/* CSS Variables - Black & White Theme */
:root {
    --color-primary: #000000;
    --color-primary-dark: #1a1a1a;
    --color-secondary: #ffffff;
    --color-bg: #ffffff;
    --color-bg-alt: #f9f9f9;
    --color-text: #1a1a1a;
    --color-text-muted: #666666;
    --color-border: #e0e0e0;
    --color-success: #2a8703;
    --color-danger: #de1c24;
    --color-white: #ffffff;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--color-text);
    background-color: var(--color-bg);
}

/* Prevent unwanted horizontal overflow on small devices */
html, body {
    max-width: 100%;
}

/* Prevent one-off horizontal overflow while preserving cart slide-in (cart is max-width-limited) */
html, body {
    overflow-x: hidden;
}

/* Make images responsive to avoid overflow from large images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* Top Banner */
.top-banner {
    background-color: var(--color-primary);
    color: var(--color-white);
    text-align: center;
    padding: 8px var(--spacing-sm);
    font-size: 0.875rem;
}

.top-banner a {
    color: var(--color-secondary);
    text-decoration: underline;
}

.top-banner a:hover {
    color: var(--color-white);
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-primary);
}

.header-main {
    background-color: var(--color-primary);
}

.header-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-sm);
}

/* allow header items to wrap on very small screens and keep actions at the end */
.header-container {
    flex-wrap: wrap;
}

/* Keep header items on one row on small screens and reduce spacing */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: nowrap;
        justify-content: space-between;
        padding: 10px var(--spacing-sm);
    }

    .header-actions {
        gap: 0.5rem;
    }

    .cart-count {
        right: -4px;
    }
}

/* Very small screens: hide cart total text to save space */
@media (max-width: 420px) {
    .cart-total {
        display: none;
    }
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--color-white);
    flex-shrink: 0;
}

.logo-img {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-secondary);
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-tagline {
    font-size: 0.6875rem;
    opacity: 0.9;
}

/* Search */
.search-container {
    flex: 1;
    max-width: 700px;
    display: flex;
    border-radius: var(--radius-full);
    overflow: hidden;
    background-color: var(--color-white);
}

.search-category {
    padding: 0 var(--spacing-sm);
    border: none;
    background-color: var(--color-bg-alt);
    font-size: 0.875rem;
    color: var(--color-text);
    cursor: pointer;
    border-right: 1px solid var(--color-border);
}

.search-category:focus {
    outline: none;
}

.search-input {
    flex: 1;
    padding: 12px var(--spacing-sm);
    border: none;
    font-size: 0.9375rem;
    min-width: 0;
}

.search-input:focus {
    outline: none;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    background-color: var(--color-secondary);
    border: none;
    color: var(--color-text);
    transition: background-color var(--transition-fast);
}

.search-btn:hover {
    background-color: #e6ae00;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-action {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    color: var(--color-white);
    border: none;
    background: none;
    transition: opacity var(--transition-fast);
}

.header-action:hover {
    opacity: 0.9;
}

.header-action svg {
    flex-shrink: 0;
}

.header-action-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.header-action-text span {
    font-size: 0.6875rem;
    opacity: 0.9;
}

.header-action-text strong {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Cart Button */
.cart-btn {
    position: relative;
}

.cart-icon-wrapper {
    position: relative;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 0.6875rem;
    font-weight: 700;
    background-color: var(--color-secondary);
    color: var(--color-text);
    border-radius: var(--radius-full);
}

.cart-total {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-white);
    transition: all var(--transition-fast);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Navigation */
.nav {
    background-color: var(--color-primary-dark);
}

.nav-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.nav-departments {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 10px var(--spacing-sm);
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color var(--transition-fast);
}

.nav-departments:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.nav-link {
    padding: 10px var(--spacing-sm);
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color var(--transition-fast);
    border-radius: var(--radius-sm);
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Departments Dropdown */
.departments-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md) 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 50;
}

.departments-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.departments-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-sm);
}

.department-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.department-item:hover {
    background-color: var(--color-bg-alt);
}

.dept-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--color-bg-alt);
    border-radius: var(--radius-md);
    color: var(--color-primary);
}

