/* Фильтры каталога в стиле маркетплейсов + голосовой подбор.
   Палитра сайта: #997748 (бронза), #c4825f, #350608 (тёмный), gold-акценты */

.fltr,
.fltr * {
    box-sizing: border-box;
}

.fltr {
    width: 100%;
    margin: 8px 0 14px;
    position: relative;
    font-size: 13px;
}

/* ── Умный/голосовой подбор ─────────────────────────────── */

.smartfilter {
    width: 100%;
    max-width: 560px;
    margin: 0 0 10px;
}

.smartfilter__row {
    display: flex;
    align-items: stretch;
    border: 1px solid #cfcfcf;
    border-radius: 22px;
    background: #fff;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}

.smartfilter__row:focus-within {
    border-color: #997748;
    box-shadow: 0 0 0 2px rgba(153, 119, 72, .15);
}

.smartfilter__row input {
    flex: 1 1 auto;
    min-width: 0;
    border: none;
    outline: none;
    padding: 9px 6px 9px 16px;
    font-size: 13px;
    color: #333;
    background: transparent;
}

.smartfilter__row button {
    flex: 0 0 auto;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0 12px;
    color: #997748;
    display: flex;
    align-items: center;
}

.smartfilter__row button:hover {
    color: #350608;
}

#smartfilter-voice.listening {
    color: #c00;
    animation: smartfilter-pulse 1.1s ease-in-out infinite;
}

@keyframes smartfilter-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

.smartfilter__status {
    margin: 6px 2px 0;
    font-size: 12px;
    color: #666;
}

