/* ═══════════════════════════════════════════
   SHOP PAGE — filter.css
   ═══════════════════════════════════════════ */

/* ── Product image wrap (positions heart button) ── */
.product-image-wrap {
    position: relative;
}

/* ── Heart / Favorite button on product cards ── */
.product-card .heart-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-gold);
    background: rgba(253, 251, 247, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.product-card .heart-btn:hover {
    background: #fff;
    transform: scale(1.12);
}

.product-card .heart-btn svg {
    width: 16px;
    height: 16px;
    stroke: #c0392b;
    fill: none;
    transition: fill 0.2s, stroke 0.2s;
}

.product-card .heart-btn.is-favorited svg {
    fill: #c0392b;
    stroke: #c0392b;
}

/* ── Waitlist Toast ── */
.wl-toast[hidden] { display: none; }
.wl-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--navy, #1a1a2e);
    color: #fff;
    padding: 14px 28px;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 90vw;
    text-align: center;
    pointer-events: none;
}
.wl-toast.wl-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Shop Intro ── */
.shop-intro {
    text-align: center;
    padding: 72px 24px 48px;
    background: var(--cream);
}

.shop-intro h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 300;
    color: var(--navy);
    margin: 12px 0 16px;
}

.shop-intro p {
    font-size: 0.95rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
}

/* ── Overlay
   Hidden on desktop via display:none.
   On mobile it is made display:block but stays invisible (opacity:0)
   until .is-active is added via JS.                                    ── */
.filter-overlay {
    display: none;
}

/* ── Page layout ── */
.shop-layout {
    display: flex;
    align-items: flex-start;
    max-width: 1280px;
    margin: 0 auto;
    gap: 32px;
    padding: 0 32px 80px;
}

/* ── Sidebar (desktop: sticky left column) ── */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

/* Drawer chrome — hidden on desktop */
.sidebar-drawer-header {
    display: none;
}

/* Transparent pass-through on desktop */
.sidebar-drawer-body {}

.filter-group {
    background: var(--cream-deep);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 16px;
}

.filter-group h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--cream);
    color: var(--text-body);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--gold);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 160px;
    overflow-y: auto;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--text-body);
    cursor: pointer;
}

.checkbox-list input[type="checkbox"] {
    accent-color: var(--gold-dark);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    cursor: pointer;
}

.outline-btn {
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    border: 1.5px solid var(--border-gold);
    color: var(--navy);
    padding: 11px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.outline-btn:hover {
    border-color: var(--gold);
    background: var(--gold-pale);
}

/* ── Dual range slider ── */
.dual-range {
    position: relative;
    height: 28px;
    margin-top: 8px;
}

.dual-range-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    pointer-events: none;
}

.dual-range-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--gold-dark);
    border-radius: 2px;
}

.dual-range input[type="range"] {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    pointer-events: none;
    height: 4px;
    outline: none;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-dark);
    border: 2px solid var(--cream);
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: transform 0.15s;
}

.dual-range input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.dual-range input[type="range"]::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-dark);
    border: 2px solid var(--cream);
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    cursor: pointer;
    transition: transform 0.15s;
}

.dual-range input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.price-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.clear-filters-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid var(--border);
    background: var(--cream-deep);
    color: var(--text-muted);
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.clear-filters-btn:hover {
    color: var(--navy);
    border-color: var(--navy);
}

/* ── Mobile trigger button — hidden on desktop ── */
.filter-trigger-btn {
    display: none;
}

/* ── Main content area ── */
.shop-content {
    flex: 1 1 0;
    min-width: 0;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--cream-deep);
    border: 1px solid var(--border);
    padding: 14px 20px;
    margin-bottom: 24px;
}

.product-count {
    font-size: 0.82rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-wrapper label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.sort-wrapper select {
    background: var(--cream);
    color: var(--text-body);
    border: 1px solid var(--border);
    padding: 8px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    outline: none;
}

/* ── Product grid ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--cream-deep);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    /* New stacking context prevents slider thumb / z-index bleed */
    isolation: isolate;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
}

.product-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-image-placeholder {
    height: 260px;
    background-color: var(--cream);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 100"><path d="M25 10 L15 80 L35 80 Z" fill="%23eee" stroke="%23d2a679" stroke-width="0.5"/></svg>');
    background-repeat: no-repeat;
    background-position: center;
}

.product-info {
    padding: 20px;
}

.product-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--navy);
    margin-bottom: 8px;
}

.description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 8px;
}

.read-more {
    color: var(--gold-dark);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-decoration: underline;
    display: inline-block;
    margin-bottom: 12px;
}

