/* =====================================================================
   FORMCOD — generic landing styles. Vanilla, no framework, fast.
   Brand color is driven by the --brand variable (override per site).
   ===================================================================== */
:root{
  --brand:#0b5cd6;          /* Baofeng box blue */
  --brand-dark:#0842a8;
  --ink:#0f172a;
  --muted:#64748b;
  --bg:#ffffff;
  --soft:#f1f5f9;
  --line:#e2e8f0;
  --ok:#16a34a;
  --radius:14px;
  --shadow:0 10px 30px rgba(2,6,23,.10);
  --max:980px;
}
/* ---- Default font: self-hosted Tajawal (Arabic + Latin subsets, split by
   unicode-range). Clean on both scripts, no Google-Fonts request / no flash.
   Every landing gets a good font by default; drop the woff2 in fonts/. ---- */
@font-face{font-family:'Tajawal';font-weight:400;font-style:normal;font-display:swap;src:url(../fonts/tajawal-arabic-400.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41}
@font-face{font-family:'Tajawal';font-weight:400;font-style:normal;font-display:swap;src:url(../fonts/tajawal-latin-400.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD}
@font-face{font-family:'Tajawal';font-weight:500;font-style:normal;font-display:swap;src:url(../fonts/tajawal-arabic-500.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41}
@font-face{font-family:'Tajawal';font-weight:500;font-style:normal;font-display:swap;src:url(../fonts/tajawal-latin-500.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD}
@font-face{font-family:'Tajawal';font-weight:700;font-style:normal;font-display:swap;src:url(../fonts/tajawal-arabic-700.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41}
@font-face{font-family:'Tajawal';font-weight:700;font-style:normal;font-display:swap;src:url(../fonts/tajawal-latin-700.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD}
@font-face{font-family:'Tajawal';font-weight:900;font-style:normal;font-display:swap;src:url(../fonts/tajawal-arabic-900.woff2) format('woff2');unicode-range:U+0600-06FF,U+0750-077F,U+08A0-08FF,U+FB50-FDFF,U+FE70-FEFF,U+200C-200E,U+2010-2011,U+204F,U+2E41}
@font-face{font-family:'Tajawal';font-weight:900;font-style:normal;font-display:swap;src:url(../fonts/tajawal-latin-900.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+2000-206F,U+2074,U+20AC,U+2122,U+2212,U+FEFF,U+FFFD}
*{box-sizing:border-box;margin:0;padding:0}
html,body{overflow-x:hidden;max-width:100%}      /* guard: never allow horizontal scroll (esp. RTL) */
html{scroll-behavior:smooth}
body{
  font-family:'Tajawal',system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--ink);background:var(--bg);line-height:1.55;
  -webkit-font-smoothing:antialiased;padding-bottom:78px; /* room for sticky bar */
}
[dir="rtl"] body{font-family:'Tajawal',system-ui,"Segoe UI",Tahoma,Arial,sans-serif}
img,video{max-width:100%;height:auto;display:block}
/* buttons/inputs/selects don't inherit font-family by default — force it,
   else the sticky CTA + form controls fall back to the system font. */
button,input,select,textarea{font-family:inherit}
/* motion: a reel/clip that replaces a GIF — autoplay muted loop */
.reel{width:100%;border-radius:var(--radius);box-shadow:var(--shadow);background:#000;object-fit:cover}
.container{max-width:var(--max);margin:0 auto;padding:0 18px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  background:var(--brand);color:#fff;border:0;border-radius:12px;
  padding:15px 26px;font-size:17px;font-weight:700;cursor:pointer;
  text-decoration:none;transition:transform .08s ease,background .2s;
  width:100%;
}
.btn:hover{background:var(--brand-dark)}
.btn:active{transform:scale(.98)}
.btn-pulse{animation:pulse 1.8s infinite}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(11,92,214,.45)}70%{box-shadow:0 0 0 14px rgba(11,92,214,0)}100%{box-shadow:0 0 0 0 rgba(11,92,214,0)}}

/* ---- Header / hero ---- */
.topbar{background:var(--brand);color:#fff;text-align:center;font-size:14px;font-weight:600;padding:8px 12px}
.hero{padding:26px 0 10px}
.hero h1{font-size:clamp(24px,5vw,38px);line-height:1.2;margin-bottom:8px}
.hero .tagline{color:var(--muted);font-size:17px;margin-bottom:16px}
.gallery{display:grid;gap:10px}
.gallery img{border-radius:var(--radius);box-shadow:var(--shadow);width:100%;object-fit:cover}

/* ---- Config-driven media (app.js builds these from product.gallery) ---- */
html,body{overflow-x:hidden}                 /* guard: full-bleed images never cause h-scroll */
.media{margin-inline:-18px}                  /* break out of .container padding => edge-to-edge */
.fullimg{width:100%;height:auto;display:block;background:var(--soft)}   /* LANDING: big full-width blocks */
/* PRODUCT: gallery widget (main image + thumbnails + arrows) */
.gwrap{position:relative}
.gmain{width:100%;height:auto;display:block;background:var(--soft);cursor:pointer}
.gnav{position:absolute;top:50%;transform:translateY(-50%);width:40px;height:40px;border-radius:50%;border:0;
  background:rgba(255,255,255,.92);box-shadow:var(--shadow);font-size:22px;font-weight:800;color:var(--ink);
  cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}
.gnav.prev{inset-inline-end:12px}
.gnav.next{inset-inline-start:12px}
.gdots{position:absolute;bottom:10px;inset-inline:0;display:flex;gap:6px;justify-content:center}
.gdots i{width:7px;height:7px;border-radius:50%;background:rgba(255,255,255,.6)}
.gdots i.on{background:#fff;width:20px;border-radius:4px}
.thumbs{display:flex;gap:8px;padding:12px 18px;overflow-x:auto}
.thumb{flex:0 0 64px;height:64px;border-radius:10px;object-fit:cover;border:2px solid transparent;cursor:pointer}
.thumb.on{border-color:var(--brand)}
/* Reviews (config.reviews) */
.reviews{display:grid;gap:12px}
.review{background:var(--soft);border-radius:var(--radius);padding:16px}
.review .stars{color:#f59e0b;margin-bottom:6px}
.review .rname{font-weight:700;font-size:14px;margin-top:8px}

/* ---- Price box ---- */
.pricebox{display:flex;align-items:baseline;gap:12px;margin:18px 0}
.price{font-size:34px;font-weight:800;color:var(--brand)}
.price .cur{font-size:18px;margin-inline-start:4px}
.old{font-size:20px;color:var(--muted);text-decoration:line-through}
.save{background:#fee2e2;color:#b91c1c;font-weight:700;font-size:13px;padding:3px 10px;border-radius:999px}

/* ---- Trust badges ---- */
.badges{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:22px 0}
.badge{background:var(--soft);border-radius:12px;padding:14px;text-align:center;font-size:13px;font-weight:600}
.badge .ic{font-size:24px;display:block;margin-bottom:6px}

/* ---- Generic sections ---- */
.section{padding:26px 0;border-top:1px solid var(--line)}
.section h2{font-size:22px;margin-bottom:12px}
.features li{margin:8px 0;padding-inline-start:26px;position:relative}
.features li::before{content:"✓";position:absolute;inset-inline-start:0;color:var(--ok);font-weight:800}

/* ---- Embedded form section ---- */
.form-section{background:var(--soft)}

/* ---- The order form ---- */
.order-form{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}
.order-form h3{font-size:20px;margin-bottom:4px}
.order-form .sub{color:var(--muted);font-size:14px;margin-bottom:16px}
.field{margin-bottom:12px}
.field label{display:block;font-size:13px;font-weight:600;margin-bottom:5px}
.field input,.field select{
  width:100%;padding:13px 14px;border:1px solid var(--line);border-radius:10px;
  font-size:16px;background:#fff;color:var(--ink);
}
.field input:focus,.field select:focus{outline:0;border-color:var(--brand);box-shadow:0 0 0 3px rgba(11,92,214,.15)}
.phone-row{display:flex;gap:8px}
.phone-row .dial{flex:0 0 78px;text-align:center;background:var(--soft);font-weight:700}
.summary{background:var(--soft);border-radius:10px;padding:12px 14px;margin:14px 0;font-size:14px}
.summary .row{display:flex;justify-content:space-between;margin:4px 0}
.summary .total{font-weight:800;font-size:17px;color:var(--brand)}
/* honeypot — visually hidden WITHOUT a huge off-screen offset.
   left:-9999px breaks RTL (adds 9999px of empty scroll space on the left). */
.hp{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}
/* ---- Variants (bundle/qty offers + color/size) ---- */
.variants{margin:6px 0 4px}
.variants:empty{display:none}
.vgroup{margin-bottom:14px}
.vlabel{font-size:13px;font-weight:700;margin-bottom:8px}
.vopts{display:grid;gap:8px}
.vgroup-cards .vopts{grid-template-columns:1fr}
.vgroup-buttons .vopts{grid-template-columns:repeat(auto-fit,minmax(90px,1fr))}
.vopt{
  position:relative;display:flex;align-items:center;justify-content:space-between;gap:8px;
  background:#fff;border:2px solid var(--line);border-radius:12px;padding:13px 14px;
  font-size:15px;font-weight:600;color:var(--ink);cursor:pointer;text-align:start;width:100%;
  transition:border-color .15s,background .15s,box-shadow .15s;
}
.vgroup-buttons .vopt{justify-content:center;padding:11px 12px;font-size:14px}
.vopt:hover{border-color:var(--brand)}
.vopt.active{border-color:var(--brand);background:color-mix(in srgb,var(--brand) 8%,#fff);box-shadow:0 0 0 3px rgba(0,0,0,.04)}
.vopt-label{flex:1}
.vgroup-buttons .vopt-label{flex:0}
.vopt-price{font-weight:800;color:var(--brand);white-space:nowrap}
.vopt-badge{position:absolute;top:-9px;inset-inline-end:10px;background:var(--brand);color:#fff;font-size:11px;font-weight:700;padding:2px 8px;border-radius:999px}

/* inline per-field error (shown directly under the field, not at form end) */
.field-err{color:#dc2626;font-size:13px;font-weight:600;margin-top:5px}
.field.has-err input,.field.has-err select,.field.has-err textarea{border-color:#dc2626;box-shadow:0 0 0 3px rgba(220,38,38,.12)}
.form-msg{font-size:14px;margin-top:10px;display:none}
.form-msg.err{display:block;color:#b91c1c}
.form-msg.ok{display:block;color:var(--ok)}

/* ---- Form styles (config.js > formStyle) — switch the whole form's look ---- */
/* classic = default (bordered card, no overrides). */
/* filled: soft-background inputs, borderless until focus */
[data-form-style="filled"] .order-form .field input,
[data-form-style="filled"] .order-form .field select{background:var(--soft);border-color:transparent}
[data-form-style="filled"] .order-form .field input:focus,
[data-form-style="filled"] .order-form .field select:focus{background:#fff}
/* minimal: underline-only inputs, flat form */
[data-form-style="minimal"] .order-form{box-shadow:none;border:0;padding:8px 0;background:transparent}
[data-form-style="minimal"] .order-form .field input,
[data-form-style="minimal"] .order-form .field select{border:0;border-bottom:2px solid var(--line);border-radius:0;background:transparent;padding-inline:2px}
[data-form-style="minimal"] .order-form .field input:focus,
[data-form-style="minimal"] .order-form .field select:focus{box-shadow:none;border-bottom-color:var(--brand)}
/* card: elevated with an accent top bar */
[data-form-style="card"] .order-form{border:0;border-top:4px solid var(--brand);border-radius:16px;box-shadow:0 18px 50px rgba(2,6,23,.16)}
/* rounded: pill inputs + button */
[data-form-style="rounded"] .order-form .field input,
[data-form-style="rounded"] .order-form .field select,
[data-form-style="rounded"] .order-form .btn{border-radius:999px}
[data-form-style="rounded"] .order-form .field input,
[data-form-style="rounded"] .order-form .field select{padding-inline:18px}

/* ---- Sticky CTA bar (always visible) ---- */
.sticky-cta{
  position:fixed;inset-inline:0;bottom:0;z-index:60;
  background:rgba(255,255,255,.96);backdrop-filter:blur(8px);
  border-top:1px solid var(--line);box-shadow:0 -6px 20px rgba(2,6,23,.08);
  padding:10px 14px;display:flex;align-items:center;gap:12px;
  transition:transform .3s ease,opacity .3s ease;
}
.sticky-cta .mini-price{font-weight:800;color:var(--brand);white-space:nowrap;font-size:18px}
.sticky-cta .btn{flex:1;width:auto;padding:13px 20px}
/* hidden while the order form is on screen (avoids a confusing duplicate CTA).
   app.js toggles .hidden via an IntersectionObserver on the embed form. */
.sticky-cta.hidden{transform:translateY(130%);opacity:0;pointer-events:none}

/* ---- Popup modal ---- */
.modal-overlay{
  position:fixed;inset:0;z-index:100;background:rgba(2,6,23,.55);
  display:none;align-items:flex-end;justify-content:center;padding:0;
}
.modal-overlay.open{display:flex}
@media(min-width:640px){.modal-overlay{align-items:center;padding:18px}}
.modal{
  background:#fff;width:100%;max-width:480px;border-radius:18px 18px 0 0;
  max-height:92vh;overflow-y:auto;padding:20px;position:relative;
  animation:slideUp .25s ease;
}
@media(min-width:640px){.modal{border-radius:18px}}
@keyframes slideUp{from{transform:translateY(40px);opacity:.4}to{transform:translateY(0);opacity:1}}
.modal .close{position:absolute;inset-inline-end:14px;top:12px;background:var(--soft);border:0;width:34px;height:34px;border-radius:50%;font-size:20px;cursor:pointer;line-height:1}

footer{padding:30px 0 20px;text-align:center;color:var(--muted);font-size:13px}
footer a{color:var(--muted)}

/* ===== Clickable video reel (tap → full popup with sound) ===== */
.reel-wrap{position:relative;display:block;width:100%;padding:0;border:0;background:transparent;cursor:pointer;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);line-height:0;-webkit-tap-highlight-color:transparent}
.reel-wrap:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
.reel-wrap .reel{border-radius:0;box-shadow:none;margin:0}
.reel-play{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:74px;height:74px;border-radius:50%;background:rgba(11,92,214,.92);display:flex;align-items:center;justify-content:center;box-shadow:0 8px 26px rgba(0,0,0,.4);transition:transform .15s ease;pointer-events:none}
.reel-wrap:hover .reel-play,.reel-wrap:active .reel-play{transform:translate(-50%,-50%) scale(1.09)}
.reel-play svg{width:34px;height:34px;fill:#fff;margin-inline-start:3px}
.reel-hint{position:absolute;inset-inline:0;bottom:12px;text-align:center;color:#fff;font-size:14px;font-weight:700;text-shadow:0 1px 5px rgba(0,0,0,.7);pointer-events:none}

/* full-screen popup */
.video-lightbox{position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.93);display:none;align-items:center;justify-content:center;padding:16px}
.video-lightbox.open{display:flex;animation:vlIn .18s ease}
@keyframes vlIn{from{opacity:0}to{opacity:1}}
.vl-inner{width:100%;max-width:900px}
.vl-video{width:100%;height:auto;max-height:86vh;border-radius:12px;background:#000;display:block;margin:0 auto;box-shadow:0 20px 60px rgba(0,0,0,.5)}
.vl-close{position:absolute;top:14px;inset-inline-end:16px;width:46px;height:46px;border:0;border-radius:50%;background:rgba(255,255,255,.16);color:#fff;font-size:30px;line-height:1;cursor:pointer;z-index:2;transition:background .15s}
.vl-close:hover{background:rgba(255,255,255,.3)}
@media(prefers-reduced-motion:reduce){.video-lightbox.open{animation:none}}

/* ===== 9:16 portrait reel (phone-width, centered) ===== */
.reel-portrait{max-width:340px;margin-inline:auto;aspect-ratio:9/16}
.reel-portrait .reel{width:100%;height:100%;aspect-ratio:9/16;object-fit:cover}
/* popup: size a portrait video by height so it isn't clipped */
.video-lightbox .vl-inner{max-width:none;display:flex;justify-content:center}
.video-lightbox .vl-video{width:auto;max-width:100%;height:86vh;max-height:86vh;aspect-ratio:9/16}

/* ===== Order-popup confirmation gate (range + "pack = 2 radios") ===== */
.confirm-step{padding:6px 2px 2px}
.confirm-title{font-size:19px;line-height:1.35;margin-bottom:14px;color:var(--ink)}
.confirm-list{list-style:none;margin:0 0 18px;padding:0;display:grid;gap:12px}
.confirm-list li{display:flex;gap:11px;align-items:flex-start;background:var(--soft);border:1px solid var(--line);border-radius:12px;padding:13px 14px;font-size:15.5px;line-height:1.55}
.confirm-list .ci{font-size:22px;line-height:1.2;flex:0 0 auto}
.confirm-list b{color:var(--brand-dark)}
.confirm-step .btn{font-size:17px}

/* photo of the 2 radios inside the confirmation step */
.confirm-img{width:100%;height:190px;object-fit:cover;border-radius:12px;margin-bottom:14px;display:block;background:var(--soft)}
