/*
 * PAGE: Shop (Exact Design Match)
 * Fully Semantic - No Utility Dependencies
 * Refined for "Premium Candle" Aesthetic
 */

:root {
    --color-brown-gold: #96705B;
    --color-brown-dark: #4A3B32;
    --color-beige-bg: #f9f8f6;
    --color-border: #e5e5e5;
    --font-serif: "Playfair Display", serif;
    --font-sans: "Inter", sans-serif;
}

/* LAYOUT MASTER */
.shop-layout-master {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 60px;
    align-items: start;
    /* Ensures sidebar doesn't stretch height */
}

/* HERO SECTION */
.shop-hero-section {
    position: relative;
    width: 100%;
    height: 400px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 60px;
}

.shop-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.5));
}

.shop-hero-content {
    position: relative;
    z-index: 10;
    color: white;
    max-width: 800px;
    padding: 0 20px;
    text-align: center;
}

.hero-sub {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    font-weight: 500;
}

.hero-title {
    font-size: 3.25rem;
    font-weight: 400;
    margin: 16px 0;
    line-height: 1.1;
}

.hero-desc {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 300;
    line-height: 1.6;
}

/* SIDEBAR FILTERS */
.shop-sidebar-area {
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-brown-gold) transparent;
}

.sidebar-header h3 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 24px;
    color: var(--color-brown-dark);
}

.filter-group {
    margin-bottom: 24px;
}

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 12px;
    cursor: pointer;
    color: var(--color-ink);
}

.toggle-icon {
    font-size: 0.75rem;
    color: var(--color-ink-secondary);
    transition: transform 0.3s ease;
}

.filter-group.active .toggle-icon {
    transform: rotate(180deg);
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease;
    opacity: 0;
}

.filter-group.active .filter-list {
    opacity: 1;
    margin-top: 12px;
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d1d1 transparent;
}

.filter-item {
    margin-bottom: 10px;
    font-size: 0.875rem;
    color: var(--color-ink-secondary);
}

.filter-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-item label:hover {
    color: var(--color-brown-gold);
}

.filter-item input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid #d1d1d1;
    border-radius: 2px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.filter-item input[type="checkbox"]:checked {
    background: var(--color-brown-gold);
    border-color: var(--color-brown-gold);
}

.filter-item input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.clear-filters-btn {
    display: inline-block;
    padding: 0;
    border: none;
    background: none;
    font-size: 0.8125rem;
    color: var(--color-ink-secondary);
    border-bottom: 1px solid currentColor;
    cursor: pointer;
    transition: color 0.2s;
}

.clear-filters-btn:hover {
    color: var(--color-admin-danger);
}

/* DROPDOWN & TOOLBAR */
.shop-toolbar-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 20px;
}

.breadcrumbs {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}

