/* =============================================================
   Baydah — base.css  (shared by every page)
   Tokens, reset, fonts per language and the fixed header.
   Direction: <html lang dir> only; logical properties everywhere.
   ============================================================= */

/* ---------- tokens ---------- */
:root{
  color-scheme:dark;
  --bg:#050505; --fg:#efe8d8; --mut:#8f8878; --gold:#d8bf8a;
  --ser:"Cormorant Garamond",Georgia,serif;
  --san:Jost,"Helvetica Neue",Arial,sans-serif;
  --hdr-h:100px;                      /* height of the fixed header (inner pages leave this space on top) */
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px); padding-bottom:env(safe-area-inset-bottom,0px);
}
/* Arabic: other fonts, and no letter-spacing (it breaks Arabic letter joining) */
html[lang="ar"]{--ser:"Amiri",Georgia,serif; --san:"Tajawal","Segoe UI",Tahoma,sans-serif}
html[lang="ar"] *{letter-spacing:0!important}

html{scroll-padding-top:env(safe-area-inset-top,0px); background:var(--bg)}
*{box-sizing:border-box}
body{margin:0; background:var(--bg); color:var(--fg); font-family:var(--san)}

/* ---------- header ---------- */
header{
  position:fixed; inset:0 0 auto 0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:calc(20px + env(safe-area-inset-top,0px)) 4vw 0;
}
/* the logo sits on the right in both languages (RTL does this by itself) */
html[dir="ltr"] header{flex-direction:row-reverse}
/* @persist wrappers (nav, currency picker, track-order button, language link, theme toggle, footer) must not become a flex/grid item of their own */
header [x-persist]{display:contents}
[x-persist="site-footer"]{display:contents}
.brand{line-height:0}
.brand img{display:block; height:80px; width:auto}
nav{display:flex; gap:clamp(18px,3vw,44px)}
nav a,.cta{
  position:relative; padding:4px 0; font-size:11px; letter-spacing:.22em; text-transform:uppercase;
  color:var(--t1); text-decoration:none; opacity:1;
}
nav a.on{opacity:1}
nav a.on:after{content:""; position:absolute; inset:auto 0 -4px 0; height:1px; background:var(--fg)}
nav a:hover{opacity:.7}
.cta{display:inline-flex; align-items:center; gap:8px; opacity:1; padding:9px 18px; border:1px solid rgba(var(--w),.35); border-radius:999px; transition:background-color .25s,border-color .25s,color .25s}
.cta:active,.cta:focus-visible{background:var(--btn-bg); border-color:var(--btn-bg); color:var(--cta-fg)}      /* white fill, no visible border */
@media (hover:hover){ .cta:hover{background:var(--btn-bg); border-color:var(--btn-bg); color:var(--cta-fg)} }
html[lang="ar"] nav a,html[lang="ar"] .cta{font-size:14px}
/* language switch (header) — round button: "EN" on the Arabic page, "ع" on the English page
   dark mode: transparent + border (same look as the track / currency buttons) · light mode: gold */
.lang{display:inline-grid; place-items:center; flex:none; width:38px; height:38px; padding:0; border:1px solid rgba(var(--w),.35); border-radius:50%; background:transparent; color:var(--t1); text-decoration:none; font:400 13px/1 "Jost",var(--san),sans-serif; transition:background-color .25s,border-color .25s,color .25s,transform .2s}
.lang[lang="ar"]{font-family:"Tajawal","Segoe UI",Tahoma,sans-serif; font-weight:700; font-size:17px}
.lang:active{transform:scale(.94)}
.lang:focus-visible{outline:2px solid var(--gold-tx); outline-offset:2px}
@media (hover:hover){ .lang:hover{background:var(--btn-bg); border-color:var(--btn-bg); color:var(--cta-fg)} }
/* actions group in the header: currency · track · language · theme */
.hdr-act{display:flex; align-items:center; gap:10px}

/* theme toggle — round button (dark: white fill · light: black fill). The sun/moon swap for light mode is in theme.css */
.tgl{
  display:inline-grid; place-items:center; flex:none; width:38px; height:38px; padding:0;
  border:1px solid var(--btn-bg); border-radius:50%; background:var(--btn-bg); color:var(--btn-fg); cursor:pointer;
  transition:opacity .25s,transform .2s;
}
.tgl svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}
.tgl .moon{display:none}                                   /* dark: shows the sun (press for light) */
.tgl:active{transform:scale(.94)}
.tgl:focus-visible{outline:2px solid var(--gold-tx); outline-offset:2px}
@media (hover:hover){ .tgl:hover{opacity:.85} }

