/*
 * Форма «Оставить заявку» (.modal_form из footer.php) —
 * боковая панель, выезжает справа на всю высоту экрана.
 * Открытие/закрытие: openModalForm()/closeModalForm() в js/jquery.main.js.
 */

.modal_form {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    bottom: 0;
    z-index: 500;
    width: min(600px, 100vw);
    min-width: 0;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0 0 32px;
    gap: 18px;
    justify-content: flex-start;
    align-items: stretch;
    background: #fff;
    border-radius: 0;
    box-shadow: -24px 0 60px rgba(0, 0, 0, .18);
    overflow-x: clip;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(143, 198, 38, .6) transparent;
    backdrop-filter: none;
    transform: translateX(105%);
    transition:
        transform .5s cubic-bezier(.22, 1, .36, 1),
        opacity .3s ease !important;
}

.modal_form.is-open {
    transform: translateX(0);
}

.modal_form::-webkit-scrollbar { width: 6px; }
.modal_form::-webkit-scrollbar-thumb {
    background: rgba(143, 198, 38, .6);
    border-radius: 3px;
}

/* шапка панели прилипает при прокрутке */
.modal_form .modal_form_elem_1 {
    position: sticky;
    top: 0;
    z-index: 2;
    flex: 0 0 auto;
    height: auto;
    padding: 12px 24px;
    font-size: 20px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid #e6e6e6;
}

.modal_form .modal_form_elem_1 p { margin: 0; }

/* крестик — кружок того же размера, что у кнопки «Отправить заявку» (css/cta-button.css: --cta-circle),
   иконка векторная, маской — как стрелка */
.modal_form .modal_form_elem_1 .modal_form_close {
    flex: 0 0 var(--cta-circle, 34px);
    width: var(--cta-circle, 34px);
    height: var(--cta-circle, 34px);
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #efefef;
    cursor: pointer;
    transition: transform .35s cubic-bezier(.22, 1, .36, 1), background-color .35s ease;
}