.smartfilter__status.ok { color: #2e7d32; }
.smartfilter__status.err { color: #b23b3b; }
.smartfilter__status.listen { color: #997748; }

/* ── Чипы активных фильтров ─────────────────────────────── */

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e0d5c5;
    border-radius: 14px;
    padding: 4px 8px 4px 12px;
    font-size: 12px;
    color: #444;
    line-height: 1;
}

.filter-chip i {
    font-style: normal;
    margin-left: 7px;
    cursor: pointer;
    color: #997748;
    font-size: 14px;
    line-height: 1;
}

.filter-chip i:hover { color: #b23b3b; }

.filter-chips__reset {
    font-size: 12px;
    color: #997748;
    text-decoration: underline;
    margin-left: 6px;
    white-space: nowrap;
}

.filter-chips__reset:hover { color: #350608; }

/* ── Панель кнопок ──────────────────────────────────────── */

.fltr-mobile-open { display: none; }

.fltr-panel__head,
.fltr-panel__foot { display: none; }

.fltr-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fltr-group { position: relative; }

.fltr-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #d8cbb8;
    background: #fff;
    border-radius: 18px;
    padding: 8px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    white-space: nowrap;
}

.fltr-btn:hover { border-color: #997748; }

.fltr-btn b {
    color: #997748;
    font-weight: 600;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fltr-btn.active { border-color: #997748; }

.fltr-btn em {
    border-style: solid;
    border-width: 5px 4px 0 4px;
    border-color: #997748 transparent transparent transparent;
    transition: transform .15s;
}

.fltr-group.open .fltr-btn em { transform: rotate(180deg); }

/* ── Дропдаун ───────────────────────────────────────────── */

.fltr-pop {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 40;
    min-width: 260px;
    background: #fff;
    border: 1px solid #e5ddd0;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(53, 6, 8, .18);
    padding: 12px;
}

.fltr-group.open .fltr-pop { display: block; }

.fltr-pop__scroll {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.fltr-pop__foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0ebe2;
}

.fltr-show {
    border: none;
    background: #997748;
    color: #fff;
    border-radius: 16px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
}

.fltr-show:hover { background: #350608; }

.fltr-show:disabled {
    background: #ccc;
    cursor: default;
}

.fltr-clear-group,
.fltr-reset-all {
    border: none;
    background: none;
    color: #997748;
    text-decoration: underline;
    font-size: 13px;
    cursor: pointer;
    padding: 8px 4px;
}

.fltr-clear-group:hover,
.fltr-reset-all:hover { color: #350608; }

.fltr-sub {
    font-weight: 600;
    color: #350608;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 10px 0 6px;
}

.fltr-sub:first-child { margin-top: 0; }

/* Чекбокс-строка */

.fltr-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 2px;
    cursor: pointer;
    border-radius: 6px;
}

.fltr-check:hover { background: #faf7f2; }

.fltr-check input { display: none; }

.fltr-check__box {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    border: 1px solid #c9bda9;
    border-radius: 4px;
    background: #fff;
    position: relative;
}

.fltr-check input:checked + .fltr-check__box {
    background: #997748;
    border-color: #997748;
}

.fltr-check input:checked + .fltr-check__box::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.fltr-check__name {
    flex: 1 1 auto;
    color: #333;
}

.fltr-check i,
.fltr-color i {
    font-style: normal;
    color: #999;
    font-size: 11px;
}

/* Размеры плитками */

.fltr-sizes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 280px;
    overflow-y: auto;
}

.fltr-size input { display: none; }

.fltr-size span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 6px;
    border: 1px solid #d8cbb8;
    border-radius: 8px;
    cursor: pointer;
    color: #333;
    font-size: 13px;
    transition: all .12s;
}

.fltr-size span:hover { border-color: #997748; }

.fltr-size input:checked + span {
    background: #997748;
    border-color: #997748;
    color: #fff;
    font-weight: 600;
}

/* Цвета свотчами */

.fltr-colors {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 4px;
}

.fltr-color {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 2px;
    cursor: pointer;
    border-radius: 6px;
}

.fltr-color:hover { background: #faf7f2; }

.fltr-color input { display: none; }

.fltr-color__dot {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, .18);
    position: relative;
}

.fltr-color input:checked + .fltr-color__dot {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #997748;
}

.fltr-color__name {
    flex: 1 1 auto;
    color: #333;
}

/* Цена */

.fltr-price {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fltr-price label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 12px;
}

.fltr-price input {
    width: 90px;
    border: 1px solid #d8cbb8;
    border-radius: 8px;
    padding: 7px 9px;
    font-size: 13px;
    outline: none;
}

.fltr-price input:focus { border-color: #997748; }

.fltr-price input::-webkit-outer-spin-button,
.fltr-price input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.fltr-price input[type=number] { -moz-appearance: textfield; }

/* Поиск в дропдауне */

.fltr-search {
    width: 100%;
    border: 1px solid #d8cbb8;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 13px;
    outline: none;
    margin: 0 0 8px;
}

.fltr-search:focus { border-color: #997748; }

/* Строка «Отобрано — ...» */

h3.filters-title {
    font-size: 13px;
    font-weight: 400;
    color: #888;
    margin: 4px 0 0;
}

/* ── Мобильная шторка ───────────────────────────────────── */

@media (max-width: 767px) {

    .smartfilter { max-width: 100%; padding-right: 8px; }
    .smartfilter__row input { font-size: 16px; } /* не даём iOS зумить */
    .smartfilter__row button { padding: 0 9px; }
    .filter-chips { padding-right: 8px; }

    .fltr-mobile-open {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        border: 1px solid #997748;
        background: #fff;
        color: #350608;
        border-radius: 18px;
        padding: 9px 16px;
        font-size: 14px;
        cursor: pointer;
    }

    .fltr-mobile-open b {
        background: #997748;
        color: #fff;
        font-size: 11px;
        border-radius: 9px;
        padding: 1px 6px;
    }

    .fltr-panel {
        position: fixed;
        inset: 0;
        z-index: 10010; /* выше cookie-баннера (9999) */
        background: #fff;
        overflow-y: auto;
        padding: 0 14px 80px;
        transform: translateY(100%);
        visibility: hidden;
        transition: transform .28s ease, visibility .28s;
    }

    .fltr.sheet-open .fltr-panel {
        transform: translateY(0);
        visibility: visible;
    }

    .fltr-overlay { display: none; }

    .fltr-panel__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        background: #fff;
        padding: 14px 0 10px;
        border-bottom: 1px solid #eee;
        z-index: 2;
        font-size: 17px;
        font-weight: 600;
        color: #350608;
    }

    .fltr-panel__close {
        border: none;
        background: none;
        font-size: 28px;
        line-height: 1;
        color: #997748;
        cursor: pointer;
        padding: 0 4px;
    }

    .fltr-bar {
        display: block;
    }

    .fltr-group {
        border-bottom: 1px solid #f0ebe2;
    }

    .fltr-btn {
        width: 100%;
        border: none;
        border-radius: 0;
        padding: 15px 2px;
        font-size: 15px;
        justify-content: flex-start;
        background: none;
    }

    .fltr-btn b { max-width: 55vw; }

    .fltr-btn em { margin-left: auto; }

    .fltr-pop {
        position: static;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0 2px 12px;
        min-width: 0;
    }

    .fltr-pop__foot { display: none; } /* общая кнопка внизу шторки */

    .fltr-sizes { grid-template-columns: repeat(5, 1fr); }

    .fltr-panel__foot {
        display: flex;
        gap: 10px;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10011;
        background: #fff;
        border-top: 1px solid #eee;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    }

    .fltr.sheet-open .fltr-panel__foot { display: flex; }
    .fltr-panel__foot { display: none; }

    .fltr.sheet-open .fltr-panel__foot .fltr-show--main {
        flex: 1 1 auto;
        padding: 12px;
        font-size: 15px;
        border-radius: 22px;
    }
}
