/**
 * Store Page Styles
 * 
 * Styling for the Threadless merchandise store page with
 * tag-based filtering and responsive product grid.
 */

/* CSS Variables - Using site theme colors */
:root {
    --store-bg: var(--nv-site-bg, #121212);
    --store-surface: var(--nv-light-bg, #222121);
    --store-border: #3a3a3a;
    --store-text: var(--nv-text-color, #ffffff);
    --store-text-muted: #a0a0a0;
    --store-accent: var(--nv-primary-accent, #63b0ef);
    --store-accent-hover: #7dc0f5;
    --store-success: var(--nv-secondary-accent, #ffd700);
    --store-card-bg: var(--nv-dark-bg, #1a1a1a);
    --store-pill-bg: #2a2a2a;
    --store-pill-active: var(--nv-primary-accent, #63b0ef);
    --store-radius: 8px;
    --store-radius-lg: 12px;
    --store-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --store-transition: 0.2s ease;
}

/* Widen container for store page (override Neve's narrow default) */
.page-template-page-store .container {
    max-width: 1400px;
}

/* Page Container */
.store-page {
    min-height: 100vh;
    padding: 2rem 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--store-text);
}

/* Store Subtitle (below Neve page header) */
.store-subtitle {
    font-size: 1.1rem;
    color: var(--store-text-muted);
    margin: 0 0 2rem;
    text-align: center;
}

.store-subtitle a {
    color: var(--store-accent);
    text-decoration: none;
    transition: color var(--store-transition);
}

.store-subtitle a:hover {
    color: var(--store-accent-hover);
    text-decoration: underline;
}

/* Tab Navigation */
.store-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.store-tab {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: var(--store-surface);
    border: 2px solid var(--store-border);
    border-radius: var(--store-radius-lg);
    color: var(--store-text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--store-transition);
}

.store-tab:hover {
    background: var(--store-card-bg);
    border-color: var(--store-accent);
    color: var(--store-text);
}

.store-tab.active {
    background: var(--store-accent);
    border-color: var(--store-accent);
    color: white;
}

.store-tab.active .tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.tab-icon {
    font-size: 1.25rem;
}

.tab-label {
    font-weight: 600;
}

.tab-count {
    background: var(--store-pill-bg);
    color: var(--store-text-muted);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    animation: fadeIn 0.3s ease;
}

/* Subcategory Tabs (secondary tab row) */
.subcat-tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 0 1rem;
    flex-wrap: wrap;
}

.subcat-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    background: transparent;
    border: 1px solid var(--store-border);
    border-radius: 999px;
    color: var(--store-text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--store-transition);
}

.subcat-tab:hover {
    background: var(--store-surface);
    border-color: var(--store-accent);
    color: var(--store-text);
}

.subcat-tab.active {
    background: var(--store-surface);
    border-color: var(--store-accent);
    color: var(--store-accent);
    box-shadow: 0 0 0 1px var(--store-accent);
}

.subcat-icon {
    font-size: 1.1rem;
}

.subcat-label {
    font-weight: 600;
}

.subcat-count {
    background: var(--store-pill-bg);
    color: var(--store-text-muted);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.subcat-tab.active .subcat-count {
    background: var(--store-accent);
    color: white;
}

/* Subcategory Content */
.subcat-content {
    animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Designs Grid (for "Choose a Design" tab) */
.designs-intro {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--store-text-muted);
}

.designs-intro p {
    max-width: 600px;
    margin: 0 auto;
    font-size: 1.05rem;
}

.designs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.design-card {
    background: var(--store-card-bg);
    border-radius: var(--store-radius-lg);
    overflow: hidden;
    border: 1px solid var(--store-border);
    transition: all var(--store-transition);
    text-align: center;
}

.design-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--store-shadow), 0 0 30px rgba(12, 162, 189, 0.2);
    border-color: var(--store-accent);
}

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

.design-image-wrap {
    aspect-ratio: 1;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.design-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.design-card:hover .design-image {
    transform: scale(1.08);
}

.design-name {
    padding: 1.25rem 1rem;
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--store-text);
    background: linear-gradient(to bottom, var(--store-card-bg), var(--store-surface));
}

/* Store Layout - Sidebar + Grid */
.store-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Filter Sidebar */
.store-sidebar {
    background: var(--store-surface);
    border-radius: var(--store-radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 100px;
    border: 1px solid var(--store-border);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--store-border);
}

.filter-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--store-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--store-accent);
    color: var(--store-bg);
    font-size: 0.75rem;
    font-weight: 700;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
}

.filter-clear {
    background: transparent;
    border: none;
    color: var(--store-accent);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--store-radius);
    transition: all var(--store-transition);
}

