﻿@charset "UTF-8";
/* =============================================================
   متجر النظارات — واجهة الموقع
   تصميم عربي (RTL) حديث: ثيم بصري هادئ، بطاقات ناعمة، ووضع ليلي تلقائي.
   لا مكتبات ولا خطوط خارجية — الصفحة تعمل كاملة بلا إنترنت غير موقعها.
   ============================================================= */

:root {
  --ink:        #0f172a;
  --ink-soft:   #475569;
  --muted:      #64748b;
  --line:       #e2e8f0;
  --bg:         #f1f5f9;
  --surface:    #ffffff;
  --surface-2:  #f8fafc;

  --brand:      #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --accent:     #0ea5e9;

  --ok:         #16a34a;
  --warn:       #d97706;
  --err:        #dc2626;

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;

  --sh-1: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
  --sh-2: 0 4px 12px rgba(15,23,42,.07), 0 2px 4px rgba(15,23,42,.05);
  --sh-3: 0 18px 40px rgba(15,23,42,.13), 0 4px 12px rgba(15,23,42,.07);

  --head-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:       #e8edf6;
    --ink-soft:  #b6c2d4;
    --muted:     #8fa0b6;
    --line:      #263248;
    --bg:        #0b1120;
    --surface:   #131c2f;
    --surface-2: #172136;
    --brand:     #818cf8;
    --brand-dark:#6366f1;
    --brand-soft:#1e2542;
    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 4px 14px rgba(0,0,0,.45);
    --sh-3: 0 18px 44px rgba(0,0,0,.55);
  }
}

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

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

body {
  margin: 0;
  font-family: Cairo, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  /* الخط يتنفّس مع عرض الشاشة بدل قفزات نقاط التوقف */
  font-size: clamp(15px, .55vw + 13.5px, 17px);
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  direction: rtl;
}

/* هالتان لونيّتان خفيفتان خلف الصفحة — تكسران بياض الخلفية بلا صور */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60rem 30rem at 100% -10%, rgba(79,70,229,.10), transparent 60%),
    radial-gradient(45rem 28rem at -10% 8%, rgba(14,165,233,.08), transparent 60%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }

/* ── الترويسة ──────────────────────────────────────────────── */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  min-height: var(--head-h);
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-block: .5rem;
}

/* ــ الهوية ــ */
.brand { display: flex; align-items: center; gap: .65rem; margin-inline-end: auto; min-width: 0; }

.brand-logo {
  width: 42px; height: 42px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface-2);
  padding: 4px;
  flex: none;
}

