@font-face{font-family:'Cairo';src:url('fonts/cairo-arabic-wght-normal.woff2') format('woff2');font-weight:200 1000;font-display:swap;unicode-range:U+0600-06FF,U+0750-077F,U+FB50-FDFF,U+FE70-FEFF}
@font-face{font-family:'Cairo';src:url('fonts/cairo-latin-wght-normal.woff2') format('woff2');font-weight:200 1000;font-display:swap;unicode-range:U+0000-00FF,U+2000-206F,U+20A0-20CF}

/* ═══════════════════════════════════════════════════════════════════════════
   مرجان — «لوحة المرجان الزجاجية»
   الاسم هو الفكرة: المرجان مادة، ولونه هو لكنة الواجهة كلها. الزجاج ليس زينة
   بل سطح ماء: المشهد خلفه دافئ مموّه، والبطاقات طافية عليه.
   صفر تبعيات · صفر صور · CSP: style-src 'self' (لا سمة style= في أي مكان).
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* الحبر — ثلاث درجات فقط: أساسي، ثانوي، خفيف. */
  --ink: #2a1714;
  --ink-2: rgba(42, 23, 20, 0.72);
  --ink-3: rgba(42, 23, 20, 0.7);

  /* المرجان: لون الاسم. --coral يحقّق 4.6:1 على الورق، والأبيض عليه 4.9:1. */
  --coral: #cf3538;
  --coral-hi: #ef7264;
  --coral-deep: #a8242b;
  /* تدرّج داخل اللون الواحد فقط، وأفتح درجة فيه ما زالت تحمل أبيض 4.9:1. */
  --coral-grad: linear-gradient(148deg, #ce4439 0%, #c23536 42%, #a92a2e 100%);
  --good: #2c8a57;

  /* الورق: سطح خفيف بلا ضباب — للبطاقات المتكرّرة. */
  --paper: rgba(255, 251, 248, 0.74);
  --paper-2: rgba(255, 255, 255, 0.66);

  /* الزجاج: للهيكل والطبقات الطافية فقط. */
  --glass: rgba(255, 247, 242, 0.5);
  --glass-2: rgba(255, 250, 247, 0.86);
  --edge: rgba(255, 255, 255, 0.5);
  --line: rgba(42, 23, 20, 0.1);
  --blur: blur(18px) saturate(150%);

  --sh-1: 0 10px 24px -22px rgba(58, 24, 18, 0.45);
  --sh-2: 0 20px 44px -30px rgba(58, 24, 18, 0.5);

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 10px;
  --pill: 999px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --side: 264px;
  --gap: 1.25rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
  background: #b98b78;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ol,
ul,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.24;
  letter-spacing: 0;
  text-wrap: balance;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
}

::selection {
  background: rgba(207, 53, 56, 0.22);
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: 1rem;
  z-index: 300;
  padding: 0.5rem 1rem;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  transform: translateY(-6rem);
  transition: transform 160ms var(--ease);
}

.skip:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 10px;
}

/* ─────────────────────────────────────────────────────────────── المشهد */
/* جدار دافئ: ضوء مرجاني من الزاوية، بركة كريمية في الوسط، وظلّ عند الحافة.
   كل الدرجات فاتحة بما يكفي ليقرأ عليها الحبر 4.5:1، بلا تدرّج لوني إلى لون آخر. */
.scene {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(42% 38% at 96% 4%, rgba(238, 112, 92, 0.5), transparent 68%),
    radial-gradient(46% 42% at 2% 98%, rgba(150, 88, 72, 0.4), transparent 72%),
    radial-gradient(64% 58% at 48% 40%, rgba(255, 250, 246, 0.96), transparent 74%),
    linear-gradient(158deg, #cfa294 0%, #efcdbd 46%, #dcab99 74%, #c99684 100%);
}

.scene::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 50% 45%, transparent 46%, rgba(96, 54, 44, 0.18));
}

