/**
 * GR Fashion - Professional Design System
 * Mobile-first responsive design with modern aesthetics
 */

/* ============================================
   CSS Variables & Design System
   ============================================ */
:root {
    /* Brand Colors */
    --brand-color: #FDD835;
    --brand-hover: #FBC02D;
    --brand-dark: #F9A825;
    --dark-color: #1a1a1a;
    --secondary-color: #3b82f6;

    /* Semantic Colors */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    /* Gray Scale */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Background Colors */
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;

    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;

    /* Typography Scale */
    --text-display: 3rem;
    /* 48px */
    --text-h1: 2.25rem;
    /* 36px */
    --text-h2: 1.875rem;
    /* 30px */
    --text-h3: 1.5rem;
    /* 24px */
    --text-h4: 1.25rem;
    /* 20px */
    --text-base: 1rem;
    /* 16px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-xs: 0.75rem;
    /* 12px */

    /* Font Weights */
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    /* Spacing Scale */
    --space-1: 0.25rem;
    /* 4px */
    --space-2: 0.5rem;
    /* 8px */
    --space-3: 0.75rem;
    /* 12px */
    --space-4: 1rem;
    /* 16px */
    --space-5: 1.25rem;
    /* 20px */
    --space-6: 1.5rem;
    /* 24px */
    --space-8: 2rem;
    /* 32px */
    --space-10: 2.5rem;
    /* 40px */
    --space-12: 3rem;
    /* 48px */
    --space-16: 4rem;
    /* 64px */
    --space-20: 5rem;
    /* 80px */
    --space-24: 6rem;
    /* 96px */

    /* Border Radius */
    --radius-sm: 0.375rem;
    /* 6px */
    --radius-md: 0.5rem;
    /* 8px */
    --radius-lg: 0.75rem;
    /* 12px */
    --radius-xl: 1rem;
    /* 16px */
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-all: all 300ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-overlay: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Breakpoints (for reference in media queries) */
    --screen-sm: 640px;
    --screen-md: 768px;
    --screen-lg: 1024px;
    --screen-xl: 1280px;
    --screen-2xl: 1536px;
}

/* ============================================
   Base Styles - Mobile First
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    /* Base font size */
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: var(--font-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Typography Hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-bold);
    line-height: 1.2;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

h1 {
    font-size: var(--text-h1);
}

h2 {
    font-size: var(--text-h2);
}

h3 {
    font-size: var(--text-h3);
}

h4 {
    font-size: var(--text-h4);
}

p {
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
}

