/* خط عربي/لاتيني موحّد بكل الأوزان: Cairo variable ذاتي الاستضافة (OFL) — CSP font-src 'self'. */
@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+0870-089F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+0660-0669;}
@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+0131,U+0152-0153,U+2000-206F,U+2074,U+20AC,U+2122,U+2212;}
/* أمان — "Soft Care": واجهة تأمين هادئة فاتحة، بطاقات بيضاء عائمة على قماش رمادي،
   تدرّج دافئ برتقالي→مرجاني في بطاقة الهيرو، أزرار إسبريسو داكنة مستديرة بالكامل،
   رقاقات فئات خوخية، ظلال ناعمة محايدة، وتباعد واسع.
   مرجع Dribbble: Insurance Mobile App UI (Paperpillar/Ghani Pradita) — ألوان اللقطة.
   صفر تبعيات · خطوط النظام فقط (CSP: style-src 'self') · RTL بخصائص منطقية.
   المنطق (app.ts) لم يتغيّر — كل id/class محفوظة. */

:root {
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 14px;
  --r-pill: 999px;
  --sans: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
  --num: ui-rounded, "SF Pro Rounded", system-ui, sans-serif;

  --bg: #ececec;
  --card: #ffffff;
  --card-2: #f6f3f0;
  --card-3: #efeae5;
  --panel: #ffffff;
  --ink: #1e1816;
  --ink-strong: #1e1816;
  --muted: #6f6762;
  --faint: #857b73;
  --line: #e6e1dc;
  --line-soft: #efeae5;

  --a1: #e8623a;   /* برتقالي صدئ */
  --a2: #f3936b;   /* مرجاني */
  --a-ink: #ffffff;
  --a-soft: #f7e6dd;  /* خوخي فاتح للرقاقات */
  --ok: #4f8a3d;
  --warn: #c9972b;
  --off: #c0472f;

  --soft: 0 18px 42px -28px rgb(30 24 22 / 0.2);
  --soft-sm: 0 10px 24px -18px rgb(30 24 22 / 0.18);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
/* سمة hidden تُخفي دائماً — تمنع بقاء الدرج/النافذة ظاهرة حتى لو ضبط صنفها display. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; overflow-x: hidden; }
body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0; min-height: 100dvh; color: var(--ink); font-family: var(--sans); line-height: 1.6;
  -webkit-font-smoothing: antialiased; color-scheme: light;
  background:
    radial-gradient(1100px 480px at 88% -8%, rgb(232 98 58 / 0.07), transparent 60%),
    var(--bg);
}

.container { width: min(1240px, 94%); margin-inline: auto; }

/* ── أزرار ─────────────────────────────────────────────────────────── */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 800; font-size: 0.9rem; padding: 0.68rem 1.2rem; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; cursor: pointer; text-decoration: none;
  transition: transform 0.16s var(--ease), background 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--soft-sm); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--a1); }