.category-heading {
    font-family: var(--font-serif);
    font-size: 2rem;
    color: var(--color-brown-dark);
    font-style: italic;
    margin: 4px 0 0;
    font-weight: 400;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* DYNAMIC SORT & COUNT */
.woocommerce-result-count {
    font-size: 0.8125rem;
    color: #888;
    margin: 0;
}

.woocommerce-ordering {
    margin: 0;
}

.woocommerce-ordering select {
    border: 1px solid var(--color-border);
    padding: 8px 32px 8px 16px;
    font-size: 0.8125rem;
    border-radius: 4px;
    cursor: pointer;
    background-color: white;
    /* Custom Arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    min-width: 140px;
    transition: border-color 0.2s;
    font-family: var(--font-sans);
    color: var(--color-ink);
}

.woocommerce-ordering select:hover {
    border-color: #999;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: var(--color-brown-gold);
}

/* PRODUCT GRID */
ul.products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-content: start !important;
    justify-items: start !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

.shop-main-area {
    min-width: 0;
    /* Prevents Grid Blowout */
    width: 100%;
}

ul.products::before,
ul.products::after {
    content: none !important;
    display: none !important;
}

ul.products li.product {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    float: none !important;
    list-style: none !important;
    max-width: 100% !important;
}

/* =========================================
   STANDARD CARD REDESIGN (Reference Implementation)
   ========================================= */

/* Card Wrapper (handled by utility classes in template, but reinforced here) */
.product-card-exact {
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    padding: 16px;
    /* Inner padding like the reference */
    background: #fff;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.product-card-exact:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    transform: translateY(-5px);
}

/* Image Wrapper */
.card-image-wrapper {
    /* Space between image and content */
    border-radius: 8px;
    /* Inner radius */
}

/* Sale Badge */
.sale-badge {
    background: #ff3b30;
    /* Bright red */
    color: #fff;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.3);
}

/* Content Area */
.card-content {
    text-align: center;
    padding: 0 10px;
}

/* Title */
.card-content h3 {
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
}

/* Price */
.price-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.price-wrapper del {
    color: #999;
    font-weight: 400;
    text-decoration: line-through;
    font-size: 14px;
}

.price-wrapper ins {
    text-decoration: none;
    color: #333;
}

/* Add to Cart Button (Block) */
.btn-add-cart-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #343a40;
    /* Dark Grey/Black */
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    padding: 14px 0;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.btn-add-cart-block:hover {
    background: #000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}


/* FOOTER PROMO */
.footer-promo-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #d4a787 0%, #b08d75 100%);
    position: relative;
    overflow: hidden;
}

.promo-content-inner h2 {
    font-size: 3.5rem;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.promo-content-inner p {
    font-size: 1.125rem;
    line-height: 1.6;
    margin-bottom: 40px;
}

.promo-content-inner .btn {
    padding: 16px 40px;
    font-size: 0.9375rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: #4a3b32;
    transition: transform 0.2s;
}

.promo-content-inner .btn:hover {
    transform: translateY(-2px);
}

/* FAQ SECTION */
.faq-section-wrapper {
    background: #fffafa;
}

.accordion-item h4 {
    transition: color 0.2s;
}

.accordion-item:hover h4 {
    color: var(--color-brown-gold);
}


/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1024px) {
    .shop-layout-master {
        grid-template-columns: 220px 1fr;
        gap: 40px;
    }

    ul.products {
        column-gap: 20px !important;
    }
}

/* Base state for mobile-only items on desktop */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .shop-layout-master {
        grid-template-columns: 1fr;
    }


    /* Transform Sidebar to Drawer */
    /* Transform Sidebar to Bottom Sheet (70% Height) */
    .shop-sidebar-area {
        position: fixed;
        top: auto;
        /* Reset top */
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 70vh;
        /* 70% Screen Height */
        background: #fff;
        z-index: 2000;
        padding: 24px;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        /* Slide from bottom */
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
        display: block;
        visibility: hidden;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .shop-sidebar-area.active {
        transform: translateY(0);
        visibility: visible;
    }

    /* Overlay */
    .shop-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1999;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        backdrop-filter: blur(4px);
    }

    .shop-sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Header in Drawer */
    /* Mobile Header in Drawer */
    .sidebar-header {
        margin-top: env(safe-area-inset-top);
        /* Safe Area for PWA */
        border-bottom: 1px solid var(--color-border);
        padding-bottom: 16px;
        margin-bottom: 24px;
        display: flex;
        /* Force Flex */
        justify-content: space-between;
        /* Space items */
        align-items: center;
        /* Center vertically */
    }

    .shop-toolbar-area {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    ul.products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    /* Mobile Only Utilities */
    .mobile-only {
        display: flex;
    }

    /* Floating Filter Button */
    #mobile-filter-toggle {
        position: fixed;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 990;
        /* below PWA header/nav */
        margin: 0;
        background: #1a1a1a;
        color: white;
        border-radius: 999px;
        padding: 12px 24px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        font-family: var(--font-sans);
        font-weight: 500;
        border: none;
    }

    /* Adjust position for PWA (above bottom nav) */
    @media (display-mode: standalone) {
        #mobile-filter-toggle {
            bottom: calc(60px + 10px + env(safe-area-inset-bottom));
            /* Nav Height + 10px + Safe Area */
        }
    }

    html.standalone #mobile-filter-toggle {
        bottom: calc(60px + 10px + env(safe-area-inset-bottom));
    }
}



.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-ink);
    padding: 8px;
    margin-right: -8px;
}