/**
 * Mrs Muraari Collections - Advanced E-Commerce Shop Filters
 * Brand Colors: Navy (#0B2E6B), Gold (#D4AF37), White (#FFFFFF), Soft Neutrals (#F8F9FA, #F1F5F9)
 */

/* ==========================================================================
   1. Active Filter Chips Bar (Above Product Grid)
   ========================================================================== */
.active-filter-chips-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.25rem;
    padding: 10px 14px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(11, 46, 107, 0.04);
}

.active-filter-chips-bar .chips-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0B2E6B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.active-filter-chips-bar .chips-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #0B2E6B;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background: #E2E8F0;
    border-color: #0B2E6B;
}

.filter-chip .chip-remove {
    font-size: 0.72rem;
    color: #64748B;
    transition: color 0.15s ease;
}

.filter-chip:hover .chip-remove {
    color: #DC2626;
}

.clear-all-chips-btn {
    background: none;
    border: none;
    color: #DC2626;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.clear-all-chips-btn:hover {
    opacity: 0.8;
}

/* ==========================================================================
   2. Filter Sidebar Container & Actions Header
   ========================================================================== */
.shop-sidebar {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(11, 46, 107, 0.04);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: #FAF9F6;
    border-bottom: 1px solid #E2E8F0;
}

.sidebar-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #0B2E6B;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-header-title i {
    color: #D4AF37;
    font-size: 0.95rem;
}

.sidebar-reset-btn {
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748B;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.sidebar-reset-btn:hover {
    color: #DC2626;
    background: #FEE2E2;
}

/* ==========================================================================
   3. Collapsible Accordion Sections
   ========================================================================== */
.filter-accordion-item {
    border-bottom: 1px solid #F1F5F9;
}

.filter-accordion-item:last-child {
    border-bottom: none;
}

.filter-accordion-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #FFFFFF;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.15s ease;
    user-select: none;
}

.filter-accordion-header:hover {
    background-color: #F8F9FA;
}

.filter-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-header-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: #1E293B;
    letter-spacing: 0.2px;
}

.filter-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 0.68rem;
    font-weight: 800;
    color: #FFFFFF;
    background: #0B2E6B;
    border-radius: 10px;
}

.filter-accordion-icon {
    font-size: 0.72rem;
    color: #64748B;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-accordion-header[aria-expanded="false"] .filter-accordion-icon {
    transform: rotate(-90deg);
}

.filter-accordion-header[aria-expanded="true"] .filter-accordion-icon {
    transform: rotate(0deg);
}

.filter-accordion-body {
    padding: 12px 18px 16px;
    background: #FFFFFF;
}

.filter-accordion-item.is-collapsed .filter-accordion-body {
    display: none;
}

/* ==========================================================================
   4. Searchable Categories & Collections Tree
   ========================================================================== */
.filter-search-box {
    position: relative;
    margin-bottom: 12px;
}

.filter-search-box input {
    width: 100%;
    height: 36px;
    padding: 6px 30px 6px 32px;
    font-size: 0.82rem;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    background: #F8F9FA;
    outline: none;
    transition: all 0.2s ease;
}

.filter-search-box input:focus {
    background: #FFFFFF;
    border-color: #0B2E6B;
    box-shadow: 0 0 0 3px rgba(11, 46, 107, 0.08);
}

.filter-search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.78rem;
    color: #94A3B8;
    pointer-events: none;
}

.filter-search-box .search-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 0.75rem;
    color: #94A3B8;
    cursor: pointer;
    display: none;
    padding: 4px;
}

.filter-search-box .search-clear-btn:hover {
    color: #0B2E6B;
}

.filter-tree-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.filter-tree-list::-webkit-scrollbar {
    width: 4px;
}

.filter-tree-list::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 4px;
}

.filter-tree-item {
    margin-bottom: 2px;
}

.filter-tree-item.depth-1 {
    padding-left: 18px;
    position: relative;
}

.filter-tree-item.depth-1::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: #CBD5E1;
}

.category-filter-radio,
.checkbox-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #334155;
    transition: all 0.15s ease;
    user-select: none;
}

