/**
 * ====================================================================
 * Store Page - Louis Vuitton Inspired Luxury Design
 * ====================================================================
 * Clean, minimal, elegant product display
 */

/* ===== CSS Variables ===== */
:root {
    --store-bg: #ffffff;
    --store-bg-alt: #f5f5f5;
    --store-text: #1a1a1a;
    --store-text-light: #666666;
    --store-text-muted: #999999;
    --store-border: #e5e5e5;
    --store-accent: #1a1a1a;
    --store-white: #ffffff;
    --store-transition: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Base Styles ===== */
/* Remove Blocksy's default content padding for store pages */
.page-template-page-store .site-main,
.page-template-page-store-category .site-main,
.page-template-page-store #main,
.page-template-page-store-category #main,
.page-template-page-store .entry-content,
.page-template-page-store-category .entry-content,
.page-template-page-store article,
.page-template-page-store-category article {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.page-template-page-store .site-main > *:first-child,
.page-template-page-store-category .site-main > *:first-child,
.page-template-page-store .entry-content > *:first-child,
.page-template-page-store-category .entry-content > *:first-child {
    margin-top: 0 !important;
}

/* Remove any content vertical spacing */
.page-template-page-store,
.page-template-page-store-category {
    --content-vertical-spacing: 0px;
}

.store-page {
    background: var(--store-bg);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--store-text);
    line-height: 1.5;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.store-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 40px;
}

@media (max-width: 768px) {
    .store-container {
        padding: 0 20px;
    }
}

/* ===== Hero Section ===== */
.store-hero {
    position: relative;
    height: 60vh;
    min-height: 400px;
    max-height: 600px;
    overflow: hidden;
}

.store-hero .hero-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.store-hero .hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
}

.store-hero .hero-content {
    position: absolute;
    bottom: 60px;
    left: 60px;
    color: var(--store-white);
    z-index: 2;
}

.store-hero .hero-title {
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin: 0 0 12px 0;
    text-transform: uppercase;
}

.store-hero .hero-subtitle {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin: 0;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .store-hero {
        height: 40vh;
        min-height: 280px;
    }
    
    .store-hero .hero-content {
        bottom: 30px;
        left: 20px;
        right: 20px;
    }
    
    .store-hero .hero-title {
        font-size: 2rem;
    }
    
    .store-hero .hero-subtitle {
        font-size: 0.95rem;
    }
}

/* ===== Store Header (Sticky) ===== */
/*
 * Uses JavaScript to detect Blocksy's ct-sticky-container height.
 * The --store-sticky-offset CSS variable is set dynamically by JS.
 */
.store-header {
    position: sticky;
    top: var(--store-sticky-offset, 0px);
    background: var(--store-bg);
    border-bottom: 1px solid var(--store-border);
    z-index: 40;
    transition: box-shadow 0.2s ease;
}

/* Add shadow when sticky */
.store-header.is-sticky {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.store-header .store-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Store Info Bar (for active filters) */
.store-info-bar {
    background: var(--store-bg);
    border-bottom: 1px solid var(--store-border);
}

.store-info-bar:empty {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .store-header .store-container {
        height: 56px;
    }
    
    .header-left {
        gap: 16px;
    }
    
    .product-count {
        display: none;
    }
    
    .filter-btn span {
        display: none;
    }
    
    .filter-btn {
        padding: 10px;
        border: none;
    }
}


/* Category Dropdown */
.category-dropdown {
    position: relative;
}

.dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--store-text);
    cursor: pointer;
    padding: 8px 0;
    transition: opacity 0.2s ease;
}

.dropdown-trigger:hover {
    opacity: 0.7;
}

.dropdown-trigger svg {
    transition: transform 0.3s var(--store-transition);
}

.category-dropdown.open .dropdown-trigger svg {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--store-white);
    border: 1px solid var(--store-border);
    min-width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s var(--store-transition);
    z-index: 60; /* Above store header but below main nav */
}

