/* ----------
   17. Filter bar
   ---------- */
.filter-bar {
    border-radius: var(--r-lg);
    padding: var(--sp-3);
    margin-bottom: var(--sp-5);
    /* [data-reveal] leaves a non-none transform on this element even once
       revealed, which makes it a stacking context — so it must out-rank
       later same-page content (.filter-chips, and .room-card__badges /
       .room-card__live in the grid below, both z-index: 2) explicitly, or
       its dropdown menu paints underneath them. */
    position: relative;
    z-index: 5;
}
/* Shop archive: filter-bar sits as a sticky sidebar beside the grid instead
   of a full-width bar above it (rooms/careers archives keep the full-width
   bar). The mobile off-canvas behaviour further down is unaffected — a
   fixed-position element is taken out of grid flow regardless of its
   track's width. */
.shop-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--sp-4);
    align-items: start;
}
/* See .room-content's min-width:0 in rooms.css for why this is needed —
   same grid-item-overflow gotcha, same fix. */
.shop-layout > * {
    min-width: 0;
}
.shop-layout .filter-bar {
    position: sticky;
    top: calc((var(--header-h) + var(--admin-bar-h)) + var(--sp-3));
    margin-bottom: 0;
}
.filter-bar__top {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar__top-left {
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar__sort {
    margin-left: auto;
}
.search-input {
    position: relative;
    margin-bottom: var(--sp-3);
}
.search-input input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--c-text);
    font-family: inherit;
}
.search-input input::placeholder {
    color: var(--c-text-mute);
}
.search-input svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--c-text-mute);
}
.select {
    position: relative;
}
.select select {
    appearance: none;
    padding: 0.85rem 2.4rem 0.85rem 1.1rem;
    border-radius: var(--r-pill);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--c-text);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}
.select::after {
    content: "";
    position: absolute;
    right: 1rem;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 1.5px solid var(--c-text-mute);
    border-bottom: 1.5px solid var(--c-text-mute);
    transform: translateY(-70%) rotate(45deg);
}
/* Once custom-select.js enhances the <select> inside, its trigger draws its
   own chevron — hide this one so they don't stack. */
.select.select--enhanced::after {
    display: none;
}
.view-toggle {
    display: flex;
    gap: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--r-pill);
    padding: 0.25rem;
}
.view-toggle button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--c-text-mute);
    transition: all var(--t-fast);
}
.view-toggle button.is-active {
    background: var(--c-gold-400);
    color: var(--c-black);
}
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.active-filters .clear-filters {
    margin-left: auto;
}
.filter-chip {
    padding: 0.5rem 1rem;
    border-radius: var(--r-pill);
    font-size: 0.83rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--c-text-dim);
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-out);
}
.filter-chip:hover {
    border-color: var(--c-gold-400);
    color: var(--c-gold-300);
    /* Was a flat color swap — every other clickable pill on the site (.btn,
       .social a) lifts + glows on hover, so a bare color change here read as
       a step down in polish right next to them. */
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -14px rgba(230, 181, 74, 0.6);
}
.filter-chip.is-active {
    background: var(--c-gold-400);
    color: var(--c-black);
    border-color: var(--c-gold-400);
}
.filter-controls-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-3);
}
.filter-controls-row .filter-chips {
    flex: 1;
}
.filter-toggle {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.25rem;
    margin-right: auto;
    border-radius: var(--r-pill);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--c-text);
    font-size: 0.9rem;
    font-family: inherit;
}
.filter-bar__close {
    display: none;
}
.results-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--c-text-mute);
    margin-bottom: var(--sp-3);
}

/* Filter bar sections — Price / Size / Color / Age Group / Availability
   groups inside the shop archive's .filter-bar (rooms archive only ever
   needed a single row of selects, so this is shop-specific). */
.filter-group {
    padding: var(--sp-3) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.filter-group:first-child {
    padding-top: 0;
}
.filter-group:last-of-type {
    border-bottom: none;
}
.filter-group h4 {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-mute);
    margin: 0 0 0.9rem;
    font-weight: 700;
}
.filter-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.9rem;
    color: var(--c-text-dim);
    cursor: pointer;
}
.filter-check input {
    accent-color: var(--c-gold-400);
    width: 16px;
    height: 16px;
}
/* Persistent "Clear all" inside the shop's .filter-bar — only ever shown on
   mobile (see the max-width:768px rule below), where .active-filters (the
   dynamic chip-list-plus-clear-button) is hidden in favour of this static
   one living inside the drawer instead of the main page. */