/* الشعار المرسوم: يظهر حين لا صورة مرفوعة */
.brand-mark {
  width: 44px; height: 44px;
  flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 34%, transparent);
}
.brand-mark svg {
  width: 26px; height: auto;
  fill: none; stroke: #fff; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong {
  font-weight: 800; font-size: 1.08rem; color: var(--ink);
  letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-text em {
  font-style: normal; font-size: .7rem; color: var(--muted);
  letter-spacing: .16em; text-transform: uppercase;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ــ التنقّل ــ */
.nav { display: flex; gap: .2rem; }
.nav a {
  padding: .5rem .9rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 600; font-size: .95rem;
  white-space: nowrap;
  transition: background .18s, color .18s;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.on { color: var(--brand); background: var(--brand-soft); }

/* ــ زر الاتصال ــ */
.call {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem 1.05rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff !important;
  font-weight: 700; font-size: .92rem;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent);
  transition: transform .18s, box-shadow .18s, background .18s;
  flex: none;
}
.call:hover { background: var(--brand-dark); transform: translateY(-1px); }
.call .ico { width: 1.05rem; height: 1.05rem; fill: currentColor; }
.call-num { direction: ltr; }

/* الجوال: القائمة تنزل سطراً مستقلاً، والرقم يصير أيقونة — بدلاً من شريط مكسور */
@media (max-width: 700px) {
  .head-inner { flex-wrap: wrap; row-gap: .5rem; }
  .nav {
    order: 3; width: 100%;
    justify-content: space-between;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: .2rem;
  }
  .nav a { flex: 1; text-align: center; font-size: .88rem; padding: .45rem .5rem; }
  .call { padding: .55rem; }
  .call-num { display: none; }
  .brand-mark, .brand-logo { width: 38px; height: 38px; }
}
/* ── الأزرار ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit; font-weight: 700;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, background .18s, border-color .18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 34%, transparent);
}
.btn.primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 12px 26px color-mix(in srgb, var(--brand) 42%, transparent); }

.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--sh-1);
}
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-2px); box-shadow: var(--sh-2); }

/* ── الواجهة الرئيسية ──────────────────────────────────────── */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(1.5rem, 4vw, 3rem); text-align: center; }
.hero h1 {
  margin: 0 0 .75rem;
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, var(--ink), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { margin: 0 auto .6rem; max-width: 62ch; color: var(--ink-soft); font-size: clamp(1rem, 1.6vw, 1.15rem); }
.hero-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.6rem; }

/* ── المزايا ───────────────────────────────────────────────── */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: clamp(1.5rem, 4vw, 3rem) 0;
}
.feature {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem 1.35rem;
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
/* شريط لوني يظهر عند التحويم — لمسة حركة بلا صور */
.feature::after {
  content: "";
  position: absolute; inset-inline: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: scaleX(0);
  transform-origin: inline-start;
  transition: transform .28s ease;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.feature:hover::after { transform: scaleX(1); }
.feature h3 { margin: 0 0 .4rem; font-size: 1.08rem; font-weight: 800; }
.feature p  { margin: 0; color: var(--muted); font-size: .95rem; }

/* ── الأقسام ───────────────────────────────────────────────── */
.block { margin: clamp(2rem, 5vw, 3.5rem) 0; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.block-head h2, .page-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -.01em;
}
.page-title { margin: clamp(1.5rem, 4vw, 2.5rem) 0 1rem; }

/* ── شبكة المنتجات ─────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: clamp(.85rem, 2vw, 1.35rem);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: transform .22s cubic-bezier(.22,.61,.36,1), box-shadow .22s, border-color .22s;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-3);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
}

.thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--brand) 7%, var(--surface-2)));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; padding: 12%; transition: transform .35s ease; }
.card:hover .thumb img { transform: scale(1.06); }

/* الخضراء لصفحة المنتج («متوفر»)، والحمراء للكتالوج («غير متوفر») */
.badge {
  position: absolute; inset-block-start: .6rem; inset-inline-start: .6rem;
  padding: .24rem .7rem;
  border-radius: 999px;
  font-size: .74rem; font-weight: 800;
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
  color: var(--ok);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  backdrop-filter: blur(6px);
}
.badge.out { background: color-mix(in srgb, var(--err) 13%, var(--surface)); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }

.card-body { padding: .95rem 1rem 1.15rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.02rem; font-weight: 700; line-height: 1.45; }
.card-body .muted { font-size: .87rem; }
.price {
  margin: .45rem 0 0;
  font-size: 1.16rem; font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* ── المرشّحات والترقيم ────────────────────────────────────── */
.filters {
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .9rem 1rem;
  box-shadow: var(--sh-1);
  margin-bottom: 1.25rem;
}
.filters input[type="text"], .filters input[type="search"], .filters select {
  font: inherit;
  padding: .6rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  min-width: 0;
  transition: border-color .18s, box-shadow .18s;
}
.filters input:focus, .filters select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.filters input[type="text"], .filters input[type="search"] { flex: 1 1 14rem; }

.count { margin: 0 0 1rem; font-size: .92rem; }
.empty {
  text-align: center; color: var(--muted);
  padding: 3.5rem 1rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.pager { display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap; margin: 2rem 0; }
.pager a, .pager span {
  min-width: 2.6rem; padding: .5rem .8rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-weight: 700; font-size: .92rem;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .on, .pager span.on {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 30%, transparent);
}
.pager .gap { border: 0; background: none; color: var(--muted); min-width: 1.5rem; padding-inline: .2rem; }

/* ── نداء الإجراء ─────────────────────────────────────────── */
.cta {
  margin: clamp(2rem, 5vw, 3.5rem) 0;
  padding: clamp(1.75rem, 4vw, 3rem);
  border-radius: var(--r-lg);
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: var(--sh-3);
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(28rem 14rem at 80% -20%, rgba(255,255,255,.28), transparent 60%);
}
.cta > * { position: relative; }
.cta h2 { margin: 0 0 .5rem; font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 800; }
.cta p  { margin: 0 0 1.35rem; opacity: .93; }
.cta .btn { background: #fff; color: var(--brand); border-color: transparent; }
.cta .btn:hover { background: #fff; color: var(--brand-dark); }

/* ── تتبّع الطلب ───────────────────────────────────────────── */
.track-form {
  display: flex; gap: .6rem; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .85rem;
  box-shadow: var(--sh-1);
  margin-bottom: .85rem;
}
.track-form input {
  flex: 1 1 16rem;
  font: inherit;
  padding: .72rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  /* الرمز لاتيني داخل صفحة عربية — تثبيت الاتجاه يمنع انقلاب ترتيبه */
  direction: ltr; text-align: start;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .04em;
}
.track-form input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

.hint { font-size: .9rem; margin: .35rem 0 1.5rem; }

.order {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: clamp(1.15rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}
.order-head {
  display: flex; flex-wrap: wrap; gap: .6rem 1.75rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.5rem;
}
.order-head > div { display: flex; flex-direction: column; gap: .1rem; }
/* الترميز يستعمل .muted للعناوين الصغيرة — القاعدة تتبعه لا اسماً لا وجود له */
.order-head .muted { font-size: .78rem; font-weight: 600; letter-spacing: .02em; }
.order-head b, .order-head strong { font-size: 1.06rem; font-weight: 800; }

/* شريط المراحل: عمودي على الجوال، أفقي على الشاشات الأوسع */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.step {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  align-items: center;
  gap: .85rem;
  padding: .7rem 0;
}
/* الخط الواصل بين النقاط */
.step::before {
  content: "";
  position: absolute;
  inset-inline-start: 1.25rem;
  top: 50%; bottom: -50%;
  width: 2px;
  transform: translateX(50%);
  background: var(--line);
}
.step:last-child::before { display: none; }
.step.done::before { background: var(--ok); }

.dot {
  width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center;
  border-radius: 50%;
  font-weight: 800; font-size: .95rem;
  background: var(--surface-2);
  color: var(--muted);
  border: 2px solid var(--line);
  position: relative; z-index: 1;
  transition: transform .2s, background .2s, color .2s, border-color .2s;
}
.step.done .dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.now  .dot {
  background: var(--brand); border-color: var(--brand); color: #fff;
  transform: scale(1.1);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 18%, transparent);
  animation: pulse 2.1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 18%, transparent); }
  50%      { box-shadow: 0 0 0 12px color-mix(in srgb, var(--brand) 6%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .step.now .dot { animation: none; }
  html { scroll-behavior: auto; }
}

.lbl { font-weight: 600; color: var(--muted); }
.step.done .lbl { color: var(--ink-soft); }
.step.now  .lbl { color: var(--ink); font-weight: 800; }

@media (min-width: 720px) {
  .steps { grid-auto-flow: column; grid-auto-columns: 1fr; }
  .step { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: .55rem; padding: .5rem .25rem; }
  .step::before {
    inset-inline-start: 50%; inset-inline-end: -50%;
    top: 1.25rem; bottom: auto;
    width: auto; height: 2px;
    transform: none;
  }
  .lbl { font-size: .88rem; }
}

.status-now {
  margin: 1.5rem 0 0;
  padding: .95rem 1.15rem;
  border-radius: var(--r);
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  color: var(--ink);
  font-weight: 700;
}

.timeline { margin-top: 1.5rem; }
.timeline .t { color: var(--muted); font-size: .84rem; }

.contact-strip {
  display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; justify-content: center;
  padding: 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
}

/* ── التنبيهات ────────────────────────────────────────────── */
.alert {
  padding: 1rem 1.15rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-1);
  margin-bottom: 1.25rem;
  border-inline-start: 4px solid var(--muted);
}
.alert.err  { border-inline-start-color: var(--err);  background: color-mix(in srgb, var(--err) 6%, var(--surface)); }
.alert.warn { border-inline-start-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }

/* ── ماسح الكاميرا ────────────────────────────────────────── */
.scan-wrap { margin-bottom: .85rem; }
.scan-btn { width: 100%; }
.scan-btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.scan-stage {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
  box-shadow: var(--sh-2);
  aspect-ratio: 4 / 3;
  max-height: 62vh;
}
.scan-stage video { width: 100%; height: 100%; object-fit: cover; }

/* إطار التصويب — أربع زوايا لا مربع كامل، فلا يحجب المشهد */
.scan-frame { position: absolute; inset: 12%; pointer-events: none; }
.scan-frame span { position: absolute; width: 2rem; height: 2rem; border: 3px solid #fff; }
.scan-frame span:nth-child(1) { top: 0; inset-inline-start: 0; border-inline-end: 0; border-bottom: 0; border-start-start-radius: 8px; }
.scan-frame span:nth-child(2) { top: 0; inset-inline-end: 0; border-inline-start: 0; border-bottom: 0; border-start-end-radius: 8px; }
.scan-frame span:nth-child(3) { bottom: 0; inset-inline-start: 0; border-inline-end: 0; border-top: 0; border-end-start-radius: 8px; }
.scan-frame span:nth-child(4) { bottom: 0; inset-inline-end: 0; border-inline-start: 0; border-top: 0; border-end-end-radius: 8px; }

.scan-close {
  position: absolute; top: .6rem; inset-inline-end: .6rem;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,.55);
  color: #fff; font-size: 1rem; line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.scan-msg {
  position: absolute; inset-inline: 0; bottom: 0;
  margin: 0; padding: .7rem 1rem;
  text-align: center;
  color: #fff; font-size: .9rem; font-weight: 600;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}

/* ── التذييل ──────────────────────────────────────────────── */
.site-foot {
  margin-top: clamp(2.5rem, 6vw, 4.5rem);
  background: var(--surface);
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .93rem;
}

.foot-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.2fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  padding: clamp(1.75rem, 4vw, 3rem) 0;
}

.foot-col { min-width: 0; }

.foot-brand strong {
  display: block;
  font-size: 1.1rem; font-weight: 800;
  color: var(--ink);
  margin-bottom: .5rem;
}
.foot-brand p { margin: 0; color: var(--muted); line-height: 1.8; }

.foot-title {
  margin: 0 0 .85rem;
  font-size: .8rem; font-weight: 800;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.foot-links { display: flex; flex-direction: column; gap: .5rem; }
.foot-links a {
  color: var(--ink-soft);
  width: fit-content;
  transition: color .18s, transform .18s;
}
/* إزاحة لطيفة عند التحويم — تتبع اتجاه الصفحة تلقائياً */
.foot-links a:hover { color: var(--brand); transform: translateX(-3px); }
[dir="ltr"] .foot-links a:hover { transform: translateX(3px); }

.foot-contact { display: flex; flex-direction: column; gap: .7rem; }
.foot-contact a, .foot-contact .hours {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--ink-soft);
  transition: color .18s;
}
.foot-contact a:hover { color: var(--brand); }
.foot-contact .hours { color: var(--muted); }
.foot-contact .ico {
  width: 1.6rem; height: 1.6rem;
  flex: none;
  padding: .32rem;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
/* أيقونة واتساب مصمتة لا خطّية — شكلها المعروف يعتمد التعبئة */
.foot-contact .wa .ico { fill: currentColor; stroke: none; padding: .3rem; }
.foot-contact .wa:hover { color: #25d366; }
.foot-contact .wa:hover .ico { border-color: color-mix(in srgb, #25d366 45%, transparent); }

.foot-bottom {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  padding: .9rem 0;
}
.copy { margin: 0; text-align: center; font-size: .85rem; color: var(--muted); }

@media (max-width: 860px) {
  .foot-inner { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .foot-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}
/* الجوال: بطاقتان في الصفّ لا واحدة.
   بعمود واحد يملأ مربّع الصورة الشاشة فيرى الزائر صنفين في كل تمريرة —
   وأغلب الزيارات من الجوال. */
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .card-body { padding: .7rem .75rem .85rem; gap: .15rem; }
  .card-body h3 { font-size: .92rem; line-height: 1.4; }
  .card-body .muted { font-size: .78rem; }
  .price { font-size: 1rem; margin-top: .3rem; }
  .card-add { margin: 0 .5rem .55rem; padding: .38rem .4rem; font-size: .76rem; }
  .badge { font-size: .66rem; padding: .18rem .5rem; }
  /* «استفسر عبر واتساب» يلتفّ سطرين في عمودٍ ضيّق — تبقى الكلمة الدالّة */
  .wa-long { display: none; }
}

/* ── بطاقة المنتج: رابط + زر واتساب ────────────────────────── */
/* الرابط يلفّ الصورة والنصّ فقط — الزر شقيقه لا ابنه، فالروابط لا تتداخل */
.card-link { display: flex; flex-direction: column; flex: 1; color: inherit; min-width: 0; }
.card-link:hover { color: inherit; }
.card-link:hover h3 { color: var(--brand); }
.card-body h3 { transition: color .18s; }

.card-wa {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  margin: 0 .8rem .8rem;
  padding: .55rem .8rem;
  border-radius: var(--r-sm);
  font-size: .88rem; font-weight: 700;
  color: #128c4a;
  background: color-mix(in srgb, #25d366 12%, var(--surface));
  border: 1px solid color-mix(in srgb, #25d366 32%, transparent);
  transition: background .18s, color .18s, border-color .18s;
}
.card-wa:hover { background: #25d366; border-color: #25d366; color: #fff; }
.card-wa svg { width: 1.05rem; height: 1.05rem; fill: currentColor; flex: none; }
@media (prefers-color-scheme: dark) { .card-wa { color: #4ade80; } }

/* ── بديل الصورة: حرف بلون ثابت للصنف ──────────────────────── */
/* أفضل من مربّع رمادي متكرّر: الكتالوج غالباً بلا صور (رفعها خطوة يدوية)،
   وشبكةٌ من رماديات متطابقة تبدو معطوبة لا مقصودة. */
.mono {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 800;
  letter-spacing: .02em;
  color: hsl(var(--mono-h) 62% 42%);
  background:
    linear-gradient(140deg,
      hsl(var(--mono-h) 70% 95%),
      hsl(calc(var(--mono-h) + 28) 65% 88%));
  transition: transform .35s ease;
}
.card:hover .mono { transform: scale(1.05); }
@media (prefers-color-scheme: dark) {
  .mono {
    color: hsl(var(--mono-h) 70% 76%);
    background: linear-gradient(140deg,
      hsl(var(--mono-h) 34% 20%), hsl(calc(var(--mono-h) + 28) 30% 15%));
  }
}

/* ── شريط الفرز ───────────────────────────────────────────── */
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.list-head .count { margin: 0; }
.sort { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--muted); }
.sort select {
  font: inherit; font-size: .9rem; font-weight: 600;
  padding: .45rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.sort select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }

/* ── صفحة المنتج ──────────────────────────────────────────── */
.crumbs { display: flex; gap: .4rem; align-items: center; font-size: .88rem; color: var(--muted); margin: 1.25rem 0 .75rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: clamp(1rem, 2.5vw, 1.75rem);
}
.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--r);
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-2), color-mix(in srgb, var(--brand) 7%, var(--surface-2)));
  display: grid; place-items: center;
}
.product-media img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.product-media .mono { font-size: clamp(3.5rem, 12vw, 7rem); }

.product-info h1 { margin: 0 0 .35rem; font-size: clamp(1.35rem, 3vw, 2rem); font-weight: 800; line-height: 1.35; }
.product-sub { margin: 0 0 1rem; color: var(--muted); }
.product-price { margin: 0 0 1.25rem; font-size: clamp(1.5rem, 3.5vw, 2.1rem); font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }

.stock { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .92rem; margin-bottom: 1.25rem; }
.stock::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.stock.in  { color: var(--ok); }
.stock.out { color: var(--err); }

.specs { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--line); }
.specs li { display: flex; gap: 1rem; justify-content: space-between; padding: .65rem .1rem; border-bottom: 1px solid var(--line); font-size: .94rem; }
.specs .k { color: var(--muted); }
.specs .v { font-weight: 700; }
.specs .v.code { direction: ltr; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; }

.product-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn.wa { background: #25d366; color: #fff; box-shadow: 0 6px 18px rgba(37,211,102,.32); }
.btn.wa:hover { background: #1eb457; color: #fff; transform: translateY(-2px); }
.btn.wa svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }

@media (max-width: 760px) {
  .product { grid-template-columns: 1fr; }
  .product-media { aspect-ratio: 4 / 3; }
}

/* ── زورونا ───────────────────────────────────────────────── */
.visit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: clamp(2rem, 5vw, 3.5rem) 0;
}
.visit-card {
  display: flex; gap: .9rem; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.25rem;
  box-shadow: var(--sh-1);
  color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
a.visit-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); color: inherit; }
.visit-card .ico {
  width: 2.4rem; height: 2.4rem; flex: none;
  padding: .55rem;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.visit-card h3 { margin: 0 0 .25rem; font-size: .96rem; font-weight: 800; }
.visit-card p  { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.7; }

/* ── زر السلّة في الترويسة ─────────────────────────────────── */
.cartbtn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.6rem; height: 2.6rem;
  flex: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  box-shadow: var(--sh-1);
  transition: color .18s, border-color .18s, transform .18s;
}
.cartbtn:hover { color: var(--brand); border-color: var(--brand); transform: translateY(-1px); }
.cartbtn.on { color: var(--brand); border-color: var(--brand); background: var(--brand-soft); }
.cartbtn .ico {
  width: 1.25rem; height: 1.25rem;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* العدّاد على الحافة الخارجية — تتبع اتجاه الصفحة تلقائياً */
.cart-count {
  position: absolute; top: -.3rem; inset-inline-end: -.3rem;
  min-width: 1.15rem; height: 1.15rem;
  padding-inline: .25rem;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: .68rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--surface);
}

/* ── زر «أضف إلى السلّة» على البطاقة ───────────────────────── */
.card-add {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  margin: 0 .85rem .85rem;
  padding: .42rem .7rem;
  border-radius: 999px;
  font: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  border: 1px solid transparent;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 26%, transparent);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.card-add:hover  { transform: translateY(-1px); box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 34%, transparent); }
.card-add:active { transform: translateY(1px); }
.card-add svg {
  width: .92rem; height: .92rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
/* حالة «أُضيف»: تأكيدٌ في مكان الضغط بلا رسالة تقفز ولا انتقال يقطع التصفّح */
.card-add.added, .btn.added { background: var(--ok); box-shadow: 0 4px 12px color-mix(in srgb, var(--ok) 30%, transparent); }

/* ── صفحة السلّة ──────────────────────────────────────────── */
.cart {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.cart-list { list-style: none; margin: 0; padding: 0; }

.cart-row {
  display: grid;
  grid-template-columns: 5rem 1fr auto auto auto;
  align-items: center;
  gap: 1rem;
  padding: .9rem clamp(.8rem, 2vw, 1.25rem);
  border-bottom: 1px solid var(--line);
}
.cart-row:last-child { border-bottom: 0; }

.cart-thumb {
  width: 5rem; height: 4rem;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  display: grid; place-items: center;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.cart-thumb .mono { font-size: 1.35rem; }

.cart-info { min-width: 0; }
.cart-info a { font-weight: 700; color: var(--ink); }
.cart-info a:hover { color: var(--brand); }
.cart-info p { margin: .15rem 0 0; font-size: .86rem; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button {
  width: 2rem; height: 2rem;
  border: 0; background: var(--surface-2); color: var(--ink);
  font: inherit; font-size: 1.05rem; font-weight: 800;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.qty button:hover { background: var(--brand); color: #fff; }
.qty span { min-width: 2.2rem; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

.cart-line { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; white-space: nowrap; }

.cart-del {
  width: 2rem; height: 2rem;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--muted);
  font-size: .9rem; cursor: pointer;
  transition: background .15s, color .15s;
}
.cart-del:hover { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }

.cart-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 1rem clamp(.8rem, 2vw, 1.25rem);
  background: var(--surface-2);
  border-top: 1px solid var(--line);
}
.cart-total { display: flex; align-items: baseline; gap: .6rem; }
.cart-total strong { font-size: 1.35rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }

.cart-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1.25rem 0 2rem; }
.cart-actions .btn { flex: 1 1 12rem; }

@media (max-width: 640px) {
  .cart-row { grid-template-columns: 4rem 1fr auto; row-gap: .6rem; }
  .cart-thumb { width: 4rem; height: 3.4rem; }
  .cart-del  { grid-column: 3; grid-row: 1; }
  .qty       { grid-column: 2; grid-row: 2; justify-self: start; }
  .cart-line { grid-column: 3; grid-row: 2; }
}

/* ── نافذة تأكيد الطلب ────────────────────────────────────── */
/* ‏display المصرَّح يتغلّب على السمة hidden (‏display:none في ورقة المتصفّح),
   فبدون :not([hidden]) تظهر النافذة فور فتح الصفحة. */
.modal { position: fixed; inset: 0; z-index: 100; padding: 1rem; }
.modal:not([hidden]) { display: grid; place-items: center; }
.modal-back { position: absolute; inset: 0; background: rgba(15,23,42,.55); backdrop-filter: blur(3px); }

.modal-card {
  position: relative;
  width: min(30rem, 100%);
  max-height: 90vh; overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: clamp(1.25rem, 3vw, 1.9rem);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0 } to { transform: none; opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .modal-card { animation: none } }

.modal-card h2 { margin: 0 0 .3rem; font-size: 1.3rem; font-weight: 800; }
.modal-card > .muted { margin: 0 0 1.15rem; font-size: .92rem; }

.modal-x {
  position: absolute; top: .7rem; inset-inline-end: .7rem;
  width: 2rem; height: 2rem;
  border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted);
  cursor: pointer; font-size: .85rem;
}
.modal-x:hover { background: var(--brand-soft); color: var(--brand); }

.fld { display: block; margin-bottom: .85rem; }
.fld > span { display: block; margin-bottom: .3rem; font-size: .9rem; font-weight: 700; color: var(--ink-soft); }
.fld input, .fld textarea {
  width: 100%;
  font: inherit;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  resize: vertical;
}
.fld input:focus, .fld textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
/* الهاتف لاتيني داخل صفحة عربية — تثبيت الاتجاه يمنع انقلاب ترتيبه */
#coPhone { direction: ltr; text-align: start; letter-spacing: .03em; }

/* الشرَك: بعيد عن العين وعن قارئ الشاشة، وليس display:none — بعض الروبوتات
   تتخطّى المخفيّ بذلك وتملأ ما عداه */
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

.co-sum { margin: .2rem 0 1rem; font-size: .9rem; font-weight: 700; }
.modal-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.modal-actions .btn { flex: 1 1 9rem; }

.done-mark {
  width: 3.5rem; height: 3.5rem; margin: .5rem auto 1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ok) 15%, var(--surface));
  color: var(--ok);
  font-size: 1.8rem; font-weight: 800;
}
#coDone { text-align: center; }
#coDone h3 { margin: 0 0 .4rem; font-size: 1.15rem; font-weight: 800; }
#coDone p  { margin: 0 0 .4rem; }

/* ── لوحة صاحب المحل ──────────────────────────────────────── */
.owner-gate { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.gate-card {
  width: min(24rem, 100%);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: clamp(1.5rem, 4vw, 2.25rem);
}
.gate-card .brand-mark { margin: 0 auto .9rem; }
.gate-card h1 { margin: 0 0 .2rem; font-size: 1.35rem; font-weight: 800; }
.gate-card > .muted { margin: 0 0 1.5rem; }
.gate-card .fld { text-align: start; }
.gate-card .btn { width: 100%; margin-top: .4rem; }
.gate-foot { margin: 1.1rem 0 0; font-size: .88rem; }

.owner-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-1);
  margin-bottom: 1.5rem;
}
.owner-head .head-inner { justify-content: space-between; }
.logout-form { margin: 0; }

/* أزرار المدى: أسئلة صاحب المحل «اليوم؟ الأسبوع؟» لا حقول تاريخ */
.ranges { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.ranges a {
  padding: .5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 700; font-size: .92rem;
  transition: background .18s, color .18s, border-color .18s;
}
.ranges a:hover { border-color: var(--brand); color: var(--brand); }
.ranges a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  padding: 1.15rem 1.25rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.kpi-cap { font-size: .85rem; font-weight: 700; color: var(--muted); }
.kpi strong {
  font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.kpi-sub { font-size: .82rem; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  padding: clamp(1rem, 2.5vw, 1.5rem);
  margin-bottom: 1.5rem;
}
.panel h2 { margin: 0 0 1.15rem; font-size: 1.1rem; font-weight: 800; }

/* أعمدة بـCSS لا مكتبة رسم: بضعة أرقام لا تستحق ٢٠٠ ك.ب جافاسكربت */
.bars { display: flex; align-items: flex-end; gap: .35rem; height: 11rem; overflow-x: auto; padding-bottom: .2rem; }
.bar { flex: 1 1 0; min-width: 1.6rem; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-fill {
  width: 100%;
  height: var(--h);
  margin-top: auto;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--brand), color-mix(in srgb, var(--accent) 70%, var(--brand)));
  transition: filter .18s;
}
.bar:hover .bar-fill { filter: brightness(1.12); }
.bar-lbl { margin-top: .35rem; font-size: .68rem; color: var(--muted); direction: ltr; white-space: nowrap; }

/* الجدول يمرَّر أفقياً وحده — تسعة أعمدة لا تدخل شاشة جوال */
.tablewrap { overflow-x: auto; }
.rep { width: 100%; border-collapse: collapse; font-size: .92rem; white-space: nowrap; }
.rep th, .rep td { padding: .65rem .8rem; border-bottom: 1px solid var(--line); text-align: center; }
.rep th { font-weight: 800; color: var(--muted); font-size: .82rem; background: var(--surface-2); }
.rep th:first-child, .rep td:first-child { text-align: start; }
.rep tbody tr:hover { background: var(--surface-2); }
.rep .num { font-variant-numeric: tabular-nums; }
.rep .b { font-weight: 800; color: var(--ink); }
.rep .neg { color: var(--err); }
.rep tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 800; background: var(--surface-2); }
.stamp { margin: 1rem 0 0; font-size: .84rem; }

/* ── درج السلّة الجانبي ───────────────────────────────────── */
.drawer { position: fixed; inset: 0; z-index: 120; }
.drawer[hidden] { display: none; }
.drawer-back {
  position: absolute; inset: 0;
  background: rgba(15,23,42,.5);
  opacity: 0; transition: opacity .22s ease;
}
.drawer.in .drawer-back { opacity: 1; }

/* ينزلق من حافة بداية القراءة — يميناً بالعربية ويساراً بالإنجليزية */
.drawer-panel {
  position: absolute; inset-block: 0; inset-inline-start: 0;
  width: min(24rem, 100%);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-inline-end: 1px solid var(--line);
  box-shadow: var(--sh-3);
  transform: translateX(var(--slide, 100%));
  transition: transform .24s cubic-bezier(.22,.61,.36,1);
}
[dir="rtl"] .drawer-panel { --slide: -100%; }
.drawer.in .drawer-panel { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .drawer-panel, .drawer-back { transition: none; }
}

.drawer-head {
  display: flex; align-items: center; gap: .6rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
}
.drawer-head strong { font-size: 1.05rem; font-weight: 800; }
.drawer-n { font-size: .82rem; color: var(--muted); margin-inline-end: auto; }
.drawer-x {
  width: 2rem; height: 2rem; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--muted);
  cursor: pointer; font-size: .82rem;
}
.drawer-x:hover { background: var(--brand-soft); color: var(--brand); }

.drawer-list { list-style: none; margin: 0; padding: .5rem 0; overflow-y: auto; flex: 1; }
.drawer-list li {
  display: grid;
  grid-template-columns: 3.4rem 1fr auto auto;
  align-items: center; gap: .7rem;
  padding: .7rem 1.15rem;
  border-bottom: 1px solid var(--line);
}
.dr-thumb {
  width: 3.4rem; height: 3rem;
  border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface-2);
  display: grid; place-items: center;
}
.dr-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.dr-thumb .mono { font-size: 1rem; }
.dr-info { min-width: 0; }
.dr-info a { display: block; font-size: .9rem; font-weight: 700; color: var(--ink); line-height: 1.4; }
.dr-info a:hover { color: var(--brand); }
.dr-info p { margin: .15rem 0 0; font-size: .84rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.dr-x {
  width: 1.7rem; height: 1.7rem; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer; font-size: .78rem;
}
.dr-x:hover { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }

.qty.sm button { width: 1.6rem; height: 1.6rem; font-size: .92rem; }
.qty.sm span { min-width: 1.7rem; font-size: .88rem; }

.drawer-empty { display: none; padding: 3rem 1.15rem; text-align: center; color: var(--muted); flex: 1; }
.drawer.is-empty .drawer-empty { display: block; }
.drawer.is-empty .drawer-list, .drawer.is-empty .drawer-foot .btn.primary,
.drawer.is-empty .drawer-sum { display: none; }

.drawer-foot { padding: 1rem 1.15rem; border-top: 1px solid var(--line); background: var(--surface-2); }
.drawer-sum { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .85rem; }
.drawer-sum span { color: var(--muted); font-size: .9rem; }
.drawer-sum strong { font-size: 1.25rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.drawer-foot .btn { width: 100%; }
.drawer-foot .btn + .btn { margin-top: .5rem; }

/* ── العدّاد داخل البطاقة (بعد الإضافة) ────────────────────── */
/* في مواقع التسوّق لا يبقى زر «أضف» بعد الإضافة — يصير عدّاداً في مكانه */
.card-buy { margin-top: auto; }
.card-step {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 .85rem .85rem;
  padding: .18rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
  background: var(--brand-soft);
}
.card-step[hidden] { display: none; }
.card-step button {
  width: 1.9rem; height: 1.9rem;
  border: 0; border-radius: 50%;
  background: var(--surface); color: var(--brand);
  font: inherit; font-size: 1rem; font-weight: 800;
  cursor: pointer;
  box-shadow: var(--sh-1);
  transition: background .15s, color .15s;
}
.card-step button:hover { background: var(--brand); color: #fff; }
.card-step span {
  flex: 1; text-align: center;
  font-weight: 800; font-size: .92rem; color: var(--brand);
  font-variant-numeric: tabular-nums;
}

/* ── صندوق الشراء في صفحة الصنف ───────────────────────────── */
.buybox { display: flex; gap: .6rem; align-items: stretch; margin-bottom: .85rem; flex-wrap: wrap; }
.buybox .qty { border-radius: 999px; flex: none; }
.buybox .qty button { width: 2.6rem; min-height: 2.9rem; }
.buybox .qty span { min-width: 2.8rem; font-size: 1rem; }
.btn.buy { flex: 1 1 12rem; min-height: 2.9rem; font-size: 1rem; }

@media (max-width: 560px) {
  .card-step { margin: 0 .5rem .55rem; }
  .card-step button { width: 1.6rem; height: 1.6rem; font-size: .9rem; }
  .card-step span { font-size: .84rem; }
}

/* ── مساعدات ──────────────────────────────────────────────── */
/* خيار «المتوفر فقط»: عبارةٌ بجوار مربّع اختيار لا شارة حالة.
   كانت خضراء عريضة (تصادم أسماء مع .badge على الأرجح) فتُقرأ كأنها نتيجة. */
.check {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .93rem; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; user-select: none;
  padding-inline: .2rem;
}
.check input { accent-color: var(--brand); width: 1.05rem; height: 1.05rem; cursor: pointer; }

@media print {
  .site-head, .site-foot, .track-form, .scan-wrap, .hero-actions, .cta { display: none !important; }
  body { background: #fff; }
  body::before { display: none; }
  .order { box-shadow: none; border-color: #999; }
}
