/*
  Панель фильтра раздела каталога, тема lux (FilterPanel; разметка — partials/filter-{bar,sheet,values,price}.tpl,
  поведение — js/filter-panel.js). Прототип — design/proto-storefront-filter-lux.html, утверждён заказчиком 2026-11-13;
  устройство — как у панели lepirate, вид — из элементов темы lux: рамки #EEEDEB и фон списков #FDFCFA (выпадающие
  списки «хлебных крошек»), стрелка — значок шрифта fendi, размеры — плашки плитки товара (ul.lx_sizes), «Применить» —
  как «Показать» у «Наличия», выделение — жёлтый #F9B949. Компьютер — от 992px (как левое меню темы), телефон и
  планшет — до 991px (кнопка с ползунками темы открывает шторку). Подключается только на странице с панелью.
*/

/* ── Колонка товаров: строка фильтра, выбранные значения, товары ── */
.mp_wrapper .left-menu { flex: none; }                                          /* меню темы — свои 250px, не сжимать */
.mp_wrapper .sf-column { flex: 1 1 auto; min-width: 0; padding-top: 40px; }   /* 40px — как у левого меню темы */
.listing .sf-column .products { padding-top: 30px; }   /* от фильтра до товаров — 30px (заказчик 2026-11-12: «чуть больше») */

