/* =============================================
   ROOT VARIABLES & BASE STYLES
   Matches Dashboard Design System — Light SaaS Blue
   ============================================= */
:root {
    /* Primary — Blue */
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.10);
    --primary-glow-strong: rgba(37, 99, 235, 0.22);
    
    /* Secondary */
    --secondary-color: #0f172a;
    
    /* Accent */
    --accent-gold: #f59e0b;
    --accent-gold-light: #fbbf24;
    
    /* Text */
    --text-dark: #0f172a;
    --text-medium: #334155;
    --text-light: #94a3b8;
    
    /* Surfaces */
    --bg-canvas: #f8fafc;
    --bg-card: #ffffff;
    --light-gray: #f8fafc;
    --light-gray-2: #f1f5f9;
    --medium-gray: #cbd5e1;
    --dark-gray: #475569;
    --white: #ffffff;
    
    /* Status */
    --success: #059669;
    --warning: #f59e0b;
    --danger: #e11d48;
    --star: #f59e0b;
    
    /* Borders */
    --border-light: #e2e8f0;
    --border-mid: #cbd5e1;

    /* Shadows — soft, layered, enterprise-grade */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.08), 0 4px 6px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px rgba(15, 23, 42, 0.10), 0 8px 10px rgba(15, 23, 42, 0.04);
    --shadow-primary: 0 4px 14px rgba(37, 99, 235, 0.22);
    --shadow-primary-lg: 0 8px 28px rgba(37, 99, 235, 0.30);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-slow: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Border radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-pill: 999px;

    /* Spacing scale */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;

    /* Font sizes */
    --text-xs: clamp(0.72rem, 1.2vw, 0.8rem);
    --text-sm: clamp(0.82rem, 1.5vw, 0.9rem);
    --text-base: clamp(0.9rem, 1.8vw, 1rem);
    --text-md: clamp(1rem, 2vw, 1.1rem);
    --text-lg: clamp(1.1rem, 2.5vw, 1.3rem);
    --text-xl: clamp(1.3rem, 3.5vw, 1.7rem);
    --text-2xl: clamp(1.6rem, 4.5vw, 2.2rem);
    --text-3xl: clamp(2rem, 6vw, 3rem);
    
    /* Font */
    --font: 'Plus Jakarta Sans', 'Inter', 'Segoe UI', sans-serif;
}

/* =============================================
   GLOBAL RESET & BASE
   ============================================= */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
}

body {
    font-family: var(--font);
    padding-top: 80px;
    color: var(--text-medium);
    line-height: 1.65;
    background-color: var(--bg-canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Selection color */
::selection {
    background-color: rgba(37, 99, 235, 0.15);
    color: var(--primary-color);
}

/* Scrollbar — webkit */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: var(--light-gray-2);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--dark-gray);
}

/* Focus states for accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(12px, 3vw, 28px);
}

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-dark);
    letter-spacing: -0.03em;
}

p {
    color: var(--text-medium);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    transition: var(--transition);
    color: inherit;
    text-decoration: none;
}

/* =============================================
   HEADER — PREMIUM STICKY NAV
   ============================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0;
    transition: var(--transition-slow);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

header.scrolled {
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, 0.97);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 clamp(12px, 3vw, 28px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 72px;
}

/* Logo */
.logo {
    font-weight: 800;
    font-size: clamp(20px, 3.5vw, 24px);
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
    transition: var(--transition-spring);
    position: relative;
    z-index: 1001;
    letter-spacing: -0.04em;
}

.logo::after {
    content: '';
    position: absolute;
    inset: -4px -8px;
    border-radius: var(--radius-sm);
    background: var(--primary-glow);
    opacity: 0;
    transition: var(--transition);
}

.logo:hover::after {
    opacity: 1;
}

.logo:hover {
    transform: scale(1.02);
    color: var(--primary-dark);
}

.logo i {
    font-size: 1.1em;
    transition: var(--transition-spring);
    position: relative;
    z-index: 1;
}