.filter-clear:hover {
    background: var(--store-pill-bg);
    color: var(--store-accent-hover);
}

/* Filter Tag Pills */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Divider between primary tags and other tags */
.filter-divider {
    width: 100%;
    height: 1px;
    background: var(--store-border);
    margin: 0.5rem 0;
}

.filter-pill {
    background: var(--store-pill-bg);
    border: 1px solid var(--store-border);
    color: var(--store-text-muted);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--store-transition);
    white-space: nowrap;
    line-height: 1.6;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.filter-pill:hover {
    background: var(--store-card-bg);
    color: var(--store-text);
    border-color: var(--store-accent);
}

/* Primary filter pills (category tags like Mens, Womens, Kids) */
.filter-pill--primary {
    padding: 0.4rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-width: 2px;
}

/* Hide unavailable tags (no matching products with current filters) */
.filter-pill.unavailable {
    display: none;
}

.filter-pill.active {
    background: var(--store-pill-active);
    border-color: var(--store-pill-active);
    color: white;
    font-weight: 500;
}

/* Filter Count */
/* Design filter pills (shown at bottom of tag list) */
.filter-pill--design {
    font-style: italic;
    color: var(--store-accent);
}

/* Product Grid */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

/* Product Card */
.product-card {
    background: var(--store-card-bg);
    border-radius: var(--store-radius-lg);
    overflow: hidden;
    border: 1px solid var(--store-border);
    transition: all var(--store-transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--store-shadow);
    border-color: var(--store-accent);
}

.product-card.hidden {
    display: none;
}

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

/* Product Image */
.product-image-wrap {
    position: relative;
    aspect-ratio: 1;
    background: #fff;
    overflow: hidden;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--store-transition);
}

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

.product-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--store-surface);
    color: var(--store-text-muted);
    font-size: 0.9rem;
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--store-success);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Product Info */
.product-info {
    padding: 1rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem;
    color: var(--store-text);
    line-height: 1.3;
}

.product-type {
    font-size: 0.85rem;
    color: var(--store-text-muted);
    margin: 0;
}

/* Product Tags */
.product-tags {
    padding: 0 1rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.product-tag {
    font-size: 0.65rem;
    background: var(--store-pill-bg);
    color: var(--store-text-muted);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    line-height: 1.3;
}

/* Empty State */
.store-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--store-surface);
    border-radius: var(--store-radius-lg);
    border: 1px solid var(--store-border);
}

.store-empty p {
    color: var(--store-text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.store-link-btn {
    display: inline-block;
    background: var(--store-accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--store-radius);
    text-decoration: none;
    font-weight: 500;
    transition: background var(--store-transition);
}

.store-link-btn:hover {
    background: var(--store-accent-hover);
}

/* No Results State */
.store-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    color: var(--store-text-muted);
}

/* Store Footer */
.store-footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem 1rem;
    border-top: 1px solid var(--store-border);
}

.store-footer-link {
    color: var(--store-accent);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color var(--store-transition);
}

.store-footer-link:hover {
    color: var(--store-accent-hover);
}

/* Responsive Design */
@media (max-width: 900px) {
    .store-layout {
        grid-template-columns: 1fr;
    }
    
    .store-sidebar {
        position: static;
        order: -1;
    }
    
    .filter-tags {
        max-height: none;
    }
    
    .store-tabs {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .store-tab {
        justify-content: center;
    }
    
    .designs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .subcat-tabs {
        gap: 0.5rem;
    }
    
    .subcat-tab {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .subcat-label {
        display: none;
    }
}

@media (max-width: 600px) {
    .store-page {
        padding: 1rem 0.75rem;
    }
    
    .store-subtitle {
        font-size: 0.95rem;
    }
    
    .store-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .product-info {
        padding: 0.75rem;
    }
    
    .product-name {
        font-size: 0.9rem;
    }
    
    .product-tags {
        display: none;
    }
    
    .filter-pill {
        font-size: 0.7rem;
        padding: 0.2rem 0.6rem;
    }
    
    .filter-pill--primary {
        font-size: 0.85rem;
        padding: 0.3rem 0.8rem;
    }
}

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