.department-item span:last-child {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Hero Slider */
.hero {
    position: relative;
    overflow: hidden;
}

.hero-slider {
    position: relative;
}

.hero-slide {
    display: none;
    min-height: 400px;
    padding: var(--spacing-2xl) 0;
}

.hero-slide.active {
    display: block;
}

.hero-slide-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 320px;
}

.hero-text {
    max-width: 500px;
    color: var(--color-white);
}

.hero-badge {
    display: inline-block;
    padding: 6px 12px;
    background-color: var(--color-secondary);
    color: var(--color-text);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
}

.hero-text h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
}

.hero-text p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-md);
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 14px 28px;
    background-color: var(--color-secondary);
    color: var(--color-text);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero-visual {
    position: relative;
    width: 300px;
    height: 300px;
}

.hero-circle {
    position: absolute;
    width: 200px;
    height: 200px;
    background-color: rgba(255,255,255,0.1);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.hero-circle-2 {
    width: 300px;
    height: 300px;
    background-color: rgba(255,255,255,0.05);
}

.hero-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.hero-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: var(--color-white);
    transition: background-color var(--transition-fast);
}

.hero-arrow:hover {
    background-color: rgba(255,255,255,0.3);
}

.hero-dots {
    display: flex;
    gap: 8px;
}

.hero-dot {
    width: 10px;
    height: 10px;
    background-color: rgba(255,255,255,0.4);
    border: none;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.hero-dot.active {
    background-color: var(--color-white);
    width: 24px;
    border-radius: var(--radius-full);
}

/* Categories */
.categories {
    padding: var(--spacing-lg) 0;
    background-color: var(--color-white);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--spacing-sm);
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    text-align: center;
    border-radius: var(--radius-lg);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
}

.category-card span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

/* Mobile: make categories a single horizontal row scroller */
@media (max-width: 768px) {
    .categories {
        padding: 1.25rem 0;
    }

    .categories-grid {
        display: flex;
        flex-direction: row;
        gap: 1rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 1rem;
        scroll-snap-type: x mandatory;
    }

    .category-card {
        min-width: 92px;
        flex: 0 0 auto;
        padding: 0.75rem 0.5rem;
        scroll-snap-align: start;
    }

    .category-icon {
        width: 48px;
        height: 48px;
    }

    .category-card span {
        font-size: 0.8125rem;
    }
}

/* Sections */
.section {
    padding: var(--spacing-2xl) 0;
}

.deals-section {
    background-color: var(--color-bg-alt);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.section-title-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
}

.countdown {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.countdown-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.countdown-timer {
    display: flex;
    align-items: center;
    gap: 4px;
}

.countdown-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 8px;
    background-color: var(--color-danger);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.countdown-block small {
    font-size: 0.625rem;
    font-weight: 400;
    text-transform: uppercase;
}

.countdown-sep {
    font-weight: 700;
    color: var(--color-danger);
}

.view-all {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-primary);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: gap var(--transition-fast);
}

.view-all:hover {
    gap: 8px;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

/* Product Card */
.product-card {
    position: relative;
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.product-card:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    background-color: var(--color-danger);
    color: var(--color-white);
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
    z-index: 1;
}

.product-badge.new {
    background-color: var(--color-success);
}

.product-image {
    position: relative;
    padding-top: 100%;
    background-color: var(--color-bg-alt);
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

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

.product-wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--color-white);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    color: var(--color-text-muted);
    transition: all var(--transition-fast);
}

.product-wishlist:hover {
    color: var(--color-danger);
}

.product-wishlist.active {
    color: var(--color-danger);
}

.product-wishlist.active svg {
    fill: currentColor;
}

.product-content {
    padding: var(--spacing-sm);
}

.product-category {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text);
    margin: 4px 0 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.product-stars {
    display: flex;
    gap: 2px;
    color: var(--color-secondary);
}

.product-stars svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.product-reviews {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

.price-current {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
}

.price-original {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.price-discount {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-success);
}

.product-shipping {
    font-size: 0.75rem;
    color: var(--color-success);
    margin-bottom: var(--spacing-sm);
}

.add-to-cart {
    width: 100%;
    padding: 10px;
    background-color: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 600;
    transition: background-color var(--transition-fast);
}

.add-to-cart:hover {
    background-color: var(--color-primary-dark);
}

/* Promo Banner */
.promo-banner {
    padding: var(--spacing-2xl) 0;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.promo-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.promo-text {
    color: var(--color-white);
}

.promo-text h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.promo-text p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: var(--spacing-md);
}

.promo-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-features span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
}

