@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Cairo:wght@300;400;600;700;800&display=swap');

:root{
  --primary:#C9A44C;

  --bg:#070B14;
  --panel:#0B1222;
  --panel2:#0E1830;
  --text:#EAF0FF;
  --muted:#9FB0D7;
  --line:rgba(255,255,255,.08);
  --shadow:0 22px 60px rgba(0,0,0,.45);
  --radius:18px;
  --glass:rgba(10,16,32,.55);
  --glass2:rgba(255,255,255,.06);
}

body.light{
  --bg:#FFFFFF;
  --panel:#F6F8FC;
  --panel2:#EEF2FA;
  --text:#0A1224;
  --muted:#56647D;
  --line:rgba(10,18,36,.10);
  --shadow:0 18px 60px rgba(10,18,36,.14);
  --glass:rgba(255,255,255,.78);
  --glass2:rgba(10,18,36,.04);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:Inter,system-ui,-apple-system,Segoe UI,Arial,sans-serif;
  background:
    radial-gradient(1200px 700px at 10% 0%, rgba(201,164,76,.16), transparent 55%),
    radial-gradient(900px 600px at 100% 12%, rgba(70,140,255,.14), transparent 55%),
    var(--bg);
  color:var(--text);
}
body.rtl{font-family:Cairo,system-ui,-apple-system,Segoe UI,Arial,sans-serif}
a{color:inherit;text-decoration:none}
.container{max-width:1200px;margin:0 auto;padding:0 18px}

/* Header */
.p4b-header{
  position:sticky;top:0;z-index:50;
  border-bottom:1px solid var(--line);
  background:var(--glass);
  backdrop-filter:blur(16px);
}
.header-inner{
  display:flex;align-items:center;justify-content:space-between;
  gap:14px;padding:14px 0;
}
.brand{display:flex;gap:12px;align-items:center}
.brand-mark{
  width:44px;height:44px;border-radius:14px;
  display:grid;place-items:center;
  font-weight:900;letter-spacing:.6px;
  background:linear-gradient(135deg, rgba(201,164,76,1), rgba(201,164,76,.55));
  color:#0A0F18;
  box-shadow:0 12px 30px rgba(201,164,76,.18);
}
.brand-title{font-weight:900;letter-spacing:.2px}
.brand-sub{font-size:12px;color:var(--muted);margin-top:2px}

/* ===== Top nav in ONE ROW (no wrap) ===== */
.nav,
.p4b-nav{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:nowrap;           /* مهم */
  overflow-x:auto;            /* مهم */
  white-space:nowrap;         /* مهم */
  -webkit-overflow-scrolling:touch;
  scrollbar-width:none;
  justify-content:center;

  flex:1;                     /* يأخذ مساحة الوسط */
  padding:0 6px;
}
.nav::-webkit-scrollbar{height:0}

.nav-link{
  flex:0 0 auto;
  display:flex;align-items:center;gap:8px;
  padding:10px 12px;border-radius:999px;
  border:1px solid transparent;
  color:var(--muted);
  transition:.18s ease;
}
.nav-link:hover{
  color:var(--text);
  border-color:var(--line);
  background:var(--glass2);
}
.nav-link.active{
  color:var(--text);
  border-color:rgba(201,164,76,.35);
  background:rgba(201,164,76,.12);
}
.nav-ico .emoji{font-size:14px}

.actions{display:flex;gap:10px;align-items:center}
/* Some pages use the newer header classes */
.p4b-actions{display:flex;gap:10px;align-items:center}

.icon-btn{
  width:42px;height:42px;border-radius:14px;
  border:1px solid var(--line);
  background:var(--glass2);
  color:var(--text);
  cursor:pointer;
  transition:.18s ease;
}
.icon-btn:hover{transform:translateY(-1px);box-shadow:var(--shadow)}
.badge{
  display:none;
  padding:8px 10px;border-radius:999px;
  border:1px dashed rgba(201,164,76,.45);
  background:rgba(201,164,76,.10);
  font-size:12px;font-weight:800;
}

/* Mobile */
#burger{display:none}
@media(max-width:980px){
  .nav{display:none}
  #burger{display:inline-flex}
}