/* حبيبات دقيقة: تكسر تدرّج CSS المسطّح وتمنحه ملمس ورق. */
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ───────────────────────────────────────────────────────────────── الزجاج */
/* وصفة واحدة، بلا لمعة داخلية: الحدّ هو ما يفصل السطح عن المشهد. */
.glass {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* الورق: السطح المتكرّر — بلا ضباب، أثقل قليلاً، أوضح للقراءة. */
.paper {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.coral {
  color: #fff;
  background: var(--coral-grad);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    0 24px 48px -32px rgba(88, 30, 24, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

/* ───────────────────────────────────────────────────────────────── الهيكل */
.shell {
  display: grid;
  grid-template-columns: var(--side) minmax(0, 1fr);
  gap: var(--gap);
  max-width: 1420px;
  margin: 0 auto;
  padding: var(--gap);
}

/* أي عنصر في الشبكة يمكنه أن ينكمش تحت عرض محتواه الأدنى؛ بدونه يفرض
   صفّ الشرائح عرضاً أكبر من الشاشة فينزلق التخطيط كله أفقياً على الهاتف. */
.shell > * {
  min-width: 0;
}

.stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--gap);
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ─────────────────────────────────────────────────────── الشريط الجانبي */
/* .side هو العمود فقط؛ الزجاج والتمرير على .side-panel حتى يبقى مقبض
   الطيّ ملتصقاً بحافة اللوحة أثناء حركة العرض. */
.side {
  position: sticky;
  top: var(--gap);
  align-self: start;
  height: calc(100dvh - 2 * var(--gap));
  min-height: 0;
}

.side-panel {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 0.75rem;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: var(--r-xl);
  scrollbar-width: thin;
  scrollbar-color: rgba(42, 23, 20, 0.2) transparent;
}

.side-panel > * {
  min-width: 0;
}

/* مقبض الطيّ: كبسولة زجاجية على حافة اللوحة الداخلية، تتحرّك معها. */
.side-toggle {
  position: absolute;
  top: 50%;
  inset-inline-end: -14px;
  z-index: 4;
  display: none;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: var(--glass-2);
  box-shadow: 0 8px 18px -12px rgba(58, 24, 18, 0.55);
  color: var(--ink-2);
  cursor: pointer;
  translate: 0 -50%;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 160ms ease, color 160ms ease, scale 160ms ease;
}

.side-toggle svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  rotate: 0deg;
  transition: rotate 320ms var(--ease);
}

[dir='rtl'] .side-toggle svg {
  scale: -1 1;
}

html.side-collapsed .side-toggle svg {
  rotate: 180deg;
}

@media (hover: hover) {
  .side-toggle:hover {
    background: #fff;
    color: var(--coral);
    scale: 1.08;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-inline: 0.15rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 10px;
  color: #fff;
  background: var(--coral);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.brand-copy b {
  font-size: 1.02rem;
  font-weight: 600;
}

.brand-copy small {
  color: var(--ink-3);
  font-size: 0.7rem;
  font-weight: 500;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
  color: var(--ink-3);
  cursor: text;
  transition: border-color 160ms ease, background 160ms ease;
}

.search-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 0.83rem;
  color: var(--ink);
}

.search-wrap input::placeholder {
  color: var(--ink-3);
}

.search-wrap kbd {
  flex: none;
  padding: 0 0.32rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 0.66rem;
  font-weight: 500;
  color: var(--ink-3);
}

.search-wrap:focus-within {
  border-color: rgba(207, 53, 56, 0.55);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(207, 53, 56, 0.14);
}

.side-label {
  margin: 1rem 0 0.35rem;
  padding-inline: 0.6rem;
  color: var(--ink-3);
  font-size: 0.68rem;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 36px;
  padding: 0.35rem 0.6rem;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.nav svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav a:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.nav a.on {
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.nav a.on svg {
  color: var(--ink);
}

.chips {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
}

.chip {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 36px;
  padding: 0.35rem 0.6rem;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-2);
  font-size: 0.85rem;
  font-weight: 500;
  text-align: start;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.chip::before {
  content: '';
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--dot, currentColor);
  opacity: 0.55;
  transition: background 160ms ease, opacity 160ms ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.chip.on {
  background: var(--paper-2);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.chip.on::before {
  background: var(--dot, var(--coral));
  opacity: 1;
}

.chip-label {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* التواصل والسلة كتلة واحدة في قاع اللوحة — لا عنصر معلّق في المنتصف. */
.side-foot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
}

.side-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-inline: 0.2rem;
}

.side-cart {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  text-align: start;
  cursor: pointer;
  transition: background 160ms ease;
}

.side-cart:hover {
  background: #fff;
}

.side-cart-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  background: rgba(42, 23, 20, 0.06);
  color: var(--ink-2);
}

.side-cart-ico svg {
  width: 16px;
  height: 16px;
}

.side-cart-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  line-height: 1.3;
}

.side-cart-copy b {
  font-size: 0.8rem;
  font-weight: 600;
}

.side-cart-copy small {
  color: var(--ink-3);
  font-size: 0.68rem;
}

.side-cart-total {
  display: flex;
  flex: none;
  align-items: baseline;
  gap: 0.15rem;
  color: var(--coral);
}

.side-cart-total b {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.side-cart-total small {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--ink-3);
}

/* ─────────────────────────────────────── الشريط: الطيّ إلى شريط أيقونات */
@media (min-width: 881px) {
  .side-toggle {
    display: grid;
  }

  .shell {
    transition: grid-template-columns 420ms var(--ease);
  }

  html.side-collapsed {
    --side: 60px;
  }

  /* النص يخرج من التخطيط؛ الأيقونات تبقى في مركز الشريط (12 + 9.6 + 8.5 = 30). */
  html.side-collapsed .brand {
    padding-inline: 0;
  }

  html.side-collapsed .brand-copy,
  html.side-collapsed .search-wrap input,
  html.side-collapsed .search-wrap kbd,
  html.side-collapsed .side-label,
  html.side-collapsed .nav a span,
  html.side-collapsed .chip-label,
  html.side-collapsed .side-links,
  html.side-collapsed .side-cart-copy,
  html.side-collapsed .side-cart-total {
    display: none;
  }

  html.side-collapsed .search-wrap {
    justify-content: center;
    padding: 0.45rem 0;
  }

  html.side-collapsed .nav a {
    justify-content: center;
    padding-inline: 0;
  }

  html.side-collapsed .chip {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
  }

  html.side-collapsed .side-cart {
    justify-content: center;
    min-height: 44px;
    padding: 0;
  }

  html.side-collapsed .side-cart-ico {
    width: 34px;
    height: 34px;
  }

  /* عدّاد السلة ينتقل إلى شارة على الأيقونة حين يختفي النص. */
  html.side-collapsed .side-cart::after {
    content: attr(data-items);
    position: absolute;
    top: 3px;
    inset-inline-end: 1px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--pill);
    background: var(--coral);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
  }

  html.side-collapsed .side-cart[data-items='0']::after {
    display: none;
  }
}

/* ──────────────────────────────────────────────────────────────── الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.5rem 1.05rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn.sm {
  min-height: 32px;
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
}

.btn.glassy,
.btn.ghosty {
  background: var(--paper-2);
  border-color: var(--line);
  color: var(--ink);
}

.btn.dark {
  background: var(--ink);
  color: #fff;
}

.btn.light {
  background: #fff;
  color: var(--coral-deep);
}

.btn.outline {
  border-color: rgba(255, 255, 255, 0.58);
  color: #fff;
}

.btn.primary,
.btn.coral-btn {
  background: var(--coral);
  color: #fff;
}

@media (hover: hover) {
  .btn.glassy:hover,
  .btn.ghosty:hover {
    background: #fff;
  }

  .btn.outline:hover {
    background: rgba(255, 255, 255, 0.18);
  }

  .btn.dark:hover {
    background: #40241f;
  }

  .btn.primary:hover,
  .btn.coral-btn:hover {
    background: var(--coral-deep);
  }
}

.link-btn {
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--coral);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background: var(--paper-2);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease, transform 180ms var(--ease);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.85);
}

.icon-btn:active {
  transform: scale(0.94);
}

.cart-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  border-radius: var(--pill);
  background: var(--coral);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cart-btn.pop .cart-count {
  animation: pop 420ms var(--ease);
}

@keyframes pop {
  40% {
    transform: scale(1.35);
  }
}

/* ────────────────────────────────────────────────────────────── الترويسة */
.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0.35rem 0;
}

.greet h1 {
  font-size: clamp(1.3rem, 2.4vw, 1.72rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.greet p {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-2);
  font-size: 0.82rem;
  font-weight: 500;
}

.greet .sep {
  opacity: 0.6;
}

.head-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.5rem;
}

/* زر القائمة (الهامبرغر) — لا يظهر إلا حين يصبح الشريط درجاً منزلقاً. */
.menu-btn {
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--glass-2);
  box-shadow: var(--sh-1);
  color: var(--ink);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 160ms ease, scale 160ms var(--ease);
}