a {
    color: var(--brand-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--brand-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Focus Styles for Accessibility */
*:focus {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

*:focus:not(:focus-visible) {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}

/* Selection Color */
::selection {
    background-color: var(--brand-color);
    color: var(--dark-color);
}

/* ============================================
   Brand Colors
   ============================================ */
.text-brand {
    color: var(--brand-color);
}

.bg-brand {
    background-color: var(--brand-color);
}

.bg-dark {
    background-color: var(--dark-color);
}

/* ============================================
   Container & Layout System
   ============================================ */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

@media (min-width: 640px) {
    .container {
        max-width: 640px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 768px;
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 1024px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1280px;
    }
}

@media (min-width: 1536px) {
    .container {
        max-width: 1536px;
    }
}

/* Responsive Grid System */
.grid {
    display: grid;
    gap: var(--space-4);
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 640px) {
    .sm\\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sm\\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .md\\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .lg\\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

/* Spacing Utilities */
.p-0 {
    padding: 0;
}

.p-2 {
    padding: var(--space-2);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

.px-4 {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.px-6 {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

.py-2 {
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}

.py-4 {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
}

.py-6 {
    padding-top: var(--space-6);
    padding-bottom: var(--space-6);
}

.py-8 {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

.py-12 {
    padding-top: var(--space-12);
    padding-bottom: var(--space-12);
}

.m-0 {
    margin: 0;
}

.m-auto {
    margin: auto;
}

.mt-4 {
    margin-top: var(--space-4);
}

.mt-6 {
    margin-top: var(--space-6);
}

.mt-8 {
    margin-top: var(--space-8);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.mb-6 {
    margin-bottom: var(--space-6);
}

.mb-8 {
    margin-bottom: var(--space-8);
}

/* Display Utilities - Do NOT use !important on .hidden, it breaks Tailwind responsive overrides like md:flex */
.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

/* Text Utilities */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: var(--font-bold);
}

.font-semibold {
    font-weight: var(--font-semibold);
}

.font-medium {
    font-weight: var(--font-medium);
}

.text-sm {
    font-size: var(--text-sm);
}

.text-base {
    font-size: var(--text-base);
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

/* Color Utilities */
.text-white {
    color: #ffffff;
}

.text-gray-500 {
    color: var(--gray-500);
}

.text-gray-600 {
    color: var(--gray-600);
}

.text-gray-700 {
    color: var(--gray-700);
}

.bg-white {
    background-color: #ffffff;
}

.bg-gray-50 {
    background-color: var(--gray-50);
}

.bg-gray-100 {
    background-color: var(--gray-100);
}

/* Border Utilities */
.rounded {
    border-radius: var(--radius-md);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-full {
    border-radius: var(--radius-full);
}

/* Shadow Utilities */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}

/* Position Utilities */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

/* Width Utilities */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

.max-w-full {
    max-width: 100%;
}

/* Common UI States */
.no-scroll {
    overflow: hidden;
}

.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   Drawer & Menu Transitions
   ============================================ */
.cart-drawer {
    transform: translateX(100%);
    transition: transform var(--transition-normal) cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-open {
    transform: translateX(0);
}

/* Safe area for mobile devices with notches */
.safe-area-inset {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

.hover-zoom:hover img {
    transform: scale(1.05);
    transition: transform var(--transition-slow);
}

.mobile-menu {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
}

/* Mobile-specific touch interactions */
.touch-manipulation {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* Prevent text selection on buttons */
button,
.btn-primary,
.btn-ghost {
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Improve active state for mobile taps */
button:active,
.btn-primary:active,
.btn-ghost:active {
    transform: scale(0.98);
}

.mobile-menu-open {
    transform: translateX(0);
}

/* ============================================
   Form Inputs
   ============================================ */
.input-field {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    background-color: white;
}

.input-field:focus {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(253, 216, 53, 0.2);
}

.input-field:invalid:not(:placeholder-shown) {
    border-color: var(--error-color);
}

.input-field.error {
    border-color: var(--error-color);
    background-color: #fef2f2;
}

.input-field.success {
    border-color: var(--success-color);
}

.input-error-message {
    color: var(--error-color);
    font-size: 11px;
    margin-top: 4px;
    display: none;
}

.input-field.error+.input-error-message {
    display: block;
}

/* ============================================
   Payment Options
   ============================================ */
.payment-option {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    margin-bottom: 12px;
    background: white;
}

.payment-option:hover {
    border-color: var(--brand-color);
    background-color: #fffef5;
}

.payment-option.active {
    border-color: var(--brand-color);
    background-color: #fffde7;
}

.radio-circle {
    height: 20px;
    width: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.active .radio-circle {
    border-color: var(--brand-color);
}

.active .radio-circle::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--brand-color);
    border-radius: 50%;
    display: block;
}

/* ============================================
   Marquee Animation
   ============================================ */
.marquee-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.marquee-content {
    display: inline-block;
    animation: marquee 25s linear infinite;
    padding-left: 100%;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

/* Pause on hover for accessibility */
.marquee-container:hover .marquee-content {
    animation-play-state: paused;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: 12px;
    z-index: 9999;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    max-width: 90%;
}

.toast-success {
    background: var(--success-color);
    color: white;
}

.toast-error {
    background: var(--error-color);
    color: white;
}

.toast-warning {
    background: var(--warning-color);
    color: white;
}

.toast-info {
    background: var(--dark-color);
    color: white;
}

@keyframes slideUp {
    from {
        bottom: -50px;
        opacity: 0;
    }

    to {
        bottom: 20px;
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        bottom: 20px;
        opacity: 1;
    }

    to {
        bottom: -50px;
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* ============================================
   Modal Styles
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

.modal-content {
    position: relative;
    margin: 5% auto;
    max-width: 900px;
    background: white;
    border-radius: 16px;
    animation: slideIn 0.3s;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   Filter Buttons
   ============================================ */
.filter-btn {
    position: relative;
    overflow: hidden;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--brand-color);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.filter-btn:hover::after,
.filter-active::after {
    width: 100%;
}

.filter-active {
    background-color: var(--brand-color) !important;
    color: #000 !important;
    font-weight: bold;
}

/* ============================================
   Quantity Controls
   ============================================ */
.qty-btn {
    width: 32px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
}

.qty-btn:hover {
    background: var(--brand-color);
    border-color: var(--brand-color);
}

.qty-btn:active {
    transform: scale(0.95);
}

/* ============================================
   Search Highlight
   ============================================ */
.search-highlight {
    background-color: var(--brand-color);
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
}

/* ============================================
   Loading States
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   Product Cards - Professional Design
   ============================================ */
.product-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: var(--transition-all);
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.05);
    border: 1px solid var(--gray-100);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgb(0 0 0 / 0.1);
    border-color: var(--gray-200);
}

.product-image-container {
    position: relative;
    background: var(--gray-50);
    overflow: hidden;
    aspect-ratio: 3 / 4;
    cursor: pointer;
}

.product-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-image-container img {
    transform: scale(1.08);
}

.product-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, var(--brand-color) 0%, var(--brand-dark) 100%);
    color: var(--dark-color);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgb(253 216 53 / 0.4);
    z-index: 2;
}

.product-quick-view {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    padding: 24px 16px 16px;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
    z-index: 3;
}

.product-card:hover .product-quick-view {
    transform: translateY(0);
}

.quick-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
}

.product-card:hover .quick-view-btn {
    background: rgba(255, 255, 255, 0.25);
}

.product-info {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    color: var(--text-primary);
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: var(--font-medium);
}

.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.product-price {
    font-size: 1.25rem;
    font-weight: var(--font-bold);
    color: var(--dark-color);
}

.product-price-old {
    font-size: var(--text-sm);
    color: var(--gray-400);
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: var(--font-normal);
}

/* Size Selector in Product Card */
.product-info select {
    transition: all var(--transition-fast);
}

.product-info select:focus {
    box-shadow: 0 0 0 2px var(--brand-color);
    border-color: var(--brand-color);
}

/* Fix line-clamp for standards compliance */
.product-name {
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* ============================================
   Mobile Navigation Styles
   ============================================ */

/* Mobile Menu Overlay */
.mobile-menu {
    transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-menu.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mobile-menu:not(.hidden) {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Drawer */
.mobile-menu nav {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
}

.mobile-menu:not(.hidden) nav {
    transform: translateX(0);
}

/* Mobile Menu Links */
.mobile-menu a,
.mobile-menu button {
    transition: var(--transition-fast);
    touch-action: manipulation;
    /* Better touch response */
}

/* Mobile-specific header adjustments */
@media (max-width: 767px) {
    header .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Ensure touch targets are large enough */
    header button,
    header a {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Hamburger button animation */
.hamburger-btn {
    position: relative;
    width: 24px;
    height: 24px;
}

/* Responsive product grid */
@media (max-width: 639px) {
    #product-container {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    #product-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem;
    }
}

@media (min-width: 1024px) {
    #product-container {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Mobile Optimization for Product Cards */
@media (max-width: 639px) {
    .product-card {
        border-radius: var(--radius-lg);
    }

    .product-info {
        padding: 12px;
    }

    .product-name {
        font-size: var(--text-sm);
    }

    .product-price {
        font-size: 1.125rem;
    }

    .product-tag {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
}

.add-to-cart-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    background: white;
}

.add-to-cart-btn:hover {
    background: var(--brand-color);
    border-color: var(--brand-color);
    transform: scale(1.1);
}

/* New style for size-enabled add to cart button */
.add-to-cart-btn-new {
    min-width: 48px;
    height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    background: linear-gradient(135deg, #FDD835 0%, #FBC02D 100%);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(253, 216, 53, 0.3);
    font-weight: 600;
    color: #000;
    flex-shrink: 0;
}

.add-to-cart-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(253, 216, 53, 0.5);
    background: linear-gradient(135deg, #FBC02D 0%, #F9A825 100%);
}

.add-to-cart-btn-new:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(253, 216, 53, 0.3);
}

.add-to-cart-btn-new i {
    font-size: 18px;
}

/* ============================================
   Mobile Search Bar
   ============================================ */
.mobile-search-bar {
    display: none;
    padding: 8px 12px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
}

@media (max-width: 768px) {
    .mobile-search-bar {
        display: block;
    }
}

.mobile-search-input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    font-size: 13px;
    background-color: #f9fafb;
    transition: all var(--transition-fast);
}

.mobile-search-input:focus {
    border-color: var(--brand-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(253, 216, 53, 0.2);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .product-image-container {
        height: 200px;
    }

    /* On mobile, the quick-view overlay doesn't hover-show, 
       so ensure taps pass through to the container onclick */
    .product-quick-view {
        pointer-events: none;
    }

    .product-info {
        padding: 12px;
    }

    .product-price {
        font-size: 16px;
    }

    /* Fix: Mobile modal scrolling */
    .modal {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
    }

    .modal-content {
        margin: 0;
        max-width: 100%;
        min-height: 100%;
        height: auto;
        border-radius: 0;
        overflow-y: auto;
    }

    /* Quick View Modal - Mobile specific fixes */
    #quick-view-content {
        max-height: none;
        overflow-y: visible;
    }

    #quick-view-content .grid {
        display: flex;
        flex-direction: column;
    }

    /* Limit product image height on mobile */
    #quick-view-content>div>div:first-child {
        height: 280px !important;
        min-height: 280px;
        max-height: 280px;
    }

    .cart-drawer {
        width: 100% !important;
    }
}

/* ============================================
   Skeleton Loading
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-card {
    height: 350px;
    border-radius: 16px;
}

/* ============================================
   Utility Classes
   ============================================ */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-scroll {
    overflow: hidden;
}

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Floating WhatsApp Button
   ============================================ */
.floating-whatsapp {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all var(--transition-normal);
    animation: pulse-whatsapp 2s infinite;
}

.floating-whatsapp:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

@keyframes pulse-whatsapp {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(37, 211, 102, 0.7);
    }
}

.floating-whatsapp .tooltip {
    position: absolute;
    left: 70px;
    background: #333;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.floating-whatsapp:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 50px;
    height: 50px;
    background: var(--dark-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-color);
    font-size: 20px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--brand-color);
    color: var(--dark-color);
    transform: translateY(-4px);
}

/* ============================================
   Testimonials Section
   ============================================ */
.testimonials-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 80px 0;
    overflow: hidden;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    transition: all var(--transition-normal);
}

.testimonial-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    border-color: var(--brand-color);
}

.testimonial-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-color) 0%, #FFA000 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #000;
}

.testimonial-stars {
    color: var(--brand-color);
}

.testimonial-text {
    color: #ccc;
    font-size: 14px;
    line-height: 1.7;
    font-style: italic;
}

.testimonial-name {
    color: white;
    font-weight: 700;
}

.testimonial-location {
    color: #888;
    font-size: 12px;
}

/* ============================================
   Enhanced Hero Gradients
   ============================================ */
.hero-gradient-left {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

.hero-gradient-right {
    background: linear-gradient(-90deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, transparent 100%);
}

/* ============================================
   Price Sorting Dropdown
   ============================================ */
.sort-dropdown {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
}

.sort-dropdown:hover,
.sort-dropdown:focus {
    border-color: var(--brand-color);
}

/* ============================================
   Stats Counter Animation
   ============================================ */
.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-color) 0%, #FFA000 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Gradient Text
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, var(--brand-color) 0%, #FF6B6B 50%, #4ECDC4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Glassmorphism Card
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

/* ============================================
   Mobile Optimizations
   ============================================ */
@media (max-width: 768px) {
    .floating-whatsapp {
        bottom: 80px;
        left: 16px;
        width: 54px;
        height: 54px;
        font-size: 24px;
    }

    .floating-whatsapp .tooltip {
        display: none;
    }

    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    .testimonials-section {
        padding: 50px 0;
    }

    .testimonial-card {
        padding: 20px;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Additional mobile improvements */
    body {
        font-size: 14px;
    }

    /* Larger touch targets */
    button,
    a,
    .btn-primary,
    .btn-ghost {
        min-height: 44px;
        touch-action: manipulation;
    }

    /* Prevent zoom on input focus (iOS) */
    input,
    select,
    textarea {
        font-size: 16px;
    }

    /* Better mobile spacing */
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Improve cart drawer */
    .cart-drawer {
        width: 100%;
        padding-bottom: 0;
    }

    /* Hide WhatsApp button when cart is open */
    .cart-open ~ .floating-whatsapp,
    body.no-scroll .floating-whatsapp {
        display: none !important;
    }

    /* Better modal sizing */
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }

    /* Improve toast positioning */
    .toast {
        bottom: 80px;
        max-width: calc(100% - 32px);
        font-size: 13px;
    }

    /* Product card optimizations */
    .product-card {
        font-size: 13px;
    }

    .product-name {
        font-size: 13px;
        line-height: 1.4;
    }

    .product-price {
        font-size: 16px;
    }
}

/* Landscape phone optimizations */
@media (max-width: 896px) and (orientation: landscape) {
    header {
        height: 56px;
    }

    .swiper {
        height: 300px;
    }

    .cart-drawer {
        width: 50%;
        min-width: 400px;
    }
}

/* ============================================
   Mobile Bottom Navigation
   ============================================ */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--gray-500);
    font-size: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
}

.mobile-bottom-nav .nav-item i {
    font-size: 20px;
    transition: transform 0.2s;
}

.mobile-bottom-nav .nav-item.active,
.mobile-bottom-nav .nav-item:hover {
    color: var(--dark-color);
}

.mobile-bottom-nav .nav-item.active i {
    color: var(--brand-color);
    transform: scale(1.1);
}

.mobile-bottom-nav .nav-item .cart-count {
    position: absolute;
    top: 0;
    right: 4px;
    background: #ef4444;
    color: white;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Category Cards Section
   ============================================ */
.category-section {
    padding: 48px 0 32px;
    background: white;
}

@media (max-width: 768px) {
    .category-section {
        padding: 24px 0 16px;
    }
    .category-section .text-center.mb-8 {
        margin-bottom: 16px !important;
    }
    .category-section h2 {
        font-size: 1.25rem;
    }
}

.category-card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.category-card:hover img {
    transform: scale(1.12);
}

.category-card .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.category-card .overlay h3 {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.category-card .overlay p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    margin: 0;
}

/* ============================================
   Stats Bar
   ============================================ */
.stats-bar {
    background: var(--dark-color);
    padding: 20px 0;
    overflow: hidden;
}

.stats-bar .stat-item {
    text-align: center;
    padding: 8px 4px;
}

.stats-bar .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--brand-color);
    line-height: 1.2;
}

.stats-bar .stat-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin: 0;
}

@media (max-width: 768px) {
    .stats-bar {
        padding: 12px 0;
    }
    .stats-bar .stat-value {
        font-size: 1.1rem;
    }
    .stats-bar .stat-label {
        font-size: 0.55rem;
        letter-spacing: 0.5px;
    }
}

/* ============================================
   Discount Badge on Product Card
   ============================================ */
.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* ============================================
   Stock Badge on Product Card
   ============================================ */
.stock-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stock-badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================
   Page Load Animation
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* ============================================
   Enhanced Header
   ============================================ */
header {
    background: white;
    transition: box-shadow 0.3s ease;
}

header.scrolled {
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

.text-brand-dark {
    color: var(--brand-dark);
}

/* ============================================
   Premium Announcement Bar
   ============================================ */
.announcement-bar {
    background: linear-gradient(90deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    position: relative;
    overflow: hidden;
}

.announcement-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(253, 216, 53, 0.03), transparent);
    animation: sheen 8s infinite;
}

@keyframes sheen {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(50%); }
}

/* ============================================
   Improved Product Card Sizing 
   ============================================ */
.product-card .product-info select {
    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 d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
}

/* ============================================
   Cart Drawer Improvements
   ============================================ */
.cart-drawer .checkout-section {
    background: white;
}

.cart-summary-card {
    background: linear-gradient(135deg, #fafafa 0%, #f3f4f6 100%);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
}

/* ============================================
   Section Headers
   ============================================ */
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(253, 216, 53, 0.15) 0%, rgba(249, 168, 37, 0.1) 100%);
    color: var(--brand-dark);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* ============================================
   Enhanced Load More Button
   ============================================ */
#load-more-btn {
    position: relative;
    overflow: hidden;
}

#load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.05), transparent);
    transition: left 0.5s;
}

#load-more-btn:hover::before {
    left: 100%;
}

/* Accessibility: Reduce motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    .marquee-content {
        animation: none;
    }
}