/* ===== overlay & drawer (z-index fixed) ===== */
#drawerOverlay{
  position:fixed;inset:0;
  z-index:999;                /* أعلى */
  background:rgba(0,0,0,.45);
  display:none;
}
#drawerOverlay.show{display:block}

#mobileDrawer{
  position:fixed;top:0;bottom:0;
  z-index:1000;               /* أعلى من overlay */
  width:340px;
  background:rgba(10,16,32,.92);
  border-inline-start:1px solid var(--line);
  backdrop-filter:blur(14px);
  padding:16px;
  transform:translateX(110%);
  transition:.25s ease;
}
body.rtl #mobileDrawer{transform:translateX(-110%);}
#mobileDrawer.open{transform:translateX(0)}
body.light #mobileDrawer{background:rgba(255,255,255,.95)}
.mobile-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px}
#mobileLinks{display:flex;flex-direction:column;gap:8px}
#mobileLinks .nav-link{
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  border-radius:14px;
}

/* Error */
#globalError{
  display:none;margin:14px auto;max-width:1200px;
  padding:12px 14px;border-radius:14px;
  border:1px solid var(--line);
  background:rgba(255,0,0,.06);
}
#globalError.show{display:block}

/* Hero Carousel */
.hero{padding:20px 0 8px}
.carousel{
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  box-shadow:var(--shadow);
  background:rgba(255,255,255,.03);
}
.carousel-top{
  display:flex;justify-content:space-between;align-items:center;
  padding:12px;border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.02);
}
.hero-meta{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.hero-pill{
  padding:6px 10px;border-radius:999px;
  border:1px solid rgba(201,164,76,.45);
  background:rgba(201,164,76,.12);
  font-weight:900;font-size:12px;
}
.hero-note{font-size:12px;color:var(--muted)}
.carousel-controls{display:flex;gap:8px}
.carousel-viewport{overflow:hidden}
.carousel-track{
  display:flex;width:100%;
  transform:translateX(0);
  transition:transform .6s cubic-bezier(.2,.85,.2,1);
}
.slide{min-width:100%;position:relative;height:440px}
@media(max-width:800px){.slide{height:520px}}
.slide-bg{
  position:absolute;inset:0;
  background-size:cover;background-position:center;
  transform:scale(1.03);
  filter:contrast(1.02) saturate(1.03);
}
.slide-bg.grad{
  background:
    radial-gradient(1000px 600px at 20% 0%, rgba(201,164,76,.45), transparent 60%),
    radial-gradient(900px 600px at 100% 10%, rgba(70,140,255,.35), transparent 55%),
    linear-gradient(135deg, rgba(255,255,255,.08), rgba(255,255,255,0));
}
.slide-overlay{
  position:absolute;inset:0;
  background:linear-gradient(90deg, rgba(0,0,0,.70), rgba(0,0,0,.10));
}
body.rtl .slide-overlay{background:linear-gradient(-90deg, rgba(0,0,0,.70), rgba(0,0,0,.10))}
body.light .slide-overlay{background:linear-gradient(90deg, rgba(255,255,255,.88), rgba(255,255,255,.10))}
body.light.rtl .slide-overlay{background:linear-gradient(-90deg, rgba(255,255,255,.88), rgba(255,255,255,.10))}
.slide-content{
  position:absolute;inset:0;
  padding:32px 34px;
  display:flex;flex-direction:column;justify-content:center;
  max-width:760px;
}
.kicker{
  display:inline-flex;width:max-content;
  padding:6px 10px;border-radius:999px;
  border:1px solid rgba(201,164,76,.45);
  background:rgba(201,164,76,.12);
  font-weight:900;letter-spacing:.6px;font-size:12px;
}
.slide-content h1{margin:14px 0 10px;font-size:46px;line-height:1.08}
.slide-content p{margin:0 0 18px;color:rgba(255,255,255,.88);max-width:66ch}
body.light .slide-content p{color:rgba(10,18,36,.72)}

.btn{display:inline-flex;align-items:center;justify-content:center;
  padding:10px 14px;border-radius:14px;border:1px solid var(--line);
  background:rgba(255,255,255,.06);font-weight:900;cursor:pointer;
  transition:.18s ease;
}
.btn:hover{transform:translateY(-1px);box-shadow:var(--shadow)}
.btn-primary{
  background:linear-gradient(135deg, rgba(201,164,76,1), rgba(201,164,76,.55));
  border-color:rgba(201,164,76,.55);
  color:#0A0F18;
}
.btn-ghost{background:rgba(255,255,255,.04)}
.carousel-dots{display:flex;gap:8px;justify-content:center;padding:12px 0 14px}
.dot{width:9px;height:9px;border-radius:99px;border:1px solid var(--line);background:rgba(255,255,255,.12);cursor:pointer}
.dot.active{background:var(--primary);border-color:rgba(201,164,76,.75)}

/* Sections */
.section{padding:52px 0}
.section.bg-dark{
  background:rgba(255,255,255,.03);
  border-block:1px solid var(--line);
}
.section.bg-gradient{
  background:
    radial-gradient(1000px 600px at 20% 0%, rgba(201,164,76,.14), transparent 60%),
    radial-gradient(900px 600px at 100% 10%, rgba(70,140,255,.12), transparent 55%);
  border-block:1px solid var(--line);
}
.sec-head{
  display:flex;align-items:flex-end;justify-content:space-between;
  gap:14px;flex-wrap:wrap;margin-bottom:18px;
}
.sec-head h2{margin:0;font-size:30px;font-weight:900}
.sec-head p{margin:0;color:var(--muted);max-width:70ch}

.grid{display:grid;gap:14px}
.grid.cards{grid-template-columns:repeat(3,1fr)}
.grid.grid4{grid-template-columns:repeat(4,1fr)}
@media(max-width:980px){
  .grid.cards,.grid.grid4{grid-template-columns:1fr}
}
.card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:rgba(255,255,255,.03);
  padding:16px;
}
body.light .card{background:rgba(255,255,255,.75)}
.card h3{margin:10px 0 8px;font-weight:900}
.card p{margin:0;color:var(--muted)}
.card-ico{
  width:44px;height:44px;border-radius:16px;
  display:grid;place-items:center;
  background:rgba(201,164,76,.14);
  border:1px solid rgba(201,164,76,.25);
  font-weight:900;
}

