/* ==========================================================================
   Модалка обратного звонка
   ========================================================================== */

.cbm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    background: rgba(30, 10, 12, .55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}

.cbm-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.cbm {
    position: relative;
    width: 100%;
    max-width: 520px;
    margin: auto;
    padding: 36px 40px 28px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 3px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
    font-family: "PT Sans", Arial, Helvetica, sans-serif;
    color: #3a3a3a;
    text-align: center;
    transform: translateY(-12px);
    transition: transform .18s ease;
}

.cbm-overlay.is-open .cbm {
    transform: translateY(0);
}

.cbm__title {
    margin: 0 0 14px;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    color: #cf1225;
}

.cbm__subtitle {
    margin: 0 0 22px;
    font-size: 16px;
    line-height: 1.35;
    color: #cf1225;
}

.cbm__row {
    display: flex;
    gap: 10px;
}

.cbm__input {
    flex: 1;
    min-width: 0;
    height: 52px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 1px solid #f0c4c9;
    border-radius: 3px;
    background: #fdeff1;
    font-family: inherit;
    font-size: 17px;
    color: #3a3a3a;
}

.cbm__input::placeholder {
    color: #d3a8ad;
}

.cbm__input:focus {
    outline: none;
    border-color: #cf1225;
    background: #fff;
}

.cbm__input.is-invalid {
    border-color: #cf1225;
}

.cbm__submit {
    height: 52px;
    padding: 0 26px;
    border: 0;
    border-radius: 3px;
    background: #cf1225;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease;
}

.cbm__submit:hover {
    background: #a80d1c;
}

.cbm__submit:disabled {
    background: #d9a3a9;
    cursor: default;
}

.cbm__hint {
    margin: 8px 0 0;
    min-height: 16px;
    font-size: 13px;
    line-height: 16px;
    color: #cf1225;
    text-align: left;
}

/* ловушка для ботов */
.cbm__trap {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.cbm__messengers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.cbm__messengers span {
    font-size: 14px;
    color: #9a9a9a;
}

.cbm-msg {
    display: block;
    width: 34px;
    height: 34px;
    transition: transform .15s ease;
}

.cbm-msg:hover {
    transform: translateY(-2px);
}

.cbm-msg svg {
    display: block;
    width: 100%;
    height: 100%;
}

.cbm__dismiss {
    display: inline-block;
    margin-top: 22px;
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 15px;
    color: #9a9a9a;
    text-decoration: underline;
    cursor: pointer;
}

.cbm__dismiss:hover {
    color: #3a3a3a;
}

.cbm__legal {
    margin: 14px 0 0;
    font-size: 11px;
    line-height: 1.4;
    color: #c0c0c0;
}

.cbm__legal a {
    color: inherit;
}

/* экран после отправки */
.cbm__done {
    display: none;
}

.cbm.is-done .cbm__form-view {
    display: none;
}

.cbm.is-done .cbm__done {
    display: block;
}

.cbm.is-done .cbm__title {
    margin-bottom: 10px;
}

@media (max-width: 560px) {
    .cbm {
        padding: 28px 20px 22px;
    }

    .cbm__title {
        font-size: 21px;
    }

    .cbm__subtitle {
        font-size: 15px;
    }

    .cbm__row {
        flex-direction: column;
    }

    .cbm__submit {
        padding: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cbm-overlay,
    .cbm,
    .cbm-msg {
        transition: none;
    }
}

/* ==========================================================================
   Плавающая кнопка вызова
   ========================================================================== */

.cbm-trigger {
    position: fixed;
    bottom: 100px;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #cf1225;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .22);
    transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
}

.cbm-trigger--right {
    right: 28px;
}

.cbm-trigger--left {
    left: 28px;
}

.cbm-trigger:hover {
    background: #a80d1c;
    transform: scale(1.06);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
}

.cbm-trigger:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.cbm-trigger__icon {
    display: block;
    width: 28px;
    height: 28px;
}

.cbm-trigger__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Расходящееся кольцо. Именно кольцо, а не залитый круг: заливка
   при увеличении даёт мутное пятно поверх кнопки. Середина прозрачная,
   поэтому цвет самой кнопки не искажается. */
.cbm-trigger::before,
.cbm-trigger::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #cf1225;
    opacity: 0;
    pointer-events: none;
}

/* второе кольцо со сдвигом — эффект читается лучше, чем одиночное */
.cbm-trigger--pulse-always::before {
    animation: cbm-pulse 2.4s ease-out infinite;
}

.cbm-trigger--pulse-always::after {
    animation: cbm-pulse 2.4s ease-out .8s infinite;
}

/* пять циклов после загрузки, дальше кнопка успокаивается */
.cbm-trigger--pulse-once::before {
    animation: cbm-pulse 2.4s ease-out 5;
}

.cbm-trigger--pulse-once::after {
    animation: cbm-pulse 2.4s ease-out .8s 5;
}

.cbm-trigger--pulse-none::before,
.cbm-trigger--pulse-none::after {
    animation: none;
}

/* пульсация не нужна, пока модалка открыта */
.cbm-trigger.is-hidden::before,
.cbm-trigger.is-hidden::after {
    animation: none;
}

@keyframes cbm-pulse {
    0%   { transform: scale(1);    opacity: .7; }
    100% { transform: scale(1.55); opacity: 0; }
}

/* кнопка прячется, пока открыта модалка */
.cbm-trigger.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(.8);
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}

@media (max-width: 560px) {
    .cbm-trigger {
        bottom: 18px;
        width: 56px;
        height: 56px;
    }

    .cbm-trigger--right {
        right: 18px;
    }

    .cbm-trigger--left {
        left: 18px;
    }

    .cbm-trigger__icon {
        width: 24px;
        height: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cbm-trigger,
    .cbm-trigger::before,
    .cbm-trigger::after {
        animation: none;
        transition: none;
    }
}