.filter-bar__clear-mobile {
    display: none;
}
.clear-filters {
    font-size: 0.85rem;
    color: var(--c-gold-400);
    cursor: pointer;
    margin-top: var(--sp-2);
    background: none;
    border: none;
    padding: 0;
    font-weight: 600;
    font-family: inherit;
}
.clear-filters:hover {
    color: var(--c-gold-300);
}

/* Multi-select attribute chips (Size, Age Group) */
.attr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.attr-chip {
    padding: 0.5rem 0.9rem;
    border-radius: var(--r-sm);
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--c-text-dim);
    cursor: pointer;
    font-family: inherit;
    transition: all var(--t-fast);
}
.attr-chip:hover {
    border-color: var(--c-gold-400);
}
.attr-chip.is-active {
    border-color: var(--c-gold-400);
    color: var(--c-gold-300);
    background: rgba(230, 181, 74, 0.1);
    font-weight: 600;
}

/* Color swatches */
.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}
.color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}
.color-swatch.is-active {
    border-color: var(--c-gold-400);
}

/* Dual-handle price range slider */
.price-slider {
    position: relative;
    height: 32px;
    margin-top: 0.25rem;
}
.price-slider .track {
    position: absolute;
    top: 14px;
    height: 4px;
    left: 2px;
    right: 2px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
}
.price-slider .track-fill {
    position: absolute;
    top: 14px;
    height: 4px;
    background: var(--c-gold-400);
    border-radius: 2px;
}
.price-slider input[type="range"] {
    position: absolute;
    width: 100%;
    top: 6px;
    left: 0;
    margin: 0;
    height: 20px;
    background: transparent;
    -webkit-appearance: none;
    pointer-events: none;
}
.price-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: all;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--c-gold-300);
    cursor: pointer;
    box-shadow: 0 0 0 3px var(--c-ink-900);
}
.price-slider input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: var(--c-gold-300);
    cursor: pointer;
    box-shadow: 0 0 0 3px var(--c-ink-900);
}
.price-values {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--c-text-dim);
    margin-top: 0.5rem;
}

/* Shop pagination */
.shop-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: var(--sp-5) 0 0;
}
.shop-pagination .page-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 0.5rem;
    border-radius: var(--r-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: var(--c-text-dim);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-family: inherit;
}
.shop-pagination .page-btn:hover:not(:disabled) {
    border-color: var(--c-gold-400);
    color: var(--c-text);
}
.shop-pagination .page-btn.is-active {
    background: var(--c-gold-400);
    border-color: var(--c-gold-400);
    color: var(--c-black);
    font-weight: 600;
}
.shop-pagination .page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Moved from base.css: that file loads before this one, so its same-
   specificity @media override lost the cascade tie to this file's
   unconditional desktop rule regardless of viewport — .filter-bar's own
   `position: relative` (desktop) was beating the mobile drawer's
   `position: fixed`, so the off-canvas panel never actually went
   full-screen and rendered as a small in-flow box with its own scrollbar
   instead. */
@media (max-width: 768px) {
    .filter-toggle {
        display: inline-flex;
    }
    .view-toggle {
        display: none;
    }
    .active-filters {
        display: none;
    }
    .filter-bar__clear-mobile {
        display: block;
        margin-top: var(--sp-3);
        padding-top: var(--sp-3);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        text-align: center;
    }
    .shop-layout {
        grid-template-columns: 1fr;
    }
    .filter-bar,
    .shop-layout .filter-bar {
        position: fixed;
        inset: 0;
        z-index: 99;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 0;
        border-radius: 0;
        background: rgba(6, 7, 10, 0.97);
        backdrop-filter: blur(24px);
        padding: calc((var(--header-h) + var(--admin-bar-h)) + 3.5rem) 1.25rem 2rem;
        /* !important: this element also carries [data-reveal], whose own
           .is-revealed state (same specificity, earlier in the cascade)
           would otherwise fight this panel's open/closed transform. */
        transform: translateY(100%) !important;
        opacity: 1 !important;
        transition: transform var(--t-slow) var(--ease-out);
        overflow-y: auto;
    }
    .filter-bar.is-open {
        transform: translateY(0) !important;
    }
    .filter-bar__close {
        display: flex;
        position: absolute;
        top: calc((var(--header-h) + var(--admin-bar-h)) + 0.5rem);
        right: 1.25rem;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: var(--c-text-dim);
        font-size: 1.5rem;
        line-height: 1;
    }
    .filter-bar__top {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar__top-left {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar__sort {
        margin-left: 0;
    }
    .filter-bar__top .select {
        width: 100%;
        min-width: 0;
    }
    .filter-bar__top .select select {
        width: 100%;
    }
}