.category-filter-radio:hover,
.checkbox-filter-row:hover {
    background: #F1F5F9;
    color: #0B2E6B;
}

.category-filter-radio.active {
    background: #EEF2F6;
    color: #0B2E6B;
    font-weight: 700;
}

.category-filter-radio .name,
.checkbox-filter-row .label-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-count {
    font-size: 0.74rem;
    color: #94A3B8;
    margin-left: 6px;
    font-weight: 500;
}

.category-filter-radio.active .filter-count {
    color: #0B2E6B;
    font-weight: 700;
}

/* ==========================================================================
   5. Interactive Price Range Slider & Presets
   ========================================================================== */
.price-slider-container {
    padding: 4px 0;
}

.price-inputs-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.price-field-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.price-field-wrap .currency-symbol {
    position: absolute;
    left: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748B;
    pointer-events: none;
}

.price-field-wrap input {
    width: 100%;
    height: 34px;
    padding: 4px 6px 4px 22px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0B2E6B;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    background: #FFFFFF;
    outline: none;
    transition: border-color 0.2s ease;
}

.price-field-wrap input:focus {
    border-color: #0B2E6B;
    box-shadow: 0 0 0 2px rgba(11, 46, 107, 0.1);
}

.price-separator {
    color: #94A3B8;
    font-size: 0.8rem;
    font-weight: 600;
}

.price-slider-track-wrap {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    margin: 8px 6px 14px;
}

.price-slider-track {
    position: absolute;
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 3px;
}

.price-slider-highlight {
    position: absolute;
    height: 6px;
    background: #0B2E6B;
    border-radius: 3px;
}

.price-range-input {
    position: absolute;
    width: 100%;
    height: 6px;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.price-range-input::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid #0B2E6B;
    box-shadow: 0 1px 4px rgba(11, 46, 107, 0.3);
    cursor: pointer;
    pointer-events: auto;
    -webkit-appearance: none;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.price-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    border-color: #D4AF37;
}

.price-range-input::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 3px solid #0B2E6B;
    box-shadow: 0 1px 4px rgba(11, 46, 107, 0.3);
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.price-range-input::-moz-range-thumb:hover {
    transform: scale(1.15);
    border-color: #D4AF37;
}

.price-presets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
}

.price-preset-btn {
    padding: 5px 8px;
    font-size: 0.74rem;
    font-weight: 600;
    color: #475569;
    background: #F8F9FA;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}

.price-preset-btn:hover,
.price-preset-btn.active {
    background: #0B2E6B;
    color: #FFFFFF;
    border-color: #0B2E6B;
}

/* ==========================================================================
   6. Size Selector (Grid Pills)
   ========================================================================== */
.size-swatch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.size-pill-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.size-pill-btn:hover {
    border-color: #0B2E6B;
    background: #F8F9FA;
}

.size-pill-btn.active {
    background: #0B2E6B;
    border-color: #0B2E6B;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(11, 46, 107, 0.2);
}

.size-pill-btn .size-name {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.1;
}

.size-pill-btn.active .size-name {
    color: #FFFFFF;
}

.size-pill-btn .size-count {
    font-size: 0.64rem;
    color: #94A3B8;
    margin-top: 2px;
}

.size-pill-btn.active .size-count {
    color: #D4AF37;
}

.size-pill-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #F1F5F9;
    border-color: #E2E8F0;
}

/* ==========================================================================
   7. Visual Colour Swatches
   ========================================================================== */
.color-swatch-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.color-swatch-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.color-swatch-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #E2E8F0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.color-swatch-btn:hover {
    transform: scale(1.15);
    border-color: #0B2E6B;
}

.color-swatch-btn.active {
    border-color: #0B2E6B;
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px #0B2E6B;
    transform: scale(1.08);
}

.color-swatch-btn .swatch-check {
    font-size: 0.72rem;
    color: #FFFFFF;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
    display: none;
}

.color-swatch-btn.active .swatch-check {
    display: block;
}

.color-swatch-btn[data-is-light="true"] .swatch-check {
    color: #0B2E6B;
    filter: none;
}

