/* phone-shell.css — نسخة الموبايل «تطبيق». كل القواعد جوّه @media (max-width:767px)، والديسكتوب مايتلمسش.
   ليه «:root» مش «html.phone-app» في الشريط العلوي والهيرو والمسافات؟ الكلاس بييجي من phone-shell.js اللي
   بيشتغل بعد سكربتات الـCDN (gsap/lenis) — فالصفحة كانت بتترسم بالشكل القديم وبعدين تتنطّ (CLS 0.66–0.88).
   :root بيشتغل من أول رسمة. اللي محتاج الـJS بس (شريط التابات، الستوري) فاضل تحت html.phone-app.
   ومن غير JS: نفس الشكل من غير شريط التابات — مقروء.
   شريط علوي رفيع + شريط تابات تحت (phone-shell.js) · هيرو بكارت فيديو كبير · مسافات أقل بين السكاشن. */

/* برا الموبايل: العناصر اللي الـJS بيضيفها مستخبية (وبتتشال أصلًا فوق 767px) */
.tabbar, .brand__sub { display: none; }
/* السكشن اللي برا الشاشة: كل حركة CSS بتقف (الكلاس بيتحط على الموبايل بس) */
.is-off, .is-off *, .is-off *::before, .is-off *::after { animation-play-state: paused !important; }