.modal_form .modal_form_elem_1 .modal_form_close::before {
    content: "";
    width: 11px;
    height: 11px;
    background: var(--color-blck, #262325);
    -webkit-mask: var(--icon) center/contain no-repeat;
    mask: var(--icon) center/contain no-repeat;
    transition: background-color .35s ease;
}

.modal_form .modal_form_elem_1 .modal_form_close:focus-visible {
    outline: 2px solid var(--color-alt);
    outline-offset: 2px;
}

@media (any-hover: hover) {
    .modal_form .modal_form_elem_1 .modal_form_close:hover {
        transform: rotate(90deg);
        background: var(--color-alt);
    }

    .modal_form .modal_form_elem_1 .modal_form_close:hover::before {
        background: var(--color-whte, #fff);
    }
}

/* поля — в колонку, панель узкая */
.modal_form .modal_form_elem_2 {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0 24px;
}

.modal_form .modal_form_label {
    width: auto;
    margin: 0;
}

.modal_form .modal_form_phone .iti {
    display: block;
    width: 100%;
    max-width: none;
}

.modal_form .modal_form_phone input[type="tel"] {
    width: 100%;
    /* intl-tel-input иногда вычисляет padding по скрытой форме — фиксируем */
    padding-left: 84px !important;
}

.modal_form .modal_form_elem_2:not(:has(*)) {
    display: none;
}

/* единый ритм: 20px между блоками, 8px от подписи до поля */
.modal_form {
    gap: 20px;
}

.modal_form .modal_form_elem_2 {
    padding-bottom: 0;
}

.modal_form .modal_form_phone .iti {
    margin: 0;
}

/* ---------- поля заявки: сетка 2 колонки ---------- */
.mf-fields {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 14px;
    padding: 4px 24px 0;
}

.mf-fields .modal_form_elem_2 {
    padding: 0;
    min-width: 0;
    gap: 6px;
}

.mf-fields .mf-wide {
    grid-column: 1 / -1;
}

.modal_form .modal_form_label {
    font-size: 13px;
    color: #555;
}

.mf-req {
    color: #e5533d;
}

.modal_form .modal_form_field input,
.modal_form .modal_form_field textarea,
.mf-select select {
    border: 1px solid transparent;
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.modal_form .modal_form_field input:focus,
.modal_form .modal_form_field textarea:focus,
.mf-select select:focus {
    outline: none;
    background: #fff;
    border-color: var(--color-alt);
    box-shadow: 0 0 0 3px rgba(143, 198, 38, .18);
}

.modal_form .modal_form_field textarea {
    height: 78px;      /* как зона загрузки файлов */
    min-height: 78px;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* «Как с вами связаться» — селект в стиле полей */
.mf-select {
    position: relative;
}

.mf-select select {
    width: 100%;
    height: 51px;
    padding: 0 40px 0 16px;
    border-radius: 12px;
    background: #f6f6f6;
    font: inherit;
    font-size: 15px;
    color: #000;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.mf-select::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 18px;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border: solid #8a8a8a;
    border-width: 0 1.8px 1.8px 0;
    transform: rotate(45deg);
    pointer-events: none;
}

/* пустое обязательное поле после попытки отправить */
.mf-field-error {
    display: none;
    font-size: 12px;
    color: #e5533d;
}

.modal_form_elem_2.is-invalid .mf-field-error {
    display: block;
}

.modal_form_elem_2.is-invalid input {
    border-color: #e5533d;
    background: #fff;
}

.modal_form_elem_2.is-invalid .iti__selected-flag {
    background: transparent;
}

.modal_form_elem_2.is-invalid.is-shake .modal_form_field {
    animation: consentShake .45s ease;
}

.modal_form_elem_2.is-invalid.is-shake input {
    animation: consentPulse 1.2s ease-out 2;
}

/* ---------- кнопка + согласие: одна строка на серой подложке ---------- */
.mf-submit {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
    padding: 20px 24px;
    background: #f4f4f2;
    border-top: 1px solid #ececec;
    border-bottom: 1px solid #ececec;
}

.mf-submit__row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.modal_form .modal_form_submit.btn {
    flex: 0 0 auto;
    display: inline-block;
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 0;
    font: inherit;
    text-align: left;
    transition: opacity .3s ease, filter .3s ease;
}

.modal_form .modal_form_submit.btn > span {
    padding-left: 22px;
    gap: 16px;
}

.modal_form .modal_form_submit.btn:hover {
    background: none;
}

.modal_form .modal_form_consent {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0;
}

.modal_form .modal_form_agreement {
    margin: 0;
    display: flex;
    align-items: center; /* галка — по центру высоты текста согласия */
    gap: 10px;
}

.modal_form .modal_form_agreement label {
    font-size: 12px;
    line-height: 1.35;
    color: #555;
}

.modal_form .modal_form_agreement a {
    display: inline;
    color: #6f9f17;
    text-decoration-color: rgba(143, 198, 38, .5);
    text-underline-offset: 2px;
}

.modal_form .modal_form_agreement input[type="checkbox"] {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #fff;
    border: 1.5px solid #b9bdb3;
    transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

.modal_form .modal_form_agreement input[type="checkbox"]:hover {
    border-color: var(--color-alt);
}

.modal_form .modal_form_agreement input[type="checkbox"]:checked {
    background: var(--color-alt);
    border-color: var(--color-alt);
    transform: scale(1.06);
}

.modal_form .modal_form_agreement input[type="checkbox"]:checked::after {
    width: 10px;
    height: 6px;
    background: none;
    border: solid #fff;
    border-width: 0 0 2px 2px;
    transform: translate(-50%, -65%) rotate(-45deg);
}

.modal_form .modal_form_agreement input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(143, 198, 38, .35);
}

/* подсказка над галкой — только после попытки отправить без согласия (как «Вы не дали согласие…») */
.modal_form_consent__note {
    font-size: 12px;
    color: #e5533d;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height .3s ease, opacity .3s ease;
}

.mf-submit.is-required .modal_form_consent__note {
    max-height: 20px;
    opacity: 1;
}

.mf-submit.is-required .modal_form_agreement {
    animation: consentShake .45s ease;
}

.mf-submit.is-required input[type="checkbox"]:not(:checked) {
    border-color: #e5533d;
    animation: consentPulse 1.2s ease-out 2;
}

@keyframes consentShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

@keyframes consentPulse {
    0% { box-shadow: 0 0 0 0 rgba(229, 83, 61, .45); }
    100% { box-shadow: 0 0 0 10px rgba(229, 83, 61, 0); }
}

#modalanswererror {
    margin: 0;
    font-size: 13px;
    color: #e5533d;
    text-align: left;
}

#modalanswererror:empty {
    display: none;
}

/* ---------- «Или свяжитесь с нами самостоятельно» ---------- */
.mf-contacts {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    text-align: center;
}

.mf-contacts__title {
    font-size: 15px;
    color: var(--color-primary);
}

.mf-contacts__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 28px;
}

.mf-contacts__links {
    max-height: 60px;
    overflow: hidden;
    transition: max-height .4s cubic-bezier(.22, 1, .36, 1), opacity .25s ease, margin-top .4s ease;
}

/* открыта карточка с QR — строка «телефон / e-mail» уезжает, номер/адрес уже в карточке */
.mf-contacts.has-card .mf-contacts__links {
    max-height: 0;
    opacity: 0;
    margin-top: -8px;
}

.mf-contacts__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    color: var(--color-primary);
    text-decoration: none;
    transition: color .2s ease;
}

