/* ═══════════════════════════════════════════════════════════════
   نظام تصميم موقع البشرة الزجاجية

   خطٌّ واحد، تتبّعٌ صفر، وإيقاعٌ رأسيّ من ٨ بكسل.
   التتبّع الموجب يفصل الأحرف العربية المتّصلة فتبدو الكلمة مفكّكة،
   و`text-transform` بلا أثر في العربية أصلاً — فالهرميّة هنا حجمٌ
   ووزنٌ ولون، لا تباعد.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* الأرضية والأسطح */
  --substrate:  #FAF6F5;
  --pane:       #FFFFFF;
  --lightbox:   #FFFFFF;

  /* الحبر — ink-faint (4.04:1) للنصّ الكبير وحده */
  --ink:        #221A1C;
  --ink-soft:   #6A585B;
  --ink-faint:  #8C7A7D;

  /* لون العلامة — محجوز للسعر والزرّ الأساسيّ ونسبة الخصم */
  --rose:       #A6231C;
  --rose-wash:  #FDF1EF;
  /* الذهبيّ — للتسميات الصغيرة والشعرات، لا يملأ مساحة */
  --gold:       #8A6729;
  --gold-wash:  #FBF5EA;

  --line:       #E8E1DF;
  --gleam:      rgba(255, 255, 255, 0.9);
  --shade:      rgba(90, 55, 50, 0.10);

  --font: "Readex Pro", "Segoe UI", system-ui, sans-serif;
  --wrap: 67.5rem;
  --gutter: clamp(1.15rem, 5vw, 2rem);
  --bay: clamp(4.5rem, 10vw, 8.25rem);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --substrate: #14100F;
    --pane:      #1C1715;
    /* يبقى فاتحاً: صور المنتجات على خلفية بيضاء، فتصير نيشاً مضاءً
       داخل خزانة مظلمة بدل مستطيل أبيض يصرخ في صفحة سوداء */
    --lightbox:  #EFEAE7;
    --ink:       #F0EAE8;
    --ink-soft:  #AFA09B;
    --ink-faint: #857571;
    --rose:      #F0A49C;
    --rose-wash: #2A1917;
    --gold:      #DDBA88;
    --gold-wash: #241C13;
    --line:      #2A2321;
    --gleam:     rgba(255, 255, 255, 0.07);
    --shade:     rgba(0, 0, 0, 0.5);
  }
}

:root[data-theme="dark"] {
  --substrate: #14100F;
  --pane:      #1C1715;
  --lightbox:  #EFEAE7;
  --ink:       #F0EAE8;
  --ink-soft:  #AFA09B;
  --ink-faint: #857571;
  --rose:      #F0A49C;
  --rose-wash: #2A1917;
  --gold:      #DDBA88;
  --gold-wash: #241C13;
  --line:      #2A2321;
  --gleam:     rgba(255, 255, 255, 0.07);
  --shade:     rgba(0, 0, 0, 0.5);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@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;
  }
}

body {
  margin: 0;
  background: var(--substrate);
  color: var(--ink);
  font-family: var(--font);
  /* 16px أرضية صلبة: أصغر منها يُكبّر iOS الصفحة تلقائياً عند التركيز */
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.8;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

a { color: var(--rose); text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ── السُّلَّم الطباعيّ ────────────────────────────────────────
   كلّما كبر الحرف رقَّ وزنه — تصحيحٌ بصريّ يجعل الصفحة مصنوعة
   لا مركَّبة. والتتبّع صفرٌ في كل درجة بلا استثناء. */

h1, h2, h3 { margin: 0; letter-spacing: 0; text-wrap: balance; }

h1 {
  font-size: clamp(2.5rem, 7.6vw, 4.75rem);
  font-weight: 200;
  line-height: 1.18;
  max-width: 17ch;
}
h2 {
  font-size: clamp(1.75rem, 4.4vw, 2.75rem);
  font-weight: 300;
  line-height: 1.24;
  max-width: 22ch;
}
h3 {
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.5;
}

.lead {
  font-size: clamp(1.06rem, 2.3vw, 1.31rem);
  font-weight: 300;
  line-height: 1.72;
  max-width: 42ch;
  color: var(--ink-soft);
  margin: 0;
}

p { margin: 0 0 1rem; max-width: 46ch; text-align: start; }
p:last-child { margin-bottom: 0; }

.label {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: var(--gold);
}

.micro {
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--ink-faint);
}

/* الأرقام لاتينية ومعزولة اتجاهياً كي لا ينقلب «25,000 د.ع»
   حين يجاوره سعرٌ مشطوب */
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  direction: ltr;
  unicode-bidi: isolate;
}

