/* =========================================================
   KLEURSTALEN PAGE
   ========================================================= */
.xl-cs-page {
    width: 100% !important;
    max-width: 1410px;
    margin: 0 auto !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box;
}
.xl-cs-page-main {
    display: flex !important;
    flex-direction: column !important;
    flex-grow: 1;
}
.xl-cs-grid-wrap { flex-grow: 1; min-width: 0; }

/* Active filter bar — hidden when no filters */
.xl-cs-activebar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0 0 16px;
    box-shadow: none;
    min-height: 0;
}
.xl-cs-activebar:has(.xl-cs-activebar-empty) { display: none !important; }
.xl-cs-activebar-label {
    font-size: 11px; font-weight: 700;
    color: var(--xl-muted);
    text-transform: uppercase; letter-spacing: .08em;
    margin-right: 4px;
}
.xl-cs-activebar-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex; flex-wrap: wrap; gap: 6px;
}
.xl-cs-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--xl-brand);
    color: #fff;
    border: 0;
    padding: 4px 4px 4px 12px;
    border-radius: 999px;
    margin: 0 !important;
    font-size: 12.5px; font-weight: 500;
}
.xl-cs-tag-text { color: #fff; font-weight: 500; }
.xl-cs-tag-x {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px;
    background: rgba(255,255,255,.22) !important;
    color: #fff !important;
    border-radius: 999px !important;
    cursor: pointer;
    font-size: 13px; font-weight: 700; line-height: 1;
    border: 0 !important; padding: 0 !important;
    transition: background .15s;
}
.xl-cs-tag-x:hover { background: rgba(255,255,255,.4) !important; }
.xl-cs-activebar-empty { display: none; }

/* Sample grid */
.xl-cs-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 14px !important;
    margin: 0 !important;
}
@media (max-width: 640px) {
    .xl-cs-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .xl-cs-card { padding: 6px 6px 8px !important; }
    .xl-cs-title { font-size: 13px !important; }
}

/* === POLAROID CARD (concept B) — namespaced .xl-cs-* === */
.xl-cs-card {
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    background: #fff !important;
    border: 1px solid var(--xl-border) !important;
    border-radius: 8px !important;
    padding: 8px 8px 10px !important;
    cursor: pointer;
    box-shadow: var(--xl-shadow-sm) !important;
    transition: border-color .15s, box-shadow .15s !important;
    box-sizing: border-box;
    margin: 0 !important;
    max-width: none !important;
    flex: initial !important;
    overflow: visible !important;
    text-align: left !important;
}
.xl-cs-card:hover {
    border-color: var(--xl-text) !important;
    box-shadow: var(--xl-shadow) !important;
}
.xl-cs-card.selected {
    border-color: var(--xl-brand) !important;
    box-shadow: 0 0 0 1px var(--xl-brand) !important;
    background: #fffaf8 !important;
}

/* Polaroid swatch */
.xl-cs-swatch {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 100% !important;
    margin: 0 0 10px !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    background: var(--xl-soft) !important;
    box-shadow: inset 0 0 0 1px rgba(15,23,42,.06) !important;
}
.xl-cs-swatch img {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important; left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    border-radius: 0 !important;
    aspect-ratio: 1/1 !important;
}

/* Floating action button — anchored inside swatch */
.xl-cs-fab {
    position: absolute !important;
    bottom: 6px !important;
    right: 6px !important;
    width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,.95) !important;
    color: var(--xl-text) !important;
    box-shadow: 0 2px 6px rgba(15,23,42,.18), 0 0 0 1px rgba(15,23,42,.06) !important;
    cursor: pointer;
    z-index: 3;
    font-size: 0 !important;
    line-height: 0 !important;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background .15s, color .15s, box-shadow .15s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.xl-cs-fab .xl-cs-fab-label { display: none !important; }
.xl-cs-fab::before {
    content: "" !important;
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' d='M12 5v14M5 12h14'/></svg>") center/14px 14px no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' d='M12 5v14M5 12h14'/></svg>") center/14px 14px no-repeat;
}
.xl-cs-card.selected .xl-cs-fab,
.xl-cs-card.selected .xl-cs-fab:hover {
    background: var(--xl-brand) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(255,59,0,.45) !important;
}
.xl-cs-card.selected .xl-cs-fab::before {
    -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M4 12.5l5 5L20 7'/></svg>") center/12px 12px no-repeat;
            mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' d='M4 12.5l5 5L20 7'/></svg>") center/12px 12px no-repeat;
}
.xl-cs-fab:active { transform: scale(.92); }
.xl-cs-card-oos .xl-cs-fab { display: none !important; }