.logo:hover i {
    transform: rotate(-6deg) scale(1.08);
}

/* Nav Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(2px, 1.5vw, 4px);
    list-style: none;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    text-decoration: none;
    color: var(--text-medium);
    font-weight: 500;
    font-size: var(--text-sm);
    transition: var(--transition);
    border-radius: var(--radius-md);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.nav-link i {
    font-size: 14px;
    color: var(--text-light);
    transition: var(--transition-spring);
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: var(--primary-glow);
}

.nav-link:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.nav-link.active {
    color: var(--primary-color);
    background-color: var(--primary-glow);
    font-weight: 600;
}

/* Cart Badge */
.cart-count {
    background: var(--danger);
    color: var(--white);
    border-radius: var(--radius-pill);
    min-width: 18px;
    height: 18px;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 2px;
    right: 2px;
    border: 2px solid var(--white);
    box-shadow: 0 1px 4px rgba(225, 29, 72, 0.3);
    transition: var(--transition-spring);
    padding: 0 3px;
    animation: cartPulse 2.5s ease-in-out infinite;
}

@keyframes cartPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* User Profile Dropdown */
.user-profile-dropdown {
    position: relative;
}

.user-profile-btn {
    background: none;
    border: 1px solid var(--border-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-size: var(--text-sm);
    color: var(--text-medium);
    padding: 7px 13px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
    font-weight: 500;
}

.user-profile-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: var(--primary-glow);
    box-shadow: var(--shadow-xs);
}

.user-profile-btn i:last-child {
    transition: transform 0.22s var(--ease-out);
    font-size: 11px;
    color: var(--text-light);
}

.user-profile-btn:hover i:last-child,
.user-profile-btn.open i:last-child {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    background: var(--white);
    min-width: 220px;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    z-index: 1100;
    padding: 6px;
    border: 1px solid var(--border-light);
    transform-origin: top right;
}

.dropdown-content.show {
    display: block;
    animation: dropdownIn 0.2s var(--ease-out) both;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: scale(0.94) translateY(-6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.dropdown-link {
    color: var(--text-medium);
    padding: 10px 13px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--text-sm);
    transition: var(--transition-fast);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.dropdown-link i {
    width: 18px;
    text-align: center;
    color: var(--text-light);
    transition: var(--transition-fast);
    font-size: 13px;
}

.dropdown-link:hover {
    background-color: var(--primary-glow);
    color: var(--primary-color);
    transform: translateX(3px);
}

.dropdown-link:hover i {
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 8px;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border-light);
    font-size: 20px;
    color: var(--text-medium);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition-spring);
    z-index: 1001;
    line-height: 1;
}

.mobile-menu-btn:hover {
    color: var(--primary-color);
    background-color: var(--primary-glow);
    border-color: var(--primary-color);
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 999;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity 0.22s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.no-scroll {
    overflow: hidden;
}

/* =============================================
   FILTER SECTION — HERO BANNER STYLE
   ============================================= */
.filter-section {
    margin: clamp(16px, 3vw, 28px) 0 clamp(32px, 5vw, 48px);
    background: linear-gradient(135deg, var(--primary-color) 0%, #1d4ed8 100%);
    padding: clamp(36px, 6vw, 60px) clamp(16px, 4vw, 36px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    color: var(--white);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.2);
    animation: heroFadeIn 0.5s var(--ease-out) both;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0);    }
}

/* Decorative shimmer */
.filter-section::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 0%, transparent 70%);
    pointer-events: none;
}

.filter-section::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* Optional: small heading above the filter */
.filter-section .filter-heading {
    text-align: center;
    margin-bottom: clamp(16px, 3vw, 28px);
    position: relative;
    z-index: 2;
}

.filter-section .filter-heading h1 {
    font-size: var(--text-3xl);
    color: var(--white);
    letter-spacing: -0.04em;
    margin-bottom: 6px;
}

