/* ============================================================
   VIRALIS — shared base
   Tokens, reset, nav, footer, mobile bar. Loaded by every page
   before its own <style>, so a page can override any of it.
   Palette source: VIRALIS Website Integrated Execution Handoff
   (stone black, warm gold, creamy ivory, clinical gray).
   ============================================================ */

/* ---------- Brand fonts (self-hosted, OFL; sources in resources/brand-src/fonts) ----------
   Montserrat = headings, Manrope = body, Montserrat Arabic = all Arabic text.
   A browser only downloads a face when text on the page uses it. */
@font-face{ font-family:'Montserrat'; src:url('../fonts/montserrat-var.woff2') format('woff2'); font-weight:100 900; font-style:normal; font-display:swap; }
@font-face{ font-family:'Manrope'; src:url('../fonts/manrope-var.woff2') format('woff2'); font-weight:200 800; font-style:normal; font-display:swap; }
@font-face{ font-family:'Montserrat Arabic'; src:url('../fonts/montserrat-arabic-regular.woff2') format('woff2'); font-weight:400; font-display:swap; }
@font-face{ font-family:'Montserrat Arabic'; src:url('../fonts/montserrat-arabic-medium.woff2') format('woff2'); font-weight:500; font-display:swap; }
@font-face{ font-family:'Montserrat Arabic'; src:url('../fonts/montserrat-arabic-semibold.woff2') format('woff2'); font-weight:600; font-display:swap; }
@font-face{ font-family:'Montserrat Arabic'; src:url('../fonts/montserrat-arabic-bold.woff2') format('woff2'); font-weight:700 900; font-display:swap; }

/* ---------- Brand tokens ---------- */
:root{
  --black:#0A0A0D;        /* primary dark: nav, hero, footer, premium sections */
  --ink:#141418;          /* cards / panels on black (derived) */
  --gold:#C8A772;         /* signature accent — for use on dark, or as fills/rules */
  --gold-deep:#7A5C2B;    /* gold for TEXT on light (5.5:1 on ivory; --gold is only 2:1) */
  --ivory:#F4F1EA;        /* light backgrounds, text on dark */
  --stone:#E8E4DC;        /* borders, dividers, secondary surfaces */
  --gray:#71717A;         /* secondary text, metadata */
  --sage:#4B7A72;         /* small "science / recovery" accent only — not identity */
  --err:#B4534A;

  --line-on-dark:rgba(232,228,220,.16);
  --line-on-light:rgba(10,10,13,.14);

  /* Legacy names used across the page stylesheets. They now resolve to the
     brand palette so every page follows it; migrate call sites to the brand
     names over time, then delete this block.
       basalt→black, paper→ivory, bone→stone,
       verdigris/bronze→gold family (deep variant where used as text on light) */
  --basalt:var(--black);
  --paper:var(--ivory);
  --bone:var(--stone);
  --verdigris:var(--gold-deep);
  --verdigris-light:var(--gold);
  --bronze:var(--gold-deep);
  --bronze-light:var(--gold);

  --font-display:'Montserrat', 'Montserrat Arabic', sans-serif;
  --font-body:'Manrope', 'Montserrat Arabic', sans-serif;
  --font-arabic:'Montserrat Arabic', sans-serif;
  --ease:cubic-bezier(.22,1,.36,1);
  --container:1360px;     /* pages may override */
  --pad:clamp(1.25rem, 5vw, 4rem);
}

/* ---------- Reset ---------- */
*,*::before,*::after{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }
html[dir="rtl"]{ direction:rtl; }
html[lang="ar"] body, body.font-arabic{ font-family:var(--font-arabic); }
img,svg{ display:block; max-width:100%; }
a{ color:inherit; text-decoration:none; }
button{ font:inherit; color:inherit; background:none; border:none; cursor:pointer; }
ul{ list-style:none; }
[x-cloak]{ display:none !important; }

.container{ max-width:var(--container); margin:0 auto; padding-inline:var(--pad); }

/* Focus ring: deep gold on light pages; a page on a dark body sets --focus:var(--gold) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible{
  outline:2px solid var(--focus, var(--gold-deep));
  outline-offset:3px;   /* no border-radius here: the ring follows each element's own shape (pills stay pills) */
}
.nav :focus-visible, footer :focus-visible, .mobile-menu :focus-visible, .mobile-bar :focus-visible{
  outline-color:var(--gold);
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ animation-duration:.001ms !important; transition-duration:.001ms !important; }
}