.menu-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.menu-close {
  display: none;
  margin-inline-start: auto;
}

@media (hover: hover) {
  .menu-btn:hover {
    background: #fff;
  }
}

.menu-btn:active {
  scale: 0.94;
}

/* ────────────────────────────────────────────────────────────────── الهيرو */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(0, 1fr);
  gap: var(--gap);
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  align-content: center;
  column-gap: 1.2rem;
  row-gap: 0.7rem;
  padding: clamp(1.15rem, 2.5vw, 1.8rem);
  border-radius: var(--r-xl);
  overflow: hidden;
  isolation: isolate;
}

.hero-card > * {
  grid-column: 1;
}

.kicker {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.7rem;
  font-weight: 500;
}

.hero-card h2 {
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  max-width: 22ch;
}

.hero-card h2 em {
  font-style: normal;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(255, 255, 255, 0.55);
  text-underline-offset: 0.18em;
}

.hero-lead {
  max-width: 44ch;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

/* الحلقة: 80% مرسومة، و20% فراغ هو الخصم نفسه. */
.ring-wrap {
  grid-column: 2;
  grid-row: 1 / span 4;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(128px, 15vw, 172px);
  aspect-ratio: 1;
  margin-top: 0.4rem;
}

.ring-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.ring-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.24);
  stroke-width: 6;
}

.ring-fg {
  fill: none;
  stroke: #fff;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-dasharray: 264;
  stroke-dashoffset: 264;
  transform: rotate(-90deg);
  transform-origin: 50px 50px;
  animation: ring-fill 1600ms var(--ease) 260ms forwards;
}

/* 264 = محيط (r=42). الإزاحة النهائية 52.8 = 20% فراغ. */
@keyframes ring-fill {
  to {
    stroke-dashoffset: 52.8;
  }
}

.ring-num {
  fill: #fff;
  font-size: 21px;
  font-weight: 600;
  text-anchor: middle;
  letter-spacing: 0;
  direction: ltr;
}

.ring-num-sub {
  fill: rgba(255, 255, 255, 0.78);
  font-size: 7.5px;
  font-weight: 500;
  text-anchor: middle;
  letter-spacing: 0.02em;
}

.orbit {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orbit .dot {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: #fff6f1;
  box-shadow: 0 6px 12px -8px rgba(58, 24, 18, 0.5);
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.orbit .dot svg {
  width: 100%;
  height: 100%;
}

.orbit .dot:nth-child(1) {
  inset-inline-start: 50%;
  top: 0;
}

.orbit .dot:nth-child(2) {
  inset-inline-start: 93%;
  top: 25%;
}

.orbit .dot:nth-child(3) {
  inset-inline-start: 93%;
  top: 75%;
}

.orbit .dot:nth-child(4) {
  inset-inline-start: 50%;
  top: 100%;
}

.orbit .dot:nth-child(5) {
  inset-inline-start: 7%;
  top: 75%;
}

.orbit .dot:nth-child(6) {
  inset-inline-start: 7%;
  top: 25%;
}

/* بطاقة الروتين — تقويم اليوم في هيئة جدول مواعيد. */
.routine {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1rem;
  border-radius: var(--r-xl);
}

.routine-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.routine-date {
  display: flex;
  flex: none;
  flex-direction: column;
  line-height: 1;
}

.routine-date b {
  font-size: clamp(1.9rem, 3vw, 2.35rem);
  font-weight: 600;
  color: var(--coral);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.routine-date small {
  margin-top: 0.15rem;
  color: var(--ink-3);
  font-size: 0.66rem;
  font-weight: 500;
}

.routine-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  padding-top: 0.15rem;
}

.routine-copy h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.routine-copy p {
  color: var(--ink-3);
  font-size: 0.72rem;
  font-weight: 500;
}

.routine-pill {
  flex: none;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  background: rgba(207, 53, 56, 0.09);
  color: var(--coral-deep);
  font-size: 0.64rem;
  font-weight: 600;
}

.week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem;
  padding-block: 0.15rem;
  border-block: 1px solid var(--line);
}

.week span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  padding: 0.3rem 0;
  border-radius: 10px;
  color: var(--ink-3);
  font-size: 0.6rem;
  font-weight: 500;
  line-height: 1;
}

