/* Мобильный фильтр каталога (ТЗ «Навигация по сайту», стр. 2–6). Только < 992px. */
@media (max-width: 991.98px) {
    .sCatalog__filter-wrap.mf-ready {
        display: flex;
        flex-direction: column;
        width: min(88vw, 360px);
        /* высота видимой области телефона (без адресной строки), иначе низ панели уходит за экран */
        height: 100vh;
        height: 100dvh;
        max-height: -webkit-fill-available;
        padding: 0;
        overflow: hidden;
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0);
        transition: transform .25s ease, box-shadow .25s ease;
    }

    .sCatalog__filter-wrap.mf-ready.active {
        box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45);
        z-index: 1060; /* выше баннера cookie (1049), иначе он закрывает кнопку «Показать» */
    }

    /* Шапка панели: «ФИЛЬТР» и крестик */
    .sCatalog__filter-wrap.mf-ready .mf-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
        padding: 0 8px 0 18px;
        min-height: 56px;
        border-bottom: 1px solid #ececec;
    }

    .mf-head__title {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
        color: #222;
    }

    .mf-head__icon {
        width: 14px;
        height: 14px;
        fill: #222;
    }

    .sCatalog__filter-wrap.mf-ready .mf-head .sCatalog__filter-close {
        width: 44px;
        height: 44px;
        margin: 0;
        justify-content: center;
        align-items: center;
    }

    /* Список групп прокручивается, кнопка «Показать» всегда внизу */
    .sCatalog__filter-wrap.mf-ready .dd-group {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0; /* без этого блок растягивается по содержимому и не прокручивается */
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 0 18px 12px;
    }

    .sCatalog__filter-wrap.mf-ready .dd-group__item,
    .sCatalog__filter-wrap.mf-ready .dds-clear-button {
        flex-shrink: 0;
    }

    .sCatalog__filter-wrap.mf-ready #catalog-filter,
    .sCatalog__filter-wrap.mf-ready #catalog-filter > .cast {
        display: contents;
    }

    .sCatalog__filter-wrap.mf-ready .mf-hidden {
        display: none !important;
    }

    .sCatalog__filter-wrap.mf-ready .dd-group__item {
        margin: 0;
        border: 0;
        border-bottom: 1px solid #ececec;
        border-radius: 0;
    }

    .sCatalog__filter-wrap.mf-ready .dd-group__head {
        padding: 16px 22px 16px 0;
        border-bottom: 0;
        font-size: 14px;
        font-weight: 600;
        color: #222;
        text-transform: none !important;
        position: relative;
        display: flex;
        align-items: center;
    }

    .sCatalog__filter-wrap.mf-ready .dd-group__head::after {
        content: "" !important;
        width: 0;
        height: 0;
        position: absolute;
        right: 4px;
        top: 50%;
        border: 4px solid transparent;
        border-top-color: #444;
        border-bottom: 0;
        transform: translateY(-50%);
        transition: transform .2s;
    }

    .sCatalog__filter-wrap.mf-ready .dd-group__item.active > .dd-group__head::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .sCatalog__filter-wrap.mf-ready .dd-group__content {
        padding: 0 0 14px;
    }

    .sCatalog__filter-wrap.mf-ready .dds-clear-button {
        order: 50;
        padding: 14px 0 4px;
    }

    /* Категория товара */
    .mf-cats {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .mf-cats__extra {
        display: none !important;
    }

    .mf-cats.is-expanded .mf-cats__extra {
        display: flex !important;
    }

    .mf-check {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0;
        font-size: 14px;
        color: #222;
        cursor: pointer;
    }

    .mf-check input {
        width: 18px;
        height: 18px;
        margin: 0;
        accent-color: #0a6ed1;
        flex-shrink: 0;
    }

    .mf-cats__toggle {
        align-self: flex-start;
        border: 0;
        background: none;
        padding: 2px 0 0;
        font-size: 12px;
        color: #0a6ed1;
        text-decoration: underline;
    }

    /* Коллекция — в две колонки */
    .sCatalog__filter-wrap.mf-ready .mf-collection .dd-group__content > * {
        column-count: 2;
        column-gap: 12px;
    }

    .sCatalog__filter-wrap.mf-ready .mf-collection label {
        break-inside: avoid;
    }

    /* Цвет — выбранный образец с галочкой */
    .sCatalog__filter-wrap.mf-ready .change-color.is-checked .custom-input__text,
    .sCatalog__filter-wrap.mf-ready .change-color.is-checked span {
        box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0a6ed1;
    }

    /* Кнопка «Показать» */
    .sCatalog__filter-wrap.mf-ready .mf-footer {
        display: block;
        flex-shrink: 0;
    }

    .mf-footer__apply {
        display: block;
        width: 100%;
        border: 0;
        padding: 17px 16px calc(17px + env(safe-area-inset-bottom, 0px));
        background: #0a6ed1;
        color: #fff;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .mf-footer__apply:active {
        background: #0858a7;
    }
}