/* ============================================================
   NAV
   .nav            solid black bar (cart / checkout, logo + language only)
   .nav--sticky    full nav on inner pages
   .nav--overlay   home: transparent over the hero, solid once scrolled
   ============================================================ */
.nav{
  position:relative; z-index:50;
  background:var(--black); color:var(--ivory);
  padding-block:1.15rem;
  border-bottom:1px solid var(--line-on-dark);
}
.nav--sticky{
  position:sticky; top:0;
  background:rgba(10,10,13,.96); backdrop-filter:blur(10px);
}
.nav--overlay{
  position:fixed; top:0; inset-inline:0;
  background:transparent; border-bottom-color:transparent;
  transition:background .35s var(--ease), border-color .35s var(--ease);
}
.nav--overlay.is-scrolled{
  background:rgba(10,10,13,.94); backdrop-filter:blur(10px);
  border-bottom-color:var(--line-on-dark);
}

.nav__row{ display:flex; align-items:center; justify-content:space-between; gap:2rem; }
/* logo image (shield + wordmark, 6:1) — height drives the size; narrower on phones so the icon row fits */
.nav__logo{ display:block; flex-shrink:0; }
.nav__logo img{ display:block; height:34px; width:auto; }
@media (max-width:1240px){ .nav__logo img{ height:28px; } }
@media (max-width:880px){ .nav__logo img{ height:24px; } }
@media (max-width:420px){ .nav__logo img{ height:20px; } }

.nav__links{ display:flex; gap:2.1rem; font-size:.95rem; }
.nav__links a{ position:relative; display:inline-block; padding-block:.2rem; color:var(--ivory); }
.nav__links a::after{
  content:''; position:absolute; left:0; right:0; bottom:-2px; height:1px;
  background:var(--gold); transform:scaleX(0); transform-origin:right;
  transition:transform .35s var(--ease);
}
.nav__links a:hover::after, .nav__links a.is-current::after{ transform:scaleX(1); transform-origin:left; }
html[dir="rtl"] .nav__links a::after{ transform-origin:left; }
html[dir="rtl"] .nav__links a:hover::after, html[dir="rtl"] .nav__links a.is-current::after{ transform-origin:right; }