/* Tooltip on swatch hover */
.color-swatch-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1E293B;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 7px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    z-index: 10;
}

.color-swatch-item:hover .color-swatch-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ==========================================================================
   8. Checkbox & Radio Lists (Fabric, Occasion, Style, Discount, Stock)
   ========================================================================== */
.filter-checkbox-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.filter-checkbox-list::-webkit-scrollbar {
    width: 4px;
}

.filter-checkbox-list::-webkit-scrollbar-thumb {
    background-color: #CBD5E1;
    border-radius: 4px;
}

.filter-checkbox-item {
    margin-bottom: 2px;
}

.custom-checkbox-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 6px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #334155;
    transition: background 0.15s ease;
    user-select: none;
}

.custom-checkbox-wrap:hover {
    background: #F1F5F9;
    color: #0B2E6B;
}

.custom-checkbox-wrap input[type="checkbox"],
.custom-checkbox-wrap input[type="radio"] {
    margin-right: 8px;
    accent-color: #0B2E6B;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.custom-checkbox-wrap .label-wrap {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-checkbox-wrap .stars-row {
    color: #D4AF37;
    margin-right: 4px;
    font-size: 0.78rem;
}

/* ==========================================================================
   9. Mobile Filter Trigger & Drawer
   ========================================================================== */
.mobile-filter-bar {
    display: none;
    margin-bottom: 1rem;
}

.mobile-filter-open-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(11, 46, 107, 0.05);
    font-size: 0.9rem;
    font-weight: 700;
    color: #0B2E6B;
    cursor: pointer;
}

.mobile-filter-open-btn i {
    color: #D4AF37;
    margin-right: 6px;
}

.mobile-filter-open-btn .active-indicator {
    background: #0B2E6B;
    color: #FFFFFF;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 10px;
    margin-left: 6px;
}

.mobile-drawer-header,
.mobile-drawer-footer {
    display: none;
}

.filter-drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(11, 46, 107, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mobile & Tablet Breakpoint (< 992px) */
@media (max-width: 991.98px) {
    .mobile-filter-bar {
        display: block;
    }

    .shop-filter-toggle {
        display: none !important;
    }

    .shop-sidebar {
        position: fixed !important;
        top: 0;
        left: -340px;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        height: 100dvh;
        z-index: 1050;
        border-radius: 0;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.18);
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex !important;
        flex-direction: column;
        border: none;
    }

    .shop-sidebar.drawer-open {
        left: 0 !important;
    }

    .filter-drawer-backdrop.show {
        display: block;
        opacity: 1;
    }

    .sidebar-header {
        display: none; /* Replaced by mobile-drawer-header */
    }

    .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        background: #0B2E6B;
        color: #FFFFFF;
        flex-shrink: 0;
    }

    .mobile-drawer-header h3 {
        margin: 0;
        font-size: 1.05rem;
        font-weight: 700;
        color: #FFFFFF;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-drawer-header h3 i {
        color: #D4AF37;
    }

    .mobile-drawer-close-btn {
        background: rgba(255, 255, 255, 0.15);
        border: none;
        color: #FFFFFF;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1rem;
        transition: background 0.15s ease;
    }

    .mobile-drawer-close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

    .sidebar-scrollable-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-drawer-footer {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
        background: #FFFFFF;
        border-top: 1px solid #E2E8F0;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
        flex-shrink: 0;
    }

    .drawer-reset-btn {
        flex: 1;
        height: 44px;
        background: #F1F5F9;
        border: 1px solid #CBD5E1;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 700;
        color: #475569;
        cursor: pointer;
        transition: background 0.15s ease;
    }

    .drawer-reset-btn:hover {
        background: #E2E8F0;
        color: #0B2E6B;
    }

    .drawer-apply-btn {
        flex: 2;
        height: 44px;
        background: #0B2E6B;
        border: 1px solid #0B2E6B;
        border-radius: 8px;
        font-size: 0.88rem;
        font-weight: 700;
        color: #FFFFFF;
        cursor: pointer;
        transition: background 0.15s ease;
    }

    .drawer-apply-btn:hover {
        background: #092352;
    }
}