/* currency picker (shown in the header where the page has it; prices are not converted in the static view) */
.cur{position:relative}
.cur-btn{background:transparent; font-family:var(--san); cursor:pointer}
.cur-btn svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round}
.cur-btn .chev{width:14px; height:14px; transition:transform .25s}
.cur-btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
.cur-list{position:absolute; inset-inline-start:0; top:calc(100% + 10px); z-index:60; min-width:230px; margin:0; padding:6px; list-style:none; background:var(--pill-bg); border:1px solid rgba(var(--w),.2); border-radius:15px; box-shadow:0 18px 40px var(--pill-shadow)}
.cur-list[hidden]{display:none}
.cur-list li{display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:10px; color:var(--t1); font-size:14px; cursor:pointer; outline:0}
.cur-list li:hover,.cur-list li:focus-visible{background:rgba(var(--w),.08)}
.cur-list b{min-width:36px; font:600 14px var(--san)}
.cur-list span{flex:1; font-size:13px; color:rgba(var(--w),.6)}
.cur-list svg{flex:none; width:16px; height:16px; fill:none; stroke:var(--gold-bg); stroke-width:2.2; stroke-linecap:round; stroke-linejoin:round; opacity:0}
.cur-list li[aria-selected="true"] svg{opacity:1}

/* mobile: logo + button on the first row, the menu on its own row underneath */
@media (max-width:720px){
  :root{--hdr-h:140px}
  header{flex-wrap:wrap; row-gap:4px; padding-bottom:10px}
  nav{order:3; flex:0 0 100%; justify-content:center; gap:22px}
  .hdr-act{gap:8px}
  .cur-btn{padding:9px 12px; gap:6px}
  .cur-btn .globe{display:none}
}

/* desktop: logo | menu | actions  — the menu stays centred whatever the width of the logo or the actions */
@media (min-width:721px){
  header{display:grid; grid-template-columns:1fr auto 1fr; column-gap:24px}
  header .brand{justify-self:start}
  header .hdr-act{justify-self:end}
  html[dir="ltr"] header{flex-direction:initial}
  html[dir="ltr"] header .brand{order:3; justify-self:end}
  html[dir="ltr"] header .hdr-act{order:1; justify-self:start}
  html[dir="ltr"] header nav{order:2}
}

/* شكل الهيدر: hdr-logo-right (افتراضي) أو hdr-logo-center — كلاس واحد على <header>، والشعار المركزي يبدأ من 901px */
@media (min-width:901px){
  html[dir] header.hdr-logo-center{display:grid; grid-template-columns:1fr auto 1fr; column-gap:24px}
  html[dir] header.hdr-logo-center .brand{grid-column:2; grid-row:1; justify-self:center; order:0}
  html[dir] header.hdr-logo-center nav{grid-column:1; grid-row:1; justify-self:start; order:0}
  html[dir] header.hdr-logo-center .hdr-act{grid-column:3; grid-row:1; justify-self:end; order:0}
  html[dir="ltr"] header.hdr-logo-center nav{grid-column:3; justify-self:end}
  html[dir="ltr"] header.hdr-logo-center .hdr-act{grid-column:1; justify-self:start}
}

/* the header turns into a dark glass bar as the page scrolls — pure CSS (scroll-driven animation), no script.
   ::before = the glass layer (fades in over the first 60px of scrolling) · ::after = the soft top shade used on phones (fades out).
   A browser without scroll-driven animations simply keeps the glass bar on all the time. */
header::before,header::after{content:""; position:absolute; inset:0 0 -8px 0; z-index:-1; pointer-events:none}
header::before{background:rgba(var(--hdr-rgb),.82); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); opacity:0}
@media (max-width:720px){
  header::before{bottom:2px}                    /* same height as the old solid bar (its bottom padding was 8px, not 10px) */
  header::after{bottom:0; background:linear-gradient(to bottom,rgba(var(--hdr-rgb),.8),rgba(var(--hdr-rgb),0))}
}
@keyframes hdr-glass{to{opacity:1}}
@keyframes hdr-shade{to{opacity:0}}
@supports (animation-timeline:scroll()){
  header::before{animation:hdr-glass linear both; animation-timeline:scroll(root); animation-range:0 60px}
  header::after{animation:hdr-shade linear both; animation-timeline:scroll(root); animation-range:0 60px}
}
@supports not (animation-timeline:scroll()){
  header::before{opacity:1}
}

/* =============================================================
   Footer (shared by every page that has one)
   Newsletter (text | email field) centred · one-row bottom bar
   ============================================================= */
.foot{background:var(--bg); border-top:1px solid rgba(var(--w),.2); padding:clamp(28px,4vh,40px) clamp(20px,4vw,64px) 22px; color:rgba(var(--w),.62)}
.foot svg{fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round}
.foot a{color:rgba(var(--w),.62); text-decoration:none; transition:color .2s}
.foot a:hover{color:var(--t1)}
.foot .sr{position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0}

