/**
 * Product Listing Page Styles - Premium Edition
 * Clean, organized, and visually appealing design
 * Adalya Point E-cigarette Webshop
 */

/* ========== GLOBAL RESET ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #FFFFFF;
    color: #1a1c1e;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========== CSS VARIABLES ========== */
:root {
    /* Brand Colors */
    --primary-navy: #0f172a;
    --primary-light: #1e293b;
    --accent-red: #dc2626;
    --accent-gold: #C0A050;
    --gold-light: #FFDD88;
    
    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Semantic */
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Playfair Display', serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Borders & Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== PRODUCTS PAGE LAYOUT ========== */
.products-page {
    min-height: 100vh;
    background: #FFFFFF;
    padding-top: 80px; /* Header height */
}

body.has-announcement .products-page {
    padding-top: 120px; /* Announcement (40px) + Header (80px) */
}

.products-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-xl);
}

/* ========== BREADCRUMB NAVIGATION ========== */
.products-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: var(--spacing-lg);
    font-size: 0.875rem;
    color: var(--gray-500);
}

.breadcrumb-link {
    color: var(--gray-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--accent-gold);
}

.breadcrumb-separator {
    color: var(--gray-300);
    margin: 0 0.25rem;
}

.breadcrumb-current {
    color: var(--gray-900);
    font-weight: 500;
}

/* ========== PAGE HEADER ========== */
.products-header {
    margin-bottom: var(--spacing-2xl);
}

.products-title-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-sm);
}

.products-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    letter-spacing: -0.02em;
}

.products-category-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    background: var(--accent-gold);
    color: var(--primary-navy);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.products-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin: 0;
}

/* ========== FILTERS SECTION ========== */
.products-filters {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    flex: 1;
    min-width: 200px;
}

/* Override flex: 1 on mobile for tighter spacing */
@media (max-width: 768px) {
    .filter-group {
        flex: 0 0 auto; /* Don't stretch on mobile */
    }
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.filter-label i {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.filter-select {
    width: 100%;
    padding: 0.75rem var(--spacing-md);
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    color: var(--gray-900);
    background: #FFFFFF;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.filter-select:hover {
    border-color: var(--gray-400);
    box-shadow: var(--shadow-sm);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(192, 160, 80, 0.1);
}

.filter-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.75rem var(--spacing-md);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-700);
    background: #FFFFFF;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    height: fit-content;
}

.filter-clear-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.filter-clear-btn i {
    font-size: 0.75rem;
}

/* ========== RESULTS COUNT ========== */
.products-results {
    margin-bottom: var(--spacing-lg);
}

.results-count {
    font-size: 0.9375rem;
    color: var(--gray-600);
    margin: 0;
}

/* ========== PAGINATION ========== */
.products-pagination {
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--gray-200);
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    background: #FFFFFF;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.pagination-btn:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.pagination-btn:active {
    transform: scale(0.98);
}

.pagination-btn i {
    font-size: 0.75rem;
}

.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    background: #FFFFFF;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.pagination-page:hover {
    background: var(--gray-50);
    border-color: var(--accent-gold);
    color: var(--gray-900);
}

.pagination-page-active {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #FFD700 100%);
    border-color: var(--accent-gold);
    color: var(--primary-navy);
    cursor: default;
}

.pagination-page-active:hover {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #FFD700 100%);
    border-color: var(--accent-gold);
    color: var(--primary-navy);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-400);
}

/* Mobile pagination */
@media (max-width: 768px) {
    .products-pagination {
        margin-top: var(--spacing-xl);
        margin-bottom: var(--spacing-lg);
    }
    
    .pagination-links {
        gap: var(--spacing-xs);
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
    }
    
    .pagination-page {
        min-width: 36px;
        height: 36px;
        padding: 0 0.5rem;
        font-size: 0.8125rem;
    }
    
    .pagination-ellipsis {
        min-width: 36px;
        height: 36px;
        font-size: 0.8125rem;
    }
}

/* ========== NO PRODUCTS STATE ========== */
.no-products {
    padding: var(--spacing-3xl) var(--spacing-xl);
    text-align: center;
}

