/* ============================================================
   عروض ماركت — main.css
   Brand tokens + reset + base + utilities (RTL-first, logical props)
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Brand */
  --c-primary: #00B894;
  --c-primary-dark: #008F72;
  --c-gold: #D4AF37;
  --c-gold-light: #F4D06F;
  --c-bg-dark: #0B1020;
  --c-shadow-deep: #05070D;

  /* Neutrals */
  --c-gray-50: #F7F8FA;
  --c-gray-100: #EEF0F4;
  --c-gray-300: #C9CED6;
  --c-gray-500: #7A8290;
  --c-gray-700: #3D444F;
  --c-white: #FFFFFF;

  /* States */
  --c-success: #00B894;
  --c-warning: #F4D06F;
  --c-danger: #E53935;
  --c-info: #2196F3;
  --c-whatsapp: #25D366;

  /* Surfaces (resolve per theme) */
  --bg-page: var(--c-gray-50);
  --bg-card: var(--c-white);
  --bg-elevated: var(--c-white);
  --fg-body: var(--c-gray-700);
  --fg-strong: #0F1620;
  --fg-muted: var(--c-gray-500);
  --border: var(--c-gray-100);
  --border-strong: var(--c-gray-300);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #00B894 0%, #008F72 100%);
  --grad-gold:    linear-gradient(135deg, #D4AF37 0%, #F4D06F 100%);
  --grad-dark:    linear-gradient(180deg, #0B1020 0%, #05070D 100%);
  --grad-hero:    radial-gradient(ellipse at 80% -10%, rgba(0,184,148,0.35) 0%, transparent 55%),
                  radial-gradient(ellipse at 10% 110%, rgba(212,175,55,0.18) 0%, transparent 55%),
                  linear-gradient(180deg, #0B1020 0%, #05070D 100%);

  /* Type */
  --font-ar: 'Cairo', 'Tajawal', 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif;
  --font-display: 'Tajawal', 'Cairo', system-ui, sans-serif;
  --font-ltr: 'Inter', 'Segoe UI', system-ui, sans-serif;

  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --fs-4xl: 36px;
  --fs-hero: clamp(34px, 6vw, 56px);

  /* Spacing scale (8pt) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-2xl: 28px;
  --r-pill: 9999px;

  /* Shadow */
  --shadow-1: 0 1px 2px rgba(11,16,32,0.06), 0 1px 3px rgba(11,16,32,0.04);
  --shadow-2: 0 4px 12px rgba(11,16,32,0.08), 0 2px 4px rgba(11,16,32,0.04);
  --shadow-3: 0 12px 32px rgba(11,16,32,0.12), 0 4px 8px rgba(11,16,32,0.06);
  --shadow-gold: 0 8px 24px rgba(212,175,55,0.28);

  /* Layout */
  --container: 1280px;
  --header-h-mobile: 56px;
  --header-h-desktop: 72px;
  --bottom-nav-h: 64px;
  --density: 1; /* multiplier — tweaks */
  --radius-multiplier: 1;

  /* Motion */
  --ease: cubic-bezier(.2,.7,.2,1);
  --dur: 200ms;

  /* Density-aware spacing */
  --card-pad: calc(14px * var(--density));
  --card-gap: calc(12px * var(--density));
}

/* DARK THEME */
[data-theme="dark"] {
  --bg-page: #0B1020;
  --bg-card: #131A2C;
  --bg-elevated: #1A2138;
  --fg-body: #D8DCE6;
  --fg-strong: #FFFFFF;
  --fg-muted: #8B95AB;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --shadow-1: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-2: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-3: 0 12px 32px rgba(0,0,0,0.55);
}

/* DENSITY */
[data-density="compact"]  { --density: 0.82; --card-pad: 10px; --card-gap: 8px; }
[data-density="cozy"]     { --density: 1;    --card-pad: 14px; --card-gap: 12px; }
[data-density="spacious"] { --density: 1.18; --card-pad: 20px; --card-gap: 16px; }

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[dir="rtl"] body { font-family: var(--font-ar); }
body {
  margin: 0;
  background: var(--bg-page);
  color: var(--fg-body);
  font-family: var(--font-ar);
  font-size: var(--fs-base);
  line-height: 1.75;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* Numbers stay LTR */
bdi, .num, .ltr {
  font-family: var(--font-ltr);
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
  direction: ltr;
  display: inline-block;
}

/* ---------- A11Y ---------- */
:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.skip-link {
  position: absolute;
  inset-inline-start: var(--s-2);
  top: -100px;
  background: var(--c-gold);
  color: #0B1020;
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-md);
  font-weight: 700;
  z-index: 200;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--s-2); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* ---------- LAYOUT ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 1024px) {
  .container { padding-inline: 32px; }
}

main { padding-block-end: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 16px); }
@media (min-width: 768px) {
  main { padding-block-end: var(--s-12); }
}

.section { padding-block: var(--s-8); }
.section--tight { padding-block: var(--s-6); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-block-end: var(--s-4); gap: var(--s-4);
}
.section__title {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--fg-strong);
  margin: 0;
  letter-spacing: 0;
}
.section__link {
  font-size: var(--fs-sm);
  color: var(--c-primary);
  font-weight: 600;
  white-space: nowrap;
}
.section__link::after {
  content: "‹";
  margin-inline-start: 4px;
  display: inline-block;
}

/* ---------- TYPE UTILITIES ---------- */
.h1 { font-family: var(--font-display); font-size: var(--fs-hero); font-weight: 800; line-height: 1.15; color: var(--fg-strong); margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
.h2 { font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: 700; line-height: 1.25; color: var(--fg-strong); margin: 0; }
.h3 { font-size: var(--fs-xl); font-weight: 700; line-height: 1.35; color: var(--fg-strong); margin: 0; }
.text-muted { color: var(--fg-muted); }
.text-gold { color: var(--c-gold); }
.text-primary { color: var(--c-primary); }

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- SCROLLBARS (subtle) ---------- */
.scroll-x { overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.scroll-x::-webkit-scrollbar { display: none; }
.snap-x { scroll-snap-type: x mandatory; }
.snap-x > * { scroll-snap-align: start; }