/* ---------- newsletter ---------- */
.foot-top{display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:28px clamp(32px,4vw,64px); max-width:1140px; margin-inline:auto}
.news-txt{flex:1 1 380px; max-width:700px; display:flex; align-items:center; gap:18px; text-wrap:balance}
.news-badge{flex:none; display:grid; place-items:center; width:58px; height:58px; border:0; border-radius:16px; background:var(--card,rgba(var(--w),.08)); color:var(--gold-bg)}
.news-badge svg{width:32px; height:32px; stroke-width:1.5}
.news-copy{min-width:0}
/* One line on desktop for Arabic. The longer English line wraps instead, or it pushes the form onto its own row. */
@media (min-width:901px){ html[dir="rtl"] .news-s{white-space:nowrap} }
.news-t{margin:0; font-size:15px; font-weight:700; line-height:2; color:var(--t1)}
.news-s{margin:2px 0 0; font-size:14px; line-height:2}

.news-box{flex:0 1 400px; min-width:0}
.news-form{
  display:flex; align-items:center; gap:8px;
  padding:4px; border:1px solid transparent; border-radius:999px;
  background:var(--card,rgba(var(--w),.08));        /* same background as the contact cards */
  transition:border-color .25s, box-shadow .25s;
}
.news-form:focus-within{border-color:var(--gold-bg); box-shadow:0 0 0 3px rgba(232,183,110,.14)}
.news-ic{flex:none; width:20px; height:20px; margin-inline-start:14px; color:rgba(var(--w),.55)}
.news-form input{flex:1; min-width:0; padding:8px 4px; border:0; background:none; color:var(--t1); outline:0; font:400 13px var(--san); text-align:start}
.news-form input:not(:placeholder-shown){direction:ltr; text-align:left; font-size:14px}   /* typed e-mail address reads left-to-right */
.news-form input::placeholder{color:rgba(var(--w),.55); font-size:13px}
.news-form button{
  flex:none; display:inline-flex; align-items:center; gap:8px;
  padding:9px 22px; border:0; border-radius:999px; cursor:pointer;
  background:#000; color:#fff; font:400 14px var(--san);
  transition:background-color .25s, transform .2s;
}
.news-form button:hover{background:var(--gold-bg); color:#14110d}
.news-form button:active{transform:scale(.97)}
.news-form button svg{width:16px; height:16px; stroke:currentColor; stroke-width:2; transition:translate .25s}
.news-form button:hover svg{translate:-4px 0}
html[dir="ltr"] .news-form button svg{scale:-1 1}
html[dir="ltr"] .news-form button:hover svg{translate:4px 0}
.news-msg{margin:12px 14px 0; font-size:14px; color:var(--okc)}
.news-msg[hidden]{display:none}

/* bottom bar: copyright | links | payments — one row on desktop */
.foot-bot{max-width:1140px; margin:clamp(20px,3vh,28px) auto 0; padding-top:18px; border-top:1px solid rgba(var(--w),.14); display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:14px 24px}
.foot-meta{display:flex; flex-wrap:wrap; align-items:center; gap:10px 24px}
.copy{margin:0; font-size:13px}
.foot-links{display:flex; flex-wrap:wrap; gap:8px 22px; margin:0; padding:0; list-style:none}
.foot-links a{font-size:13px}
.pay{display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex:none}
.pay .lbl{margin-inline-end:4px; font-size:13px}
.pay b{padding:6px 11px; border:1px solid rgba(var(--w),.22); border-radius:6px; font:600 12px/1 "Jost",var(--san),sans-serif; letter-spacing:.04em; color:var(--t1); direction:ltr; white-space:nowrap}
@media (min-width:1260px){
  .foot-bot,.foot-meta,.foot-links,.pay{flex-wrap:nowrap}
  .copy,.foot-links a,.pay .lbl{white-space:nowrap}
  .foot-links{gap:0 20px} .foot-meta{gap:0 20px}
}
@media (max-width:900px){
  .foot-top{flex-direction:column; text-align:center}
  .news-txt{flex:none; flex-direction:column; gap:12px}
  .news-box{flex:none; width:min(100%,420px)}
  .foot-bot,.foot-meta{flex-direction:column; justify-content:center; text-align:center}
  .foot-links,.pay{justify-content:center}
}


/* شاشات الموبايل الصغيرة (أقل من 410px): اللوجو والأزرار في صف واحد */
@media (max-width:410px){
  .brand img{height:64px}
  .hdr-act{gap:6px}
  .lang,.tgl{width:34px; height:34px}

  /* زر "تتبع طلبك": أيقونة الشاحنة بس */
  header .cta:not(.cur-btn){width:34px; height:34px; padding:0; gap:0; justify-content:center; font-size:0!important}

  /* زر العملة: رمز العملة (ر.ع. / ر.س ...) بدل السهم */
  header .cur .cur-btn{width:34px!important; height:34px!important; min-width:0!important; padding:0!important; gap:0!important; justify-content:center}
  header .cur .cur-btn .globe,
  header .cur .cur-btn .chev{display:none!important}
  header .cur .cur-btn #cur-now{display:inline!important; font-size:11px!important; font-weight:600; line-height:1; white-space:nowrap}
}