.filter-section .filter-heading p {
    color: rgba(255,255,255,0.75);
    font-size: var(--text-base);
}

.filter-form {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: clamp(10px, 2vw, 16px);
    align-items: end;
    position: relative;
    z-index: 2;
}

.form-group {
    margin-bottom: 0;
    animation: slideUpIn 0.4s var(--ease-out) both;
}

.form-group:nth-child(1) { animation-delay: 0.05s; }
.form-group:nth-child(2) { animation-delay: 0.10s; }
.form-group:nth-child(3) { animation-delay: 0.15s; }
.form-group:nth-child(4) { animation-delay: 0.20s; }
.form-group:nth-child(5) { animation-delay: 0.25s; }

@keyframes slideUpIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.filter-section label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.filter-section .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    background: rgba(255, 255, 255, 0.95);
    transition: var(--transition);
    font-family: var(--font);
    color: var(--text-dark);
    font-weight: 500;
    -webkit-appearance: none;
    appearance: none;
}

.filter-section .form-control:hover {
    background: var(--white);
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.5);
}

.filter-section .form-control:focus {
    outline: none;
    border-color: var(--white);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.filter-section select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394a3b8' d='M5 6 0 0h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* =============================================
   BUTTONS — PREMIUM INTERACTIONS
   ============================================= */
.btn-primary {
    background: var(--white);
    color: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    width: 100%;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
    background: #eff6ff;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary i {
    transition: var(--transition-spring);
}

.btn-primary:hover i {
    transform: scale(1.1);
}

/* Secondary/ghost variant */
.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: var(--text-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: clamp(16px, 3vw, 24px);
    padding: 0 2px;
}

.section-header h2 {
    font-size: var(--text-xl);
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.03em;
}

.section-header h2 i {
    color: var(--primary-color);
    font-size: 1em;
}

.section-subheader {
    color: var(--text-light);
    font-size: var(--text-xs);
    background: var(--primary-glow);
    padding: 4px 14px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    font-weight: 600;
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    transition: var(--transition);
    background: var(--primary-glow);
    font-size: var(--text-sm);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

.view-all i {
    font-size: 10px;
    transition: var(--transition-spring);
}

.view-all:hover {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
    border-color: transparent;
}

.view-all:hover i {
    transform: translateX(3px);
}

/* =============================================
   FLASH SALES — HORIZONTAL SCROLL CAROUSEL
   ============================================= */
.flash-sales-section {
    margin: clamp(24px, 4vw, 44px) 0;
    padding: 0 2px;
}

.flash-sales-container {
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}

.flash-sales-scroller {
    display: flex;
    gap: clamp(12px, 2vw, 18px);
    overflow-x: auto;
    padding: 12px 16px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--medium-gray) var(--light-gray-2);
}

.flash-sales-scroller::-webkit-scrollbar {
    height: 4px;
}

.flash-sales-scroller::-webkit-scrollbar-track {
    background: var(--light-gray-2);
    border-radius: var(--radius-pill);
}

.flash-sales-scroller::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: var(--radius-pill);
}

/* Flash Sale Card */
.flash-sale-card {
    flex: 0 0 clamp(190px, 22vw, 245px);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    scroll-snap-align: start;
    border: 1px solid var(--border-light);
    transform-origin: center bottom;
    will-change: transform;
}

.flash-sale-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.2);
}

.discount-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--danger);
    color: var(--white);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 800;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.25);
    letter-spacing: 0.03em;
}

.flash-sale-image {
    width: 100%;
    height: clamp(130px, 16vw, 170px);
    object-fit: contain;
    padding: 14px;
    background: var(--light-gray-2);
    transition: var(--transition-slow);
    display: block;
}

.flash-sale-card:hover .flash-sale-image {
    transform: scale(1.06);
}

.flash-sale-body {
    padding: clamp(12px, 2vw, 16px);
    border-top: 1px solid var(--border-light);
}

