/* ═══════════════════════════════════════════════════════════════════
   Braik Tech — نظامُ التصميم
   ───────────────────────────────────────────────────────────────────
   لوحةٌ داكنةٌ بلمسةٍ سماويّة، مأخوذةٌ من شعار العلامة (دائرةٌ سوداء
   وعلامةٌ زرقاء). والمرجعُ في البنية easy-unlocker، أمّا اللونُ فلنا:
   الأصفرُ هناك علامتُهم لا علامتُنا.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  /* الأسطح — من الأعمق إلى الأعلى */
  --bg:        #070b14;
  --surface:   #0d1424;
  --raised:    #131c30;
  --border:    #1e2b45;
  --border-lit:#2b3d61;

  /* النصّ */
  --text:      #eaf0fb;
  --muted:     #8fa3c4;
  --dim:       #5f7496;

  /* العلامة */
  --brand:     #2f9bff;
  --brand-lit: #5cb4ff;
  --brand-dim: #12294a;
  --accent:    #22d3ee;

  /* الحالات */
  --ok:        #34d399;
  --warn:      #fbbf24;
  --run:       #fb923c;   /* order in process: orange */
  --err:       #f87171;

  --radius:    14px;
  --radius-sm: 10px;
  --maxw:      1120px;

  --font: "Segoe UI", system-ui, -apple-system, "Noto Naskh Arabic",
          "Noto Sans Arabic", Tahoma, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;

  /* أعمقُ من الخلفيّة (الشريطُ العلويّ والتذييل)، وترويسةٌ شبهُ شفّافة */
  --deep:      #050810;
  --nav-bg:    rgba(7, 11, 20, .9);
  /* ⚠ أرضيّةُ صور الأجهزة ثابتةٌ في الوضعين: الصورُ على خلفيّةٍ سوداء، وعلى
     أرضيّةٍ فاتحةٍ تظهر بحوافَّ رماديّةٍ مقصوصة — لذلك كان الموقعُ داكنًا فقط. */
  --photo:     #0d1424;
  color-scheme: dark;
}

/* ── الوضعُ الفاتح — يختاره الزائر (theme.js) ─────────────────────────
   المتغيّراتُ وحدَها تتبدّل. وألوانُ الحالة والروابط أغمقُ هنا: الأخضرُ
   والأزرقُ الفاتحان المقروءان على الأسود يغيبان على الأبيض. */
:root[data-theme="light"] {
  --bg:        #f3f6fb;
  --surface:   #ffffff;
  --raised:    #eef2f8;
  --border:    #dce3ee;
  --border-lit:#c2cde0;

  --text:      #0f1a2e;
  --muted:     #475774;
  --dim:       #56667f;

  --brand:     #1e88e5;
  --brand-lit: #1565c0;
  --brand-dim: #e2eefc;
  --accent:    #0e7490;

  --ok:        #047857;
  --warn:      #9a4506;
  --run:       #c2410c;
  --err:       #c62828;

  --deep:      #e7ecf4;
  --nav-bg:    rgba(255, 255, 255, .92);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* ⚠ **Scrolling over an open window moved the page behind it.** A modal
 *   <dialog> doesn't stop the page from scrolling: over a short window, or
 *   once a long one hit its end, the wheel and the finger scrolled the price
 *   list underneath instead. While any dialog is open the page is held
 *   still; the gutter stays reserved so nothing shifts sideways when the
 *   scrollbar goes away. */
html { scrollbar-gutter: stable; }
html:has(dialog[open]) { overflow: hidden; }

/* ⚠ **The page bounced on a phone.** Pulled past its top or bottom, the
 *   whole page slid down or up and sprang back (iOS rubber-band, Android
 *   stretch), and the background moved with it (owner's report, 2026-10-05).
 *   The page now stops at its edges. Pull-to-refresh goes with the bounce;
 *   the portal refreshes its orders and top-ups by itself. */
html, body { overscroll-behavior-y: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--brand-lit); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ── الترويسة ──────────────────────────────────────────────────── */

.topbar {
  background: var(--deep);
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  color: var(--muted);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding-block: 7px;
}
.topbar a { color: var(--muted); }
.topbar a:hover { color: var(--brand-lit); }
.topbar .set { display: flex; gap: 18px; flex-wrap: wrap; }

header.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
header.nav .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-block: 13px;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark {
  width: 40px; height: 40px; border-radius: 11px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--brand), #1567c4);
  color: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 4px 16px rgba(47, 155, 255, .32);
}
.brand b { font-size: 1.08rem; letter-spacing: -.01em; display: block; line-height: 1.2; }
.brand small { color: var(--dim); font-size: .74rem; letter-spacing: .04em; }