.category-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 20px;
    color: var(--store-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s ease;
}

.dropdown-item:hover {
    background: var(--store-bg-alt);
}

.dropdown-item.active {
    font-weight: 600;
    background: var(--store-bg-alt);
    color: var(--store-accent);
    border-left: 3px solid var(--store-accent);
    padding-left: 17px;
}

/* Subcategory styling in dropdown */
.dropdown-item.subcategory {
    font-size: 0.85rem;
    color: var(--store-text-light);
    padding-left: 20px;
}

.dropdown-item.subcategory:hover {
    color: var(--store-text);
}

.dropdown-item.subcategory.active {
    color: var(--store-accent);
    padding-left: 17px;
}

/* Category count in dropdown */
.dropdown-item .cat-count {
    font-size: 0.8rem;
    color: var(--store-text-muted);
    margin-left: 5px;
}

.dropdown-item.active .cat-count {
    color: var(--store-text-light);
}

/* Parent category styling */
.dropdown-item.parent-category {
    font-weight: 500;
}

/* Filter sidebar subcategory styling */
.filter-option.subcategory {
    padding-left: 15px;
}

.filter-option.subcategory span {
    font-size: 0.85rem;
    color: var(--store-text-light);
}

.filter-option.parent-category span {
    font-weight: 500;
}

/* Product Count */
.product-count {
    font-size: 0.85rem;
    color: var(--store-text-light);
}

/* Category Page Title */
.category-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    color: var(--store-text);
}


/* Category Hero - smaller for category pages */
.category-hero {
    height: 40vh;
    min-height: 280px;
    max-height: 400px;
}

.category-hero .hero-title {
    font-size: 2.5rem;
}

@media (max-width: 768px) {
    .category-hero {
        height: 30vh;
        min-height: 200px;
    }
    
    .category-hero .hero-title {
        font-size: 1.8rem;
    }
    
    .category-title {
        font-size: 1rem;
    }
}

/* Filter Button */
.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--store-border);
    padding: 10px 20px;
    font-size: 0.9rem;
    color: var(--store-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: var(--store-text);
    color: var(--store-white);
    border-color: var(--store-text);
}

/* ===== Active Filters Display ===== */
.active-filters {
    border-top: 1px solid var(--store-border);
    padding: 16px 0;
    background: var(--store-bg-alt);
}

.active-filters-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.active-label {
    font-size: 0.85rem;
    color: var(--store-text-light);
}

.filter-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--store-white);
    border: 1px solid var(--store-border);
    padding: 6px 12px;
    font-size: 0.85rem;
    color: var(--store-text);
}

.remove-tag {
    color: var(--store-text-muted);
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.remove-tag:hover {
    color: var(--store-text);
}

.clear-all-filters {
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--store-text-light);
    text-decoration: underline;
    transition: color 0.2s ease;
}

.clear-all-filters:hover {
    color: var(--store-text);
}

@media (max-width: 768px) {
    .active-filters-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .clear-all-filters {
        margin-left: 0;
        margin-top: 8px;
    }
}

/* ===== Product Grid ===== */
.store-main {
    padding: 40px 0 80px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(var(--store-columns, 4), 1fr);
    gap: var(--store-gap, 2px);
}

@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(min(var(--store-columns, 4), 3), 1fr);
    }
}

@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Product Card ===== */
.product-card {
    position: relative;
    background: #ffffff;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-2px);
}

.product-info-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Product Image */
.product-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 aspect ratio fallback */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #ffffff;
}

.product-image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.6s var(--store-transition), opacity 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.02);
}

/* ===== Product Actions Overlay ===== */
.product-actions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--store-transition);
    z-index: 10;
    pointer-events: none;
}

.product-card:hover .product-actions-overlay,
.product-card.show-actions .product-actions-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Hide text, show only icon */
.action-btn span {
    display: none;
}

