/* -------------------------------------------------------------------------- */
/* SHOP EDITORIAL HEADER — Cinematic Image Header                            */
/* -------------------------------------------------------------------------- */
.shop-editorial-header {
    position: relative;
    width: 100%;
    height: 350px;
    background-color: var(--color-background, #F7F5F0);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
    overflow: hidden;
}

/* Prevent layout shift */
html {
    overflow-y: scroll !important;
}

/* Overlay for contrast */
.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
    z-index: 1;
}

/* Inner content container */
.header-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--container-max-width, 1400px);
    margin: 0 auto;
    padding: 0 var(--container-padding, 2rem);
    text-align: center;
    color: #ffffff;
    box-sizing: border-box;
    transform: translateY(20px);
}

.header-content h1.page-title {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: clamp(3rem, 7vw, 5.5rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin: 0 0 0.5rem 0;
    color: #ffffff;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.header-content .subtitle {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* -------------------------------------------------------------------------- */
/* UNIFIED SHOP TOOLBAR */
/* -------------------------------------------------------------------------- */
.shop-toolbar-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
    margin-top: 1rem;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 100%;
    box-sizing: border-box;
    width: 100%;
}

/* Left: Breadcrumbs */
.toolbar-left {
    flex: 1;
    min-width: 200px;
}

.woocommerce-breadcrumb {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.85rem;
    color: var(--color-text-light, #555);
    font-family: var(--font-body, sans-serif);
}

.woocommerce-breadcrumb a {
    color: var(--color-text, #111);
    text-decoration: none;
    transition: color 0.2s ease;
}

.woocommerce-breadcrumb a:hover {
    color: var(--color-primary, #000);
    text-decoration: underline;
}

/* Center: Filter Toggle */
.toolbar-center {
    display: flex;
    justify-content: center;
    flex: 0 0 auto;
}

.shop-filter-toggle-btn {
    background: transparent !important;
    border: none !important;
    color: var(--color-primary, #111) !important;
    padding: 0.5rem 1rem;
    font-family: var(--font-body, system-ui, sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
    box-shadow: none !important;
}

.shop-filter-toggle-btn:hover,
.shop-filter-toggle-btn.active {
    color: var(--color-accent, #d4af37) !important;
    background: transparent !important;
}

/* Underline effect on hover/active */
.shop-filter-toggle-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: currentColor;
    transform: scaleX(0.3); /* Persistent subtle indicator */
    opacity: 0.4;
    transition: all 0.3s ease;
}

.shop-filter-toggle-btn:hover::after,
.shop-filter-toggle-btn.active::after {
    transform: scaleX(1);
    opacity: 1;
}

.toggle-icon {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
    margin-top: -2px;
}

.shop-filter-toggle-btn.active .toggle-icon {
    transform: rotate(180deg);
}



/* Right: Sort */
.toolbar-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 200px;
}

.woocommerce-ordering {
    margin: 0 !important;
}

.woocommerce-ordering select {
    border: none;
    background: transparent;
    font-family: var(--font-body, sans-serif);
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    padding-right: 1.5rem;
    outline: none;
    font-weight: 500;
}

/* -------------------------------------------------------------------------- */
/* FILTER DRAWER (OFF-CANVAS) */
/* -------------------------------------------------------------------------- */
.shop-filter-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.shop-filter-drawer.open {
    transform: translateX(0);
}

.shop-drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.shop-drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

/* Drawer Header */
.drawer-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.drawer-title {
    font-family: var(--font-heading, serif);
    font-size: 1.5rem;
    margin: 0;
    color: #333;
}

.close-drawer-btn {
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.close-drawer-btn:hover {
    color: #000;
}

/* Drawer Content (Scrollable) */
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.drawer-section {
    margin-bottom: 2.5rem;
}

.drawer-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #bbb;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 0.5rem;
}

/* Drawer Options List */
.drawer-options-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.drawer-radio {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #555;
    transition: color 0.2s;
}

.drawer-radio:hover {
    color: #000;
}

.drawer-radio input[type="radio"] {
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #ddd;
    border-radius: 50%;
    margin: 0;
    position: relative;
    transition: all 0.2s;
}

.drawer-radio input[type="radio"]:checked {
    border-color: #000;
    background: #000;
    box-shadow: inset 0 0 0 3px #fff;
}

.drawer-radio span {
    font-family: var(--font-body, sans-serif);
    font-size: 1rem;
}

/* Author A-Z Grid in Drawer */
.drawer-author-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.drawer-radio-letter {
    cursor: pointer;
}

.drawer-radio-letter input {
    display: none;
}

.drawer-radio-letter span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.9rem;
    color: #777;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
}

.drawer-radio-letter input:checked+span {
    background: #f0f0f0;
    color: #000;
    font-weight: 600;
    border-color: #ddd;
}

.drawer-radio-letter:hover span {
    color: #000;
    background: #fafafa;
}

/* Drawer Footer */
.drawer-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Filter Drawer Buttons — Standardized */
.drawer-action-btn {
    flex: 1;
    padding: 14px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    border-radius: var(--radius-md);
}

.drawer-action-btn.secondary {
    background: transparent;
    color: var(--color-text-light, #999);
}

.drawer-action-btn.secondary:hover {
    color: var(--color-error, #d45d5d);
    background: rgba(139, 58, 58, 0.05);
}

.drawer-action-btn.primary {
    background: var(--color-primary, #1C1C1C);
    color: var(--color-white, #fff);
}

.drawer-action-btn.primary:hover {
    background: var(--color-accent, #3A4B40);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* -------------------------------------------------------------------------- */
/* ACTIVE CHIPS (Simplified Inline) */
/* -------------------------------------------------------------------------- */
#active-filter-chips-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    background: var(--color-background-soft, #EFECE6);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text, #111);
    border: 1px solid var(--color-border-dark, #D4D4D4);
    transition: all 0.2s;
}

.filter-chip:hover {
    background: #fff;
    border-color: #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-chip-remove {
    margin-left: 6px;
    color: #999;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.filter-chip-remove:hover {
    color: #d45d5d;
}

/* Responsive */
@media (max-width: 768px) {

    /* 1. Header — Image version mobile adjustments */
    .shop-editorial-header {
        height: 260px;
        margin-bottom: 1.5rem;
        padding-top: 50px;
    }

    .shop-editorial-header .header-content {
        padding: 0 1.25rem;
        transform: translateY(0);
    }

    .shop-editorial-header .page-title {
        font-size: clamp(2.5rem, 10vw, 3.5rem) !important;
        margin-bottom: 0.25rem !important;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    .shop-editorial-header .subtitle {
        font-size: 0.85rem !important;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    }


    /* 2. Toolbar Layout - Ensure breadcrumbs and filter are fully visible */
    .shop-toolbar-wrapper {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
        padding-bottom: 1.5rem;
        margin-top: 0;
        margin-bottom: 1.5rem;
        /* Reorder: Breadcrumbs (top) -> Filter (center) -> Chips/Count (bottom) */
    }

    .toolbar-left,
    .toolbar-center,
    .toolbar-right {
        width: 100%;
        flex: auto;
        justify-content: center;
        text-align: center;
        min-width: 0;
    }

    /* Specifically ensure the filter button container is centered */
    .toolbar-center {
        display: flex;
        justify-content: center;
        order: 2;
        /* Put filter button in middle if desirable, or let flow naturally */
    }

    /* Adjust order if needed (Breadcrumbs 1, Filter 2, Sort 3) */
    .toolbar-left {
        order: 1;
        margin-bottom: 0.5rem;
        text-align: left;
        justify-content: flex-start;
    }

    .toolbar-right {
        order: 3;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    /* Ensure specific elements align center */
    .woocommerce-breadcrumb {
        text-align: left;
        display: block;
        padding: 0 !important;
    }

    .woocommerce-ordering {
        margin: 0 auto !important;
    }

    /* Drawer adjustments - FIX: Ensure full viewport height and visible action buttons */
    .shop-filter-drawer {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        /* Use dynamic viewport height to account for mobile browser chrome */
        height: 100vh;
        /* Fallback for browsers that don't support dvh */
        max-height: 100dvh;
        max-height: 100vh;
        overflow: hidden;
        /* Prevent drawer itself from scrolling */
        display: flex;
        flex-direction: column;
    }

    /* Ensure drawer content is scrollable and doesn't push footer out of view */
    .drawer-content {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        /* Smooth scrolling on iOS */
    }

    /* Ensure footer stays at bottom and is always visible */
    .drawer-footer {
        flex-shrink: 0;
        /* Prevent footer from shrinking */
        padding-bottom: env(safe-area-inset-bottom, 1.5rem);
        /* iOS safe area */
    }

    #active-filter-chips-inline {
        justify-content: center;
        margin-top: 0.5rem;
    }
}

/* AJAX Loading State */
#shop-ajax-wrapper.ajax-loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s;
}

/* Force Hidden Info Messages */
/* Force Hidden Info Messages - DISABLED to show "No products found" */
/*
.shop-editorial-header+#content .woocommerce-info,
.shop-main-content .woocommerce-info,
.shop-empty-state+.woocommerce-info {
    display: none !important;
}
*/
/* Fix visibility issue caused by main.js entrance animations */
#shop-ajax-wrapper .product {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Ensure empty state is visible */
.shop-empty-state {
    padding: 4rem 2rem;
    text-align: center;
    color: #777;
    font-size: 1.1rem;
    font-family: var(--font-body, sans-serif);
}

.shop-empty-state::after {
    content: "No products found matching your selection.";
    display: block;
}