.promo-buttons {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.app-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 12px 20px;
    background-color: var(--color-text);
    color: var(--color-white);
    border-radius: var(--radius-md);
    transition: transform var(--transition-fast);
}

.app-btn:hover {
    transform: translateY(-2px);
}

.app-btn div {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-btn span {
    font-size: 0.6875rem;
    opacity: 0.8;
}

.app-btn strong {
    font-size: 1rem;
}

/* Grocery Section */
.grocery-section {
    background-color: var(--color-bg);
}

/* Features */
.features {
    padding: var(--spacing-2xl) 0;
    background-color: var(--color-bg-alt);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.feature-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--spacing-md);
}

.feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: var(--color-white);
    border-radius: 50%;
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
}

.feature-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

/* Newsletter */
.newsletter {
    padding: var(--spacing-2xl) 0;
    background-color: var(--color-secondary);
}

.newsletter-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--spacing-xs);
}

.newsletter-content p {
    color: var(--color-text);
    opacity: 0.8;
    margin-bottom: var(--spacing-md);
}

.newsletter-form {
    display: flex;
    gap: var(--spacing-xs);
    max-width: 480px;
    margin: 0 auto;
}

.newsletter-form input {
    flex: 1;
    padding: 14px var(--spacing-sm);
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    font-size: 1rem;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.newsletter-form button {
    padding: 14px 28px;
    background-color: var(--color-primary);
    border: none;
    border-radius: var(--radius-full);
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 600;
    transition: background-color var(--transition-fast);
}

.newsletter-form button:hover {
    background-color: var(--color-primary-dark);
}

/* Footer */
.footer {
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    background-color: var(--color-text);
    color: var(--color-white);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.footer-brand .logo {
    color: var(--color-white);
}

.footer-brand .logo-img {
    border-color: var(--color-secondary);
}

.footer-brand p {
    font-size: 0.9375rem;
    opacity: 0.8;
    max-width: 280px;
}

.social-links {
    display: flex;
    gap: var(--spacing-xs);
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.1);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-fast);
}

.social-links a:hover {
    background-color: var(--color-primary);
}

.footer-col h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.footer-col a {
    font-size: 0.875rem;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.footer-col a:hover {
    opacity: 1;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.footer-bottom p {
    font-size: 0.875rem;
    opacity: 0.6;
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
}

.footer-links a {
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.footer-links a:hover {
    opacity: 1;
}

/* Cart Sidebar */
.cart-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.cart-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: var(--color-white);
    box-shadow: var(--shadow-lg);
    z-index: 201;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-base);
}

.cart-sidebar.active {
    transform: translateX(0);
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--color-border);
}

.cart-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.cart-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.cart-close:hover {
    color: var(--color-text);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-md);
}

.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--color-text-muted);
}

.cart-empty svg {
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.cart-empty p {
    margin-bottom: var(--spacing-md);
}

.btn-primary {
    display: inline-flex;
    padding: 12px 24px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    transition: background-color var(--transition-fast);
}

.btn-primary:hover {
    background-color: var(--color-primary-dark);
}

/* Cart Item */
.cart-item {
    display: flex;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--color-border);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--color-bg-alt);
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 4px;
}

.cart-item-price {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: auto;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--spacing-xs);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.quantity-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.quantity-btn:hover {
    color: var(--color-text);
}

.quantity-value {
    width: 40px;
    text-align: center;
    font-size: 0.9375rem;
    font-weight: 500;
}

.remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.remove-btn:hover {
    color: var(--color-danger);
}

.cart-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--color-border);
    display: none;
}

.cart-footer.active {
    display: block;
}

.cart-subtotal {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
}

.cart-shipping {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: var(--spacing-md);
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    background-color: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--color-white);
    font-size: 1rem;
    font-weight: 600;
    transition: background-color var(--transition-fast);
}