@media (max-width: 767px) {
  /* ===== أداء: مفيش ضبابية (backdrop-filter) خالص على الموبايل — كانت بتعيد رسم كل اللي تحتها مع كل فريم.
     بيشتغل حتى قبل ما الـJS يحمّل. */
  *, *::before, *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  /* ===== الهيرو باين من أول لحظة (كان فاضي ~3 ثواني لحد ما GSAP ييجي من الـCDN) ===== */
  .hero [data-reveal] { opacity: 1 !important; transform: none !important; }
  /* الإنجليزي: الـHTML عربي والترجمة بتيجي من main.js بعد الـCDN — منوريش نص عربي يتقلب ويهزّ الكارت (CLS 0.25).
     pre-i18n بيتحط في الـhead لو اللغة إنجليزي، وmain.js بيشيله أول ما الترجمة تتحط (ومهلة 4 ث لو ماحمّلش). */
  :root.pre-i18n .hero__wrap { visibility: hidden; }

  :root {
    --phone-top-h: calc(env(safe-area-inset-top) + 57px);
    --phone-tab-h: calc(env(safe-area-inset-bottom) + 64px);
    --bar-bg: rgba(15, 15, 17, .96);
    --bar-line: rgba(255, 255, 255, .08);
  }
  :root[data-theme="light"] { --bar-bg: rgba(255, 255, 255, .96); --bar-line: rgba(26, 26, 18, .12); }

  /* ---------- الشريط العلوي = الهيدر نفسه ---------- */
  :root .header {
    inset-block-start: 0; padding: 0; z-index: 60;
    transition: transform .35s var(--ease), visibility 0s linear 0s;
  }
  :root .header__inner,
  :root .header.is-stuck .header__inner {
    width: 100%; max-width: none; height: auto; margin: 0; gap: 8px;
    justify-content: space-between;
    padding: calc(env(safe-area-inset-top) + 6px) max(10px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left));
    border: 0; border-block-end: 1px solid var(--bar-line); border-radius: 0;
    background: var(--bar-bg);
    box-shadow: 0 12px 26px -22px rgba(0, 0, 0, .8);
  }
  :root[dir="rtl"] .header__inner,
  :root[dir="rtl"] .header.is-stuck .header__inner {
    padding-inline: max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-left));
  }
  :root .header .nav,
  :root .header .burger,
  :root .header .tools-sep,
  :root .header .header__progress,
  :root .header .btn--primary { display: none !important; }

  :root .header .brand { flex: 1 1 auto; min-width: 0; min-height: 44px; gap: 10px; }
  :root .header .brand__pic { width: 38px; height: 38px; }
  :root .header .brand__txt { display: flex; flex-direction: column; min-width: 0; gap: 1px; line-height: 1.25; }
  :root .header .brand__txt > span { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* السطر القديم (Xfera Media) بيحجز مكانه لحد ما phone-shell.js يحط «كورس الإعلانات الممولة» قبله — فالشريط مابيتهزّش */
  :root .header .brand__txt small[data-i18n] { visibility: hidden; font-size: 12px; line-height: 1.25; }
  :root .header .brand__sub + small[data-i18n] { display: none; }
  :root .header .brand__sub {
    display: block; font-size: 12px; font-weight: 500; color: var(--text-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  :root[lang="en"] .header .brand__sub { font-size: 12px; letter-spacing: .01em; }

  /* الثيم واللغة: دايرة مرسومة 38px جوّه هدف لمس 44px */
  :root .header__tools { gap: 2px; }
  :root .header .icon-btn {
    position: relative; isolation: isolate; width: 44px; height: 44px; padding: 0;
    background: none; border: 0; color: var(--text); transform: none;
  }
  :root .header .icon-btn::before {
    content: ""; position: absolute; inset: 3px; z-index: -1; border-radius: 50%;
    background: var(--glass-strong); border: 1px solid var(--glass-brd);
  }
  :root .header .icon-btn svg { width: 18px; height: 18px; }
  :root .header .lang-btn { font-size: 13px; letter-spacing: .03em; }
  /* «ع» في الإنجليزي بخط النظام — منحمّلش خط عربي تقيل لحرف واحد */
  :root[lang="en"] .header .lang-btn {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, sans-serif;
    font-size: 17px; font-weight: 600; letter-spacing: 0;
  }

  /* ---------- الشريط العايم (#stickyBar) فوق شريط التابات ----------
     main.js هو اللي بيقرر: is-on (بعد الهيرو ولحد الفوتر) و is-mini (جوّه سكاشن الدفع).
     كل التغييرات هنا transform/opacity بس — مفيش عرض بيتغيّر (CLS = 0):
     الكبسولة الكبيرة (::before) والصغيرة (::after) طبقتين بيتبادلوا، وزرار الواتساب بيتزحلق جنب السهم. */
  html.phone-app #stickyBar {
    --dock-w: min(100vw - 24px, 440px);
    --dock-pad: 6px;
    --dock-ic: 44px;
    --dock-gap: 6px;
    --dock-mini: calc(var(--dock-pad) * 2 + var(--dock-ic) * 2 + var(--dock-gap));
    --dock-bg: #17171A;
    --dock-brd: rgba(255, 255, 255, .11);
    inset-block-end: calc(var(--phone-tab-h) + 8px);
    padding-inline: 0; z-index: 59;            /* تحت شريط التابات (60): بيتزحلق وراه وهو بيختفي */
    visibility: hidden;
    transform: translateY(calc(100% + 18px)) scale(.97);
    transition: transform .45s var(--ease), opacity .3s var(--ease), visibility 0s linear .45s;
  }
  :root[data-theme="light"] #stickyBar { --dock-bg: #FFFFFF; --dock-brd: rgba(26, 26, 18, .14); }
  html.phone-app #stickyBar.is-on { visibility: visible; transform: none; transition: transform .45s var(--ease), opacity .3s var(--ease), visibility 0s; }
  html.phone-app #stickyBar .sticky-bar__inner {
    position: relative; isolation: isolate;
    width: var(--dock-w); max-width: none; justify-content: space-between;
    gap: var(--dock-gap); padding: var(--dock-pad);
    background: none; border: 0; box-shadow: none;
  }
  /* الطبقتين: الكبسولة الكاملة والصغيرة (لون مصمت، من غير ضبابية) */
  html.phone-app #stickyBar .sticky-bar__inner::before,
  html.phone-app #stickyBar .sticky-bar__inner::after {
    content: ""; position: absolute; z-index: -1; inset-block: 0;
    border-radius: 999px; background: var(--dock-bg); border: 1px solid var(--dock-brd);
    box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .85), 0 0 26px -6px var(--tint-12);
    transition: opacity .3s var(--ease), transform .45s var(--ease);
  }
  :root[data-theme="light"] #stickyBar .sticky-bar__inner::before,
  :root[data-theme="light"] #stickyBar .sticky-bar__inner::after { box-shadow: 0 14px 28px -14px rgba(26, 26, 18, .38); }
  html.phone-app #stickyBar .sticky-bar__inner::before { inset-inline: 0; }
  html.phone-app #stickyBar .sticky-bar__inner::after { inset-inline-end: 0; width: var(--dock-mini); opacity: 0; transform: scale(.9); }
  html.phone-app #stickyBar .dock__buy {
    flex: 1 1 auto; min-width: 0; max-width: none; justify-content: space-between; gap: 8px;
    padding-inline: 2px; margin: 0; overflow: visible;   /* overflow:hidden كان بيقصّ ظل الزرار ويعمل حتة غامقة */
    transition: opacity .25s var(--ease), visibility 0s;
  }
  html.phone-app #stickyBar .dock__sep,
  html.phone-app #stickyBar .sticky-bar__seal { display: none; }
  html.phone-app #stickyBar .sticky-bar__txt { min-width: 0; line-height: 1.3; }
  html.phone-app #stickyBar b { display: block; font-size: 15px; }
  html.phone-app #stickyBar small { font-size: 11px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
  :root[lang="en"] #stickyBar small { font-size: 11px; letter-spacing: -.01em; }
  html.phone-app #stickyBar .dock__btn { flex: none; min-height: 44px; padding: 0 14px; font-size: 14px; box-shadow: 0 8px 20px -10px var(--accent-glow); }
  html.phone-app #stickyBar .dock__ic { width: var(--dock-ic); height: var(--dock-ic); transition: transform .45s var(--ease), border-color .3s, color .3s, background .3s; }
  html.phone-app #stickyBar .dock__wa svg { width: 22px; height: 22px; }
  html.phone-app #stickyBar .dock__ping { top: 6px; inset-inline-end: 6px; }
  /* الدوك مستخبي = النقطة الخضرا واقفة */
  html.phone-app #stickyBar:not(.is-on) .dock__ping::after { animation-play-state: paused; }

  /* الصغيرة (سكاشن الدفع): الكبسولة الكاملة بتختفي والصغيرة بتظهر في الركن، والواتساب بيروح جنب السهم.
     اللمس بيعدّي للصفحة في الجزء الفاضي (الزرارين بس اللي بياخدوا اللمس) */
  html.phone-app #stickyBar.is-mini { justify-content: center; }
  html.phone-app #stickyBar.is-mini .sticky-bar__inner { pointer-events: none; }
  html.phone-app #stickyBar.is-mini .dock__ic { pointer-events: auto; }
  html.phone-app #stickyBar.is-mini .sticky-bar__inner::before { opacity: 0; }
  html.phone-app #stickyBar.is-mini .sticky-bar__inner::after { opacity: 1; transform: none; }
  html.phone-app #stickyBar.is-mini .dock__buy { opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility 0s linear .2s; }
  html.phone-app #stickyBar.is-mini .dock__wa { transform: translateX(calc(var(--dock-w) - var(--dock-mini))); }
  :root[dir="rtl"] #stickyBar.is-mini .dock__wa { transform: translateX(calc(var(--dock-mini) - var(--dock-w))); }

  /* ستوري مفتوحة: الدوك بيختفي زي الشريطين */
  html.phone-app.story-open #stickyBar,
  html.phone-app.story-open #stickyBar.is-on { opacity: 0; visibility: hidden; transform: translateY(calc(100% + 18px)) scale(.97); transition: transform .3s var(--ease), opacity .2s var(--ease), visibility 0s linear .3s; }

  /* ---------- شريط التابات ---------- */
  html.phone-app .tabbar {
    position: fixed; z-index: 60; inset-inline: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: stretch;
    padding: 5px max(4px, env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left));
    background: var(--bar-bg); border-block-start: 1px solid var(--bar-line);
    box-shadow: 0 -14px 30px -24px rgba(0, 0, 0, .85);
    transition: transform .35s var(--ease), visibility 0s linear 0s;
  }
  :root[data-theme="light"] .tabbar { box-shadow: 0 -10px 24px -20px rgba(26, 26, 18, .35); }
  :root[data-theme="light"] .header__inner,
  :root[data-theme="light"] .header.is-stuck .header__inner { box-shadow: 0 10px 24px -20px rgba(26, 26, 18, .35); }
  html.phone-app .tabbar__tab {
    min-width: 0; min-height: 54px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-2); font-size: 11.5px; font-weight: 600; line-height: 1.2;
    -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    transition: color .25s var(--ease);
  }
  :root[lang="en"] .tabbar__tab { font-size: 11px; letter-spacing: .01em; }
  html.phone-app .tabbar__ico {
    display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px;
    transition: background-color .25s var(--ease), box-shadow .25s var(--ease), transform .2s var(--ease);
  }
  html.phone-app .tabbar__ico svg { width: 21px; height: 21px; }
  html.phone-app .tabbar__lbl { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.phone-app .tabbar__tab[aria-current="page"] { color: var(--accent-txt); }
  html.phone-app .tabbar__tab[aria-current="page"] .tabbar__ico { background: var(--tint-14); box-shadow: inset 0 0 0 1px var(--tint-34); }
  /* «اشترِ»: دايمًا كبسولة ليموني */
  html.phone-app .tabbar__tab--buy { color: var(--text); }
  html.phone-app .tabbar__tab--buy .tabbar__ico { background: var(--lime); color: #0A0A0B; box-shadow: 0 6px 18px -8px rgba(196, 248, 42, .7); }
  html.phone-app .tabbar__tab:active .tabbar__ico { transform: scale(.93); }
  html.phone-app .tabbar__tab:focus-visible { outline-offset: -3px; border-radius: 14px; }

  /* ---------- ستوري مفتوحة: الشريطين بيوسعوا ---------- */
  html.phone-app.story-open .header { transform: translateY(-105%); visibility: hidden; transition: transform .3s var(--ease), visibility 0s linear .3s; }
  html.phone-app.story-open .tabbar { transform: translateY(105%); visibility: hidden; transition: transform .3s var(--ease), visibility 0s linear .3s; }

  /* ---------- مسافات السكاشن: من ~160px لـ ~64px عند كل فاصل ---------- */
  :root main > * { scroll-margin-top: var(--phone-top-h); }
  :root main > .section:not(.hero) { min-height: 0; padding-block: 38px 26px; }
  :root #faq { min-height: 0; padding-block-end: 30px; }
  /* آخر الصفحة يطلع فوق شريط التابات */
  :root .footer { padding-block: 18px calc(var(--phone-tab-h) + 18px); }
  :root .footer__row { gap: 10px 16px; }
  :root .footer__copy { font-size: 12px; }
  :root .social a { width: 44px; height: 44px; }

  /* ====================== الهيرو = «الرئيسية» ======================
     عنوان ← الوعد ← سطر الشرح ← كارت الفيديو (بياخد كل المساحة الفاضية) ← الشراء ← البراندات.
     الهيرو كله = شاشة واحدة بين الشريطين. */
  :root .hero {
    min-height: 100vh; min-height: 100svh;
    justify-content: flex-start;
    padding-block: calc(var(--phone-top-h) + 16px) var(--phone-tab-h);
  }
  :root .hero .topics,
  :root .hero .orb,
  :root .hero .eyebrow,
  :root .stage__ring,
  :root .stage__glow,
  :root .chip--3 { display: none; }
  /* الأورب (blur 90px بتتحرك على طول) بقت تدرّج ثابت */
  :root .hero__bg {
    background:
      radial-gradient(75% 40% at 92% 4%, rgba(196, 248, 42, .13), transparent 70%),
      radial-gradient(70% 36% at 0% 62%, rgba(123, 224, 164, .08), transparent 72%);
  }
  :root[data-theme="light"] .hero__bg {
    background:
      radial-gradient(75% 40% at 92% 4%, rgba(159, 185, 138, .26), transparent 70%),
      radial-gradient(70% 36% at 0% 62%, rgba(143, 183, 166, .18), transparent 72%);
  }
  :root .hero__wrap { flex: 1 1 auto; display: flex; flex-direction: column; align-items: stretch; padding-inline: 16px; }
  :root .hero__layout { flex: 1 1 auto; display: flex; flex-direction: column; gap: 0; }
  :root .hero__copy { display: contents; }

  :root .hero__title { order: 1; margin: 0; max-width: none; font-size: clamp(26px, 7.9vw, 34px); line-height: 1.34; }
  :root[lang="en"] .hero__title { font-size: clamp(25px, 7.3vw, 31px); line-height: 1.16; }
  :root .trip__a { gap: .4em; }
  :root .hero__promise { order: 2; margin-top: 8px; max-width: none; font-size: 15.5px; line-height: 1.6; }
  :root[lang="en"] .hero__promise { line-height: 1.5; }
  /* الرقم لينك: هدف لمس 44px من غير ما يوسّع السطر */
  :root .hero__proof {
    min-height: 44px; margin-block: -10px; vertical-align: middle; border-bottom: 0;
  }
  :root .hero__proof > span { text-decoration: underline dashed var(--tint-45); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
  :root .hero .hero__sub { order: 3; margin-top: 6px; max-width: none; font-size: 13.5px; line-height: 1.75; }
  :root[lang="en"] .hero .hero__sub { line-height: 1.6; }
  :root .hero .pf { font-size: .92em; }

  /* كارت الفيديو: عريض بعرض الشاشة وبياخد اللي فاضل من الطول */
  :root .stage {
    order: 4; flex: 1 1 0; height: auto; min-height: 168px; max-height: 440px;
    margin-top: 14px; display: block;
  }
  :root .reel {
    position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto;
    border-radius: 24px; border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 24px 46px -22px rgba(0, 0, 0, .85), 0 0 0 1px rgba(196, 248, 42, .08);
    transform: none !important;
  }
  :root[data-theme="light"] .reel { box-shadow: 0 22px 44px -20px rgba(10, 10, 11, .4); border-color: rgba(26, 26, 18, .14); }
  :root .reel__vid { object-fit: cover; object-position: 50% 44%; }
  :root .reel.is-on .reel__vid { object-fit: contain; }
  :root .reel__play {
    flex-direction: row; align-items: flex-end; justify-content: flex-start; gap: 12px;
    padding: 16px; background: linear-gradient(to top, rgba(0, 0, 0, .82), rgba(0, 0, 0, 0) 52%);
  }
  :root .reel__btn { position: relative; top: auto; left: auto; translate: none; width: 56px; height: 56px; flex: none; background: var(--lime); color: #0A0A0B; }
  :root .reel__btn svg { width: 22px; height: 22px; }
  :root .reel__txt { display: flex; align-items: flex-start; text-align: start; gap: 1px; padding-bottom: 6px; }
  :root .reel__txt b { font-size: 16px; line-height: 1.3; }
  :root .reel__txt small { font-size: 12px; direction: ltr; unicode-bidi: isolate; }
  /* الشارات العايمة كانت بتغطي الكارت — الأرقام دي موجودة في الوعد وفي صف الستوريز اللي بعد الهيرو */
  :root .chip { display: none; }

  /* الشراء: الزرار بعرض الشاشة وتحته سطر الضمان */
  :root .hero__cta { order: 5; margin-top: 14px; display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 8px; }
  :root .hero__cta .btn--lg { min-height: 52px; padding: 12px 20px; font-size: 16px; }
  :root .hero__guar { justify-content: center; gap: 8px; }
  :root .hero__shield { width: 28px; height: 28px; }
  :root .hero__shield svg { width: 15px; height: 15px; }
  :root .hero__guar-txt { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
  :root .hero__guar-txt b { font-size: 13px; }
  :root .hero__guar-txt small { font-size: 12.5px; color: var(--text-2); }

  /* شريط البراندات: في آخر الهيرو فوق التابات */
  :root .strip { position: relative; bottom: auto; inset-inline: auto; margin-top: 14px; padding: 9px 0; background: none; }
  :root .strip__img { height: 30px; }

  /* شاشات قصيرة (iPhone SE): نضغط شوية */
  @media (max-height: 700px) {
    :root .hero { padding-block-start: calc(var(--phone-top-h) + 10px); }
    :root .hero__title { font-size: 25px; line-height: 1.3; }
    :root .hero__promise { font-size: 14.5px; margin-top: 4px; }
    :root .hero .hero__sub { font-size: 13px; line-height: 1.6; margin-top: 4px; }
    :root .stage { min-height: 140px; margin-top: 10px; }
    :root .hero__cta { margin-top: 10px; gap: 6px; }
    :root .hero__cta .btn--lg { min-height: 48px; }
    :root .strip { margin-top: 8px; padding: 6px 0; }
    :root .strip__img { height: 26px; }
  }

  /* ---------- آراء حقيقية (يحيي) ---------- */
  :root .yh__wave { height: 44px; }
  :root .yh__bars { inset-block: 7px; }
  :root .yh__who span { font-size: 12px; }
  :root .yh__time { font-size: 12px; }

  /* ---------- العرض ---------- */
  :root .fk__inc li { font-size: 13.5px; }
  :root .fk__once, :root .fk__lbl { font-size: 12px; }

  /* ---------- الضمان: الدرع جوّه الكارت والعلامات متنفسة ---------- */
  :root .gt__race { padding: 18px 16px; gap: 22px; }
  :root .gt__row--me .gt__track { height: 24px; margin-inline-end: 22px; }
  :root .gt__ticks { inset-inline: 12px 34px; }
  :root .gt__ticks i { width: 1.5px; height: 9px; }
  :root .gt__shield { width: 42px; height: 42px; inset-inline-end: -20px; }
  :root .gt__race.is-in .gt__shield { transform: scale(1.06); box-shadow: 0 0 0 5px var(--tint-18), 0 0 22px var(--accent-glow); }
  :root .gt__who small, :root .gt__why { font-size: 12.5px; }
  :root .gt__end { font-size: 14px; }

  /* ---------- الأسئلة ---------- */
  :root .ex__row { padding: 12px 2px; }
  :root .ex__a { font-size: 14px; }
  :root .ex__wa { min-height: 48px; }
}

/* حركة أقل: مفيش أنيميشن لانهائي في الهيرو، ومفيش انتقالات للشريطين */
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  :root .header, html.phone-app .tabbar, html.phone-app .tabbar__ico { transition: none; }
  html.phone-app #stickyBar, html.phone-app #stickyBar.is-on, html.phone-app.story-open #stickyBar,
  html.phone-app #stickyBar *, html.phone-app #stickyBar .sticky-bar__inner::before, html.phone-app #stickyBar .sticky-bar__inner::after { transition: none !important; }
  :root .reel__btn, :root .trip__end, :root .strip__track { animation: none; }
}