.mf-contacts__link svg {
    color: var(--color-alt);
    flex: 0 0 auto;
}

.mf-contacts__link:hover,
.mf-contacts__link.is-active {
    color: #5d8a12;
}

/* кружки мессенджеров; сверху — место под всплывающую подпись */
.mf-contacts .mf-contacts__icons {
    align-self: center;
    display: flex;
    align-items: center;
    margin: 22px 0 0; /* сверху — место под подпись; у .images-block в общих стилях margin-left: -17px */
    padding: 0;
}

.mf-contacts__icons .images-block__item {
    display: block;
    position: relative;
}

.mf-contacts__icons .images-block__item:not(:first-child) {
    margin-left: -12px;
}

.mf-contacts__icons .images-block__img {
    --size: 56px;
}

.mf-contacts__icons .images-block__img img {
    width: 100%;
    height: 100%;
    display: block;
}

.mf-contacts__icons .js-mf-call.is-active .images-block__img {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--color-alt);
}

/* номер + QR-визитка (только десктоп, по клику на телефон) */
.mf-call {
    width: 100%;
    text-align: left;
    display: grid;
    grid-template-rows: 0fr;
    opacity: 0;
    margin-top: -8px; /* закрытая карточка не добавляет промежуток (gap .mf-contacts = 8px) */
    transition: grid-template-rows .45s cubic-bezier(.22, 1, .36, 1), opacity .3s ease, margin-top .45s ease;
}

.mf-call.is-open {
    grid-template-rows: 1fr;
    opacity: 1;
    margin-top: 0;
}

.mf-call__inner {
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 18px;
    border-radius: 14px;
    background: #f6f6f6;
    transition: padding .45s cubic-bezier(.22, 1, .36, 1);
}

.mf-call.is-open .mf-call__inner {
    padding: 14px;
}

.mf-call__qr {
    flex: 0 0 120px;
    width: 120px;
    height: 120px;
    padding: 6px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
}

.mf-call__info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
}

.mf-call__number {
    font-size: 22px;
    font-weight: 500;
    color: var(--color-primary);
    white-space: nowrap;
    text-decoration: none;
}

.mf-call__hint {
    font-size: 12px;
    line-height: 1.45;
    color: #7a7a7a;
}