/* Вне мобильной ширины свои блоки не показываем */
@media (min-width: 992px) {
    .mf-head,
    .mf-groups,
    .mf-footer {
        display: none !important;
    }
}

/* Цена (телефон и компьютер) */
.mf-price__inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    overflow: hidden;
}

.mf-price__inputs input {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 10px 12px;
    font-size: 14px;
    background: #f7f7f7;
    color: #222;
}

.mf-price__inputs input + input {
    border-left: 1px solid #e3e3e3;
}

.mf-price__range {
    position: relative;
    height: 28px;
    margin: 10px 8px 0;
}

.mf-price__track {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    margin-top: -1px;
    background: #dcdcdc;
}

.mf-price__fill {
    position: absolute;
    top: 0;
    bottom: 0;
    background: #0a6ed1;
}

.mf-price__range input[type=range] {
    position: absolute;
    left: -8px;
    width: calc(100% + 16px);
    top: 0;
    height: 28px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.mf-price__range input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #cfcfcf;
    box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 10px #0a6ed1;
    cursor: pointer;
}

.mf-price__range input[type=range]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0a6ed1;
    border: 6px solid #fff;
    box-shadow: 0 0 0 1px #cfcfcf;
    cursor: pointer;
}

.mf-price__range input[type=range]::-webkit-slider-runnable-track,
.mf-price__range input[type=range]::-moz-range-track {
    background: none;
}

.mf-price__limits {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #888;
}

/* Размеры: «таблетки» по ширине текста, без переносов; выбранный размер залит цветом */
.sCatalog__filter-wrap .sCatalog__filter-grid {
    display: flex !important;
    flex-wrap: wrap;
    gap: 6px;
    grid-template-columns: none !important;
    grid-auto-rows: auto;
}

.sCatalog__filter-wrap .sCatalog__filter-grid .custom-input {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
}

.sCatalog__filter-wrap .sCatalog__filter-grid .custom-input__text {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid #d5dbe6;
    border-radius: 15px;
    background: #fff;
    color: #222;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

.sCatalog__filter-wrap .sCatalog__filter-grid .custom-input__text.inner {
    font-size: 13px;
}

.sCatalog__filter-wrap .sCatalog__filter-grid .custom-input__text::before,
.sCatalog__filter-wrap .sCatalog__filter-grid .custom-input__text::after {
    display: none !important;
}

.sCatalog__filter-wrap .sCatalog__filter-grid .form-check-input:checked + .custom-input__text {
    border-color: #20438f;
    background: #20438f;
    color: #fff !important;
    font-weight: 600;
}

/* Цена на компьютере: группа внутри формы фильтра, раскрыта */
@media (min-width: 992px) {
    .sCatalog__filter-wrap .mf-desktop-price {
        display: block !important;
    }

    .sCatalog__filter-wrap .mf-desktop-price .mf-price__inputs input {
        padding: 8px 8px;
        font-size: 13px;
    }

    .sCatalog__filter-wrap .mf-desktop-price .mf-price__range {
        margin: 8px 6px 0;
    }
}