.action-btn svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.view-btn {
    background: var(--store-white);
    color: var(--store-text);
    border: 1px solid var(--store-border);
}

.view-btn:hover {
    background: var(--store-bg-alt);
    transform: scale(1.05);
}

.cart-btn {
    background: var(--store-accent, #1a1a1a);
    color: var(--store-white);
    border: none;
}

.cart-btn:hover {
    background: #333;
    transform: scale(1.05);
}

/* Mobile */
@media (max-width: 900px) {
    .action-btn {
        width: 44px;
        height: 44px;
    }
    
    .action-btn svg {
        width: 20px;
        height: 20px;
    }
}

/* Wishlist Wrapper - Must be inside product-image-wrapper */
/* z-index: 20 to stay above .product-actions-overlay (z-index: 10) */
.store-page .product-card .wishlist-wrapper {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 20 !important;
    width: 36px !important;
    height: 36px !important;
}

/* WPC Smart Wishlist Button Integration */
.store-page .product-card .wishlist-wrapper .woosw-btn,
.store-page .product-card .wishlist-wrapper .woosw-wishlist,
.store-page .product-card .wishlist-wrapper [class*="woosw"],
.store-page .product-card .wishlist-wrapper > a,
.store-page .product-card .wishlist-wrapper > button {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border: none !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    cursor: pointer !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}

.store-page .product-card .wishlist-wrapper .woosw-btn:hover,
.store-page .product-card .wishlist-wrapper [class*="woosw"]:hover,
.store-page .product-card .wishlist-wrapper > a:hover,
.store-page .product-card .wishlist-wrapper > button:hover {
    background: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    transform: scale(1.05) !important;
}

.store-page .product-card .wishlist-wrapper .woosw-btn.woosw-added,
.store-page .product-card .wishlist-wrapper .woosw-btn.woosw-btn-added,
.store-page .product-card .wishlist-wrapper [class*="woosw"].woosw-added,
.store-page .product-card .wishlist-wrapper .added {
    background: #fff0f0 !important;
}

.store-page .product-card .wishlist-wrapper .woosw-btn-icon,
.store-page .product-card .wishlist-wrapper i,
.store-page .product-card .wishlist-wrapper svg {
    font-size: 16px !important;
    width: 18px !important;
    height: 18px !important;
    color: #1d1d1f !important;
    transition: color 0.2s ease !important;
    line-height: 1 !important;
}

.store-page .product-card .wishlist-wrapper .woosw-btn:hover .woosw-btn-icon,
.store-page .product-card .wishlist-wrapper .woosw-added .woosw-btn-icon,
.store-page .product-card .wishlist-wrapper a:hover i,
.store-page .product-card .wishlist-wrapper .added i,
.store-page .product-card .wishlist-wrapper a:hover svg {
    color: #e74c3c !important;
}

/* Hide text label if any */
.store-page .product-card .wishlist-wrapper .woosw-btn-text,
.store-page .product-card .wishlist-wrapper span.woosw-btn-text {
    display: none !important;
}

/* Sale Badge */
.sale-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: var(--store-text);
    color: var(--store-white);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 12px;
    letter-spacing: 0.05em;
    z-index: 5;
}

/* Product Title Row (Title + Badge) */
.product-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.product-title-row .product-title {
    margin: 0;
    flex: 1;
}

/* Status Badge (Sold Out, Has Options) */
.status-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-badge.sold-out {
    background: #dc3545;
    color: #fff;
}

.status-badge.has-options {
    background: #f5f5f5;
    color: var(--store-text-light);
    border: 1px solid var(--store-border);
}

/* Product Info */
.product-info {
    padding: 20px;
    background: var(--store-white);
}

.product-title {
    font-size: 0.9rem;
    font-weight: 400;
    margin: 0 0 8px 0;
    color: var(--store-text);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--store-text);
    margin: 0 0 12px 0;
}