.week b {
  color: var(--ink-2);
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.week .today {
  background: var(--coral);
  color: #fff;
}

.week .today b {
  color: #fff;
}

.routine-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.routine-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--edge);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.52);
}

.rt {
  color: var(--ink-3);
  font-size: 0.66rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.rl {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.3;
}

.rl b {
  font-size: 0.78rem;
  font-weight: 600;
}

.rl small {
  overflow: hidden;
  color: var(--ink-3);
  font-size: 0.67rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rd {
  flex: none;
  padding: 0.05rem 0.35rem;
  border-radius: 5px;
  background: rgba(207, 53, 56, 0.08);
  color: var(--coral-deep);
  font-size: 0.62rem;
  font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────── الأرقام */
/* بطاقات الأرقام: رقم، تسمية، سطر توضيحي. لا أيقونة ولا رسم مصغّر. */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-height: 124px;
  padding: 1rem 1.1rem 1.1rem;
  border-radius: var(--r-lg);
}

.stat-num {
  font-size: clamp(1.7rem, 2.6vw, 2.1rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 0.76rem;
  font-weight: 500;
}

.stat.coral .stat-label {
  color: rgba(255, 255, 255, 0.95);
}

.stat-sub {
  margin-top: auto;
  padding-top: 0.6rem;
  color: var(--ink-3);
  font-size: 0.68rem;
  font-weight: 500;
}

.stat.coral .stat-sub {
  color: rgba(255, 255, 255, 0.8);
}

/* ─────────────────────────────────────────────────── ما يضمنه المتجر */
/* شريط واحد بأربعة بنود تفصلها شعرة — لا أربع بطاقات منفصلة. */
.quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0.2rem;
  border-radius: var(--r-lg);
}

.qcard {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border-inline-start: 1px solid var(--line);
}

.qcard:first-child {
  border-inline-start: 0;
}

.qico {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-3);
}

.qico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qcopy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.35;
}

.qcopy b {
  font-size: 0.76rem;
  font-weight: 500;
}

.qcopy small {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 0.66rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────────────────────── الأقسام */
.panel {
  padding: var(--gap);
  border-radius: var(--r-xl);
}

.section {
  display: flex;
  flex-direction: column;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.9rem;
}

.section-head h2 {
  font-size: 1.16rem;
  font-weight: 600;
}

.section-head p {
  color: var(--ink-2);
  font-size: 0.8rem;
  font-weight: 500;
}

.section > .section-head h2 {
  color: var(--ink);
}

.section > .section-head p {
  color: var(--ink-2);
}

.tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sort-label {
  color: var(--ink-3);
  font-size: 0.75rem;
  font-weight: 500;
}

select {
  min-height: 36px;
  padding-block: 0.3rem;
  padding-inline: 0.8rem 1.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background-color: var(--paper-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%232a1714' stroke-opacity='.55' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
}

[dir='rtl'] select {
  background-position: left 0.75rem center;
}

select:focus-visible {
  border-color: rgba(207, 53, 56, 0.55);
}

/* ────────────────────────────────────────────────────────────── المنتجات */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 214px), 1fr));
  gap: 0.85rem;
}

.product {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.5rem 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper-2);
  transition: border-color 160ms ease, background 160ms ease;
}

@media (hover: hover) {
  .product:hover {
    border-color: rgba(207, 53, 56, 0.32);
    background: #fff;
  }
}

.product:focus-visible {
  outline-offset: 2px;
}

.art-wrap {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 6px;
  background: rgba(255, 246, 240, 0.9);
  overflow: hidden;
}

.art {
  width: 78%;
  height: auto;
}

.art-wrap.lg {
  aspect-ratio: 1;
  min-width: 170px;
}

.art-wrap.sm {
  width: 50px;
  aspect-ratio: 1;
  flex: none;
  border-radius: 8px;
}

.badge {
  position: absolute;
  inset-inline-start: 0.45rem;
  top: 0.45rem;
  padding: 0.1rem 0.4rem;
  border-radius: 5px;
  background: var(--coral);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 600;
  font-style: normal;
}

.spec-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.spec {
  padding: 0.05rem 0.35rem;
  border-radius: 5px;
  background: rgba(42, 23, 20, 0.05);
  color: var(--ink-2);
  font-size: 0.63rem;
  font-weight: 500;
}

.product h3 {
  font-size: 0.9rem;
  font-weight: 600;
}

.desc {
  color: var(--ink-2);
  font-size: 0.76rem;
  line-height: 1.6;
}

.product .desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.meta {
  color: var(--ink-3);
  font-size: 0.68rem;
  font-weight: 500;
}

