.kcf-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
}

.kcf-sidebar {
    flex: 0 0 260px;
    max-width: 260px;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
}

.kcf-grid-col {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
}

.kcf-grid-col.kcf-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.kcf-facet {
    margin-bottom: 0;
    border-bottom: 1px solid #eee;
    padding: 18px 0;
}

.kcf-facet summary {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.kcf-facet summary::-webkit-details-marker {
    display: none;
}

.kcf-facet summary::after {
    content: '';
    width: 12px;
    height: 8px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23111111' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: contain;
    transition: transform 0.15s ease;
}

.kcf-facet[open] summary::after {
    transform: rotate(180deg);
}

.kcf-facet .kcf-checkbox-list,
.kcf-facet .kcf-range-inputs {
    margin-top: 14px;
}

.kcf-checkbox-list,
.kcf-checkbox-list li {
    list-style: none !important;
}

.kcf-checkbox-list {
    margin: 0;
    padding: 0;
}

.kcf-checkbox-list li {
    margin-bottom: 8px;
}

.kcf-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.kcf-count {
    color: #999;
    font-size: 12px;
}

.kcf-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kcf-range-inputs input[type="number"] {
    width: 80px;
}

.kcf-sort select {
    width: 100%;
    border: 1px solid #eee;
    color: #000 !important;
    font-size: 13px !important;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23000000' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.kcf-price-slider,
.kcf-dimension-slider {
    position: relative;
}

/* Thumb diameter, referenced below to inset the track/fill so their visual
   edges land exactly where the native thumbs travel to (a plain 0-100%
   track is wider than the thumbs' actual travel range, which is inset by
   half the thumb's own width at each end - without this the fill/track
   never quite lines up with where the thumbs actually sit). */
.kcf-slider-wrap {
    position: relative;
    height: 24px;
    margin-top: 14px;
}

.kcf-slider-track {
    position: absolute;
    top: 10px;
    left: 8px;
    right: 8px;
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
}

.kcf-slider-fill {
    position: absolute;
    top: 0;
    height: 4px;
    background: var(--nectar-accent-color);
    border-radius: 2px;
}

.kcf-slider-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 24px;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.kcf-slider-input::-webkit-slider-runnable-track {
    background: transparent;
}

.kcf-slider-input::-moz-range-track {
    background: transparent;
}

.kcf-slider-input::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--nectar-accent-color);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
    margin-top: 6px;
}

.kcf-slider-input::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--nectar-accent-color);
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.kcf-slider-values {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #555;
    margin-top: 14px;
}

.kcf-sentinel {
    height: 1px;
}

.kcf-empty {
    padding: 40px 0;
    text-align: center;
    color: #777;
}

.kcf-mobile-filter-toggle {
    display: none;
}

/* Wraps just the toggle button + sidebar, separate from .kcf-grid-col.
   On desktop it's not a real box at all (display: contents) - .kcf-sidebar
   still sizes/positions itself directly against .kcf-layout, unchanged.
   At <=999px it becomes the sidebar's positioning anchor: anchoring
   directly against .kcf-layout instead (which wraps the entire product
   grid) meant "100% down" landed at the bottom of the whole page, not
   just below the button. */
.kcf-mobile-filter-bar {
    display: contents;
}

@media (max-width: 999px) {
    .kcf-layout {
        flex-direction: column;
    }

    .kcf-mobile-filter-bar {
        display: block;
        position: relative;
        flex: 1 1 100%;
    }

    /* position: sticky doesn't work here - Salient sets overflow:hidden on
       <body> globally, which breaks sticky on every descendant regardless
       of this element's own CSS. Pinned via position:fixed instead
       (added/removed by filters.js, which also measures and sets the
       real left/width inline - a fixed element ignores container
       padding entirely, so a hardcoded width here would drift out of
       alignment with the grid below it). top matches this codebase's
       existing "below the header" convention (.pdp-tab-nav's top: 95px
       fallback). */
    .kcf-mobile-filter-bar.kcf-pinned {
        position: fixed;
        top: 95px;
        z-index: 25;
    }

    .kcf-mobile-filter-toggle {
        display: block;
        width: 100%;
        margin-bottom: 0;
        padding: 14px 18px;
        font-size: 13px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        border: 1px solid #111;
        background: #fff;
        color: #111;
        cursor: pointer;
    }

    /* Collapsed by default; when open, this is a self-contained dropdown
       panel (own scroll, capped height) rather than in-flow content -
       stacking all facets inline pushed the grid far down the page and
       let the site's sticky header overlap whatever facet ended up at
       the scroll position's top. Hidden via opacity/pointer-events, not
       display:none - display can't be transitioned, and filters.js drives
       the enter-from-left / exit-to-right transform directly (a single
       CSS open/closed state pair can only produce symmetric motion). */
    .kcf-sidebar {
        display: block;
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        width: 50vw;
        max-width: 50vw;
        z-index: 20;
        max-height: 70vh;
        overflow-y: auto;
        background: #fff;
        border: 1px solid #eee;
        padding: 20px;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease, transform 0.25s ease;
    }

    .kcf-layout.kcf-sidebar-open .kcf-sidebar {
        opacity: 1;
        pointer-events: auto;
    }
}