.flash-sale-title {
    font-size: var(--text-sm);
    color: var(--text-dark);
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.price-container {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.old-price {
    font-size: var(--text-xs);
    color: var(--text-light);
    text-decoration: line-through;
    font-weight: 500;
}

.new-price {
    font-size: var(--text-md);
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.02em;
}

.countdown {
    font-family: 'Courier New', 'Lucida Console', monospace;
    background: #fff1f2;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    text-align: center;
    margin-bottom: 11px;
    color: var(--danger);
    font-weight: 800;
    font-size: var(--text-base);
    border: 1px solid #ffe4e6;
    letter-spacing: 0.04em;
}

/* Shop Now Button */
.shop-now-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-sm);
}

.shop-now-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

.shop-now-btn i {
    transition: var(--transition-spring);
}

.shop-now-btn:hover i {
    transform: translateX(3px);
}

/* =============================================
   PRODUCTS SECTION — MAIN GRID
   ============================================= */
.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: clamp(16px, 3vw, 24px);
    padding: 0 2px;
}

.products-header h2 {
    font-size: var(--text-xl);
    color: var(--text-dark);
    margin: 0;
    letter-spacing: -0.03em;
}

.products-header div {
    color: var(--text-light);
    font-size: var(--text-sm);
    background: var(--white);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border-light);
    font-weight: 500;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(155px, 20vw, 210px), 1fr));
    gap: clamp(12px, 2vw, 22px);
    padding: 0 2px;
    margin-bottom: clamp(24px, 4vw, 44px);
}

/* Product Card */
.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: block;
    text-decoration: none;
    border: 1px solid var(--border-light);
    position: relative;
    animation: cardReveal 0.4s var(--ease-out) both;
    transform-origin: center bottom;
    will-change: transform;
}

.product-card:nth-child(1)  { animation-delay: 0.04s; }
.product-card:nth-child(2)  { animation-delay: 0.08s; }
.product-card:nth-child(3)  { animation-delay: 0.12s; }
.product-card:nth-child(4)  { animation-delay: 0.16s; }
.product-card:nth-child(5)  { animation-delay: 0.20s; }
.product-card:nth-child(6)  { animation-delay: 0.24s; }

@keyframes cardReveal {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.2);
}

.product-image {
    width: 100%;
    height: clamp(140px, 20vw, 195px);
    object-fit: contain;
    padding: clamp(12px, 2.5vw, 18px);
    background: var(--light-gray-2);
    transition: var(--transition-slow);
    display: block;
}

.product-card:hover .product-image {
    transform: scale(1.06);
}

.product-body {
    padding: clamp(11px, 2vw, 15px);
    border-top: 1px solid var(--border-light);
}

.product-title {
    font-size: var(--text-sm);
    color: var(--text-dark);
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: var(--transition);
}

.product-card:hover .product-title {
    color: var(--primary-color);
}

.product-price {
    font-size: var(--text-md);
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 7px;
    letter-spacing: -0.02em;
}

.product-rating {
    color: var(--star);
    font-size: clamp(11px, 1.8vw, 14px);
    margin-bottom: 4px;
    letter-spacing: 2px;
    display: block;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
    text-align: center;
    padding: clamp(40px, 7vw, 64px) 20px;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xs);
    max-width: 440px;
    margin: 32px auto;
    border: 1px solid var(--border-light);
    animation: emptyFade 0.4s var(--ease-out) both;
}

@keyframes emptyFade {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1);    }
}

.empty-state i {
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    color: var(--medium-gray);
    margin-bottom: 16px;
    display: block;
    animation: emptyBounce 2.5s ease-in-out infinite;
}

@keyframes emptyBounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.empty-state h3 {
    font-size: var(--text-lg);
    color: var(--text-dark);
    margin-bottom: 6px;
}

.empty-state p {
    color: var(--text-light);
    font-size: var(--text-sm);
    margin: 0;
}

/* =============================================
   CATEGORY SECTION — HORIZONTAL SCROLL
   ============================================= */