.checkout-btn:hover {
    background-color: var(--color-primary-dark);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 12px 20px;
    background-color: var(--color-success);
    color: var(--color-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 0.9375rem;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 300;
}

.toast.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

/* Product Detail Page */
.breadcrumb {
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-white);
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--color-text);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.product-detail-page {
    padding: var(--spacing-xl) 0 var(--spacing-2xl);
    background-color: var(--color-bg-alt);
}

.product-detail {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.product-gallery,
.product-info,
.product-tabs,
.related-products {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.product-gallery,
.product-info,
.product-tabs,
.related-products {
    padding: var(--spacing-md);
}

.main-image {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--color-bg-alt);
    margin-bottom: var(--spacing-sm);
}

.main-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.thumbnail-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.thumbnail-list img,
.thumbnail-list button {
    width: 100%;
    border-radius: var(--radius-sm);
}

.product-title {
    font-size: clamp(1.5rem, 3vw, 2.125rem);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.product-rating-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.stars {
    display: inline-flex;
    gap: 2px;
}

.star {
    color: #c7c7c7;
    font-size: 1rem;
}

.star.filled,
.star.half {
    color: #f5b301;
}

.stock-status.in-stock {
    color: var(--color-success);
    font-weight: 600;
}

.product-price-section {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
}

.current-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text);
}

.original-price {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-decoration: line-through;
}

.discount-badge {
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background-color: #e7f6dd;
    color: var(--color-success);
    font-size: 0.8125rem;
    font-weight: 600;
}

.product-description {
    color: var(--color-text);
    margin-bottom: var(--spacing-md);
}

.product-features h3 {
    margin-bottom: 8px;
    font-size: 1rem;
}

.product-features ul {
    list-style: disc;
    padding-left: 20px;
    color: var(--color-text);
    display: grid;
    gap: 6px;
}

.product-options {
    margin: var(--spacing-md) 0;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.qty-btn {
    width: 38px;
    height: 38px;
    border: none;
    background-color: var(--color-bg-alt);
    font-size: 1.125rem;
}

#qtyInput {
    width: 64px;
    height: 38px;
    text-align: center;
    border: none;
}

.product-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: var(--spacing-md);
}

.btn-add-to-cart,
.btn-buy-now,
.btn-wishlist {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 0.9375rem;
    font-weight: 600;
    padding: 12px 16px;
}

.btn-add-to-cart {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.btn-buy-now {
    background-color: #f5b301;
    color: var(--color-text);
}

.btn-wishlist {
    background-color: var(--color-white);
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-wishlist.active {
    background-color: #ffe4e6;
    border-color: #fb7185;
    color: #be123c;
}

.btn-wishlist.active svg {
    fill: currentColor;
}

/* Auth Modal */
body.auth-open {
    overflow: hidden;
}

.auth-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
}

.auth-modal.active {
    display: flex;
}

.auth-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.68);
}

.auth-panel {
    position: relative;
    width: min(100%, 460px);
    max-height: min(90vh, 720px);
    overflow-y: auto;
    background: var(--color-white);
    color: var(--color-text);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
    z-index: 1;
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
}

.auth-header {
    padding-right: 44px;
}

.auth-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.auth-header h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.auth-copy {
    color: var(--color-text-muted);
    line-height: 1.6;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
    background: var(--color-bg-alt);
    border-radius: 16px;
    margin: 20px 0;
}

.auth-tab {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-weight: 700;
    padding: 12px 16px;
    border-radius: 12px;
}

.auth-tab.active {
    background: var(--color-white);
    color: var(--color-text);
    box-shadow: var(--shadow-sm);
}

.auth-state-logged-in {
    margin-bottom: 16px;
}

.auth-user-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: var(--color-bg-alt);
}

.auth-user-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.auth-user-card h3 {
    font-size: 1.125rem;
    margin-bottom: 2px;
}

.auth-user-card p {
    color: var(--color-text-muted);
}

.auth-logout-btn,
.auth-submit {
    border: none;
    border-radius: 14px;
    padding: 12px 16px;
    font-weight: 700;
}

.auth-logout-btn {
    background: var(--color-primary);
    color: var(--color-white);
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    display: grid;
    gap: 6px;
}

.auth-form label span {
    font-size: 0.875rem;
    font-weight: 600;
}

