/* ============================================================
   وفّر | Waffer — الأساسيات (Reset + Typography + Utilities)
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
  transition: background var(--med) var(--ease), color var(--med) var(--ease);
  text-rendering: optimizeLegibility;
}

/* جعل التمرير الناعم اختياريًا لمن يفضّلون تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

img, svg, canvas { display: block; max-width: 100%; }
input, button, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 {
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: -0.01em;
}

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

/* ---------- شريط التمرير ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ============================================================
   Utilities عامة
   ============================================================ */
.container {
  width: min(1200px, 100% - 40px);
  margin-inline: auto;
}

.section { padding-block: 84px; }
.section--soft { background: var(--bg-soft); }

/* رأس أي قسم: عنوان صغير + عنوان كبير + وصف */
.section-head {
  max-width: 640px;
  margin-bottom: 44px;
}
.section-head--center {
  margin-inline: auto;
  text-align: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 900;
  margin-bottom: 10px;
}
.section-head p { color: var(--ink-2); font-size: 17px; }

/* أزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 99px;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              background var(--fast) var(--ease), border-color var(--fast) var(--ease);
  will-change: transform;
  border: 2px solid transparent;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 20px var(--primary-glow);
}
.btn--primary:hover { background: var(--primary-2); transform: translateY(-2px); }
.btn--ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}
.btn--ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn--light {
  background: #fff;
  color: var(--primary-2);
  box-shadow: var(--shadow-md);
}
.btn--light:hover { transform: translateY(-2px); }
.btn--block { width: 100%; }

/* شارات صغيرة */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

/* شارة نسبة الخصم */
.badge-discount {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  background: var(--accent);
  color: #3A2A00;
  font-weight: 900;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(224, 143, 16, 0.35);
  z-index: 2;
}

/* شارة مميزة (عرض اليوم / الأكثر توفيرًا) */
.badge-feature {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 10px;
  box-shadow: 0 6px 16px var(--primary-glow);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* أرقام الأسعار بالعملة */
.price { font-weight: 900; }
.price--new { color: var(--primary); font-size: 22px; }
.price--old {
  color: var(--ink-3);
  text-decoration: line-through;
  font-size: 14.5px;
  font-weight: 600;
}

/* شبكة عامة */
.grid { display: grid; gap: 22px; }

/* روابط خارجية (المنصات) */
.platform-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 9px;
}
.platform-pill--amazon { background: var(--amazon-soft); color: var(--amazon); }
.platform-pill--noon   { background: var(--noon-soft);   color: var(--noon); }

/* عنصر أساسي للظهور عند التمرير — تُدار حركته من engine.js */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--slow) var(--ease), transform var(--slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}

/* أداة إخفاء بصريًا للمنفذين (Accessibility) */
.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;
}

/* تركيز واضح لإمكانية الوصول */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}