.category-section {
    margin: clamp(32px, 5vw, 52px) auto clamp(24px, 4vw, 40px);
    max-width: 1400px;
    padding: 0 clamp(12px, 3vw, 28px);
}

.category-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: clamp(16px, 3vw, 24px);
}

.category-products-container {
    position: relative;
    overflow: hidden;
    mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 3%, black 97%, transparent 100%);
}

.category-products-scroller {
    display: flex;
    gap: clamp(12px, 2vw, 18px);
    overflow-x: auto;
    padding: 10px 16px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--medium-gray) var(--light-gray-2);
}

.category-products-scroller::-webkit-scrollbar {
    height: 4px;
}

.category-products-scroller::-webkit-scrollbar-track {
    background: var(--light-gray-2);
    border-radius: var(--radius-pill);
}

.category-products-scroller::-webkit-scrollbar-thumb {
    background: var(--medium-gray);
    border-radius: var(--radius-pill);
}

.category-product-card {
    flex: 0 0 clamp(170px, 20vw, 220px);
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: var(--transition);
    scroll-snap-align: start;
    border: 1px solid var(--border-light);
    position: relative;
    will-change: transform;
}

.category-product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.2);
}

.category-product-image {
    width: 100%;
    height: clamp(130px, 16vw, 180px);
    object-fit: contain;
    padding: 14px;
    background: var(--light-gray-2);
    transition: var(--transition-slow);
    display: block;
}

.category-product-card:hover .category-product-image {
    transform: scale(1.06);
}

.category-product-body {
    padding: clamp(11px, 2vw, 15px);
    border-top: 1px solid var(--border-light);
}

.category-product-title {
    font-size: var(--text-sm);
    color: var(--text-dark);
    margin: 0 0 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.category-product-price {
    font-size: var(--text-md);
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 7px;
    letter-spacing: -0.02em;
}

.category-product-rating {
    color: var(--star);
    font-size: clamp(11px, 1.6vw, 13px);
    margin-bottom: 11px;
    letter-spacing: 2px;
    display: block;
}

.category-product-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    text-align: center;
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.category-product-link:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--white);
}

/* =============================================
   PAGINATION — REFINED CONTROLS
   ============================================= */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(5px, 1.2vw, 8px);
    margin: clamp(32px, 5vw, 52px) 0;
    flex-wrap: wrap;
    padding: 0 6px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: clamp(36px, 7vw, 42px);
    height: clamp(36px, 7vw, 42px);
    padding: 0 8px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-medium);
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--border-light);
    background: var(--white);
    box-shadow: var(--shadow-xs);
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-glow);
}

.page-link i {
    font-size: 12px;
}

.page-link.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
}

/* =============================================
   FOOTER — ENHANCED DARK PREMIUM
   ============================================= */
footer {
    background: var(--secondary-color);
    color: #cbd5e1;
    padding: 3.5rem 0 0;
    margin-top: clamp(3rem, 5vw, 4.5rem);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 28px);
    position: relative;
    z-index: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}

.footer-section h3 {
    color: var(--white);
    font-size: 0.95rem;
    margin-bottom: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.6rem;
}

.footer-section a {
    color: #94a3b8;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.88rem;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.footer-section a:hover {
    color: var(--white);
    transform: translateX(3px);
}

.social-links {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.social-links a {
    color: #94a3b8;
    font-size: 1.1rem;
    transition: var(--transition-spring);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
}

.social-links a:hover {
    color: var(--white);
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
}

.newsletter p {
    margin-bottom: 0.6rem;
    color: #94a3b8;
    font-size: 0.88rem;
}

.newsletter-form {
    display: flex;
    gap: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255,255,255,0.05);
    transition: var(--transition);
}

.newsletter-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.newsletter-form input {
    flex: 1;
    padding: 10px 13px;
    border: none;
    background: transparent;
    color: var(--white);
    font-family: var(--font);
    font-size: 0.86rem;
    min-width: 0;
}