.steps{display:flex;flex-direction:column;gap:12px}
.step{
  display:flex;gap:12px;align-items:flex-start;
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  background:rgba(255,255,255,.03);
}
body.light .step{background:rgba(255,255,255,.75)}
.step-n{
  width:38px;height:38px;border-radius:14px;
  display:grid;place-items:center;
  background:rgba(70,140,255,.16);
  border:1px solid rgba(70,140,255,.30);
  font-weight:900;
}
.step-body h3{margin:0 0 6px;font-weight:900}
.step-body p{margin:0;color:var(--muted)}

/* Footer */
.p4b-footer{
  margin-top:40px;
  border-top:1px solid var(--line);
  background:rgba(255,255,255,.02);
  padding:30px 0;
}
.footer-grid{display:grid;gap:16px;grid-template-columns:repeat(4,1fr)}
@media(max-width:980px){.footer-grid{grid-template-columns:1fr}}
.fcol h4{margin:0 0 10px;font-weight:900}
.fcol ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.fcol a{color:var(--muted)}
.fcol a:hover{color:var(--text)}
.footer-line{margin-top:16px;color:var(--muted);font-size:13px}


/* ===== Drawer visibility controlled by aria-hidden (Strong Fix) ===== */

#mobileDrawer{
  /* خليها دائمًا قابلة للانتقال */
  opacity: 0;
  pointer-events: none;
}

/* الحالة المقفولة */
#mobileDrawer[aria-hidden="true"]{
  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;
}
body.rtl #mobileDrawer[aria-hidden="true"]{
  transform: translateX(-110%);
}

/* الحالة المفتوحة */
#mobileDrawer[aria-hidden="false"]{
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* Overlay فوق كل شيء */
#drawerOverlay{
  z-index: 9999 !important;
}
#mobileDrawer{
  z-index: 10000 !important;
}

/* ===== ICON CONSISTENCY (Products + Home) ===== */