.status {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.out-of-stock { color: #d95f5f; }
.in-stock     { color: #4e9e70; }
.in-stock span { color: var(--text-muted); font-weight: 400; }

.price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 300;
    color: var(--navy);
    margin-bottom: 14px;
}

/* ── No results ── */
.no-products {
    text-align: center;
    padding: 48px 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.no-products[hidden] { display: none; }

/* ── Stock availability toggle ── */
.stock-toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.stock-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    transition: color 0.2s;
    user-select: none;
    cursor: pointer;
    white-space: nowrap;
}

.stock-label--active {
    color: var(--navy);
}

.stock-toggle-btn {
    position: relative;
    flex-shrink: 0;
    width: 56px;
    height: 28px;
    border-radius: 14px;
    border: 1.5px solid var(--border-gold);
    background: var(--cream);
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
}

.stock-toggle-btn::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold-dark, #b8952a);
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
    transition: transform 0.22s ease;
}

.stock-toggle-btn.is-active {
    background: var(--gold-pale);
    border-color: var(--gold);
}

.stock-toggle-btn.is-active::after {
    transform: translateX(28px);
}

/* ── Card buttons ── */
.product-card button {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
    border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: opacity 0.2s, transform 0.15s;
}

.product-card button:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.waitlist-btn { background: var(--navy); color: var(--cream); }
.cart-btn     { background: var(--gold); color: var(--navy);  }
.buy-btn      { background: var(--navy); color: var(--cream); }

.product-card .waitlist-btn.is-waitlisted {
    background: var(--gold-pale);
    color: var(--navy);
    box-shadow: inset 0 0 0 1px var(--gold-dark);
}

.product-card .waitlist-btn.is-waitlisted:hover {
    background: #EEDCB0;
    opacity: 1;
}

.product-card .cart-btn.is-added,
.product-card .cart-btn.is-added:hover {
    background: #2E7D32;
    color: #fff;
    opacity: 1;
    transform: none;
    cursor: default;
}


/* ═══════════════════════════════════════════════════════════════════
   MOBILE DRAWER  ≤ 768px
   ───────────────────────────────────────────────────────────────────
   The sidebar is removed from document flow with position:fixed and
   slides in from the left.  The product grid always occupies 100%
   of the content column — there is nothing for it to overlap with.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── Overlay ── */
    .filter-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: rgba(15, 20, 35, 0.52);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.32s ease;
    }

    .filter-overlay.is-active {
        opacity: 1;
        pointer-events: auto;
    }

    /* ── Layout ── */
    .shop-layout {
        padding: 0 20px 56px;
        /* flex-direction stays row; fixed sidebar is not a flex participant,
           so .shop-content is the only child and fills the available space */
    }

    /* Constrain and center the content column on tablet */
    .shop-content {
        width: 90%;
        max-width: 680px;
        margin-left: auto;
        margin-right: auto;
        min-width: 0;
    }

    /* ── Sidebar → fixed slide-in drawer ── */
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;          /* top:0  left:0  bottom:0 */
        width: min(300px, 88vw);
        z-index: 1101;
        overflow-y: auto;
        background: var(--cream, #faf7f4);
        box-shadow: 6px 0 40px rgba(0, 0, 0, 0.14);
        /* Start off-screen to the left; no layout shift, no overlap */
        transform: translateX(-110%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

    /* ── Drawer header (sticky inside the scrollable drawer) ── */
    .sidebar-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 20px 16px;
        border-bottom: 1px solid var(--border);
        position: sticky;
        top: 0;
        background: var(--cream, #faf7f4);
        z-index: 1;
    }

    .sidebar-drawer-title {
        font-family: 'DM Sans', sans-serif;
        font-size: 0.68rem;
        font-weight: 500;
        letter-spacing: 0.18em;
        color: var(--text-muted);
    }

    /* ── Close (×) button ── */
    .filter-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 32px;
        height: 32px;
        border: 1px solid var(--border);
        background: transparent;
        color: var(--navy);
        cursor: pointer;
        transition: background 0.2s;
    }

    .filter-close-btn:hover {
        background: var(--cream-deep, #f0ebe3);
    }

    .filter-close-btn svg {
        width: 14px;
        height: 14px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2.5;
        stroke-linecap: round;
    }

    /* ── Drawer body ── */
    .sidebar-drawer-body {
        padding: 20px 20px 32px;
    }

    /* Tighten group spacing inside the drawer */
    .filter-group {
        margin-bottom: 12px;
    }

    /* ── Filter FAB — fixed bottom-left ── */
    .filter-trigger-btn {
        display: flex;
        position: fixed;
        bottom: 24px;
        left: 20px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border: 1px solid rgba(212, 175, 55, 0.38);
        background: rgba(253, 251, 247, 0.70);
        backdrop-filter: blur(14px) saturate(1.8);
        -webkit-backdrop-filter: blur(14px) saturate(1.8);
        box-shadow:
            0 8px 28px rgba(26, 31, 60, 0.13),
            0 2px 8px  rgba(26, 31, 60, 0.07),
            inset 0 1px 0 rgba(255, 255, 255, 0.65);
        color: #1A1F3C;
        z-index: 9999;
        outline: none;
        transition:
            transform  0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
            box-shadow 0.25s ease,
            background 0.3s  ease,
            border-color 0.3s ease;
    }

    .filter-trigger-btn:hover {
        transform: scale(1.1);
        box-shadow:
            0 14px 40px rgba(26, 31, 60, 0.18),
            0 4px 12px  rgba(26, 31, 60, 0.10),
            inset 0 1px 0 rgba(255, 255, 255, 0.75);
        border-color: rgba(212, 175, 55, 0.65);
    }

    .filter-trigger-btn:active {
        transform: scale(1.04);
    }

    .filter-trigger-btn svg {
        width: 15px;
        height: 15px;
        stroke: #1A1F3C;
        fill: none;
        stroke-width: 2;
        stroke-linecap: round;
        flex-shrink: 0;
    }

    /* Text label hidden — icon-only in FAB form */
    .filter-trigger-label {
        display: none;
    }

    /* ── Toolbar: keep count + sort on one row ── */
    .toolbar {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        margin-bottom: 16px;
    }

    /* ── Product grid: single column ── */
    .product-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .product-image-placeholder {
        height: 220px;
    }
}

@media (max-width: 445px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