nav.links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
nav.links a {
  color: var(--muted); padding: 7px 13px; border-radius: var(--radius-sm);
  font-size: .92rem; font-weight: 500;
}
nav.links a:hover { color: var(--text); background: var(--raised); }

/* ── الأزرار ───────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .94rem; font-family: inherit;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(145deg, var(--brand), #1567c4);
  color: #fff; box-shadow: 0 6px 20px rgba(47, 155, 255, .28);
}
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border-lit); color: var(--text); }
.btn-ghost:hover { background: var(--raised); color: var(--text); }
.btn-wa { background: #25d366; color: #052e16; }
.btn-wa:hover { color: #052e16; filter: brightness(1.06); }

/* ── الأقسام ───────────────────────────────────────────────────── */

section { padding: 76px 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--brand-lit); font-size: .8rem; font-weight: 700;
  letter-spacing: .13em; margin-bottom: 14px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 2px; background: var(--brand); flex: none;
}

h1 {
  font-size: clamp(2rem, 5.6vw, 3.5rem); line-height: 1.18;
  letter-spacing: -.025em; margin: 0 0 18px;
}
h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.15rem); line-height: 1.3;
  letter-spacing: -.02em; margin: 0 0 12px;
}
h3 { font-size: 1.05rem; margin: 0 0 7px; }
p.lede { color: var(--muted); font-size: 1.04rem; margin: 0; max-width: 62ch; }

.hl { color: var(--brand-lit); }

/* ── البطل ─────────────────────────────────────────────────────── */

.hero { position: relative; padding: 84px 0 64px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset-block-start: -220px; inset-inline-end: -160px;
  width: 620px; height: 620px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(47,155,255,.18), transparent 68%);
}
.hero .wrap { position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center;
}
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-top: 52px; padding-top: 32px; border-top: 1px solid var(--border);
}
.stat b { display: block; font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.stat span { color: var(--dim); font-size: .76rem; letter-spacing: .1em; font-weight: 600; }

/* لوحُ الفحص — زخرفةٌ حيّة لا صورة */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.panel-head {
  display: flex; align-items: center; gap: 8px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.panel-head i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-lit); }
.panel-head span { margin-inline-start: auto; color: var(--dim); font-size: .74rem; font-family: var(--mono); }
.panel .row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; font-family: var(--mono); font-size: .82rem;
}
.panel .row + .row { border-top: 1px dashed var(--border); }
.panel .row span { color: var(--dim); }
.panel .row b { color: var(--text); font-weight: 600; }
.badge-ok  { color: var(--ok);  font-weight: 700; }
.badge-err { color: var(--err); font-weight: 700; }

/* ── الشبكات ───────────────────────────────────────────────────── */

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover { border-color: var(--border-lit); transform: translateY(-3px); }
.card .ico {
  width: 42px; height: 42px; border-radius: 11px; margin-bottom: 14px;
  display: grid; place-items: center; font-size: 1.25rem;
  background: var(--brand-dim); border: 1px solid var(--border-lit);
}
.card p { color: var(--muted); font-size: .91rem; margin: 0; }
.card .price {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
  display: flex; align-items: baseline; gap: 6px;
}
.card .price b { color: var(--brand-lit); font-size: 1.1rem; }
.card .price span { color: var(--dim); font-size: .8rem; }

