/* ==========================================================================
   Be Family Shell v1.0.0 — shared across every Be site.

   Two jobs:
     1. The FAMILY VIEW STANDARD: one set of --be-* tokens (type scale, content
        width, section rhythm, control sizes) that every theme's own rules
        consume, so all ten sites sit at the same visual "zoom" on a desktop.
     2. The MOBILE APP SHELL: a bottom tab bar, scroll-aware header, safe-area
        handling and touch polish, so every site behaves like one app family
        on a phone.

   Themes never edit this file. Site colours arrive as inline :root overrides
   printed by be-shell.php from configs/<site>.json.
   ========================================================================== */

:root{
  /* ---- layout ---- */
  --be-max:1440px;                          /* the family content width. 1920 screens centre it. */
  --be-max-narrow:1080px;                   /* long-form prose */
  --be-gutter:clamp(20px,3.2vw,48px);       /* 20 @phone · 46 @1440 · 48 @1500+ */
  --be-sec-y:clamp(40px,3.9vw,64px);        /* per side: 40 @phone · 56 @1440 · 64 @1640+ */
  --be-sec-y-tight:clamp(28px,2.6vw,40px);
  --be-header-h:72px;                       /* desktop main header */
  --be-header-h-m:60px;                     /* phone main header */
  --be-bar-h:40px;                          /* family brand bar */

  /* ---- type: solved between 380px and 1800px so the size actually moves ----
         380     1440    1800  */
  --be-h1:clamp(36px,calc(26.366px + 2.5352vw),72px);          /* 36 · 63 · 72  hero headline */
  --be-h1-page:clamp(32px,calc(26.648px + 1.4085vw),52px);     /* 32 · 47 · 52  inner page headline */
  --be-h2:clamp(28px,calc(23.718px + 1.1268vw),44px);          /* 28 · 40 · 44  section heading */
  --be-h3:clamp(19px,calc(17.662px + .3521vw),24px);           /* 19 · 23 · 24  */
  --be-h3-card:clamp(17.5px,calc(16.831px + .1761vw),20px);    /* 17.5 · 19.4 · 20 dense card title */
  --be-lede-hero:clamp(19px,calc(17.93px + .2817vw),23px);     /* 19 · 22 · 23 */
  --be-lede:clamp(18px,calc(17.197px + .2113vw),21px);         /* 18 · 20 · 21 */
  --be-body:17.5px; --be-body-lh:1.6;                          /* flat: body copy does not scale */
  --be-body-card:16.25px;                                      /* denser measure inside cards */
  --be-small:14px;                                             /* captions, meta, footer links */
  --be-eyebrow:13px;                                           /* mono/uppercase labels */
  --be-nav:15px;                                               /* primary nav links */
  --be-btn:15.5px; --be-btn-h:48px; --be-btn-h-m:52px;         /* buttons */
  --be-h1-lh:1.05; --be-h2-lh:1.12; --be-h3-lh:1.25; --be-lede-lh:1.6;

  /* ---- app shell ---- */
  --be-tab-h:64px;
  --be-safe-b:env(safe-area-inset-bottom,0px);
  --be-tab-bp:900px;                                           /* tab bar shows below this (see media queries) */

  /* ---- colours: overridden per site by be-shell.php ---- */
  --be-accent:#1E63B8;        /* active tab, hero tab background */
  --be-accent-ink:#FFFFFF;    /* icon on the hero tab */
  --be-tab-bg:rgba(255,255,255,.88);
  --be-tab-ink:#12203A;
  --be-tab-mute:#5D6E86;
  --be-tab-hair:rgba(18,32,58,.12);
  --be-tab-shadow:0 -8px 30px -18px rgba(18,32,58,.35);
}

@media (max-width:640px){
  :root{ --be-body:17px; }
}

/* ==========================================================================
   Touch polish — every site, every width
   ========================================================================== */
html{ -webkit-text-size-adjust:100%; }
a,button,[role="button"],summary{ -webkit-tap-highlight-color:transparent; touch-action:manipulation; }
.be-hidden{ display:none !important; }

/* Scroll-aware header: be-shell.js toggles .be-scrolled on the configured
   header once the page has moved. A hairline plus a soft drop reads as
   "this bar is floating over content", which is what native apps do. */
.be-scrolled{ box-shadow:0 1px 0 rgba(0,0,0,.06),0 10px 30px -18px rgba(0,0,0,.28); }

/* ==========================================================================
   Bottom tab bar
   ========================================================================== */