.product-price del {
    color: var(--store-text-muted);
    margin-right: 8px;
}

.product-price ins {
    text-decoration: none;
}

/* Color Swatches */
.color-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid var(--store-border);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.color-dot:hover {
    transform: scale(1.2);
}

/* Color mapping - common colors */
.color-dot[data-color*="black"],
.color-dot[data-color*="黑"] { background: #1a1a1a; }
.color-dot[data-color*="white"],
.color-dot[data-color*="白"] { background: #ffffff; }
.color-dot[data-color*="gray"],
.color-dot[data-color*="grey"],
.color-dot[data-color*="灰"] { background: #808080; }
.color-dot[data-color*="navy"],
.color-dot[data-color*="藍"] { background: #1a365d; }
.color-dot[data-color*="red"],
.color-dot[data-color*="紅"] { background: #e53e3e; }
.color-dot[data-color*="brown"],
.color-dot[data-color*="棕"],
.color-dot[data-color*="咖啡"] { background: #8b4513; }
.color-dot[data-color*="beige"],
.color-dot[data-color*="米"] { background: #d4c4a8; }
.color-dot[data-color*="orange"],
.color-dot[data-color*="橘"] { background: #ed8936; }

.more-colors {
    font-size: 0.75rem;
    color: var(--store-text-muted);
    margin-left: 4px;
}

/* No Products */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--store-text-muted);
}

.no-products svg {
    margin-bottom: 16px;
    stroke: var(--store-text-muted);
}

.no-products p {
    margin: 0;
    font-size: 1rem;
}

/* ===== Filter Sidebar ===== */
/* Uses z-index: 999999 (same as Blocksy's .ct-panel) */
.filter-sidebar {
    position: fixed;
    top: 0;
    left: auto;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    background: var(--store-white);
    z-index: 999999; /* Same as Blocksy .ct-panel */
    display: flex;
    flex-direction: column;
    transition: right 0.4s var(--store-transition);
    overflow: hidden;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

.filter-sidebar.open {
    right: 0;
}

/* Filter Overlay */
/* Uses z-index: 99999 (above header z-index:50, below sidebar) */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999; /* Above header (50), below sidebar (999999) */
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s var(--store-transition);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.filter-overlay.open {
    opacity: 1;
    visibility: visible;
}

.sidebar-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--store-border);
    background: var(--store-white) !important;
    flex-shrink: 0;
    min-height: 70px;
    position: relative;
    z-index: 10;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.02em;
    color: var(--store-text);
}

.close-btn {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
    padding: 0;
    color: var(--store-text) !important;
    transition: all 0.2s ease;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    border-radius: 50% !important;
    flex-shrink: 0;
}

.close-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
}

.close-btn:hover {
    background: var(--store-bg-alt) !important;
}

.close-btn:active {
    transform: scale(0.95);
    color: var(--store-text-light) !important;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

/* Filter Sections */
.filter-section {
    border-bottom: 1px solid var(--store-border);
}

.filter-section-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--store-text);
    cursor: pointer;
    text-align: left;
    transition: background 0.2s ease;
}

.filter-section-header:hover {
    background: var(--store-bg-alt);
}

.filter-section-header svg {
    transition: transform 0.3s var(--store-transition);
}

.filter-section.open .filter-section-header svg {
    transform: rotate(180deg);
}

.filter-section-content {
    padding: 0 30px 20px;
    display: none;
}

.filter-section.open .filter-section-content {
    display: block;
}

/* Filter Options */
.filter-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--store-text);
    transition: opacity 0.2s ease;
}

.filter-option:hover {
    opacity: 0.7;
}

.filter-option input[type="radio"],
.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--store-text);
}

/* Price Range */
.price-range-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.price-range-inputs input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--store-border);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.price-range-inputs input:focus {
    border-color: var(--store-text);
}

.price-separator {
    color: var(--store-text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--store-border);
    background: var(--store-white);
    flex-shrink: 0;
}