.auth-form input {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--color-white);
    color: var(--color-text);
}

.auth-form input:focus {
    outline: 2px solid rgba(0, 0, 0, 0.12);
    outline-offset: 2px;
}

.auth-submit {
    background: var(--color-primary);
    color: var(--color-white);
    margin-top: 4px;
}

.auth-message {
    min-height: 1.25rem;
    margin-top: 12px;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.auth-message.error {
    color: var(--color-danger);
}

.delivery-info {
    border-top: 1px solid var(--color-border);
    padding-top: var(--spacing-sm);
    display: grid;
    gap: 10px;
}

.delivery-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: var(--color-text);
}

.delivery-item strong {
    display: block;
    font-size: 0.875rem;
}

.delivery-item span {
    display: block;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.product-tabs {
    margin-bottom: var(--spacing-xl);
}

.tab-headers {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 10px;
    margin-bottom: var(--spacing-sm);
    overflow-x: auto;
}

.tab-btn {
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.tab-btn.active {
    color: var(--color-text);
    background-color: var(--color-bg-alt);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel h3 {
    margin-bottom: var(--spacing-xs);
}

.tab-panel p,
.tab-panel li {
    color: var(--color-text);
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
}

.spec-table td {
    border-bottom: 1px solid var(--color-border);
    padding: 10px 0;
    font-size: 0.9375rem;
}

.spec-table td:first-child {
    color: var(--color-text-muted);
    width: 38%;
}

.reviews-summary {
    margin-bottom: var(--spacing-sm);
}

.big-rating {
    display: inline-block;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.review-list {
    display: grid;
    gap: var(--spacing-sm);
}

.review-item {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
}

.review-header {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: 8px;
}

.reviewer-info {
    display: flex;
    flex-direction: column;
}

.reviewer-name {
    font-weight: 600;
}

.review-date {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.review-comment {
    color: var(--color-text);
    font-size: 0.9375rem;
}

.related-products h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--spacing-md);
}

.related-products .product-card {
    border: 1px solid var(--color-border);
    box-shadow: none;
}

.related-products .badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-white);
    background-color: var(--color-primary);
    text-transform: uppercase;
}

.product-details {
    padding: var(--spacing-sm);
}

.product-details .category {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0;
}

.rating .stars {
    color: #f5b301;
}

.rating .count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.price-row .price {
    font-size: 1.125rem;
    font-weight: 700;
}

.price-row .discount {
    color: var(--color-success);
    font-size: 0.75rem;
    font-weight: 700;
}

.shipping {
    display: block;
    font-size: 0.75rem;
    color: var(--color-success);
    margin-bottom: 8px;
}

.add-to-cart-btn {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: var(--radius-md);
    background-color: var(--color-primary);
    color: var(--color-white);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .departments-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-detail {
        grid-template-columns: 1fr;
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .search-container {
        display: none;
    }

    .search-bar {
        display: none;
    }
    
    .header-action-text {
        display: none;
    }

    .header-action.account-btn.logged-in .header-action-text {
        display: flex;
    }

    .header-action.account-btn.logged-in .header-action-text span {
        display: none;
    }

    .header-action.account-btn.logged-in .header-action-text strong {
        font-size: 0.8rem;
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .action-link span {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav-links {
        display: none;
    }
    
    .nav.active {
        position: fixed;
        /* top set dynamically by JS to match header height on mobile */
        left: 0;
        right: 0;
        background-color: var(--color-white);
        padding: var(--spacing-md);
        box-shadow: var(--shadow-lg);
    }
    
    .nav.active .nav-links {
        display: flex;
        flex-direction: column;
    }
    
    .nav.active .nav-link {
        color: var(--color-text);
        padding: var(--spacing-sm);
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    .promo-content {
        flex-direction: column;
        text-align: center;
    }
    
    .promo-features {
        align-items: center;
    }
    
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-slide-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-visual {
        display: none;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .departments-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .product-detail-page {
        padding-top: var(--spacing-md);
    }

    .product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .current-price {
        font-size: 1.625rem;
    }
}

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

    .product-grid {
        grid-template-columns: 1fr;
    }

    .breadcrumb .container {
        font-size: 0.8125rem;
        gap: 6px;
    }
}