/* لا تخلي النص في الناف يلف سطرين */
.nav-txt { white-space: nowrap; }

/* لو Lucide تولّد SVG داخل .nav-ico/.card-ico */
.nav-ico svg,
.card-ico svg,
.lucide-ico svg{
  width: 18px;
  height: 18px;
  stroke: var(--primary);
  fill: none;
  stroke-width: 2;
  opacity: .95;
}

/* Emoji fallback */
.nav-ico .emoji,
.card-ico .emoji{
  color: var(--primary);
  font-size: 18px;
  line-height: 1;
}


/* Lucide icons: use primary color like emoji icons */
.nav-ico{color: var(--primary);} 
.card-ico{color: var(--primary);} 
.nav-ico svg,.card-ico svg{stroke: currentColor;}
.nav-link{white-space:nowrap;}
.p4b-nav{flex-wrap:nowrap;}

/* ------------------------------------------------------------------
   Mobile drawer - final overrides
   JS toggles: #drawerOverlay.show and #mobileDrawer.open
-------------------------------------------------------------------*/
#drawerOverlay{display:none !important;}
#drawerOverlay.show{display:block !important;}

#mobileDrawer{transform:translateX(110%) !important;}
body[dir="rtl"] #mobileDrawer{transform:translateX(-110%) !important;}
#mobileDrawer.open{transform:translateX(0) !important;}

/* Burger button alignment on mobile */
.icon-btn#burger{position:relative; z-index:50;}

/* ==========================================================
   FINAL FIX (CROSS-BROWSER): Drawer + Overlay + Burger
   Append at END of style.css
========================================================== */

/* Overlay */
#drawerOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.48);
  display: none;
  z-index: 9999;
}
#drawerOverlay.show{ display:block; }

/* Drawer */
#mobileDrawer{
  position: fixed;
  top: 0;
  bottom: 0;
  width: min(360px, 92vw);
  padding: 16px;
  background: rgba(10,16,32,.94);
  backdrop-filter: blur(14px);
  border-inline-start: 1px solid var(--line);

  /* ALWAYS slide from the correct side */
  inset-inline-end: 0;
  inset-inline-start: auto;

  transform: translateX(110%);
  opacity: 0;
  pointer-events: none;

  transition: transform .25s ease, opacity .25s ease;
  z-index: 10000;
}

/* RTL: slide from LEFT */
html[dir="rtl"] #mobileDrawer{
  inset-inline-start: 0;
  inset-inline-end: auto;
  transform: translateX(-110%);
}

#mobileDrawer.open{
  transform: translateX(0) !important;
  opacity: 1;
  pointer-events: auto;
}

/* Keep aria-hidden consistent (optional safety) */
#mobileDrawer[aria-hidden="false"]{
  opacity: 1;
  pointer-events: auto;
}
#mobileDrawer[aria-hidden="true"]{
  opacity: 0;
  pointer-events: none;
}

/* Drawer links */
#mobileLinks{
  display:flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin-top: 10px;
}
#mobileLinks .nav-link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 14px 14px;
  border-radius: 16px;            /* ثابت وغير دائري مبالغ */
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}
#mobileLinks .nav-link.active{
  border-color: rgba(201,164,76,.45);
  background: rgba(201,164,76,.14);
}

/* Burger always clickable & not “stuck on edge” */
#burger{
  position: relative;
  z-index: 10001;
}

/* Center icons/text inside header icon buttons (mobile + desktop)
   Fixes burger glyph sitting too high in some mobile browsers */
.icon-btn{
  display: grid;
  place-items: center;
  line-height: 1;
  padding: 0;
  font-size: 18px;
}

#burger{
  font-size: 20px;
}

/* Language toggle is a TEXT button, so it must not wrap inside 42px */
#langToggle{
  width: auto;
  min-width: 82px;
  padding: 0 12px;
  font-size: 14px;
  white-space: nowrap;
  letter-spacing: .2px;
}

/* Make sure header stays above hero/carousel layers on ALL pages (fix home burger click) */
.p4b-header{ z-index: 10002 !important; }
.p4b-actions{ position: relative; z-index: 10003; }