.no-products-content {
    max-width: 500px;
    margin: 0 auto;
}

.no-products-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: var(--spacing-lg);
}

.no-products-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
}

.no-products-text {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.6;
}

.no-products-text a {
    color: var(--accent-gold);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.no-products-text a:hover {
    color: var(--accent-red);
    text-decoration: underline;
}

/* ========== RESPONSIVE DESIGN ========== */

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
    .products-container {
        padding: var(--spacing-lg);
    }
    
    .products-title {
        font-size: 2rem;
    }
    
    .products-subtitle {
        font-size: 1rem;
    }
    
    .filters-form {
        gap: var(--spacing-md);
    }
    
    .filter-group {
        min-width: 180px;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .products-page {
        padding-top: 70px; /* Mobile header height */
    }
    
    body.has-announcement .products-page {
        padding-top: 106px; /* Mobile: announcement 36px + header 70px */
    }
    
    .products-container {
        padding: var(--spacing-md);
    }
    
    .products-breadcrumb {
        font-size: 0.8125rem;
        margin-bottom: var(--spacing-md);
    }
    
    .products-header {
        margin-bottom: var(--spacing-xl);
    }
    
    .products-title {
        font-size: 1.75rem;
    }
    
    .products-subtitle {
        font-size: 0.9375rem;
    }
    
    .products-filters {
        padding: var(--spacing-md);
    }
    
    .filters-form {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-clear-btn {
        width: 100%;
        justify-content: center;
    }
    
    .no-products {
        padding: var(--spacing-2xl) var(--spacing-md);
    }
    
    .no-products-icon {
        font-size: 3rem;
    }
    
    .no-products-title {
        font-size: 1.25rem;
    }
    
    .no-products-text {
        font-size: 0.9375rem;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .products-page {
        padding-top: 65px; /* Small mobile header height */
    }
    
    body.has-announcement .products-page {
        padding-top: 97px; /* Small mobile: announcement 32px + header 65px */
    }
    
    .products-container {
        padding: var(--spacing-sm);
    }
    
    .products-breadcrumb {
        font-size: 0.75rem;
    }
    
    .products-title {
        font-size: 1.5rem;
    }
    
    .products-subtitle {
        font-size: 0.875rem;
    }
    
    .products-filters {
        padding: var(--spacing-sm);
        border-radius: var(--radius-md);
    }
    
    .filter-select {
        padding: 0.625rem var(--spacing-sm);
        font-size: 0.875rem;
    }
    
    .filter-clear-btn {
        padding: 0.625rem var(--spacing-sm);
        font-size: 0.875rem;
    }
    
    /* Override products-grid-container padding on small mobile */
    .products-page .products-grid-container {
        padding: 0 !important;
    }
    
    /* Adjust filter panel position for small mobile */
    .products-filters {
        top: 65px; /* Small mobile header height */
        height: calc(100vh - 65px);
    }
    
    body.has-announcement .products-filters {
        top: 97px; /* Small mobile: announcement 32px + header 65px */
        height: calc(100vh - 97px);
    }
}

/* ========== PRODUCTS GRID SECTION OVERRIDES - RESPONSIVE ========== */
@media (max-width: 767px) {
    .products-page .products-grid-container {
        padding: 0 !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .products-page .products-grid-container {
        padding: 0 !important;
    }
}

@media (min-width: 1024px) {
    .products-page .products-grid-container {
        padding: 0 !important;
    }
}

/* ========== ACCESSIBILITY ========== */
.filter-select:focus-visible,
.filter-clear-btn:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* ========== PRODUCTS GRID SECTION OVERRIDES ========== */
.products-page .products-grid-section {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    width: 100%;
}

.products-page .products-grid-section::before {
    display: none !important;
}

.products-page .products-grid-section::after {
    display: none !important;
}

.products-page .products-grid-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100%;
}

.products-page .products-grid {
    width: 100%;
}

.products-page .products-grid-header {
    display: none;
}

/* ========== MOBILE FLAVOR BUTTON (SIDE TAB) ========== */
.mobile-flavor-btn {
    display: none; /* Hidden by default, shown only on mobile */
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: var(--accent-gold);
    color: var(--primary-navy);
    border: none;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    padding: 0.75rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 1px 0 6px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1.3;
    min-height: 90px;
    width: 36px;
}

.mobile-flavor-btn:hover {
    box-shadow: 1px 0 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) translateX(1px);
}

.mobile-flavor-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.mobile-flavor-btn i {
    font-size: 0.7rem;
    margin-bottom: 0.35rem;
    transform: rotate(90deg);
}

.mobile-flavor-btn .btn-text {
    font-size: 0.65rem;
}

/* Show on mobile only */
@media (max-width: 768px) {
    .mobile-flavor-btn {
        display: flex;
        top: 50vh; /* Center of viewport */
    }
}

/* ========== MOBILE FILTERS OVERLAY ========== */
.mobile-filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filters-overlay.active {
    display: block;
    opacity: 1;
}

/* ========== MOBILE FILTERS STYLES ========== */
.mobile-filters-close {
    display: none;
    position: sticky;
    top: var(--spacing-md);
    right: auto;
    width: 36px;
    height: 36px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 50%;
    color: var(--gray-700);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.mobile-filters-close:hover {
    background: var(--gray-200);
    color: var(--gray-900);
    border-color: var(--gray-400);
}

.mobile-filters-close:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .mobile-filters-close {
        display: flex;
    }
    
    /* Hide filters by default on mobile */
    .products-filters {
        position: fixed;
        top: 70px; /* Mobile header height */
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: calc(100vh - 70px); /* Full height minus header */
        overflow-y: auto;
        z-index: 999;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        border-left: 1px solid var(--gray-200);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
        padding: var(--spacing-lg);
        margin: 0;
        display: flex;
        flex-direction: column;
    }
    
    /* Adjust for announcement bar */
    body.has-announcement .products-filters {
        top: 106px; /* Announcement (36px) + Header (70px) */
        height: calc(100vh - 106px);
    }
    
    .products-filters.active {
        right: 0;
    }
    
    .filters-form {
        flex-direction: column;
        gap: var(--spacing-md); /* Reduced from spacing-lg for tighter spacing on mobile */
        flex: 1;
        margin-top: 0;
        align-items: stretch; /* Ensure items don't stretch unnecessarily */
    }
    
    .filter-group {
        width: 100%;
        margin-bottom: 0;
        flex: 0 0 auto; /* Prevent stretching - only take needed space */
    }
    
    .filter-label {
        margin-bottom: var(--spacing-xs);
    }
    
    .filter-select {
        margin-top: 0;
        margin-bottom: 0;
    }
    
    /* Ensure close button is at the top */
    .mobile-filters-close {
        align-self: flex-end;
        margin-bottom: var(--spacing-md);
        margin-top: 0;
    }
}

/* ========== LOADING STATE ========== */
.filters-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ========== SEO CONTENT SECTION ========== */
.products-seo-content {
    margin-top: 4rem;
    padding: 3rem 0;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.seo-content-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.products-seo-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.5rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.products-seo-content h2 strong {
    font-weight: 700;
    color: #0f172a;
}

.products-seo-content h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: #0f172a;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.products-seo-content h3 strong {
    font-weight: 600;
    color: #0f172a;
}

.products-seo-content p {
    font-size: 1rem;
    line-height: 1.7;
    color: #334155;
    margin-bottom: 1.25rem;
}

.products-seo-content p:last-child {
    margin-bottom: 0;
}

.products-seo-content p strong {
    font-weight: 600;
    color: #0f172a;
}

/* Mobile SEO Content */
@media (max-width: 768px) {
    .products-seo-content {
        margin-top: 3rem;
        padding: 2rem 0;
    }
    
    .seo-content-container {
        padding: 0 1.5rem;
    }
    
    .products-seo-content h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    .products-seo-content h3 {
        font-size: 1.25rem;
        margin-top: 1.5rem;
        margin-bottom: 0.875rem;
    }
    
    .products-seo-content p {
        font-size: 0.9375rem;
        margin-bottom: 1rem;
    }
}
