/* ========================================================================
   filters-sidebar.css — Боковой фильтр (эко-минимализм Greenway)
   ======================================================================== */

/* ---------- 1. ОБЩИЙ КОНТЕЙНЕР ---------- */
.shop-filters-sidebar {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.filters-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

/* ---------- 2. СЕКЦИИ ФИЛЬТРОВ ---------- */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.4rem 0;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    transition: color 0.2s;
    user-select: none;
}

.filter-header:hover {
    color: #2e7d32;
}

.filter-header .arrow {
    transition: transform 0.25s ease;
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.filter-header .arrow.open {
    transform: rotate(180deg);
}

/* ---------- 3. КОНТЕНТ ФИЛЬТРА (списки) ---------- */
.filter-content {
    padding-top: 0.6rem;
    display: block;
}
.filter-content.open {
    display: block;
}

/* Основной контейнер для списка категорий/брендов — с ограничением высоты и скроллом */
.filter-options-scrollable {
    max-height: 250px; /* фиксированная высота */
    overflow-y: auto;
    padding-right: 4px; /* место для скроллбара */
    margin-right: -4px; /* компенсация */
}

/* ---------- 4. КАСТОМИЗАЦИЯ СКРОЛЛБАРА ---------- */
.filter-options-scrollable::-webkit-scrollbar {
    width: 5px;
}

.filter-options-scrollable::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.filter-options-scrollable::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
    transition: background 0.2s;
}

.filter-options-scrollable::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Для Firefox */
.filter-options-scrollable {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

/* ---------- 5. ЭЛЕМЕНТЫ СПИСКА (чекбоксы) ---------- */
.filter-item {
    display: flex;
    align-items: center;
    padding: 0.3rem 0;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #334155;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.filter-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.filter-item__checkbox {
    width: 16px;
    height: 16px;
    accent-color: #2e7d32; /* зелёный для нативных чекбоксов */
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.filter-item__text {
    flex: 1;
    line-height: 1.3;
    word-break: break-word;
}

.filter-item__count {
    font-size: 0.75rem;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 0.1rem 0.5rem;
    border-radius: 40px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.filter-item:hover .filter-item__count {
    background: #e2e8f0;
    color: #475569;
}

/* ---------- 6. ЦЕНОВОЙ СЛАЙДЕР ---------- */
.price-slider-wrapper {
    margin-top: 0.5rem;
}

#price-slider {
    margin: 0.8rem 0;
}

.price-slider-inputs {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.price-slider-inputs input {
    flex: 1;
    padding: 0.4rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.price-slider-inputs input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

/* ---------- 7. КНОПКИ ДЕЙСТВИЙ ---------- */
.filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.filter-btn,
.filter-btn-reset {
    flex: 1;
    padding: 0.5rem 0.8rem;
    border-radius: 60px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    transition: all 0.25s ease;
    cursor: pointer;
}

.filter-btn {
    background: #2e7d32;
    color: #ffffff;
    border-color: #2e7d32;
}

.filter-btn:hover {
    background: #1b5e20;
    border-color: #1b5e20;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
}

.filter-btn-reset {
    background: transparent;
    color: #64748b;
    border-color: #d1d5db;
}

.filter-btn-reset:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b;
}

/* ---------- 8. АДАПТИВ ---------- */
@media (max-width: 768px) {
    .shop-filters-sidebar {
        border-radius: 12px;
        padding: 1rem;
    }

    .filter-options-scrollable {
        max-height: 200px;
    }

    .filter-item {
        font-size: 0.85rem;
        padding: 0.25rem 0;
    }

    .filter-btn,
    .filter-btn-reset {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
}

@media (max-width: 480px) {
    .filter-options-scrollable {
        max-height: 160px;
    }
}