.price {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.15rem;
}

.price b {
  font-size: 1rem;
  font-weight: 600;
  color: var(--coral);
  font-variant-numeric: tabular-nums;
}

.price s {
  color: var(--ink-3);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.row {
  display: flex;
  align-items: center;
}

.row.gap {
  gap: 0.35rem;
  flex-wrap: wrap;
}

.row .btn {
  flex: 1;
}

.no-results {
  padding: 2.2rem 0;
  color: var(--ink-2);
  font-size: 0.85rem;
  text-align: center;
}

/* ───────────────────────────────────────────────────────────────── الرسوم */
.charts {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: var(--gap);
}

.chart-card {
  display: flex;
  flex-direction: column;
  padding: var(--gap);
  border-radius: var(--r-xl);
}

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.chart-head h2 {
  font-size: 1rem;
  font-weight: 600;
}

.chart-head p {
  color: var(--ink-2);
  font-size: 0.75rem;
  font-weight: 500;
}

.chart-avg {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.chart-avg span {
  color: var(--ink-3);
  font-size: 0.63rem;
  font-weight: 500;
}

.chart-avg b {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--coral);
  font-variant-numeric: tabular-nums;
}

.chart-avg small {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--ink-3);
}

.pill {
  padding: 0.22rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
  color: var(--ink-2);
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.pill:hover {
  background: #fff;
  color: var(--ink);
}

.pill.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.bars {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 8.5rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
}

.bar-name {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.bar-track {
  height: 8px;
  border-radius: 4px;
  background: rgba(42, 23, 20, 0.07);
  overflow: hidden;
}

.bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: var(--coral);
  transform: scaleX(var(--w, 0));
  transform-origin: right center;
  transition: transform 700ms var(--ease);
}

[dir='ltr'] .bar-fill {
  transform-origin: left center;
}

.bar-row.other .bar-fill {
  background: rgba(42, 23, 20, 0.2);
}

.bar-val {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  min-width: 2.6rem;
  text-align: end;
}

.bar-row.other {
  opacity: 0.55;
}

.donut-wrap {
  position: relative;
  width: min(196px, 70%);
  aspect-ratio: 1;
  margin: 0.7rem auto 0.4rem;
}

#cat-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.donut-seg {
  fill: none;
  stroke-width: 12;
  stroke-linecap: butt;
  transition: opacity 200ms ease;
}

.donut-seg.dim {
  opacity: 0.28;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  pointer-events: none;
}