.be-tabbar{
  position:fixed; left:0; right:0; bottom:0; top:auto; z-index:940;
  margin:0; border-bottom:0; width:auto; max-width:none; min-height:0; /* themes style bare <nav>; none of it applies here */
  display:none;
  height:calc(var(--be-tab-h) + var(--be-safe-b));
  padding:0 max(4px,env(safe-area-inset-left,0px)) var(--be-safe-b) max(4px,env(safe-area-inset-right,0px));
  background:var(--be-tab-bg);
  -webkit-backdrop-filter:saturate(180%) blur(22px);
  backdrop-filter:saturate(180%) blur(22px);
  border-top:1px solid var(--be-tab-hair);
  box-shadow:var(--be-tab-shadow);
  font-family:inherit;
  transform:translateY(0);
  transition:transform .28s cubic-bezier(.22,.61,.36,1),opacity .2s;
}
.be-tabbar-in{
  display:grid; grid-template-columns:repeat(5,1fr); align-items:end;
  height:var(--be-tab-h); max-width:560px; margin:0 auto;
}
.be-tab{
  appearance:none; -webkit-appearance:none; background:none; border:0; margin:0;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  height:var(--be-tab-h); min-width:44px; padding:6px 2px 8px;
  color:var(--be-tab-mute); text-decoration:none; cursor:pointer;
  font:600 11px/1.1 inherit; letter-spacing:.01em; white-space:nowrap;
  transition:color .15s,transform .12s;
  position:relative;
}
.be-tab:active{ transform:scale(.92); }
.be-tab-i{ display:block; width:24px; height:24px; }
.be-tab-i svg{ display:block; width:24px; height:24px; stroke:currentColor; fill:none; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.be-tab-l{ display:block; font-size:11px; font-weight:600; }
.be-tab.is-on{ color:var(--be-accent); }
.be-tab.is-on .be-tab-i svg{ stroke-width:2.2; }
.be-tab:focus-visible{ outline:2px solid var(--be-accent); outline-offset:-4px; border-radius:12px; }

/* the raised centre action */
.be-tab--hero{ color:var(--be-tab-ink); }
.be-tab--hero .be-tab-i{
  width:54px; height:54px; margin-top:-26px; border-radius:50%;
  background:var(--be-accent); color:var(--be-accent-ink);
  display:grid; place-items:center;
  box-shadow:0 10px 24px -8px color-mix(in srgb,var(--be-accent) 70%,transparent),0 0 0 4px var(--be-tab-bg);
  transition:transform .15s,box-shadow .15s;
}
.be-tab--hero .be-tab-i svg{ width:26px; height:26px; stroke:currentColor; stroke-width:2; }
.be-tab--hero .be-tab-i img{ width:28px; height:28px; display:block; }
.be-tab--hero:active .be-tab-i{ transform:scale(.94); }
.be-tab--hero .be-tab-l{ color:var(--be-tab-ink); }

/* numeric badge (cart count etc.) */
.be-tab-badge{
  position:absolute; top:6px; left:calc(50% + 6px);
  min-width:18px; height:18px; padding:0 5px; border-radius:999px;
  background:var(--be-accent); color:var(--be-accent-ink);
  font:700 11px/18px inherit; text-align:center;
}
.be-tab-badge[data-n="0"],.be-tab-badge[data-n=""]{ display:none; }

/* Show the bar on phones and small tablets, and give the page room for it.
   The page padding lives on <html> so no theme's body rule can cancel it. */
@media (max-width:899px){
  .be-tabbar{ display:block; }
  html.be-has-tabbar{ padding-bottom:calc(var(--be-tab-h) + var(--be-safe-b)); }
  html.be-has-tabbar body{ padding-bottom:0; }
  /* anything the site already floats above the bottom edge moves up */
  html.be-has-tabbar .be-raised{ bottom:calc(var(--be-tab-h) + var(--be-safe-b) + 14px) !important; }
  /* the theme's own drawer / menu takes the whole screen; the bar steps aside */
  html.be-drawer-open .be-tabbar{ transform:translateY(calc(100% + 40px)); pointer-events:none; }
  html.be-has-tabbar{ scroll-padding-bottom:calc(var(--be-tab-h) + var(--be-safe-b)); }
}

/* Installed to the home screen: no browser chrome, so the bar is the app's
   only persistent navigation. Slightly taller, no blur cost. */
@media (display-mode:standalone){
  :root{ --be-tab-h:68px; }
  html{ overscroll-behavior-y:none; }
}

@media (prefers-reduced-motion:reduce){
  .be-tabbar,.be-tab,.be-tab--hero .be-tab-i{ transition:none; }
}

/* ==========================================================================
   Bottom sheet — opened by a tab with "sheet":[...] (e.g. a Services grid)
   ========================================================================== */
.be-sheet{
  position:fixed; inset:0; z-index:960; display:flex; align-items:flex-end; justify-content:center;
  background:rgba(1,18,40,.48); opacity:0; transition:opacity .25s ease;
  -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
}
.be-sheet.is-open{ opacity:1; }
.be-sheet-panel{
  width:100%; max-width:560px; background:#fff; color:var(--be-tab-ink,#01224D);
  border-radius:22px 22px 0 0; padding:10px 16px calc(20px + var(--be-safe-b));
  box-shadow:0 -24px 60px -24px rgba(1,34,77,.55);
  transform:translateY(100%); transition:transform .32s cubic-bezier(.22,.61,.36,1);
}
.be-sheet.is-open .be-sheet-panel{ transform:translateY(0); }
.be-sheet-grab{ width:42px; height:4px; border-radius:999px; background:rgba(1,34,77,.18); margin:4px auto 12px; }
.be-sheet-h{ margin:0 4px 14px; font:700 18px/1.2 inherit; letter-spacing:.01em; }
.be-sheet-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.be-sheet-item{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  min-height:92px; padding:16px 8px; border-radius:16px; text-decoration:none;
  background:#F2F7FC; color:var(--be-tab-ink,#01224D); border:1px solid rgba(1,34,77,.06);
  transition:transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.be-sheet-item:active{ transform:scale(.95); }
.be-sheet-item:hover{ background:#E8F1FB; box-shadow:0 10px 24px -14px rgba(1,34,77,.45); }
.be-sheet-item:focus-visible{ outline:2px solid var(--be-accent,#0E63C8); outline-offset:2px; }
.be-sheet-ic{ width:46px; height:46px; border-radius:50%; display:grid; place-items:center; background:var(--be-accent,#0E63C8); color:var(--be-accent-ink,#fff); }
.be-sheet-ic svg{ width:24px; height:24px; stroke:currentColor; fill:none; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.be-sheet-ic img{ width:26px; height:26px; display:block; }
.be-sheet-l{ font:600 13px/1.15 inherit; text-align:center; }
.be-sheet-sub{ font:500 11px/1.1 inherit; color:var(--be-tab-mute,#5A6B84); text-align:center; }
html.be-sheet-open{ overflow:hidden; }
@media (min-width:900px){ .be-sheet{ display:none; } }
@media (prefers-reduced-motion:reduce){ .be-sheet,.be-sheet-panel{ transition:opacity .01s; } }

/* ==========================================================================
   WhatsApp float (config: "whatsapp":{...})
   ========================================================================== */
.be-wa{
  position:fixed; right:16px; z-index:935;
  bottom:calc(16px + env(safe-area-inset-bottom,0px));
  width:56px; height:56px; border-radius:50%;
  display:grid; place-items:center;
  background:#25D366; color:#fff; text-decoration:none;
  box-shadow:0 12px 26px -8px rgba(37,211,102,.7), 0 2px 10px rgba(0,0,0,.22);
  transition:transform .15s ease, box-shadow .2s ease;
}
.be-wa:hover{ transform:translateY(-2px) scale(1.04); color:#fff; }
.be-wa:active{ transform:scale(.93); }
.be-wa:focus-visible{ outline:3px solid rgba(37,211,102,.5); outline-offset:3px; }
.be-wa svg{ display:block; }
.be-wa--pulse::before{
  content:""; position:absolute; inset:0; border-radius:50%; pointer-events:none;
  box-shadow:0 0 0 0 rgba(37,211,102,.55); animation:be-wa-pulse 2.6s infinite;
}
@keyframes be-wa-pulse{ 70%{ box-shadow:0 0 0 16px rgba(37,211,102,0); } 100%{ box-shadow:0 0 0 0 rgba(37,211,102,0); } }
/* lift above the bottom tab bar on phones */
@media (max-width:899px){
  html.be-has-tabbar .be-wa{ bottom:calc(var(--be-tab-h) + var(--be-safe-b) + 14px); }
}
@media (prefers-reduced-motion:reduce){ .be-wa{ transition:none; } .be-wa--pulse::before{ animation:none; } }
@media print{ .be-wa{ display:none !important; } }

@media print{ .be-tabbar{ display:none !important; } }

/* Keyboard up: the bar would sit on top of the keyboard, so it steps aside
   while a text field has focus (be-shell.js toggles .be-typing). */
@media (max-width:899px){
  html.be-typing .be-tabbar{ transform:translateY(calc(100% + 40px)); }
}
