/* ==========================================================================
   IseMoody Shop — Filter Sidebar Redesign
   Visual language: matches the site's cream cards, Cormorant headings,
   DM Sans body, and #b8860b gold accent.
   ========================================================================== */

/* ── Layout ──────────────────────────────────────────────────────────────── */
.shop-products__inner {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 36px;
    align-items: start;
}

.shop-filters-toggle {
    display: none;
}

/* ── Sidebar card — identical DNA to the site's content cards ────────────── */
.shop-filters {
    position: sticky;
    top: 120px;
    background: #fdfcfb;
    border: 1px solid rgba(184, 134, 11, 0.12);
    border-radius: 20px;
    padding: 28px 24px 24px;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.04),
        0 8px 28px rgba(0, 0, 0, 0.06);
}

.shop-filters__inner {
    display: flex;
    flex-direction: column;
}

/* ── Sidebar header row ──────────────────────────────────────────────────── */
.shop-filters__close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(184, 134, 11, 0.12);
}

/* "Filters" heading */
.shop-filters__close-label {
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent, #b8860b);
    line-height: 1;
}

/* Close button: hidden on desktop, shown on mobile */
.shop-filters__close-btn {
    display: none;
}

/* ── Accordion sections ──────────────────────────────────────────────────── */
.shop-filters__accordion {
    border-bottom: 1px solid rgba(184, 134, 11, 0.09);
}

.shop-filters__accordion:last-of-type {
    border-bottom: none;
}

/* Section title */
.shop-filters__accordion > summary,
.shop-filters__label {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 14px 0;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text, #1a1a1a);
    user-select: none;
    transition: color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.shop-filters__accordion > summary::-webkit-details-marker,
.shop-filters__accordion > summary::marker {
    display: none;
}

/* Delicate chevron — thin 1px lines, subtle */
.shop-filters__accordion > summary::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    flex-shrink: 0;
    opacity: 0.35;
    margin-right: 2px;
}

.shop-filters__accordion[open] > summary::after {
    transform: rotate(-135deg) translateY(2px);
    opacity: 0.65;
}