/* الزر الأساسي: حبّة إسبريسو داكنة كما في اللقطة */
.btn.primary { background: var(--ink-strong); border-color: transparent; color: #fff; box-shadow: 0 14px 28px -16px rgb(30 24 22 / 0.5); }
.btn.primary:hover { background: #2c2420; box-shadow: 0 18px 34px -16px rgb(30 24 22 / 0.6); }
.btn.ghosty { background: var(--card); }
.btn.sm { font-size: 0.82rem; padding: 0.5rem 0.9rem; }
.link-btn { appearance: none; border: 0; background: none; font: inherit; font-weight: 800; font-size: 0.82rem; color: var(--muted); cursor: pointer; padding: 0.4rem 0; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }
.icon-btn { appearance: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 2.4rem; height: 2.4rem; border-radius: var(--r-pill); font-size: 1.3rem; line-height: 1; cursor: pointer; display: grid; place-items: center; }

/* ── الترويسة ──────────────────────────────────────────────────────── */
.site-head { position: sticky; top: 0; z-index: 50; padding-block: 0.8rem; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(16px); border-block-end: 1px solid var(--line-soft); }
.head-in { display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 900; letter-spacing: -0.01em; color: inherit; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; font-size: 1.1rem; font-weight: 900; color: #fff; background: linear-gradient(140deg, var(--a2), var(--a1)); box-shadow: 0 10px 20px -12px rgb(232 98 58 / 0.6); }
.brand-name { font-weight: 900; }
.nav { display: flex; gap: 0.3rem; margin-inline: auto; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.9rem; padding: 0.45rem 0.85rem; border-radius: var(--r-pill); transition: color 0.16s, background 0.16s; }
.nav a:hover { color: var(--ink); background: var(--card); }
.head-actions { display: flex; align-items: center; gap: 0.5rem; }
.cart-btn .cart-count { margin-inline-start: 0.4rem; background: var(--a1); color: #fff; font-weight: 900; font-size: 0.74rem; border-radius: var(--r-pill); padding: 0.05rem 0.42rem; }
@media (max-width: 760px) { .nav { display: none; } }

/* ── الهيرو: بطاقة ترحيب دافئة + بطاقات إحصاء ──────────────────────── */
.hero { display: grid; gap: 12px; margin-block: clamp(1.4rem, 4vw, 2.6rem); grid-template-columns: repeat(5, 1fr); align-items: stretch; }
.hero > div:first-child { grid-column: span 3; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(1.5rem, 3.4vw, 2.6rem); box-shadow: var(--soft); display: flex; flex-direction: column; justify-content: center; }
.hero-panel {
  grid-column: span 2; position: relative; overflow: hidden; min-height: 260px; border-radius: var(--r-xl);
  background: linear-gradient(150deg, #f3a07f, #e8623a 55%, #c44730);
  box-shadow: var(--soft); display: grid; place-items: center;
}
.hero-panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 60% at 25% 15%, rgb(255 255 255 / 0.35), transparent 60%); pointer-events: none; }
.hero-panel svg, .hero-panel > * { position: relative; max-width: 72%; }
.kicker { display: inline-flex; align-items: center; gap: 0.4rem; width: fit-content; padding: 0.42rem 0.9rem; border-radius: var(--r-pill); background: var(--a-soft); border: 1px solid color-mix(in srgb, var(--a1) 22%, var(--line)); font-size: 0.75rem; font-weight: 800; color: var(--a1); }
.hero h1 { margin: 1rem 0 0; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.12; font-weight: 900; letter-spacing: -0.03em; text-wrap: balance; }
.hero-lead { margin: 0.95rem 0 0; max-width: 46ch; color: var(--muted); font-size: 1.02rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; grid-column: 1 / -1; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.2rem; box-shadow: var(--soft-sm); display: flex; flex-direction: column; gap: 0.15rem; transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--soft); }
.stat b { font-family: var(--num); font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--a1); }
.stat span { font-size: 0.78rem; font-weight: 700; color: var(--muted); }
@media (max-width: 880px) { .hero { grid-template-columns: 1fr; } .hero > div:first-child, .hero-panel { grid-column: 1 / -1; } .hero-panel { min-height: 200px; } }

/* شريط متحرّك خفيف */
.marquee { overflow: hidden; margin-block: 0.4rem; }
.marquee-track { display: flex; gap: 2.4rem; width: max-content; padding-block: 0.4rem; animation: am-marq 28s linear infinite; }
.marquee-track span { font-weight: 800; letter-spacing: 0.02em; color: var(--faint); font-size: 0.86rem; }
.marquee-track span:nth-child(odd) { color: var(--a1); }
@keyframes am-marq { to { transform: translateX(-50%); } }
[dir="rtl"] .marquee-track { animation-direction: reverse; }

/* ── الأقسام ───────────────────────────────────────────────────────── */
.section { margin-block: clamp(2.2rem, 5vw, 3.4rem); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-block-end: 1.4rem; }
.section-head h2 { margin: 0; font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 900; letter-spacing: -0.02em; }
.section-head p { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.94rem; max-width: 54ch; }
.tools { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.search-wrap { display: inline-flex; align-items: center; gap: 0.5rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.5rem 0.95rem; color: var(--muted); box-shadow: var(--soft-sm); }
.search-wrap input { appearance: none; border: 0; background: none; color: var(--ink); font: inherit; font-size: 0.88rem; width: min(42vw, 220px); outline: none; }
.sort-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
#sort { appearance: none; background: var(--card); border: 1px solid var(--line); color: var(--ink); font: inherit; font-weight: 700; font-size: 0.82rem; padding: 0.55rem 0.95rem; border-radius: var(--r-pill); cursor: pointer; box-shadow: var(--soft-sm); }

/* رقائق الفئات */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block-end: 1.2rem; }
.chip { appearance: none; font: inherit; font-size: 0.82rem; font-weight: 800; cursor: pointer; color: var(--muted); padding: 0.52rem 1.05rem; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); transition: color 0.16s, background 0.16s, border-color 0.16s, transform 0.16s var(--ease); }
.chip:hover { color: var(--ink); transform: translateY(-1px); }
.chip.on { color: #fff; background: var(--ink-strong); border-color: transparent; }

/* ── شبكة الخطط ────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.product {
  position: relative; display: flex; flex-direction: column; gap: 0.6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 0.8rem;
  box-shadow: var(--soft-sm); transition: transform 0.24s var(--ease), box-shadow 0.24s; isolation: isolate;
}
.product:hover, .product:focus-visible { transform: translateY(-5px); outline: none; box-shadow: var(--soft); }
.art-wrap { position: relative; aspect-ratio: 5 / 4; border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; background: radial-gradient(120% 120% at 30% 10%, var(--a-soft), var(--card-2) 70%); border: 1px solid var(--line-soft); }
.art-wrap svg, .art-wrap > svg { width: 62%; height: 62%; filter: drop-shadow(0 12px 20px rgb(200 90 50 / 0.18)); transition: transform 0.3s var(--ease); }
.product:hover .art-wrap svg { transform: scale(1.05); }
.art-wrap.lg { aspect-ratio: 4 / 3; }
.art-wrap.sm { width: 58px; height: 58px; aspect-ratio: 1; border-radius: var(--r-md); flex: none; }
.art-wrap.sm svg { width: 70%; height: 70%; }
.badge { position: absolute; inset-block-start: 0.65rem; inset-inline-start: 0.65rem; z-index: 2; font-style: normal; font-size: 0.68rem; font-weight: 900; color: var(--a1); background: var(--a-soft); padding: 0.24rem 0.6rem; border-radius: var(--r-pill); }
.spec-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.spec { font-size: 0.68rem; font-weight: 700; color: var(--muted); background: var(--card-2); border: 1px solid var(--line-soft); border-radius: var(--r-pill); padding: 0.2rem 0.55rem; }
.product h3 { margin: 0.1rem 0 0; font-size: 1.04rem; font-weight: 900; letter-spacing: -0.01em; }
.product .desc { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.product .meta { margin: 0; color: var(--faint); font-size: 0.76rem; }
.price { margin-top: auto; font-family: var(--num); font-weight: 900; font-size: 1.2rem; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 0.35rem; }
.price .cur { font-size: 0.78rem; color: var(--muted); font-weight: 800; }
.price .was { font-size: 0.82rem; color: var(--faint); text-decoration: line-through; font-weight: 700; }
.row { display: flex; align-items: center; }
.row.gap { gap: 0.5rem; }
.row.gap .btn { flex: 1; }

/* ── بطاقات "لماذا"/"كيف" ───────────────────────────────────────────── */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .bento { grid-template-columns: 1fr; } }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 1.5rem; box-shadow: var(--soft-sm); }
.feature .ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-family: var(--num); font-size: 1.2rem; font-weight: 900; color: #fff; background: linear-gradient(140deg, var(--a2), var(--a1)); }
.feature h3 { margin: 0.9rem 0 0.35rem; font-size: 1.1rem; font-weight: 900; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 1.5rem; box-shadow: var(--soft-sm); counter-increment: step; }
.step::before { content: counter(step); position: absolute; inset-block-start: 1.2rem; inset-inline-end: 1.3rem; font-family: var(--num); font-size: 2.2rem; font-weight: 900; color: var(--card-3); line-height: 1; }
.step h3 { margin: 0 0 0.35rem; font-size: 1.08rem; font-weight: 900; }
.step p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* ── نافذة سريعة + حجب ──────────────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 70; border: 0; background: rgb(30 24 22 / 0.4); backdrop-filter: blur(5px); cursor: pointer; }
.modal { position: fixed; inset-block-start: 50%; inset-inline-start: 50%; translate: -50% -50%; z-index: 80; width: min(680px, 92vw); max-height: 88dvh; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 1.3rem; box-shadow: 0 44px 90px -40px rgb(30 24 22 / 0.4); animation: am-pop 0.28s var(--ease); }
@keyframes am-pop { from { opacity: 0; translate: -50% -46%; } to { opacity: 1; translate: -50% -50%; } }
.modal .quick-copy { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.9rem; }
.modal h3 { margin: 0; font-size: 1.3rem; font-weight: 900; }
.modal .desc { margin: 0; color: var(--muted); }
.modal .meta { margin: 0; color: var(--faint); font-size: 0.82rem; }