/* بطاقةٌ هي رابط: تفتح البوّابةَ على فئتها. */
a.card.link-card { display: block; color: inherit; }
a.card.link-card:hover { color: inherit; }
a.card.link-card .price b::after { content: " ›"; color: var(--dim); }
/* العددُ سطرٌ واحدٌ لا ينكسر، والملاحظةُ تلتفّ تحته في البطاقة الضيّقة —
   لا عمودان متجاوران يُقرأ كلٌّ منهما كلمةً كلمة. */
a.card.link-card .price { flex-wrap: wrap; column-gap: 6px; row-gap: 0; }
a.card.link-card .price b { white-space: nowrap; }

/* خمسُ بطاقاتٍ للشوب: تملأ الصفَّ على الشاشة الواسعة وتلتفّ على الضيّقة. */
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* مُرقَّمة */
.num { counter-reset: n; }
.num .card::before {
  counter-increment: n; content: "0" counter(n);
  display: block; font-family: var(--mono); font-size: 1.5rem;
  color: var(--brand); opacity: .55; font-weight: 700; margin-bottom: 8px;
}

/* ── شريطُ العلامات المتحرّك ───────────────────────────────────── */

.marquee {
  overflow: hidden; border-block: 1px solid var(--border);
  background: var(--surface); padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}
.marquee ul {
  display: flex; gap: 42px; list-style: none; margin: 0; padding: 0;
  width: max-content; animation: slide 34s linear infinite;
}
.marquee li {
  color: var(--dim); font-weight: 700; font-size: .95rem;
  letter-spacing: .05em; white-space: nowrap;
}
@keyframes slide { to { transform: translateX(50%); } }

/* ⚠ من طلب تقليلَ الحركة يُعطَ شريطًا ساكنًا لا شريطًا يدور أبطأ. */
@media (prefers-reduced-motion: reduce) {
  .marquee ul { animation: none; }
  html { scroll-behavior: auto; }
  .btn:hover, .card:hover { transform: none; }
}

/* ── التواصل ───────────────────────────────────────────────────── */

.contact {
  background: linear-gradient(160deg, var(--surface), var(--bg));
  border: 1px solid var(--border); border-radius: 20px; padding: 40px;
  display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center;
}
.chans { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── التذييل ───────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border); background: var(--deep);
  padding: 44px 0 30px; color: var(--muted); font-size: .89rem;
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
footer h4 { color: var(--text); font-size: .82rem; letter-spacing: .1em; margin: 0 0 14px; }
footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
footer .copy {
  margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--dim); font-size: .83rem;
}

/* ── المحمول ───────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .contact, .foot-grid { grid-template-columns: 1fr; }
  section { padding: 56px 0; }
  nav.links { display: none; }
}
@media (max-width: 560px) {
  /* الزرّان جنبًا إلى جنبٍ وسطرُ العلامة لا ينكسر — كانا يتكدّسان عموديًّا
     فيأكلان ربعَ شاشة الهاتف قبل أيّ محتوى. */
  header.nav .wrap { gap: 10px; }
  .nav-cta { display: flex; gap: 6px; flex: none; }
  .nav-cta .btn { padding: 8px 12px; font-size: .82rem; }
  .brand small { white-space: nowrap; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 22px; }
  .contact { padding: 26px; }
  .topbar .set { gap: 12px; }
}

/* ── بطاقةُ جهازٍ معروض ─────────────────────────────────────────── */

.card.product { display:flex; flex-direction:column; }

.card.product .shot {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: var(--photo);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 2rem;
}
.card.product .shot img { width:100%; height:100%; object-fit:cover; }

.card.product .cond { color: var(--muted); font-size: .86rem; margin: 0 0 10px; }