/* Meta footer */
.xl-cs-meta { padding: 0 2px; }
.xl-cs-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: var(--xl-text) !important;
    margin: 0 0 6px !important;
    line-height: 1.25 !important;
    text-align: left !important;
    word-break: break-word !important;
}
.xl-cs-meta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
}
.xl-cs-type {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 5px !important;
    background: var(--xl-soft) !important;
    color: var(--xl-text) !important;
    border: 1px solid var(--xl-border) !important;
    border-radius: 999px !important;
    padding: 4px 10px 4px 7px !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    margin: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    width: fit-content !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
}
.xl-cs-type-icon,
img.xl-cs-type-icon,
.xl-cs-type img.sample-icon,
.xl-cs-type .sample-icon {
    width: 13px !important;
    height: 13px !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 0 !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    vertical-align: middle !important;
    align-self: center !important;
    line-height: 1 !important;
    transform: translateY(0.5px) !important;
}
.xl-cs-type {
    line-height: 2px !important;
}
.xl-cs-product {
    font-size: 10px !important;
    line-height: 1.35 !important;
    color: var(--xl-muted) !important;
    margin: 1px 0 0 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    text-align: right !important;
    flex: 1;
    min-width: 0;
    /* clamp to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word !important;
}

/* Selected meta accent */
.xl-cs-card.selected .xl-cs-title { color: var(--xl-brand) !important; }
.xl-cs-card.selected .xl-cs-type {
    background: var(--xl-brand-soft) !important;
    border-color: #ffd1bf !important;
    color: var(--xl-brand) !important;
}

/* Out-of-stock overlay */
.xl-cs-stock-overlay {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center; justify-content: center;
    text-align: center;
    background: rgba(255,255,255,.85);
    color: var(--xl-text);
    font-weight: 700;
    font-size: 11px;
    line-height: 1.4;
    padding: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
    z-index: 2;
}
.xl-cs-card-oos .xl-cs-swatch img { filter: grayscale(60%) opacity(.55); }

/* =========================================================
   LOAD MORE
   ========================================================= */
.xl-cs-loadmore-wrap { text-align: center; margin: 32px 0 48px; }
.xl-cs-loadmore {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    height: 42px !important; padding: 0 22px !important;
    background: #fff !important;
    border: 1px solid var(--xl-border-strong) !important;
    border-radius: 8px !important;
    color: var(--xl-text) !important;
    font-size: 14px !important; font-weight: 600 !important;
    cursor: pointer;
    transition: background .15s, border-color .15s !important;
    box-shadow: none !important;
    text-transform: none !important;
    line-height: 1 !important;
}
.xl-cs-loadmore:hover { background: var(--xl-soft) !important; border-color: var(--xl-text) !important; }

/* =========================================================
   FILTER SIDEBAR — redesigned, namespaced
   ========================================================= */
.xl-cs-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--xl-drawer-width, 450px);
    max-width: var(--xl-drawer-max-width, 90vw);
    background: var(--xl-drawer-bg, #fff);
    transform: translateX(-100%);
    transition: var(--xl-drawer-panel-transition, transform .32s cubic-bezier(.25, .46, .45, .94), opacity .24s ease, visibility .24s ease);
    box-shadow: var(--xl-drawer-shadow-left, 5px 0 15px rgba(0, 0, 0, .1));
    overflow: hidden;
    padding: 0;
    display: flex; flex-direction: column;
    z-index: var(--xl-drawer-panel-z, 99999);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}
.xl-cs-sidebar.open {
    transform: translateX(0);
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.xl-cs-sidebar-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 18px 24px;
    border-bottom: 1px solid var(--xl-border);
    background: #fff;
    flex-shrink: 0;
}
.xl-cs-sidebar-title {
    margin: 0 !important;
    font-family: var(--font-heading, Outfit, system-ui, sans-serif) !important;
    font-size: 21px !important;
    font-weight: 900 !important;
    line-height: 1.05 !important;
    color: var(--xl-text) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.xl-cs-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 18px 20px;
}

/* Filter section */
.xl-cs-fsec {
    padding: 16px 0;
    border-bottom: 1px solid var(--xl-border);
}
.xl-cs-fsec:last-child { border-bottom: 0; }
.xl-cs-fsec-title {
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: .08em !important;
    color: var(--xl-muted) !important;
    margin: 0 0 10px !important;
}