.nav__actions{ display:flex; align-items:center; gap:1.3rem; }
.icon-btn{ position:relative; width:21px; height:21px; color:var(--ivory); transition:color .25s; }
.icon-btn:hover{ color:var(--gold); }
.nav__login{
  display:inline-flex; align-items:center; gap:.45rem; font-size:.8rem; letter-spacing:.03em; color:var(--gold);
  border:1px solid rgba(200,167,114,.6); padding:.38rem .9rem; border-radius:999px;
  transition:background .25s, color .25s, border-color .25s;
}
.nav__login svg{ width:15px; height:15px; }
.nav__login:hover{ background:var(--gold); color:var(--black); border-color:var(--gold); }
@media (max-width:880px){ .nav__login{ padding:.42rem; } .nav__login span{ display:none; } }
/* signed in: initials + first name, opens the account menu */
.nav-account{ position:relative; }
.nav-account__btn{ padding-inline-start:.3rem; }
.nav-account__initials{ width:22px; height:22px; border-radius:50%; background:var(--gold); color:var(--black); display:grid; place-items:center; font-size:.62rem; font-weight:600; letter-spacing:0; }
.nav-account__btn:hover .nav-account__initials{ background:var(--black); color:var(--gold); }
.nav-account__btn > span:last-child{ max-width:9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.nav-account__menu{ position:absolute; top:calc(100% + .6rem); inset-inline-end:0; z-index:60; min-width:230px; background:var(--ivory); color:var(--black); border:1px solid var(--line-on-light); border-radius:4px; box-shadow:0 18px 40px rgba(10,10,13,.18); padding:.5rem; }
.nav-account__who{ padding:.6rem .7rem .7rem; margin-bottom:.3rem; border-bottom:1px solid var(--line-on-light); display:grid; gap:.15rem; }
.nav-account__who strong{ font-weight:600; font-size:.9rem; }
.nav-account__who span{ font-size:.78rem; color:var(--gray); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
html[dir="rtl"] .nav-account__who span{ text-align:right; }
.nav-account__menu a, .nav-account__menu button{ display:block; width:100%; text-align:start; padding:.55rem .7rem; font-size:.88rem; border-radius:2px; }
.nav-account__menu a:hover, .nav-account__menu button:hover{ background:var(--stone); }
.nav-account__menu form{ border-top:1px solid var(--line-on-light); margin-top:.3rem; padding-top:.3rem; }
.nav-account__menu .nav-account__who span{ display:block; }
@media (max-width:880px){ .nav-account__btn{ padding:.2rem; } .nav-account__btn .nav-account__initials{ display:grid; width:25px; height:25px; } }
.mobile-menu__signout{ font-family:var(--font-display); font-size:1.9rem; }
.mobile-menu__signout:hover{ color:var(--gold); }
/* header bag: gold circle, same treatment as the Login pill */
.nav__cart{
  width:31px; height:31px; display:grid; place-items:center; flex-shrink:0;
  border:1px solid rgba(200,167,114,.6); border-radius:50%; color:var(--gold);
  transition:background .25s, color .25s, border-color .25s;
}
.nav__cart svg{ width:16px; height:16px; }
.nav__cart:hover{ background:var(--gold); color:var(--black); border-color:var(--gold); }
.nav__cart .cart-badge{ top:-5px; inset-inline-end:-6px; box-shadow:0 0 0 2px var(--black); }
.cart-badge{
  position:absolute; top:-7px; inset-inline-end:-9px; min-width:16px; height:16px; padding:0 4px;
  display:grid; place-items:center; border-radius:999px;
  background:var(--gold); color:var(--black); font-size:.62rem; font-weight:700; line-height:1;
}
.cart-badge[hidden]{ display:none; }
.lang-toggle{
  font-size:.8rem; letter-spacing:.04em; color:var(--ivory);
  border:1px solid rgba(232,228,220,.4); padding:.38rem .8rem; border-radius:999px;
  transition:border-color .25s, color .25s;
}
.lang-toggle:hover{ border-color:var(--gold); color:var(--gold); }

.nav__burger{ display:none; width:24px; height:18px; position:relative; }
.nav__burger span{ position:absolute; left:0; right:0; height:1.5px; background:var(--ivory); }
.nav__burger span:nth-child(1){ top:0; }
.nav__burger span:nth-child(2){ top:8px; }
.nav__burger span:nth-child(3){ top:16px; }

/* 7 links + image logo + 3 actions: compact between 1100-1240px, burger menu below 1100px */
@media (max-width:1240px){
  .nav__row{ gap:1.5rem; }
  .nav__links{ gap:1.4rem; font-size:.9rem; }
}
@media (max-width:1100px){
  .nav__links{ display:none; }
  .nav__burger{ display:block; }
}
/* small phones: logo + 4 controls must fit in ~350px */
@media (max-width:420px){
  .nav__row{ gap:1rem; }
  .nav__actions{ gap:.9rem; }
  .lang-toggle{ padding:.34rem .6rem; font-size:.75rem; }
}

.mobile-menu{
  position:fixed; inset:0; z-index:80;
  background:var(--black); color:var(--ivory);
  display:flex; flex-direction:column; justify-content:center; gap:1.8rem; padding:var(--pad);
}
.mobile-menu a{ font-family:var(--font-display); font-size:1.9rem; }
.mobile-menu a:hover{ color:var(--gold); }
.mobile-menu__close{ position:absolute; top:1.5rem; inset-inline-end:1.5rem; width:24px; height:24px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer{ background:var(--black); color:var(--ivory); border-top:1px solid var(--line-on-dark); }
.footer__top{ display:grid; grid-template-columns:1.4fr repeat(3,1fr); gap:2.5rem; padding-block:clamp(3rem,6vw,4.5rem); }
.footer__brand{ display:inline-block; margin-bottom:1.2rem; }
.footer__brand img{ display:block; height:56px; width:auto; max-width:100%; }
.footer__blurb{ color:var(--stone); opacity:.7; max-width:32ch; font-size:.9rem; }
.footer__col h4{ font-size:.82rem; color:var(--gold); margin-bottom:1rem; font-weight:500; }
.footer__col ul{ display:flex; flex-direction:column; gap:.55rem; font-size:.92rem; }
.footer__col a{ transition:color .25s; }
.footer__col a:hover{ color:var(--gold); }
.footer__bottom{
  border-top:1px solid var(--line-on-dark); padding-block:1.5rem;
  display:flex; flex-wrap:wrap; justify-content:space-between; gap:1rem; font-size:.8rem; opacity:.65;
}
.social-row{ list-style:none; display:flex; flex-wrap:wrap; gap:.65rem; margin-top:1.3rem; }
.social-row a{
  width:38px; height:38px; border-radius:50%; display:grid; place-items:center; color:var(--ivory);
  border:1px solid rgba(232,228,220,.35); transition:border-color .25s, color .25s, background .25s;
}
.social-row a:hover{ border-color:var(--gold); color:var(--gold); }
.social-row svg{ width:17px; height:17px; }
.social-row--light a{ color:var(--black); border-color:var(--line-on-light); }
.social-row--light a:hover{ border-color:var(--gold-deep); color:var(--gold-deep); }
/* minimal footer (cart / checkout) */
.footer__row{ display:flex; justify-content:space-between; flex-wrap:wrap; gap:1rem; padding-block:2rem; font-size:.82rem; opacity:.65; }

@media (max-width:820px){ .footer__top{ grid-template-columns:1fr 1fr; } }
/* phones: centred brand block, the three link columns side by side, centred bottom row */
@media (max-width:520px){
  .footer__top{ grid-template-columns:repeat(3,1fr); gap:2.2rem 1rem; text-align:center; }
  .footer__top > :first-child{ grid-column:1 / -1; }
  .footer__blurb{ margin-inline:auto; }
  .footer__top .social-row{ justify-content:center; }
  .footer__col ul{ align-items:center; font-size:.88rem; }
  .footer__bottom{ flex-direction:column; align-items:center; text-align:center; gap:.4rem; }
}

/* ============================================================
   MOBILE STICKY BAR + FLOATING CHAT BUTTON
   (each page sets its own .fab-chat bottom offset at <=880px so it
   clears that page's sticky bars)
   ============================================================ */
.mobile-bar{
  position:fixed; bottom:0; inset-inline:0; z-index:60; display:none;
  background:rgba(10,10,13,.96); backdrop-filter:blur(10px); border-top:1px solid var(--line-on-dark);
  color:var(--stone); padding:.7rem var(--pad); justify-content:space-between; align-items:center;
}
.mobile-bar__item{ display:flex; flex-direction:column; align-items:center; gap:.25rem; font-size:.68rem; transition:color .25s; }
.mobile-bar__item:hover{ color:var(--gold); }
.mobile-bar__item svg{ width:20px; height:20px; }
@media (max-width:880px){
  .mobile-bar{ display:flex; }
  /* keep the footer's last row clear of the fixed bar */
  body:has(.mobile-bar) footer{ padding-bottom:4.5rem; }
}

.fab-chat{
  position:fixed; bottom:1.6rem; inset-inline-end:1.6rem; z-index:65;
  width:54px; height:54px; border-radius:50%;
  background:var(--gold); color:var(--black);
  display:flex; align-items:center; justify-content:center; box-shadow:0 8px 24px rgba(0,0,0,.35);
}
.fab-chat svg{ width:23px; height:23px; }

/* ---- cookie bar (partials/cookie-bar) ---- */
.cookie-bar{ position:fixed; z-index:85; inset-inline:1rem; bottom:1rem; max-width:720px; margin-inline:auto; display:flex; align-items:center; gap:1rem 1.4rem; flex-wrap:wrap;
  padding:1rem 1.2rem; background:var(--black); color:var(--ivory); border:1px solid rgba(200,167,114,.35); border-radius:6px; box-shadow:0 18px 40px rgba(10,10,13,.3); font-size:.88rem; line-height:1.5; }
.cookie-bar[hidden]{ display:none; }
.cookie-bar p{ flex:1 1 320px; margin:0; }
.cookie-bar a{ color:var(--gold); text-decoration:underline; margin-inline-start:.3rem; }
.cookie-bar__actions{ display:flex; gap:.6rem; }
.cookie-bar__btn{ min-height:40px; padding-inline:1.3rem; border-radius:2px; background:var(--gold); color:var(--black); font-size:.86rem; font-weight:500; }
.cookie-bar__btn:hover{ background:var(--ivory); }
.cookie-bar__btn--ghost{ background:transparent; color:var(--ivory); border:1px solid rgba(244,241,234,.4); }
.cookie-bar__btn--ghost:hover{ background:transparent; border-color:var(--ivory); }
@media (max-width:600px){ .cookie-bar{ bottom:.6rem; inset-inline:.6rem; } .cookie-bar__actions{ width:100%; } .cookie-bar__btn{ flex:1; } }