.card.product .specs {
  list-style: none; margin: 0 0 12px; padding: 0;
  display: grid; gap: 5px; font-size: .84rem;
}
.card.product .specs li { display: flex; justify-content: space-between; gap: 10px; }
.card.product .specs span { color: var(--dim); }
.card.product .specs b { color: var(--text); font-weight: 600; }

/* السعرُ آخرَ البطاقة دائمًا مهما اختلف عددُ المواصفات — وإلا تفاوتت
   مواضعُه بين البطاقات في الصفّ الواحد فبدت الشبكةُ مكسورة. */
.card.product .price { margin-top: auto; }

.card.product .price .was {
  color: var(--dim);
  text-decoration: line-through;
  font-size: .86rem;
}

/* ── الأرقامُ في سياقٍ عربيّ ────────────────────────────────────── */
/*
 * ⚠ **رقمٌ مجزّأٌ بمسافاتٍ داخل RTL يُقلَب ترتيبُ مجموعاتِه.**
 *   النصُّ `079 921 4747` ظهر على الشاشة `4747 921 079` — وهو رقمٌ
 *   آخرُ تمامًا يُقرأ ويُحفظ ويُتّصل به فلا يردّ أحد.
 *
 *   و`isolate` لا `embed`: يمنع محيطَ النصّ من التأثير في ترتيبِه
 *   ويمنعه من التأثير في محيطِه.
 */
[data-wa-text] {
  direction: ltr;
  unicode-bidi: isolate;
  font-variant-numeric: tabular-nums;
}

/* ── صفحةُ الأجهزة (/devices/) ─────────────────────────────────── */
.head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 30px;
}
nav.links a[aria-current="page"] { color: var(--text); background: var(--raised); }

.page-head { padding: 52px 0 76px; }
.page-title { font-size: clamp(1.8rem, 4.4vw, 2.6rem); margin-bottom: 12px; }

.dev-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin: 30px 0 18px;
}
.dev-bar .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.dev-bar .chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font-family: inherit; font-size: .87rem; font-weight: 600;
}
.dev-bar .chip:hover { color: var(--text); border-color: var(--border-lit); }
.dev-bar .chip.on { background: var(--brand-dim); border-color: var(--border-lit); color: var(--text); }
.dev-bar .chip .n { color: var(--dim); font-size: .76rem; }
.dev-search {
  max-width: 280px; width: 100%; padding: 10px 13px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--raised); color: var(--text);
  font-family: inherit; font-size: .95rem; margin-inline-start: auto;
}
.dev-search:focus { outline: 2px solid var(--brand); outline-offset: -1px; }

.dev-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
a.card.product { color: inherit; }
a.card.product:hover { color: inherit; }
.dev-empty {
  grid-column: 1 / -1; border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 40px 20px; text-align: center; color: var(--muted);
}
.dev-empty p { margin: 0; }

.back { display: inline-block; color: var(--muted); font-size: .9rem; margin-bottom: 22px; }
.back:hover { color: var(--text); }

.dev-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start; }
.gallery { display: grid; gap: 12px; }
.main-shot {
  aspect-ratio: 1; border-radius: 18px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  display: grid; place-items: center; font-size: 4rem;
}
.main-shot img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumbs button {
  width: 72px; height: 72px; padding: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 2px solid var(--border); background: var(--surface);
}
.thumbs button.on { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }

.cond-tag {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--brand-dim); border: 1px solid var(--border-lit); color: var(--brand-lit);
}
.dev-name { font-size: clamp(1.6rem, 3.6vw, 2.3rem); margin: 12px 0 10px; }
.dev-price { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.dev-price b { font-size: 1.7rem; color: var(--brand-lit); }
.dev-price .was { color: var(--dim); text-decoration: line-through; }
.dev-price .save {
  font-size: .8rem; font-weight: 700; color: var(--ok);
  background: rgba(52,211,153,.12); padding: 2px 10px; border-radius: 999px;
}
.dev-desc { color: var(--muted); margin: 0 0 20px; white-space: pre-line; }
.spec-table {
  width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: .92rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.spec-table th, .spec-table td { padding: 10px 14px; text-align: start; border-top: 1px solid var(--border); }
.spec-table tr:first-child th, .spec-table tr:first-child td { border-top: 0; }
.spec-table th { color: var(--dim); font-weight: 600; width: 42%; }
.dev-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.info .fine { color: var(--dim); font-size: .84rem; margin: 0; }

@media (max-width: 900px) {
  .dev-detail { grid-template-columns: 1fr; gap: 26px; }
  .page-head { padding: 34px 0 56px; }
}
@media (max-width: 560px) {
  .dev-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dev-grid .card.product { padding: 12px; }
  .dev-grid .card.product .specs { display: none; }
  .dev-search { max-width: none; }
}

/* ── Phones and iPhone ──────────────────────────────────────────────
 *
 * ⚠ **iPhone Safari zooms the page into any field under 16px** the moment
 *   it is tapped, and does not zoom back out: the sign-in form, the search
 *   and every dropdown were 15.2px or smaller (measured). 16px on touch
 *   screens stops it. The code fields keep their larger size.
 */
@media (pointer: coarse), (max-width: 900px) {
  input:not([type=checkbox]):not([type=radio]):not([name=code]), select, textarea {
    font-size: 16px !important;
  }
}

/* Finger-sized targets: footer and top-bar links were 19–23px tall. */
@media (pointer: coarse), (max-width: 560px) {
  footer ul { gap: 2px; }
  footer ul a, .topbar a, .copy a, .back { display: inline-block; padding-block: 9px; }
  .topbar .wrap { padding-block: 2px; }
}

/* ── Phone menu: a drawer from the side, after gsmjordan's ──────────
 *
 * ⚠ **On a phone the site had no menu at all.** nav.links is hidden under
 *   900px and nothing replaced it: Devices, How it works and Contact were
 *   unreachable except by scrolling. The drawer is a modal <dialog>, so
 *   Esc, the backdrop and focus come from the browser, not from our code.
 */
.menu-btn {
  display: none; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border-lit); background: transparent; color: var(--text);
}
.menu-btn svg { width: 22px; height: 22px; }
@media (max-width: 900px) { .menu-btn { display: grid; } }
@media (max-width: 560px) { header.nav .nav-cta { display: none; } }

dialog.drawer {
  margin: 0; padding: 0; border: 0; inset-inline-start: 0; inset-inline-end: auto;
  width: min(86vw, 340px); max-width: none;
  height: 100vh; height: 100dvh; max-height: none;
  background: var(--surface); color: var(--text);
  box-shadow: 10px 0 40px rgba(0, 0, 0, .5);
  overflow-y: auto; overscroll-behavior: contain;
}
dialog.drawer::backdrop { background: rgba(3, 6, 12, .62); }
dialog.drawer[open] { animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.drawer[open] { animation: none; } }

.drawer-top { background: linear-gradient(145deg, var(--brand), #1567c4); color: #fff; padding: 12px 16px 16px; }
.drawer-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.drawer-head .x {
  width: 42px; height: 42px; display: grid; place-items: center; flex: none;
  background: none; border: 0; color: #fff; font-size: 1.5rem; cursor: pointer; border-radius: 10px;
}
.drawer-head .x:hover { background: rgba(255, 255, 255, .14); }
.drawer-head b { font-size: 1.25rem; letter-spacing: -.01em; }
.drawer-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-cta .btn { justify-content: center; padding: 12px 10px; box-shadow: none; }
.drawer-cta .light { background: #eef4ff; color: #0d1424; }
.drawer-cta .dark { background: #0d1424; color: #fff; }
.drawer-who { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .92rem; }
.drawer-who b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

.drawer-sec {
  padding: 18px 20px 8px; color: var(--dim);
  font-size: .76rem; font-weight: 700; letter-spacing: .12em;
}
.drawer .item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  padding: 15px 20px; border: 0; border-top: 1px solid var(--border);
  background: none; color: var(--text); font-family: inherit; font-size: 1.02rem;
  text-align: start; cursor: pointer; text-decoration: none;
}
.drawer .item::after { content: "›"; color: var(--dim); font-size: 1.35rem; line-height: 1; }
.drawer .item:hover, .drawer .item:focus-visible { background: var(--raised); color: var(--text); outline: none; }
.drawer .item.on { color: var(--brand-lit); background: var(--brand-dim); }
.drawer .item.danger { color: var(--err); }
.drawer-end { height: 24px; }

/* ── Light / dark switch (theme.js) ───────────────────────────────────
   The sun shows in dark mode (press for light), the moon in light. */
.theme-btn {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border-lit); background: transparent; color: var(--text);
}
.theme-btn:hover { background: var(--raised); }
.theme-btn svg { width: 19px; height: 19px; }
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
@media (max-width: 900px) { .theme-btn { width: 44px; height: 44px; } }

/* ── English / Arabic switch (i18n.js) ─────────────────────────────── */
.lang-btn {
  display: inline-grid; place-items: center; flex: none;
  height: 40px; padding: 0 12px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border-lit); background: transparent; color: var(--text);
  font: inherit; font-weight: 700; font-size: .88rem; white-space: nowrap;
}
.lang-btn:hover { background: var(--raised); }
@media (max-width: 900px) { .lang-btn { height: 44px; } }

/* ── Arabic: right to left ─────────────────────────────────────────────
 * The layout already uses start/end, not left/right, so it mirrors by
 * itself; these are the few things that don't.
 *
 * ⚠ letter-spacing tears Arabic apart: the letters of a word are joined,
 *   and spacing between them breaks the joins (the uppercase eyebrows and
 *   section labels are spaced for Latin).
 */
html[lang="ar"] body * { letter-spacing: 0 !important; }
[dir="rtl"] .drawer .item::after { content: "‹"; }
[dir="rtl"] .drawer-head .x { transform: scaleX(-1); }
/* The IMEI panel imitates an English terminal: it stays left to right, or
   "35•• •••• •••• 918" reads backwards. */
[dir="rtl"] .panel { direction: ltr; }

/* The drawer slides in from its own side, and the marquee runs toward the
   end of the line. ⚠ The LTR marquee used to run the RTL way (+50%) — a
   leftover of the Arabic original — and opened a gap at the left edge. */
@keyframes drawer-in-rtl { from { transform: translateX(100%); } to { transform: none; } }
@keyframes slide-ltr { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: no-preference) {
  [dir="rtl"] dialog.drawer[open] { animation-name: drawer-in-rtl; }
  [dir="ltr"] .marquee ul { animation-name: slide-ltr; }
}

/* ── WhatsApp in the corner, Telegram invitation (community.js) ───────
 * The button sits at the end of the line (bottom-right in English,
 * bottom-left in Arabic), above the page but under any open window. */
.fab {
  position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 40;
  display: grid; justify-items: end; gap: 10px;
}
.fab-btn {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: #25d366; color: #fff; border: 0; cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
  animation: fab-pulse 2.4s ease-out 1.5s 3;
}
.fab-btn:hover { filter: brightness(1.06); color: #fff; }
.fab-btn svg { width: 31px; height: 31px; }
.fab.open .fab-btn { background: #1da851; }
@keyframes fab-pulse {
  0%   { box-shadow: 0 10px 28px rgba(0, 0, 0, .35), 0 0 0 0 rgba(37, 211, 102, .55); }
  70%  { box-shadow: 0 10px 28px rgba(0, 0, 0, .35), 0 0 0 18px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 10px 28px rgba(0, 0, 0, .35), 0 0 0 0 rgba(37, 211, 102, 0); }
}
.fab-menu {
  display: grid; gap: 4px; min-width: 240px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border-lit); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}
.fab-menu[hidden] { display: none; }
.fab-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 11px;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .93rem;
}
.fab-item:hover, .fab-item:focus-visible { background: var(--raised); color: var(--text); outline: none; }
.fab-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.fab-ic svg { width: 19px; height: 19px; }
.fab-item.wa .fab-ic { background: #25d366; }
.fab-item.tg .fab-ic { background: #229ed9; }
@media (max-width: 560px) {
  .fab { inset-inline-end: 14px; bottom: 14px; }
  .fab-btn { width: 54px; height: 54px; }
}

dialog.join-pop {
  width: min(92vw, 400px); padding: 30px 26px 22px; margin: auto;
  border: 1px solid var(--border-lit); border-radius: 20px;
  background: var(--surface); color: var(--text); text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
dialog.join-pop::backdrop { background: rgba(3, 6, 12, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.join-ic {
  width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-items: center; background: #229ed9; color: #fff;
}
.join-ic svg { width: 40px; height: 40px; }
.join-pop h2 { font-size: 1.3rem; margin: 0 0 8px; }
.join-pop p { color: var(--muted); margin: 0 0 20px; line-height: 1.6; }
.join-go {
  display: flex; justify-content: center; width: 100%; padding: 13px;
  background: #229ed9; color: #fff; border-radius: 12px; font-weight: 700; box-shadow: none;
}
.join-go:hover { filter: brightness(1.08); color: #fff; }
.join-later {
  margin-top: 12px; padding: 6px 10px; background: none; border: 0;
  color: var(--dim); cursor: pointer; font: inherit; font-size: .9rem;
}
.join-later:hover { color: var(--text); }
.join-x {
  position: absolute; top: 12px; inset-inline-end: 12px; width: 34px; height: 34px;
  border-radius: 9px; background: transparent; border: 0; color: var(--dim);
  cursor: pointer; font-size: 1rem;
}
.join-x:hover { background: var(--raised); color: var(--text); }
@media (prefers-reduced-motion: no-preference) {
  dialog.join-pop[open] { animation: join-in .25s ease-out; }
}
@keyframes join-in { from { transform: translateY(14px) scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .fab-btn { animation: none; } }

/* ── Reseller levels on the home page ─────────────────────────────── */
.levels-grid .level { position: relative; padding-top: 26px; }
.level .lv-name {
  display: inline-block; margin-bottom: 12px; padding: 4px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 800; letter-spacing: .06em;
  background: var(--raised); color: var(--muted); border: 1px solid var(--border-lit);
}
.level.l-vip .lv-name { background: rgba(251, 191, 36, .16); color: var(--warn); border-color: rgba(251, 191, 36, .45); }
.level.l-pro .lv-name { background: rgba(167, 139, 250, .18); color: #a78bfa; border-color: rgba(167, 139, 250, .5); }
:root[data-theme="light"] .level.l-pro .lv-name { color: #6d28d9; }
.level.l-pro { border-color: rgba(167, 139, 250, .45); }


/* ── Policies: privacy, terms, refund ─────────────────────────────────
 * Long-form text is written out in both languages on the page; i18n.js
 * sets <html lang> in <head>, before the first paint, so only one shows. */
html:not([lang="ar"]) [data-only="ar"], html[lang="ar"] [data-only="en"] { display: none !important; }
.legal { max-width: 820px; }
.legal article { color: var(--muted); }
.legal h2 { font-size: 1.15rem; color: var(--text); margin: 30px 0 8px; }
.legal p, .legal li { line-height: 1.85; }
.legal ul { padding-inline-start: 22px; margin: 8px 0; }
.legal li { margin: 4px 0; }
.legal b { color: var(--text); }
.legal .lede { margin-bottom: 8px; }
.legal-date { color: var(--dim); font-size: .88rem; margin: 0 0 18px; }
.legal-nav { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--border); }
.legal-nav ul { list-style: none; padding: 0; margin: 0; display: flex; gap: 8px 22px; flex-wrap: wrap; }
.legal-nav a[aria-current="page"] { color: var(--text); font-weight: 700; }
.legal-links a { color: inherit; }
.legal-links a:hover { color: var(--text); }