.newsletter-form input::placeholder {
    color: #64748b;
}

.newsletter-form input:focus {
    outline: none;
}

.newsletter-form button {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 10px 16px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.84rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.12);
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.payment-methods {
    display: flex;
    gap: 12px;
    font-size: 1.5rem;
    color: #64748b;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.payment-methods i {
    transition: var(--transition-spring);
}

.payment-methods i:hover {
    color: var(--white);
    transform: scale(1.12) translateY(-2px);
}

.copyright {
    color: #64748b;
    font-size: 0.8rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

/* Large screens */
@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    .products-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    .flash-sale-card {
        flex: 0 0 265px;
    }
    .category-product-card {
        flex: 0 0 245px;
    }
}

@media (max-width: 1200px) {
    .container {
        padding: 0 16px;
    }
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .flash-sale-card {
        flex: 0 0 205px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 64px;
    }

    .header-container {
        height: 64px;
        padding: 0 16px;
    }

    .mobile-menu-btn {
        display: block;
        order: 2;
    }

    .logo {
        order: 1;
        font-size: 19px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: min(300px, 85vw);
        height: 100dvh;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 30px;
        gap: 4px;
        transition: right 0.3s var(--ease-out);
        z-index: 1000;
        box-shadow: -8px 0 40px rgba(15, 23, 42, 0.1);
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-link {
        width: 100%;
        padding: 12px 15px;
        justify-content: flex-start;
        border-radius: var(--radius-sm);
        font-size: 15px;
    }

    .user-profile-dropdown {
        width: 100%;
    }

    .user-profile-btn {
        width: 100%;
        justify-content: flex-start;
        border-radius: var(--radius-sm);
        border: none;
        padding: 12px 15px;
    }

    .dropdown-content {
        position: static;
        box-shadow: none;
        width: 100%;
        display: none;
        padding: 4px;
        background: var(--light-gray-2);
        margin-top: 4px;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-light);
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-image {
        height: 140px;
        padding: 12px;
    }

    .product-body {
        padding: 12px;
    }

    .filter-section {
        padding: 36px 16px;
        border-radius: var(--radius-lg);
    }

    .filter-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .flash-sales-section,
    .category-section {
        margin: 24px 0;
    }

    .pagination {
        gap: 4px;
    }

    .page-link {
        min-width: 34px;
        height: 34px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 2px;
    }

    .product-image {
        height: 125px;
        padding: 10px;
    }

    .product-body {
        padding: 10px;
    }

    .product-title {
        font-size: 0.8rem;
    }

    .flash-sale-card {
        flex: 0 0 160px;
    }

    .flash-sale-image {
        height: 115px;
    }

    .flash-sale-body {
        padding: 12px;
    }

    .category-product-card {
        flex: 0 0 160px;
    }

    .category-product-image {
        height: 115px;
    }

    .category-product-body {
        padding: 12px;
    }
}

@media (max-width: 380px) {
    .products-grid {
        gap: 7px;
    }

    .product-image {
        height: 110px;
        padding: 8px;
    }

    .product-body {
        padding: 8px;
    }

    .flash-sale-card {
        flex: 0 0 140px;
    }

    .category-product-card {
        flex: 0 0 140px;
    }

    .page-link {
        min-width: 30px;
        height: 30px;
        font-size: 0.78rem;
    }
}

/* Landscape phone */
@media (max-height: 600px) and (orientation: landscape) {
    .nav-links {
        padding: 64px 16px 18px;
        gap: 3px;
    }

    .nav-link {
        padding: 8px 13px;
        font-size: 14px;
    }
}

/* Print */
@media print {
    header,
    footer,
    .filter-section,
    .pagination,
    .btn-primary,
    .shop-now-btn,
    .view-all {
        display: none !important;
    }

    body {
        padding-top: 0;
        background: #fff;
    }

    .product-card,
    .flash-sale-card,
    .category-product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        transform: none !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High-contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-light: #888;
        --text-light: #555;
    }
}