.donut-center b {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.donut-center small {
  color: var(--ink-3);
  font-size: 0.63rem;
  font-weight: 500;
}

.legend {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: min(268px, 100%);
  margin: 0.35rem auto 0;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem 0.35rem;
  border-radius: 9px;
  font-size: 0.72rem;
  font-weight: 500;
}

.legend li.dim {
  opacity: 0.45;
}

.legend .sw {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 3px;
}

.legend .lname {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.legend .lnum {
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* ─────────────────────────────────────────────────── لماذا / الخطوات */
/* ثلاثة أعمدة على قاعدة واحدة، بلا صناديق: النص نفسه هو العنصر. */
.bento,
.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(42, 23, 20, 0.18);
}

.feature h3,
.step h3 {
  margin-bottom: 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.feature p,
.step p {
  color: var(--ink-2);
  font-size: 0.8rem;
  line-height: 1.7;
}

.steps {
  counter-reset: step;
}

.step {
  counter-increment: step;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 0.5rem;
  color: var(--coral);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 0.74rem;
  font-weight: 500;
}

.foot-brand {
  font-size: 0.95rem;
  font-weight: 600;
}

.site-foot a {
  text-underline-offset: 3px;
}

/* ─────────────────────────────────────────────────── النوافذ والسلة */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  border: 0;
  background: rgba(42, 23, 20, 0.4);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade 220ms ease both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal {
  position: fixed;
  z-index: 100;
  inset-inline: 0;
  top: 50%;
  width: min(92vw, 620px);
  max-height: 88vh;
  margin-inline: auto;
  padding: 1.15rem;
  overflow-y: auto;
  border-radius: var(--r-xl);
  background: var(--glass-2);
  translate: 0 -50%;
  animation: pop-in 340ms var(--ease) both;
}

@keyframes pop-in {
  from {
    opacity: 0;
    scale: 0.96;
  }
}

.quick-view {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}

.quick-copy {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quick-copy h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.quick.demo {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.demo h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.drawer {
  position: fixed;
  z-index: 100;
  inset-block: 0.8rem;
  inset-inline-end: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: min(92vw, 386px);
  padding: 1.05rem;
  border-radius: var(--r-xl);
  background: var(--glass-2);
  animation: slide 380ms var(--ease) both;
}

@keyframes slide {
  from {
    opacity: 0;
    translate: -26px 0;
  }
}

[dir='ltr'] .drawer {
  animation-name: slide-ltr;
}

@keyframes slide-ltr {
  from {
    opacity: 0;
    translate: 26px 0;
  }
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-head h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

.ship {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
}

.ship-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--ink-2);
}

.ship-top b {
  font-weight: 600;
  color: var(--coral);
  font-variant-numeric: tabular-nums;
}

.ship-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(42, 23, 20, 0.08);
  overflow: hidden;
}

.ship-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  background: var(--coral);
  transform: scaleX(var(--w, 0));
  transform-origin: right center;
  transition: transform 420ms var(--ease);
}

[dir='ltr'] .ship-track i {
  transform-origin: left center;
}

.ship.done .ship-track i {
  background: var(--good);
}

.ship.done .ship-top b {
  color: var(--good);
}

.cart-lines {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.cart-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper-2);
}

.grow {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  line-height: 1.35;
}

.ln {
  overflow: hidden;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cart-line .price {
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  color: var(--ink-3);
  font-size: 0.7rem;
}

.cart-line .price b {
  color: var(--ink-2);
  font-size: 0.72rem;
}

.stepper {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.25rem;
}

.step-btn {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-2);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 180ms ease;
}

.step-btn:hover {
  background: #fff;
}

.qty {
  min-width: 1.1rem;
  font-style: normal;
  font-size: 0.76rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.ghost {
  flex: none;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color 180ms ease;
}

.ghost:hover {
  color: var(--coral);
}

.cart-empty {
  display: grid;
  flex: 1;
  place-items: center;
  padding: 2rem 0;
  color: var(--ink-2);
  font-size: 0.82rem;
  text-align: center;
}

.cart-foot {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cart-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.25rem 0.15rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.cart-total b {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--coral);
  font-variant-numeric: tabular-nums;
}

.toast {
  position: fixed;
  z-index: 150;
  inset-inline: 0;
  bottom: 4.2rem;
  width: max-content;
  max-width: 90vw;
  margin-inline: auto;
  padding: 0.5rem 1.05rem;
  border-radius: var(--pill);
  background: var(--ink);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  box-shadow: 0 14px 28px -18px rgba(42, 23, 20, 0.55);
  animation: pop-in 260ms var(--ease) both;
}

/* ─────────────────────────────────────────────────────── شارة القالب */
/* ─────────────────────────────────────────────────────────────── الحركة */
/* الحركة تشرح تغيّراً: عنوان يدخل، مقياس يمتلئ، زر يستجيب.
   لا شيء يتحرّك بلا سبب، وكل شيء يتوقّف عند prefers-reduced-motion. */

@keyframes rise {
  from {
    opacity: 0;
    translate: 0 16px;
  }
}

@keyframes dot-in {
  from {
    opacity: 0;
    scale: 0.55;
  }
}

html.motion .hero-card > .kicker,
html.motion .hero-card > h2,
html.motion .hero-card > .hero-lead,
html.motion .hero-card > .hero-cta,
html.motion .ring-wrap {
  animation: rise 620ms var(--ease) both;
}

html.motion .hero-card > .kicker {
  animation-delay: 40ms;
}

html.motion .hero-card > h2 {
  animation-delay: 110ms;
}

html.motion .hero-card > .hero-lead {
  animation-delay: 180ms;
}

html.motion .hero-card > .hero-cta {
  animation-delay: 250ms;
}

html.motion .ring-wrap {
  animation-delay: 120ms;
}

html.motion .orbit .dot {
  animation: dot-in 420ms var(--ease) both;
}

html.motion .orbit .dot:nth-child(1) {
  animation-delay: 360ms;
}

html.motion .orbit .dot:nth-child(2) {
  animation-delay: 420ms;
}

html.motion .orbit .dot:nth-child(3) {
  animation-delay: 480ms;
}

html.motion .orbit .dot:nth-child(4) {
  animation-delay: 540ms;
}

html.motion .orbit .dot:nth-child(5) {
  animation-delay: 600ms;
}

html.motion .orbit .dot:nth-child(6) {
  animation-delay: 660ms;
}

/* الأقسام: تدخل مرة واحدة، بتأخير متتابع داخل المجموعة نفسها. */
html.motion [data-rise] {
  opacity: 0;
  translate: 0 18px;
  transition: opacity 520ms var(--ease), translate 560ms var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}

html.motion [data-rise].in {
  opacity: 1;
  translate: none;
}

.art {
  transition: scale 240ms var(--ease);
}

@media (hover: hover) {
  .product:hover .art {
    scale: 1.04;
  }
}

/* ───────────────────────────────────────────────────────────── الاستجابة */
/* ─────────────────────────────────────────────── سطح المكتب: مقياس أكبر */
/* الشاشة العريضة ليست هاتفاً ممدوداً: نوع أكبر، إطار أوسع، وشريط يمتدّ. */
@media (min-width: 1024px) {
  :root {
    --gap: 1.5rem;
  }

  /* الشاشة العريضة غرفة واحدة: الشريط ثابت، والمحتوى وحده يمرّ.
     فلا تطول الصفحة ولا يسبح الشريط في الفراغ. */
  html,
  body {
    height: 100%;
  }

  body {
    overflow: hidden;
    font-size: 16px;
  }

  .shell {
    height: 100dvh;
  }

  .side {
    position: relative;
    height: 100%;
  }

  .stage {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
    scroll-padding-top: 1rem;
  }

  .stage::-webkit-scrollbar {
    width: 10px;
  }

  .stage::-webkit-scrollbar-track {
    background: transparent;
  }

  .stage::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: var(--pill);
    background: rgba(42, 23, 20, 0.18) padding-box;
  }

  .stage::-webkit-scrollbar-thumb:hover {
    background-color: rgba(42, 23, 20, 0.3);
  }

  .greet h1 {
    font-size: clamp(1.5rem, 1.7vw, 1.85rem);
  }

  .hero-card h2 {
    font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  }

  .section-head h2 {
    font-size: 1.26rem;
  }

  .section-head p {
    font-size: 0.84rem;
  }

  .chart-head h2 {
    font-size: 1.08rem;
  }

  .chart-head p {
    font-size: 0.8rem;
  }

  .stat-num {
    font-size: clamp(1.85rem, 2.6vw, 2.25rem);
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .stat-sub {
    font-size: 0.7rem;
  }

  .qcopy b {
    font-size: 0.8rem;
  }

  .qcopy small {
    font-size: 0.7rem;
  }

  .product h3 {
    font-size: 0.96rem;
  }

  .desc {
    font-size: 0.8rem;
  }

  .meta {
    font-size: 0.72rem;
  }

  .spec {
    font-size: 0.68rem;
  }

  .bar-name {
    font-size: 0.78rem;
  }

  .bar-val {
    font-size: 0.76rem;
  }

  .legend li {
    font-size: 0.76rem;
  }

  .feature h3,
  .step h3 {
    font-size: 1rem;
  }

  .feature p,
  .step p {
    font-size: 0.84rem;
  }
}

@media (max-width: 1180px) {
  .hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  }

  .charts {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  }

  .bar-row {
    grid-template-columns: minmax(0, 7rem) minmax(0, 1fr) auto;
  }
}

@media (max-width: 1080px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero,
  .charts {
    grid-template-columns: minmax(0, 1fr);
  }

  .ring-wrap {
    width: 150px;
  }
}

@media (max-width: 880px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.85rem;
    gap: 0.85rem;
  }

  .stage,
  main {
    gap: 0.85rem;
  }

  /* الترويسة: زر القائمة ثم الترحيب في صفّ واحد، والإجراءات تحته. */
  .top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.55rem 0.65rem;
    padding: 0.15rem 0.1rem 0;
  }

  .menu-btn {
    display: grid;
  }

  .head-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  /* الشريط الجانبي: درج منزلق خارج الشاشة، لا عمود يضغط المحتوى.
     مخفيّ افتراضياً (visibility) فلا يدخل حقلُه في ترتيب الـTab. */
  .side {
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 70;
    width: min(86vw, 340px);
    height: 100dvh;
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform 320ms var(--ease), visibility 0s linear 320ms;
  }

  [dir='rtl'] .side {
    transform: translateX(100%);
  }

  html.drawer-open .side {
    visibility: visible;
    transform: translateX(0);
    transition: transform 320ms var(--ease), visibility 0s;
  }

  .side-panel {
    height: 100%;
    max-height: 100dvh;
    padding: 0.9rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-block: 0;
    border-inline-start: 0;
    border-start-end-radius: var(--r-xl);
    border-end-end-radius: var(--r-xl);
    box-shadow: 0 30px 70px -30px rgba(58, 24, 18, 0.6);
  }

  .menu-close {
    display: grid;
  }

  .side-backdrop {
    z-index: 65;
  }

  /* خلفية الصفحة لا تُمرَّر تحت الدرج. */
  html.drawer-open,
  html.drawer-open body {
    overflow: hidden;
  }

  .quick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qcard:nth-child(odd) {
    border-inline-start: 0;
  }

  .qcard:nth-child(n + 3) {
    border-block-start: 1px solid var(--line);
  }

  .hero,
  .charts {
    grid-template-columns: minmax(0, 1fr);
  }

  .ring-wrap {
    width: 150px;
  }

  .bento,
  .steps {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stats,
  .quick,
  .hero,
  .charts {
    gap: 0.85rem;
  }
}