.shop-filters__accordion > summary:hover {
    color: var(--color-accent, #b8860b);
}

.shop-filters__accordion > summary:hover::after {
    opacity: 1;
}

/* ── Filter options — editorial list ─────────────────────────────────────── */
.shop-filters__list {
    list-style: none;
    padding: 0 0 12px;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.shop-filters__list > li {
    padding: 0;
}

/* Each row */
.shop-filters__checkbox {
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 0.84rem;
    color: var(--color-text-muted, #5c5c5c);
    padding: 7px 0;
    border-bottom: 1px solid rgba(184, 134, 11, 0.055);
    transition: color 0.22s ease;
    user-select: none;
    position: relative;
}

.shop-filters__list > li:last-child .shop-filters__checkbox {
    border-bottom: none;
}

/* Visually hide the native checkbox — keep it accessible & functional */
.shop-filters__checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

/* Custom indicator — small square, gold-tinted border */
.shop-filters__checkbox::before {
    content: '';
    flex-shrink: 0;
    width: 13px;
    height: 13px;
    border: 1px solid rgba(184, 134, 11, 0.28);
    border-radius: 3px;
    background: transparent;
    transition: background 0.22s ease, border-color 0.22s ease;
}

.shop-filters__checkbox:hover {
    color: var(--color-text, #0f0f0f);
}

.shop-filters__checkbox:hover::before {
    border-color: rgba(184, 134, 11, 0.55);
}

/* Checked state — gold fill with white tick */
.shop-filters__checkbox:has(input:checked),
.shop-filters__checkbox.is-checked {
    color: var(--color-accent, #b8860b);
}

.shop-filters__checkbox:has(input:checked)::before,
.shop-filters__checkbox.is-checked::before {
    background: var(--color-accent, #b8860b);
    border-color: var(--color-accent, #b8860b);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l3 3 5-5.5' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

/* ── Colour swatches ─────────────────────────────────────────────────────── */
.shop-filters__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0 16px;
}

/* Circular colour dot */
.shop-filters__swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    background-color: #e0dbd4;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.shop-filters__swatch:hover {
    opacity: 0.85;
    transform: scale(1.1);
}

/* Selected — gold ring (outline avoids overflow:hidden clipping) */
.shop-filters__swatch.is-selected {
    outline: 2.5px solid var(--color-accent, #b8860b);
    outline-offset: 3px;
    transform: scale(1.05);
}

/* Swatches without a hex colour → pill-style text tags */
.shop-filters__swatch:not([style]) {
    width: auto;
    height: auto;
    border-radius: 20px;
    padding: 5px 12px;
    background: rgba(184, 134, 11, 0.05);
    border: 1px solid rgba(184, 134, 11, 0.18);
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--color-text-muted, #5c5c5c);
    transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
    outline: none;
    transform: none;
}

.shop-filters__swatch:not([style]):hover {
    color: var(--color-text, #0f0f0f);
    background: rgba(184, 134, 11, 0.09);
    border-color: rgba(184, 134, 11, 0.35);
    opacity: 1;
    transform: none;
}

.shop-filters__swatch:not([style]).is-selected {
    color: var(--color-accent, #b8860b);
    background: rgba(184, 134, 11, 0.12);
    border-color: var(--color-accent, #b8860b);
    font-weight: 600;
    box-shadow: none;
    opacity: 1;
    outline: none;
    transform: none;
}

.shop-filters__swatch-label {
    font-family: var(--font-body);
    font-size: 0.84rem;
    color: inherit;
}

/* ── Price range slider ──────────────────────────────────────────────────── */
.shop-filters__price {
    padding: 2px 0 16px;
}

.shop-filters__price-range {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.shop-filters__range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 1px;
    background: transparent;
    outline: none;
    position: absolute;
    pointer-events: none;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Thumb — solid gold dot, no white ring */
.shop-filters__range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent, #b8860b);
    border: none;
    box-shadow: 0 1px 6px rgba(184, 134, 11, 0.4);
    cursor: grab;
    pointer-events: all;
    transition: transform 0.15s ease;
}

.shop-filters__range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent, #b8860b);
    border: none;
    box-shadow: 0 1px 6px rgba(184, 134, 11, 0.4);
    cursor: grab;
    pointer-events: all;
}

.shop-filters__range::-webkit-slider-thumb:hover,
.shop-filters__range:active::-webkit-slider-thumb {
    transform: scale(1.28);
    cursor: grabbing;
}

.shop-filters__range::-webkit-slider-runnable-track { height: 1px; background: transparent; }
.shop-filters__range::-moz-range-track { height: 1px; background: transparent; }

/* Track */
.shop-filters__price-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(184, 134, 11, 0.18);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.shop-filters__price-track-fill {
    position: absolute;
    height: 100%;
    background: var(--color-accent, #b8860b);
}

/* Price display */
.shop-filters__price-values {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 0.84rem;
    font-style: normal;
    font-weight: 500;
    color: var(--color-text-muted, #5c5c5c);
    margin-top: 8px;
}

.shop-filters__price-values span {
    color: var(--color-text, #0f0f0f);
}

.shop-filters__price-values span::before {
    content: '€';
    color: var(--color-text-muted, #5c5c5c);
    margin-right: 1px;
    font-style: normal;
}

/* ── Apply / Clear buttons ───────────────────────────────────────────────── */
.shop-filters__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(184, 134, 11, 0.12);
}

/* Apply — override WooCommerce .button defaults with high specificity */
.shop-filters .shop-filters__apply,
.shop-filters .shop-filters__apply.button,
.shop-filters .shop-filters__apply.is-luxury {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: var(--color-accent, #b8860b) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 20px !important;
    font-family: var(--font-body, 'DM Sans', sans-serif) !important;
    font-size: 0.67rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.22em !important;
    text-transform: uppercase !important;
    cursor: pointer !important;
    transition: background 0.25s ease, transform 0.15s ease !important;
    text-align: center !important;
    box-shadow: none !important;
    outline: none !important;
    text-shadow: none !important;
}

.shop-filters .shop-filters__apply:hover,
.shop-filters .shop-filters__apply.button:hover {
    background: #96700a !important;
    color: #fff !important;
    transform: translateY(-1px) !important;
}

.shop-filters .shop-filters__apply:active {
    transform: translateY(0) !important;
}

/* Clear — plain text link, minimum weight */
.shop-filters__clear {
    display: block;
    width: 100%;
    padding: 8px 20px;
    background: transparent;
    color: var(--color-text-muted, #5c5c5c);
    border: none;
    font-family: var(--font-body, 'DM Sans', sans-serif);
    font-size: 0.67rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: color 0.22s ease;
}

.shop-filters__clear:hover {
    color: var(--color-text, #0f0f0f);
}

/* ── Mobile: slide-in panel ──────────────────────────────────────────────── */
@media (max-width: 960px) {

    .shop-products__inner {
        grid-template-columns: 1fr;
    }

    /* Toggle button — matches site card look */
    .shop-filters-toggle {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        margin-bottom: 22px;
        padding: 11px 22px;
        background: #fdfcfb;
        border: 1px solid rgba(184, 134, 11, 0.15);
        border-radius: 20px;
        font-family: var(--font-body);
        font-size: 0.67rem;
        font-weight: 600;
        letter-spacing: 0.22em;
        text-transform: uppercase;
        cursor: pointer;
        color: var(--color-text, #0f0f0f);
        transition: box-shadow 0.22s ease, background 0.22s ease;
    }

    .shop-filters-toggle:hover {
        background: #fff;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
    }

    /* 3-line filter icon */
    .shop-filters-toggle::before {
        content: '';
        display: inline-block;
        width: 14px;
        height: 10px;
        background: linear-gradient(
            to bottom,
            currentColor 0%, currentColor 17%,
            transparent 17%, transparent 42%,
            currentColor 42%, currentColor 58%,
            transparent 58%, transparent 83%,
            currentColor 83%, currentColor 100%
        );
        opacity: 0.5;
        flex-shrink: 0;
    }

    /* Slide-in panel */
    .shop-filters {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: min(340px, 92vw);
        z-index: 9000;
        border-radius: 0 20px 20px 0;
        overflow-y: auto;
        transform: translateX(-110%);
        transition: transform 0.36s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 40px rgba(0, 0, 0, 0.08);
    }

    .shop-filters.is-open {
        transform: translateX(0);
    }

    /* Scrim overlay */
    .shop-filters-scrim {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 15, 15, 0.4);
        z-index: 8999;
        backdrop-filter: blur(3px);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .shop-filters-scrim.is-visible {
        display: block;
        opacity: 1;
    }

    /* Show close button on mobile */
    .shop-filters__close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 1px solid rgba(184, 134, 11, 0.2);
        width: 30px;
        height: 30px;
        border-radius: 50%;
        cursor: pointer;
        color: var(--color-text, #0f0f0f);
        font-size: 0.85rem;
        line-height: 1;
        flex-shrink: 0;
        transition: background 0.2s ease, border-color 0.2s ease;
    }

    .shop-filters__close-btn:hover {
        background: rgba(184, 134, 11, 0.06);
        border-color: rgba(184, 134, 11, 0.4);
    }
}

@media (max-width: 768px) {
    ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}
