/* =====================================================
   المتغيرات - Light Mode (لطيف وهادئ - مريح للعين)
   ===================================================== */
:root {
    --bg-primary: #fdfcfb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-input: #f7f5f3;
    --bg-glass: rgba(253,252,251,0.88);
    --text-primary: #3d3832;
    --text-secondary: #7a736b;
    --text-muted: #a9a29a;
    --accent: #b8936f;
    --accent-hover: #a37d5a;
    --accent-light: #f8f3ee;
    --accent-glow: rgba(184, 147, 111, 0.1);
    --accent-secondary: #cca886;
    --border: #eeebe7;
    --border-focus: #b8936f;
    --success: #6aaa7a;
    --danger: #d46b6b;
    --warning: #d4a84e;
    --shadow-sm: 0 1px 4px rgba(60,50,40,0.05);
    --shadow-md: 0 4px 16px rgba(60,50,40,0.07);
    --shadow-lg: 0 8px 30px rgba(60,50,40,0.09);
    --shadow-glow: 0 4px 20px rgba(184, 147, 111, 0.1);
    --radius: 14px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --gradient-hero: linear-gradient(135deg, #d4b896 0%, #b8936f 45%, #a68058 100%);
    --gradient-card: linear-gradient(160deg, #ffffff 0%, #fcfaf8 100%);
}

/* =====================================================
   Dark Mode (دافئ وأنيق - مريح للعين)
   ===================================================== */
[data-theme="dark"] {
    --bg-primary: #141210;
    --bg-secondary: #1c1a17;
    --bg-card: #232019;
    --bg-input: #2a2722;
    --bg-glass: rgba(28,26,23,0.92);
    --text-primary: #ede8e3;
    --text-secondary: #ada49b;
    --text-muted: #6e665e;
    --accent: #d4ad88;
    --accent-hover: #e0bfa0;
    --accent-light: #2e2518;
    --accent-glow: rgba(212, 173, 136, 0.12);
    --accent-secondary: #c49a74;
    --border: #302c26;
    --border-focus: #d4ad88;
    --success: #7ec48e;
    --danger: #d97070;
    --warning: #dab054;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
    --shadow-glow: 0 4px 20px rgba(212, 173, 136, 0.08);
    --gradient-hero: linear-gradient(135deg, #1e1810 0%, #120e08 50%, #221a10 100%);
    --gradient-card: linear-gradient(160deg, #232019 0%, #2a2722 100%);
}

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

html {
    scroll-behavior: smooth;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
}

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    transition: background 0.4s ease, color 0.4s ease;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--accent-hover); }

/* GPU-accelerated elements for smoother animations */
.product-card, .category-card, .cat-card, .btn, .btn-add-cart,
.btn-primary, .btn-submit, .hero-btn, .floating-cart, .back-to-top {
    will-change: transform;
    transform: translateZ(0);
}

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

::selection {
    background: var(--accent);
    color: #fff;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* =====================================================
   Scroll Reveal Animations
   ===================================================== */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Ensure reveal elements still take layout space */
.reveal { min-height: 1px; }

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.4s; }
.stagger-children.visible > *:nth-child(9) { transition-delay: 0.45s; }

.stagger-children.visible > * {
    opacity: 1;
    transform: translateY(0);
}

/* =====================================================
   Loading Skeleton
   ===================================================== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-input) 25%, var(--border) 50%, var(--bg-input) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   Container
   ===================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}