/* Chip-pills (categories, colors) */
.xl-cs-chips {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.xl-cs-chip {
    position: relative;
    display: inline-flex; align-items: center;
    padding: 7px 12px;
    background: #fff;
    color: var(--xl-text);
    border: 1px solid var(--xl-border);
    border-radius: 999px;
    font-size: 12.5px; font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
    user-select: none;
}
.xl-cs-chip:hover { border-color: var(--xl-text); }
.xl-cs-chip-input {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
}
.xl-cs-chip:has(.xl-cs-chip-input:checked) {
    background: var(--xl-brand);
    border-color: var(--xl-brand);
    color: #fff;
}
.xl-cs-chip-text { line-height: 1; }

/* Product list — compact rows, single line + ellipsis */
.xl-cs-flist {
    display: flex; flex-direction: column; gap: 0;
    margin: 0 -8px;
}
.xl-cs-frow {
    display: flex; align-items: center; gap: 10px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s, color .15s;
    color: var(--xl-text);
    font-size: 12.5px;
    line-height: 1.2;
    min-height: 32px;
}
.xl-cs-frow:hover { background: var(--xl-soft); color: var(--xl-text); }
.xl-cs-frow-input {
    position: absolute !important;
    width: 1px !important; height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.xl-cs-frow-box {
    flex-shrink: 0;
    width: 16px; height: 16px;
    border: 1.5px solid var(--xl-border-strong);
    border-radius: 4px;
    background: #fff;
    transition: background .15s, border-color .15s;
    position: relative;
}
.xl-cs-frow:has(.xl-cs-frow-input:checked) {
    background: var(--xl-brand-soft);
    color: var(--xl-brand);
    font-weight: 600;
}
.xl-cs-frow:has(.xl-cs-frow-input:checked) .xl-cs-frow-box {
    background: var(--xl-brand);
    border-color: var(--xl-brand);
}
.xl-cs-frow:has(.xl-cs-frow-input:checked) .xl-cs-frow-box::after {
    content: "";
    position: absolute; inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round' d='M5 12.5l4 4L19 7'/></svg>") center/12px no-repeat;
}
.xl-cs-frow-text {
    flex: 1; min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Filter overlay (mobile only) */
.xl-cs-filter-overlay {
    position: fixed; inset: 0;
    background: var(--xl-drawer-overlay-bg, rgba(17, 24, 39, .58));
    backdrop-filter: blur(var(--xl-drawer-overlay-blur, 8px));
    -webkit-backdrop-filter: blur(var(--xl-drawer-overlay-blur, 8px));
    z-index: var(--xl-drawer-overlay-z, 99990);
    visibility: hidden; opacity: 0;
    pointer-events: none;
    transition: var(--xl-drawer-overlay-transition, opacity .24s ease, visibility .24s ease);
}
.xl-cs-filter-overlay.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

/* Filter toggle button (mobile only) — subtle white w/ brand accent */
.xl-cs-filter-toggle.xl-cs-btn,
.xl-cs-filter-toggle.xl-cs-btn-primary,
button.xl-cs-filter-toggle {
    width: 100% !important;
    margin-bottom: 16px !important;
    background: #fff !important;
    color: var(--xl-text) !important;
    border: 1px solid var(--xl-border-strong) !important;
    box-shadow: var(--xl-shadow-sm) !important;
    font-weight: 600 !important;
    height: 44px !important;
}
.xl-cs-filter-toggle svg { color: var(--xl-brand); }
button.xl-cs-filter-toggle:hover {
    background: var(--xl-soft) !important;
    border-color: var(--xl-text) !important;
    color: var(--xl-text) !important;
}

@media (min-width: 992px) {
    button.xl-cs-filter-toggle,
    .xl-cs-filter-toggle.xl-cs-btn,
    .xl-cs-filter-toggle,
    .xl-cs-filter-overlay,
    .xl-cs-sidebar .xl-cs-sidebar-head { display: none !important; }
    .xl-cs-page-main { flex-direction: row !important; align-items: flex-start; gap: 28px; }
    .xl-cs-sidebar {
        position: sticky; top: 20px;
        transform: none !important;
        flex: 0 0 260px;
        background: #fff;
        border: 1px solid var(--xl-border);
        border-radius: 8px;
        box-shadow: var(--xl-shadow-sm);
        max-height: calc(100vh - 40px);
        overflow: hidden;
        visibility: visible; opacity: 1;
        z-index: auto;
        pointer-events: auto;
    }
    .xl-cs-sidebar-body { padding: 4px 14px 16px; }
    .xl-cs-fsec { padding: 14px 0; }
}

/* JS-class compat for sidebar open toggle */
.product-samples-filters.open { transform: translateX(0) !important; }
.filter-overlay.open { visibility: visible !important; opacity: 1 !important; }

/* Cleanup empty wp paragraphs */
.xl-grid-item p:empty { display: none !important; }
.xl-grid-item > br { display: none !important; }
