/* --- Breadcrumb + Range tabs (ALL / MODERNA / RUSTICA) --- */
.kcf-breadcrumb {
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--warm-500, #7d766a);
    margin: 0 0 22px;
}
.kcf-breadcrumb a {
    color: inherit;
    text-decoration: none;
}
.kcf-breadcrumb a:hover {
    color: var(--accent-primary, #8c1c1c);
}
.kcf-breadcrumb-sep {
    margin: 0 8px;
    color: #c9c6bf;
}

.kcf-range-tabs {
    display: flex;
    gap: 10px;
    margin: 0 0 34px;
    flex-wrap: wrap;
}
.kcf-range-tab {
    display: inline-block;
    padding: 12px 26px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-primary, #141311);
    background: transparent;
    border: 1px solid rgba(20, 19, 17, 0.28);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.kcf-range-tab:hover {
    border-color: var(--text-primary, #141311);
}
.kcf-range-tab.is-active {
    background: var(--ink-950, #141311);
    border-color: var(--ink-950, #141311);
    color: #fff;
}

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

.kcf-sidebar {
    flex: 0 0 260px;
    max-width: 260px;
    position: sticky;
    /* Matches this codebase's "below the header" convention (.pdp-tab-nav's
       top: 95px fallback, also used by .kcf-mobile-filter-bar below) - the
       site header is fixed/z-index:9999 at up to 90px tall, and top: 0 let
       the sidebar stick flush with the viewport top on scroll, riding up
       under the header instead of stopping below it. */
    top: 95px;
    max-height: calc(100vh - 95px);
    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;
}

/* --- Sidebar facets: collapsible accordions, all open by default --- */
.kcf-facet {
    margin: 0 0 26px;
    padding: 0;
    border: 0;
}
.kcf-facet summary {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-primary, #141311);
    list-style: none;
    cursor: pointer;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(20, 19, 17, 0.14);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.kcf-facet summary::-webkit-details-marker,
.kcf-facet summary::marker {
    display: none;
    content: '';
}
.kcf-facet summary::after {
    content: '';
    flex: none;
    width: 11px;
    height: 7px;
    background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23141311' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    transition: transform 0.15s ease;
}
.kcf-facet:not([open]) summary::after {
    transform: rotate(-90deg);
}
/* Salient's dynamic CSS has a blanket `label span{color:accent}` !important
   rule - the facet name + count spans need to opt back out. */
.kcf-checkbox-list label .kcf-facet-name {
    color: var(--text-primary, #141311) !important;
    margin-top: 4px;
}
.kcf-checkbox-list label .kcf-count {
    color: var(--warm-500, #7d766a) !important;
}

.kcf-checkbox-list {
    list-style: none !important;
    margin: 14px 0 0;
    padding: 0;
}
.kcf-checkbox-list li {
    margin: 0;
    list-style: none !important;
    padding-left: 0 !important;
}
.kcf-checkbox-list li::before,
.kcf-checkbox-list li::marker {
    content: none !important;
    display: none !important;
}
.kcf-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    padding: 7px 0;
    color: var(--text-primary, #141311);
}
.kcf-checkbox-list input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    flex: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 1px solid rgba(20, 19, 17, 0.4);
    background: #F2EFE7;
    cursor: pointer;
    position: relative;
}
.kcf-checkbox-list input[type="checkbox"]:checked {
    background: var(--ink-950, #141311);
    border-color: var(--ink-950, #141311);
}
.kcf-facet-name {
    flex: 1 1 auto;
}
.kcf-count {
    flex: none;
    color: var(--warm-500, #7d766a);
    font-size: 13px;
}

/* --- Toolbar: "N models" | Sort ▾ --- */
.kcf-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(20, 19, 17, 0.14);
}
.kcf-result-count {
    font-size: 13px;
    color: var(--warm-500, #7d766a);
}
.kcf-sort-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}
.kcf-sort-label {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--warm-500, #7d766a);
}
.kcf-toolbar .kcf-sort-wrap select {
    border: 0;
    background-color: transparent;
    font: inherit;
    font-size: 14px !important;
    color: var(--text-primary, #141311) !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    padding: 4px 22px 4px 0;
    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='%23141311' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

.kcf-empty {
    padding: 40px 0;
    color: var(--warm-500, #7d766a);
    font-size: 14px;
}

/* --- Product card (reference) ---
   #ajax-content-wrap prefix so these beat Salient's own
   `#ajax-content-wrap .products .product{width:..}` grid rules. */
#ajax-content-wrap .kcf-grid-col ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 48px 26px !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    width: 100% !important;
}
#ajax-content-wrap .kcf-grid-col ul.products::before,
#ajax-content-wrap .kcf-grid-col ul.products::after {
    display: none !important;
    content: none !important;
}
#ajax-content-wrap .kcf-grid-col ul.products > li.product {
    position: relative;
    display: flex !important;
    flex-direction: column;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
    left: auto !important;
    right: auto !important;
    clear: none !important;
    border: 0;
    background: none;
    list-style: none;
}
.kcf-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.kcf-card-media {
    position: relative;
    background: #fff;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 18px;
}
.kcf-card-media .kcf-card-img,
.kcf-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* hide the alt text that flashes before the bitmap loads */
    color: transparent;
    font-size: 0;
    opacity: 0;
    transition: transform 1.1s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease !important;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0) scale(1);
}
.kcf-card-media .kcf-card-img.kcf-img-in,
.kcf-card-media img.kcf-img-in {
    opacity: 1;
}
/* Reference hover = a slow image zoom only. Kill Salient's classic-card
   lift + drop-shadow + its own image hover transform/transition. */
#ajax-content-wrap .kcf-grid-col ul.products > li.product,
#ajax-content-wrap .kcf-grid-col ul.products > li.product:hover {
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
}
#ajax-content-wrap .kcf-grid-col ul.products > li.product:hover .kcf-card-media img,
.kcf-card:hover .kcf-card-media .kcf-card-img,
.kcf-card:hover .kcf-card-media img {
    transform: translateZ(0) scale(1.08) !important;
}
.kcf-card-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    background: var(--accent-primary, #8c1c1c);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 8px 13px;
    line-height: 1;
}
/* kooka-product-compare's toggle - badge-style, flush top-right. */
.kcf-card-media .kpc-compare-toggle {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    background: var(--text-primary, #141311);
    border: none;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 8px 13px;
    cursor: pointer;
    line-height: 1;
}
.kpc-compare-toggle input[type="checkbox"] {
    display: none;
}
.kcf-card-media .kpc-compare-toggle:has(input:checked) {
    background: var(--accent-primary, #8c1c1c);
}
.kcf-card-eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--warm-500, #7d766a);
}
.kcf-card-name {
    margin: 0 !important;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary, #141311);
}
.kcf-card-cooktop {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--warm-500, #7d766a);
}
.kcf-card-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}
.kcf-card-price {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary, #141311);
}
.kcf-card-price .woocommerce-Price-amount {
    font-weight: 600;
}
.kcf-card-swatch {
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(20, 19, 17, 0.2);
}

@media (max-width: 1100px) {
    .kcf-grid-col ul.products { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .kcf-grid-col ul.products { grid-template-columns: 1fr; }
}

.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-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;
    }
}