.sf-bar { display: flex; flex-wrap: wrap; gap: 10px; padding: 0 15px; }
.sf-drop { position: relative; }
.sf-drop.is-open { z-index: 20; }   /* над «хлебными крошками» темы (z-index 13) и плитками */
.sf-btn {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 34px 0 14px; position: relative;
    background: #fff; border: 1px solid #EEEDEB; border-radius: 2px; outline: 0; color: #212121;
    font: inherit; font-size: 14px; letter-spacing: 1px; line-height: 1; white-space: nowrap; cursor: pointer;
    transition: border-color .2s linear, background-color .2s linear;
}
/* стрелка — уголок рамкой (2026-11-13: значок шрифта fendi сидел выше середины кнопки); уголок — по середине строчных букв названия */
.sf-btn::after {
    content: ""; position: absolute; right: 14px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
    border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); transition: transform .15s, margin-top .15s;
}
.sf-btn:hover { border-color: #212121; }
.sf-drop.is-open .sf-btn { background: #FDFCFA; border-color: #212121; }
.sf-drop.is-open .sf-btn::after { margin-top: 1px; transform: rotate(-135deg); }
.sf-btn.has-value { border-color: #212121; }
.sf-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
    background: #F9B949; color: #212121; border-radius: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0;
}

/* Выпадающий список значений */
.sf-pop {
    display: none; position: absolute; left: 0; top: calc(100% + 4px); min-width: 280px;
    background: #FDFCFA; border: 1px solid #EEEDEB; box-shadow: 0 8px 24px rgba(0, 0, 0, .06); text-align: left;
}
.sf-pop-right { left: auto; right: 0; }
/* сортировка — у правого края строки фильтров (2026-11-13); список темы «по умолчанию» в «хлебных крошках» не нужен */
.sf-sort { margin-left: auto; }
.has-filter-panel #filters-modal { display: none !important; }
.sf-drop.is-open .sf-pop { display: block; }
.sf-pop-list { max-height: 360px; overflow-y: auto; padding: 8px 0; }

.sf-opt {
    display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 16px; color: #181715;
    font-size: 14px; letter-spacing: .5px; text-decoration: none; cursor: pointer;
}
.sf-opt:hover { color: #181715; text-decoration: underline; }   /* как пункты списков темы */
.sf-check { flex: none; width: 16px; height: 16px; border: 1px solid #212121; background: #fff; position: relative; }
.sf-opt.is-selected .sf-check { background: #212121; }
.sf-opt.is-selected .sf-check::after {
    content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.sf-radio .sf-check { border-radius: 50%; }
.sf-radio.is-selected .sf-check { background: #fff; }
.sf-radio.is-selected .sf-check::after {
    left: 3px; top: 3px; width: 8px; height: 8px; border: 0; border-radius: 50%; background: #212121; transform: none;
}
.sf-name { flex: 1; }
.sf-count { color: #949494; font-size: 12px; letter-spacing: 0; }
.sf-opt.is-empty { color: #bbb; cursor: default; pointer-events: none; }
.sf-opt.is-empty .sf-check { border-color: #ccc; }

/* Размеры — плашками, как в плитке товара темы (вид ul.lx_sizes скопирован: свой класс, потому что main.js темы
   вешает на ul.lx_sizes li выбор размера с return false — ссылки фильтра не открывались); под плашкой — число товаров */
ul.sf-sizes {
    display: grid; grid-template-columns: repeat(5, 48px); justify-content: start; gap: 4px; margin: 0; padding: 16px;
    list-style: none;
}
ul.sf-sizes li {
    display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; line-height: 1.1;
    background-color: rgba(0, 0, 0, .05); border-radius: 4px; color: #000; font-size: 13px;
    transition: background-color .3s ease, color .3s ease;
}
ul.sf-sizes li:hover { background: #cdcdcd; }
ul.sf-sizes li.active { background: #000; color: #fff; }
ul.sf-sizes li a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%;
    color: inherit; text-decoration: none;
}
.sf-sizes small { color: #949494; font-size: 10px; }
ul.sf-sizes li.active small { color: #ccc; }
ul.sf-sizes li.is-empty { color: #bbb; background: rgba(0, 0, 0, .02); text-decoration: line-through; }

/* Цена — «от» и «до» */
.sf-price { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; width: 300px; box-sizing: border-box; }
.sf-price label { flex: 1 1 0; display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 12px; font-weight: normal; color: #666; }
.sf-price input {
    width: 100%; height: 40px; padding: 0 10px; box-sizing: border-box; border: 1px solid #EEEDEB; border-radius: 2px;
    background: #fff; color: #212121; font: inherit; font-size: 14px;
}
.sf-price input:focus { border-color: #212121; outline: 0; }
/* «Применить» — как «Показать» у «Наличия» темы (div.location-filter input.button) */
.sf-apply {
    flex: 1 0 100%; height: 40px; margin-top: 4px; border: 1px solid #000; border-radius: 2px; background: none;
    color: #212121; font: inherit; font-size: 14px; letter-spacing: 1px; cursor: pointer;
}
.sf-apply:hover { border-color: #F9B949; }

/* ── Выбранные значения ── */
.sf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 15px 0; }
.sf-chips:empty { display: none; }
.sf-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px 7px 12px; background: #212121; color: #fff;
    border-radius: 2px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.sf-chip:hover { background: #000; color: #F9B949; text-decoration: none; }
.sf-chip-x { display: block; flex: none; width: 9px; height: 9px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.sf-reset { color: #212121; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; text-decoration: underline; cursor: pointer; margin-left: 4px; }
.sf-reset:hover { color: #a86843; }
.sf-found { flex: none; color: #949494; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; margin-right: 4px; }

/* Шторка и строка под заголовком — только на телефоне и планшете */
.sf-sheet, .sf-mbar { display: none; }

/* Узкий компьютер: кнопки плотнее */
@media (min-width: 992px) and (max-width: 1199px) {
    .sf-bar { gap: 6px; }
    .sf-btn { padding: 0 28px 0 10px; letter-spacing: .5px; }
    .sf-btn::after { right: 10px; }
}

/* ── Телефон и планшет: строка кнопок скрыта, фильтр — в шторке по кнопке с ползунками темы ── */
@media (max-width: 991px) {
    .mp_wrapper .sf-column { padding-top: 0; }
    .sf-bar { display: none; }
    .sf-chips { flex-wrap: nowrap; overflow-x: auto; padding: 14px 15px 4px; scrollbar-width: none; }
    .sf-chips::-webkit-scrollbar { display: none; }
    .sf-chip, .sf-reset { flex: none; }
    .sf-found { display: none; }                         /* как у lepirate: без «Найдено», «Сбросить всё» — первым */
    .sf-reset { order: -1; margin: 0 4px 0 0; }

    /* Строка под заголовком (partials/filter-mobile.tpl, 2026-11-13, пример — OSKELLY): кнопка с ползунками темы в
       «хлебных крошках» не нужна — «Одежда» и «Платья» там по 50% */
    .has-filter-panel .breadcrumbs section.filters { display: none; }
    .sf-mbar { display: block; margin: 4px 0 8px; }   /* .listing темы уже даёт 15px по бокам */
    .sf-mrow { display: flex; gap: 8px; overflow-x: auto; padding: 0; scrollbar-width: none; }
    .sf-mrow::-webkit-scrollbar { display: none; }
    .sf-mrow .sf-btn { flex: none; height: 40px; }
    .sf-mrow .sf-btn:hover { border-color: #EEEDEB; }
    .sf-mrow .sf-btn.has-value { border-color: #212121; }
    .sf-mfilter { width: 44px; padding: 0; justify-content: center; }
    .sf-mfilter::after { display: none; }
    .sf-mfilter svg { width: 20px; height: 20px; fill: #fff; stroke: #212121; stroke-width: 1.4; stroke-linecap: round; }
    .sf-mfilter .sf-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; }
    .sf-mrow .sf-mfilter { overflow: visible; }
    .sf-mrow { padding-top: 6px; }   /* место для значка над кнопкой с ползунками */
    /* сортировка — справа под строкой, без рамки: значок со стрелками и название */
    .sf-msort { display: flex; justify-content: flex-end; padding: 10px 0 0; }
    .sf-msort .sf-msort-btn { height: 36px; padding: 0 0 0 4px; gap: 8px; border: 0; background: none; }
    .sf-msort .sf-msort-btn::after { display: none; }
    .sf-msort .sf-drop.is-open .sf-msort-btn { background: none; text-decoration: underline; }
    .sf-msort-btn svg { width: 18px; height: 18px; fill: none; stroke: #212121; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
    .has-filter-panel #filters-modal { display: none !important; }   /* окно темы (сортировка) заменила строка */

    .sf-sheet {
        position: fixed; inset: 0; z-index: 100000; display: flex; flex-direction: column; background: #fff;
        transform: translateY(100%); transition: transform .25s ease; visibility: hidden; text-align: left;
    }
    .sf-sheet.is-open { transform: none; visibility: visible; }
    .sf-sheet.is-loading .sf-sheet-body, .sf-sheet.is-loading .sf-show { opacity: .5; pointer-events: none; }
    body.sf-locked { overflow: hidden; }
    .sf-sheet-head {
        flex: none; display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 4px 0 20px;
        border-bottom: 1px solid #EEEDEB; font-size: 14px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #212121;
    }
    .sf-sheet-close {
        display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 0;
        background: none; cursor: pointer;
    }
    .sf-sheet-close svg { width: 14px; height: 14px; fill: none; stroke: #212121; stroke-width: 1.4; }
    .sf-sheet-body { flex: 1; position: relative; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    /* разделы — как «Бренды +» темы на телефоне (.brands-mobile): заглавные 14px / 600, рамки #EEEDEB */
    .sf-sec { border-bottom: 1px solid #EEEDEB; }
    .sf-sec-head {
        display: flex; align-items: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 20px; border: 0;
        background: none; color: #212121; font: inherit; font-size: 14px; font-weight: 600; text-transform: uppercase;
        text-align: left; cursor: pointer;
    }
    .sf-sec-head .sf-name { flex: 1; }
    .sf-sec-sum { color: #949494; font-size: 12px; font-weight: normal; text-transform: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sf-sec-head::after { content: "+"; flex: none; width: 14px; font-size: 24px; font-weight: 300; line-height: 1; text-align: center; }
    .sf-sec.is-open .sf-sec-head::after { content: "\2212"; }
    .sf-sec-body { display: none; padding: 0 0 12px; }
    .sf-sec.is-open .sf-sec-body { display: block; }
    .sf-sec .sf-pop-list { max-height: none; overflow: visible; padding: 0; }
    .sf-sec .sf-opt { min-height: 44px; padding: 8px 20px; }
    .sf-sec ul.sf-sizes { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); padding: 4px 20px 8px; }
    .sf-sec .sf-price { width: auto; padding: 4px 20px 8px; }
    .sf-sheet-foot {
        flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid #EEEDEB; background: #fff;
    }
    .sf-sheet-reset {
        display: flex; align-items: center; height: 48px; padding: 0 16px; border: 1px solid #000; border-radius: 2px;
        color: #212121; font-size: 14px; letter-spacing: 1px; text-decoration: none; cursor: pointer;
    }
    .sf-sheet-foot .sf-show {
        flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; height: 48px; margin: 0;
        border: 1px solid #F9B949; border-radius: 2px; background: #F9B949; color: #212121;
        font-size: 14px; letter-spacing: 1px; white-space: nowrap; text-decoration: none;
    }
    .sf-sheet-foot .sf-show.is-disabled { opacity: .5; pointer-events: none; }
    .sf-sheet-foot .sf-show:hover { background: #f7a618; border-color: #f7a618; color: #212121; }   /* как .btn-primary темы */
}