.apply-filters-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--store-text);
    color: var(--store-white);
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.apply-filters-btn:hover {
    opacity: 0.85;
}


/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeIn 0.6s var(--store-transition) forwards;
    opacity: 0;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }
.product-card:nth-child(7) { animation-delay: 0.35s; }
.product-card:nth-child(8) { animation-delay: 0.4s; }
.product-card:nth-child(n+9) { animation-delay: 0.45s; }

/* ===== Mobile Styles ===== */
@media (max-width: 768px) {
    .product-info {
        padding: 16px;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .product-price {
        font-size: 0.85rem;
    }
    
    /* WPC Wishlist button on mobile */
    .store-page .product-card .wishlist-wrapper {
        top: 8px !important;
        right: 8px !important;
        width: 32px !important;
        height: 32px !important;
    }
    
    .store-page .product-card .wishlist-wrapper .woosw-btn,
    .store-page .product-card .wishlist-wrapper > a,
    .store-page .product-card .wishlist-wrapper > button {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
    }
    
    /* Filter sidebar full width on mobile */
    .filter-sidebar {
        width: 100vw;
        max-width: 100vw;
        right: -100vw;
    }
    
    .filter-sidebar.open {
        right: 0;
    }
    
    /* Make header and close button more prominent on mobile */
    .filter-sidebar .sidebar-header {
        padding: 16px 20px !important;
        min-height: 64px !important;
        background: var(--store-white) !important;
        border-bottom: 2px solid var(--store-border) !important;
    }
    
    .filter-sidebar .sidebar-header h2 {
        font-size: 1.2rem !important;
        font-weight: 600 !important;
    }
    
    .filter-sidebar .close-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        background: transparent !important;
    }
    
    .filter-sidebar .close-btn svg {
        width: 26px !important;
        height: 26px !important;
        stroke-width: 2.5 !important;
    }
    
    .filter-sidebar .close-btn:active {
        color: var(--store-text-light) !important;
    }
    
    .filter-sidebar .close-btn:active svg {
        stroke: var(--store-text-light) !important;
    }
}

/* ===== Z-Index Management ===== */
/* 
 * Blocksy theme z-index reference:
 * - #header: z-index: 50
 * - .ct-panel (mobile menu): z-index: 999999
 * 
 * Our filter sidebar needs to be above header but can coexist with .ct-panel
 * Filter overlay: 99999 (above header z-index:50)
 * Filter sidebar: 999999 (same as .ct-panel)
 */

/* Do NOT set z-index on .store-page - this creates a stacking context
   that prevents children from appearing above site header */

/* 
 * CRITICAL FIX: Ensure filter sidebar/overlay are direct children of body
 * or have no z-indexed ancestors. Since they use position:fixed,
 * we need to make sure no parent creates a limiting stacking context.
 */

/* Force filter elements to break out of any stacking context */
.filter-sidebar,
.filter-overlay {
    /* These should be at the document level, not trapped in any container */
    isolation: isolate;
}

/* When filter is open, lower the header z-index to allow overlay/sidebar to show */
body.filter-open header,
body.filter-open .ct-header,
body.filter-open [data-header] {
    z-index: 50 !important; /* Keep header visible but below our overlay (99999) */
}

/* Ensure store page containers don't create stacking contexts */
.page-template-page-store .ct-container,
.page-template-page-store-category .ct-container,
.page-template-page-store #main,
.page-template-page-store-category #main,
.page-template-page-store main,
.page-template-page-store-category main,
.page-template-page-store .site-main,
.page-template-page-store-category .site-main {
    position: relative;
    z-index: auto !important;
}

/* ===== Remove default WooCommerce styling when on this page ===== */
.store-page .woocommerce ul.products,
.store-page .products {
    display: contents !important;
}

.store-page .woocommerce ul.products li.product {
    all: unset !important;
}