.mf-call__copy {
    margin-top: 4px;
    padding: 6px 12px;
    border: 1px solid #d6d9d1;
    border-radius: 999px;
    background: #fff;
    font: inherit;
    font-size: 12px;
    color: var(--color-primary);
    cursor: pointer;
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.mf-call__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.mf-call__actions .mf-call__copy {
    margin-top: 0;
}

a.mf-call__copy {
    display: inline-block;
    text-decoration: none;
}

.mf-call__copy:hover,
.mf-call__copy.is-done {
    border-color: var(--color-alt);
    background: #f3f8ea;
}

.mf-call__copy.is-done {
    color: #5d8a12;
}

/* ---------- телефон: всё в одну колонку ---------- */
@media (max-width: 560px) {
    /* та же раскладка, что на десктопе (имя/e-mail, телефон/способ связи), только плотнее */
    .mf-fields {
        /* левая колонка (имя, телефон) чуть шире — маска телефона влезает целиком */
        grid-template-columns: 1.15fr 1fr;
        gap: 12px 10px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .modal_form .modal_form_label {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mf-fields .modal_form_field input,
    .mf-select select {
        height: 46px;
        min-height: 46px;
        font-size: 16px; /* меньше 16px — iOS зумит страницу при фокусе */
        padding-left: 12px;
        padding-right: 12px;
    }

    .mf-select select {
        padding-left: 10px;
        padding-right: 20px;
    }

    /* подсказки мельче самого текста — влезают в узкую колонку (на зум iOS не влияет) */
    .mf-fields input::placeholder,
    .mf-fields textarea::placeholder {
        font-size: 13px;
    }

    .mf-select::after {
        right: 8px;
    }

    .modal_form .modal_form_phone .iti__flag-container {
        height: 46px;
    }

    .modal_form .modal_form_phone .iti__selected-flag {
        padding: 0 2px 0 8px;
    }

    /* отступы ужаты, чтобы маска «(999) 999-99-99» помещалась целиком */
    .modal_form .modal_form_phone input[type="tel"] {
        padding-left: 62px !important;
        padding-right: 4px;
    }

    /* карточка с QR: номер и адрес целиком помещаются в узкую колонку */
    .mf-call__number {
        font-size: 18px;
    }

    .mf-call__inner {
        gap: 12px;
    }

    .mf-call.is-open .mf-call__inner {
        padding: 10px;
    }

    .mf-call__qr {
        flex-basis: 96px;
        width: 96px;
        height: 96px;
    }

    .mf-contacts__link {
        font-size: 16px;
    }

    /* остальные блоки — с теми же боковыми полями 16px */
    .modal_form .modal_form_elem_1,
    .mf-submit,
    .mf-contacts {
        padding-left: 16px;
        padding-right: 16px;
    }

    .mf-submit__row {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .modal_form .modal_form_agreement {
        align-items: flex-start;
    }

    /* кнопка на всю ширину, текст по центру, кружок со стрелкой — у правого края */
    .modal_form .modal_form_submit.btn {
        width: 100%;
    }

    .modal_form .modal_form_submit.btn > span {
        position: relative;
        justify-content: center;
        padding-left: 52px;
        padding-right: 52px;
    }

    .modal_form .modal_form_submit.btn > span > span {
        position: absolute;
        top: 50%;
        right: var(--cta-inset);
        margin-top: calc(var(--size) / -2);
    }

    /* 8 кружков в ряд на ширине телефона */
    .mf-contacts__icons .images-block__img {
        --size: 44px;
    }

    .mf-contacts__icons .images-block__item:not(:first-child) {
        margin-left: -9px;
    }
}

@media (max-width: 380px) {
    .mf-call__number {
        font-size: 16px;
    }

    .mf-call__qr {
        flex-basis: 84px;
        width: 84px;
        height: 84px;
    }
}

/* ---------- загрузчик файлов (js/file-drop.js) ---------- */
.fdrop {
    --fdrop-p: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fdrop__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.fdrop__zone {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1.5px dashed #cfd3c9;
    border-radius: 12px;
    background: #f6f6f6;
    cursor: pointer;
    overflow: hidden;
    transition: border-color .25s ease, background-color .25s ease, transform .35s cubic-bezier(.34, 1.56, .64, 1);
}

.fdrop__input:focus-visible + .fdrop__zone {
    border-color: var(--color-alt);
    box-shadow: 0 0 0 3px rgba(143, 198, 38, .3);
}

.fdrop__icon {
    flex: 0 0 var(--cta-circle, 34px); /* как кружок у «Отправить заявку» */
    width: var(--cta-circle, 34px);
    height: var(--cta-circle, 34px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transition: background-color .3s ease, color .3s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1);
}

.fdrop__text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.fdrop__title {
    font-size: 14px;
    color: var(--color-primary);
}

.fdrop__title u {
    color: #6f9f17;
    text-decoration-color: rgba(143, 198, 38, .6);
    text-underline-offset: 3px;
}

.fdrop__hint {
    font-size: 12px;
    color: #8a8a8a;
}

@media (any-hover: hover) {
    .fdrop__zone:hover {
        border-color: var(--color-alt);
        background: #f3f8ea;
    }
    .fdrop__zone:hover .fdrop__icon {
        background: var(--color-alt);
        transform: translateY(-2px);
    }
}

/* файл тащат над панелью — зона «ждёт» */
.fdrop.is-drag .fdrop__zone {
    border-color: var(--color-alt);
    background: #f3f8ea;
}

.fdrop.is-drag .fdrop__icon {
    background: var(--color-alt);
    animation: fdropBob 1s ease-in-out infinite;
}

.fdrop__zone.is-over {
    transform: scale(1.02);
    background: #eaf4d8;
}

@keyframes fdropBob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* лимит файлов достигнут */
.fdrop.is-full .fdrop__zone {
    opacity: .55;
    pointer-events: none;
}

.fdrop__error {
    font-size: 12px;
    line-height: 1.4;
    color: #e5533d;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    margin-top: -10px;
    transition: max-height .3s ease, opacity .3s ease, margin-top .3s ease;
}

.fdrop__error.is-visible {
    max-height: 60px;
    opacity: 1;
    margin-top: 0;
}

.fdrop__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fdrop__list:empty {
    display: none;
}

.fdrop__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 8px 8px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #ececec;
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px) scale(.97);
    transition: opacity .3s ease, transform .4s cubic-bezier(.34, 1.56, .64, 1), max-height .28s ease, margin .28s ease;
    max-height: 64px;
}

.fdrop__item.is-in {
    opacity: 1;
    transform: none;
}

.fdrop__item.is-out {
    opacity: 0;
    transform: translateX(24px);
    max-height: 0;
    margin-bottom: -8px;
    padding-top: 0;
    padding-bottom: 0;
}

.fdrop__thumb {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.fdrop__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fdrop__thumb--ext {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: var(--fdrop-c, #8fc626);
}

.fdrop__meta {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fdrop__name {
    font-size: 13px;
    color: var(--color-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fdrop__size {
    font-size: 12px;
    color: #8a8a8a;
}

.fdrop__remove {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: #f3f3f3;
    color: #6b6b6b;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .3s cubic-bezier(.34, 1.56, .64, 1);
}

@media (any-hover: hover) {
    .fdrop__remove:hover {
        background: #fde8e5;
        color: #e5533d;
        transform: rotate(90deg);
    }
}

/* полоса отправки: заполняется по всем файлам при отправке формы */
.fdrop__bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--color-alt);
    transform-origin: left;
    transform: scaleX(0);
    transition: transform .2s linear;
}

.fdrop.is-uploading .fdrop__bar {
    transform: scaleX(var(--fdrop-p));
}

.fdrop.is-uploading .fdrop__remove,
.fdrop.is-uploading .fdrop__zone {
    pointer-events: none;
    opacity: .5;
}

/* открытие «каплей» (js/drawer-drop.js): панель уже на месте, но прозрачна, пока растекается жидкость */
.modal_form.is-dropping {
    opacity: 0 !important;
    transition: none !important;
}

.modal_form.is-open:not(.is-dropping) {
    transition:
        transform .5s cubic-bezier(.22, 1, .36, 1),
        opacity .35s ease !important;
}

/* подложка панели — белая «капля» из js/drawer-drop.js, свой фон и тень не нужны */
.modal_form.is-liquid {
    background: transparent;
    box-shadow: none;
}

/* серая полоса с кнопкой — слева скруглена, чтобы не резать «жидкий» край ровной линией
   (на телефоне панель во всю ширину, края формы не видно — полоса обычная) */
@media (min-width: 561px) {
    .modal_form.is-liquid .mf-submit {
        margin-left: 14px;
        padding-left: 30px;
        border-left: 1px solid #ececec;
        border-radius: 999px 0 0 999px;
    }
}

.drawer-goo {
    position: fixed;
    inset: -80px; /* запас за краями экрана — js/drawer-drop.js: BLEED */
    z-index: 499; /* над подложкой .modal-bg, под панелью .modal_form (500) */
    overflow: hidden;
    pointer-events: none;
    filter: url(#drawer-goo);
    display: none;
}

.drawer-goo.is-on {
    display: block;
}

.drawer-goo__blob {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    will-change: transform;
}

/* подложка — плавнее, чем мгновенное .1s */
.modal-bg {
    transition: opacity .4s ease;
}

/* блокируем прокрутку страницы под панелью — только на html: у body высота 100%,
   и overflow: hidden на нём схлопывает страницу, прокрутка сбрасывается наверх */
html.modal-form-open {
    overflow: hidden;
}

/* стрелка нажатой кнопки поверх зелёной капли (js/drawer-drop.js: showArrow):
   поворачивается вниз (на 90° по часовой), пока растекается зелёное, и гаснет, когда заливка становится белой */
.drawer-arrow {
    position: fixed;
    z-index: 501;
    pointer-events: none;
    transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .3s ease;
}

.drawer-arrow.is-turning {
    transform: rotate(90deg);
}

.drawer-arrow.is-gone {
    opacity: 0;
    transform: rotate(90deg) scale(.4);
    transition: transform .3s ease, opacity .3s ease;
}