/* على الهاتف والشاشات الصغيرة: كل بطاقة في عمود واحد. */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }
}

/* عمود واحد لا يعني صورة مربّعة بعرض الشاشة: بين 481 و768 تصبح البطاقة
   أفقية (العبوة يميناً والتفاصيل بجانبها) فتبقى مقروءة بلا تمرير طويل. */
@media (min-width: 481px) and (max-width: 768px) {
  .product {
    display: grid;
    grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.3rem;
    align-items: start;
  }

  .product > .art-wrap {
    grid-row: 1 / span 6;
  }
}

@media (max-width: 620px) {
  .hero-card {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.7rem;
  }

  .ring-wrap {
    width: 108px;
    margin-top: 1.6rem;
  }

  .orbit .dot {
    width: 24px;
    height: 24px;
  }

  .stat {
    min-height: 112px;
    padding: 0.85rem;
  }

  .quick-view {
    grid-template-columns: 1fr;
  }

  .drawer {
    inset: auto 0 0;
    width: 100%;
    max-height: 86vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }

  .site-foot {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 400px) {
  .hero-card {
    grid-template-columns: 1fr;
  }

  .ring-wrap {
    grid-column: 1;
    grid-row: auto;
    width: 96px;
    margin: 0.4rem auto 1.2rem;
  }

  .quick {
    grid-template-columns: 1fr;
  }

  .qcard {
    border-inline-start: 0;
  }

  .qcard + .qcard {
    border-block-start: 1px solid var(--line);
  }
}

/* المتصفحات بلا backdrop-filter: سطح معتم بدل شفافية غير مقروءة. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass,
  .modal,
  .drawer {
    background: rgba(255, 250, 246, 0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .ring-fg {
    stroke-dashoffset: 52.8;
  }

  .bar-fill {
    transform: scaleX(var(--w, 0));
  }

  [data-rise] {
    opacity: 1;
    translate: none;
  }
}


/* ═══════════════════════════════════════════ الجوال: ترويسة لاصقة وأقراص وسلة عائمة */
/* الأقراص الأفقية نسخة من أقسام الشريط الجانبي — مخفية على سطح المكتب. */
.m-chips {
  display: none;
}

.cart-bar {
  display: none;
}

@media (max-width: 880px) {
  /* الترويسة تبقى ظاهرة أثناء التمرير: زر القائمة والسلة واللغة في متناول الإبهام. */
  .top {
    position: sticky;
    inset-block-start: 0;
    z-index: 20;
    margin-inline: -0.35rem;
    padding: 0.6rem 0.6rem 0.5rem;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    background: rgba(255, 246, 240, 0.78);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    box-shadow: 0 8px 24px -18px rgba(42, 23, 20, 0.45);
  }

  .m-chips {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-block: 0.15rem;
  }

  .m-chips::-webkit-scrollbar {
    display: none;
  }

  .m-chips .chip {
    flex: none;
    scroll-snap-align: start;
    width: auto;
    padding-inline: 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 0 0 1px var(--line);
  }

  .m-chips .chip.on {
    background: var(--ink);
    color: #fff;
    box-shadow: none;
  }

  .m-chips .chip.on::before {
    background: #fff;
    border-color: #fff;
  }

  /* أهداف لمس لا تقل عن 44px (WCAG 2.5.5) */
  .btn,
  .btn.sm,
  .chip,
  .menu-btn,
  .icon-btn,
  select,
  .step-btn,
  .del {
    min-height: 44px;
  }

  .menu-btn,
  .icon-btn,
  .step-btn,
  .del {
    min-width: 44px;
  }

  /* ترويسة مدمجة: القائمة والعنوان والإجراءات في صفّ واحد، والأقراص تحته —
     الترويسة اللاصقة يجب ألا تأكل ربع الشاشة. */
  .top {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    row-gap: 0.45rem;
  }

  .head-actions {
    grid-column: auto;
    gap: 0.4rem;
  }

  .greet h1 {
    font-size: clamp(1.05rem, 0.9rem + 1.2vw, 1.3rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .greet p {
    display: none;
  }

  /* نص «السلة» يُخفى بصرياً فقط: يبقى اسماً مقروءاً لقارئ الشاشة */
  .cart-btn [data-i18n=cart] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .head-actions .btn {
    padding-inline: 0.75rem;
  }

  /* نصوص ثانوية مقروءة: لا شيء أصغر من 12px، ويكبر بنعومة مع العرض */
  .spec,
  .badge,
  .stat-sub,
  .stat-label,
  .qcopy small,
  .week small,
  .week span,
  .legend,
  .meta,
  .greet p,
  .sort-label,
  .chip-label,
  .routine-pill,
  .rt,
  .rd,
  .routine small,
  .routine-list small,
  .kicker,
  .routine-copy p,
  .price s,
  .lname,
  .lnum,
  #main .chart-avg,
  #main .chart-avg span,
  .bar-name,
  .bar-val,
  #main small {
    font-size: clamp(0.75rem, 0.7rem + 0.3vw, 0.8125rem);
  }

  .desc {
    font-size: clamp(0.85rem, 0.8rem + 0.3vw, 0.95rem);
    line-height: 1.6;
  }

  /* البطاقة: عمود مرن، والأزرار مثبّتة في الأسفل مهما اختلف طول الوصف */
  .grid {
    align-items: stretch;
  }

  .product .row.gap {
    margin-block-start: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  /* شريط السلة العائم: يحمل العدد والإجمالي ويفتح الدرج */
  .cart-bar:not([hidden]) {
    position: fixed;
    inset-inline: 12px;
    inset-block-end: calc(12px + env(safe-area-inset-bottom));
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 56px;
    padding: 0.5rem 0.6rem 0.5rem 1.1rem;
    padding-inline: 0.6rem 1.1rem;
    border: 0;
    border-radius: var(--r-lg);
    background: rgba(42, 23, 20, 0.9);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #fff;
    font: inherit;
    font-weight: 600;
    box-shadow: 0 18px 40px -16px rgba(42, 23, 20, 0.7);
    cursor: pointer;
    animation: cart-bar-in 420ms cubic-bezier(0.16, 1, 0.3, 1);
    transition: transform 200ms ease, background 200ms ease;
  }

  .cart-bar:active {
    transform: scale(0.98);
  }

  .cart-bar:focus-visible {
    outline: 3px solid var(--coral);
    outline-offset: 3px;
  }

  .cb-count {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding-inline: 0.4rem;
    border-radius: 999px;
    background: var(--coral);
    font-variant-numeric: tabular-nums;
  }

  .cb-label {
    flex: 1;
    text-align: start;
  }

  .cb-total {
    font-variant-numeric: tabular-nums;
  }

  /* مسافة أسفل المحتوى كي لا يغطي الشريط آخر بطاقة أو التذييل */
  #main {
    padding-block-end: 84px;
  }
}

/* بين 481 و880: بطاقتان عموديتان متساويتا الارتفاع بدل البطاقة الأفقية الواحدة —
   البطاقة الأفقية داخل عمودين تضغط الأزرار خارج حدودها. */
@media (min-width: 481px) and (max-width: 880px) {
  .grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  }

  .product {
    display: flex;
    align-items: stretch;
  }

  .product > .art-wrap {
    grid-row: auto;
  }
}

@keyframes cart-bar-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

@media (hover: hover) {
  .cart-bar:hover {
    background: rgba(42, 23, 20, 1);
  }
}