/* ── التخطيط ────────────────────────────────────────────────── */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
section { padding-block: var(--bay); }

/* الحافّة: بكسلان يرسمان حرف صفيحة زجاج مضاءة من فوق.
   هي كل البنية المرئية في الصفحة — بديل الصناديق والخلفيات المتبادلة. */
.edge {
  height: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--gleam);
}

/* ── الشريط العلويّ ─────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--substrate) 74%, transparent);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--line);
}
/* الطمس الخلفيّ مكلف على الأجهزة الرخيصة — بديلٌ صلب حين لا يُدعَم */
@supports not (backdrop-filter: blur(1px)) {
  .topbar { background: var(--substrate); }
}
.topbar > .wrap {
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: inherit; }
.logo img { width: 34px; height: 34px; border-radius: 10px; }
.logo b { font-size: 1.0625rem; font-weight: 500; line-height: 1.25; }
.logo span { display: block; font-size: 0.6875rem; font-weight: 400; color: var(--ink-soft); line-height: 1.3; }

/* ── الأزرار ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.985); }
.btn-primary { background: var(--rose); color: var(--pane); }
:root[data-theme="dark"] .btn-primary { color: #14100F; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn-primary { color: #14100F; }
}
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink-faint); opacity: 1; }

/* ── شارات المتاجر ──────────────────────────────────────────── */
.stores { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.store {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 1.1rem;
  border-radius: 12px;
  background: var(--ink);
  color: var(--substrate);
  text-decoration: none;
  border: 1px solid var(--ink);
  min-height: 2.75rem;
}
.store[aria-disabled="true"] {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--line);
  pointer-events: none;
}
.store svg { width: 20px; height: 20px; flex: none; }
.store .s-top { display: block; font-size: 0.6875rem; opacity: 0.8; line-height: 1.2; }
.store .s-main { display: block; font-size: 0.9375rem; font-weight: 500; line-height: 1.3; }

/* ── الفاترينة: صفيحة واحدة مسطَّرة ────────────────────────────
   الفواصل من فجوة ١px تكشف لون الخلفية — لا حدّ لكل بطاقة ولا ظلّ.
   يجعل الشبكة تُقرأ كقطعة واحدة مرتّبة لا كأوراقٍ متناثرة. */
.case {
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
}
.case .card { border-radius: 0; }

.card {
  background: var(--pane);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: background 0.18s ease;
}
.card:hover { background: color-mix(in srgb, var(--rose) 4%, var(--pane)); }
.card-img {
  aspect-ratio: 1;
  background: var(--lightbox);
  position: relative;
  display: grid;
  place-items: center;
}
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 1rem; }
.card-off {
  position: absolute;
  inset-block-start: 0.65rem;
  inset-inline-start: 0.65rem;
  background: var(--rose);
  color: #FFF;
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
:root[data-theme="dark"] .card-off { color: #14100F; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .card-off { color: #14100F; }
}
.card-body { padding: 0.9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.card-name {
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cat { font-size: 0.75rem; color: var(--gold); }
.card-price { margin-top: auto; padding-top: 0.5rem; display: flex; align-items: baseline; gap: 0.55rem; }
.card-price b { color: var(--rose); font-size: 1.0625rem; font-weight: 600; }
.card-price s { color: var(--ink-faint); font-size: 0.8125rem; }

.skeleton { background: var(--pane); aspect-ratio: 0.74; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: 0.5 } }
.empty { color: var(--ink-soft); grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; background: var(--pane); }

/* ── الكشف عند التمرير ──────────────────────────────────────── */
/* بلا JavaScript تبقى الأقسام مرئية: `.js` تضعها الصفحة على <html> قبل
   أي رسم، فالإخفاء لا يقع إلا حين يوجد من يكشفه. */
.reveal { opacity: 1; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.seen { opacity: 1; transform: none; }
/* أسبقية `.js .reveal` هي (0,2,0)، فقاعدةٌ بمحدّد واحد لا تغلبها ويبقى
   المحتوى مخفياً عمّن طلب تقليل الحركة. تقليل الحركة يعني ألّا يوجد
   كشفٌ أصلاً — لا كشفاً أسرع. */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ── التذييل ────────────────────────────────────────────────── */
footer { border-top: 1px solid var(--line); padding-block: 3rem 2.25rem; }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 2.25rem; }
.foot-grid h3 { font-size: 0.8125rem; font-weight: 500; color: var(--gold); margin-bottom: 0.85rem; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.55rem; }
.foot-grid a { color: var(--ink-soft); text-decoration: none; font-size: 0.9375rem; }
.foot-grid a:hover { color: var(--rose); }
.foot-base {
  margin-top: 2.5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.65rem;
}