/* ── قائمة الخطط (الدرج) ───────────────────────────────────────────── */
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 80; width: min(420px, 100%); background: var(--panel); border-inline-start: 1px solid var(--line); box-shadow: -34px 0 80px -40px rgb(30 24 22 / 0.3); padding: 1.3rem; display: flex; flex-direction: column; animation: am-slide 0.3s var(--ease); }
@keyframes am-slide { from { transform: translateX(8%); opacity: 0; } to { transform: none; opacity: 1; } }
[dir="rtl"] .drawer { animation-name: am-slide-rtl; }
@keyframes am-slide-rtl { from { transform: translateX(-8%); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-block-end: 0.9rem; }
.drawer-head h2 { margin: 0; font-size: 1.2rem; font-weight: 900; }
.cart-lines { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.cart-line { display: flex; align-items: center; gap: 0.7rem; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0.65rem; }
.cart-line .grow { flex: 1; min-width: 0; }
.cart-line .ln { display: block; font-weight: 800; font-size: 0.88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line .price { font-family: var(--num); font-size: 0.86rem; color: var(--muted); margin: 0; }
.stepper { display: inline-flex; align-items: center; gap: 0.2rem; background: var(--card-3); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 0.15rem; }
.stepper .step { all: unset; cursor: pointer; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; color: var(--ink); }
.stepper .step::before { content: none; }
.stepper .step:hover { background: var(--card); }
.stepper .qty { font-style: normal; font-weight: 900; min-width: 1.4rem; text-align: center; font-variant-numeric: tabular-nums; }
.del { all: unset; cursor: pointer; color: var(--off); font-size: 1.2rem; line-height: 1; padding: 0.2rem 0.3rem; }
.cart-empty { color: var(--muted); text-align: center; padding: 2rem 0; }
.cart-foot { border-block-start: 1px solid var(--line); margin-block-start: 0.9rem; padding-block-start: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; color: var(--muted); }
.cart-total b { font-family: var(--num); font-size: 1.5rem; font-weight: 900; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── إشعار + تذييل ─────────────────────────────────────────────────── */
.toast { position: fixed; inset-inline: 0; inset-block-end: 1.4rem; z-index: 90; margin-inline: auto; width: max-content; max-width: 88%; background: var(--ink-strong); color: #fff; font-weight: 900; font-size: 0.86rem; padding: 0.72rem 1.3rem; border-radius: var(--r-pill); box-shadow: 0 22px 46px -22px rgb(30 24 22 / 0.5); animation: am-toast 0.3s var(--ease); }
.toast h3 { margin: 0; font-size: 0.9rem; }
.toast .desc { display: none; }
@keyframes am-toast { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.site-foot { margin-block-start: 3rem; padding-block: 1.6rem; border-block-start: 1px solid var(--line-soft); }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: 0.82rem; }
.foot-links { display: flex; gap: 0.5rem; }

/* ── كشف + تخطّي ───────────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
.no-results { color: var(--muted); text-align: center; padding: 2rem 0; }
.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 1rem; inset-block-start: 1rem; z-index: 100; background: var(--card); border: 1px solid var(--line); padding: 0.5rem 1rem; border-radius: var(--r-pill); }

/* ── تحسين الخطوط: stack عربي/لاتيني أوضح + تقنين أحرف ومقاسات متّسقة ── */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { text-rendering: optimizeLegibility; font-feature-settings: "kern", "liga", "calt"; }

/* ── برواز مضيء متحرك + شارة بيانات القالب ── */
.tpl-frame{position:fixed;inset:0;z-index:200;pointer-events:none;}
.tpl-frame::before{content:"";position:absolute;inset:0;padding:2.5px;border-radius:0;background:linear-gradient(130deg,var(--a1),var(--a2),var(--a1));background-size:220% 220%;-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask-composite:exclude;animation:tpl-glow 5s ease infinite;opacity:.95;}
.tpl-frame::after{content:"";position:absolute;inset:0;box-shadow:inset 0 0 24px -6px var(--a1);animation:tpl-pulse 3.4s ease-in-out infinite;}
@keyframes tpl-glow{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}
@keyframes tpl-pulse{0%,100%{opacity:.16}50%{opacity:.42}}
.tpl-badge{position:fixed;inset-block-end:calc(12px + env(safe-area-inset-bottom));inset-inline-start:50%;translate:-50% 0;z-index:201;display:inline-flex;align-items:center;gap:.45rem;padding:.4rem .95rem;border-radius:999px;background:var(--a1);color:#fff;font-size:.72rem;font-weight:800;box-shadow:0 12px 26px -12px rgb(0 0 0 / .55);pointer-events:none;white-space:nowrap;}
.tpl-badge b{font-weight:900}
.tpl-badge span{opacity:.8;font-weight:700}
@media (prefers-reduced-motion:reduce){.tpl-frame::before,.tpl-frame::after{animation:none}}
