/* Saucr — Liquid Glass layer.
   Apple's rule: glass is the CONTROL layer floating over content — tab bar,
   action buttons, sheets. Content (bottles, cards, the logo) stays matte.
   Refraction (SVG displacement in backdrop-filter) only exists in Chromium;
   Safari/WKWebView get a frosted fallback from liquid-glass.js (.lg-fallback).
   Loads AFTER app.css and overrides only the control layer.
   Never put `position` on .lg: it would clobber .tabbar/.toast position:fixed. */

:root{
  --glass-tint:rgba(26,18,14,.6);
  --glass-edge:rgba(244,235,217,.2);
  --glass-hi:rgba(255,246,230,.3);
  --tab-h:64px;
  --glare:0px;            /* glass.js drifts this with scroll */
  --spring:cubic-bezier(.32,1.45,.5,1);
  --lead:cubic-bezier(.2,1.25,.4,1);     /* leading edge: quick, slight overshoot */
  --trail:cubic-bezier(.45,.05,.15,1);   /* trailing edge: smooth catch-up, no bounce */
}

/* shared dressing; liquid-glass.js owns backdrop-filter, we own the rest */
.lg{
  isolation:isolate;
  background:var(--glass-tint);
}
.tabbar.lg{background:linear-gradient(180deg,rgba(30,21,16,.52) 0%,rgba(16,11,8,.84) 100%)}
.lg{
  border:1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 0 rgba(0,0,0,.3),
    0 18px 40px -18px rgba(0,0,0,.85),
    0 2px 6px rgba(0,0,0,.28);
}
/* specular glare: a diagonal sheen that slides with --glare, under the children */
.lg::before{
  content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:-1;
  background:linear-gradient(112deg,
    rgba(255,255,255,0) 0%,rgba(255,255,255,.17) 18%,rgba(255,255,255,.03) 34%,
    rgba(255,255,255,0) 52%,rgba(255,255,255,.07) 78%,rgba(255,255,255,0) 100%);
  background-size:220% 100%;
  background-position:calc(50% + var(--glare)) 0;
}
.lg.lg-fallback{background:rgba(26,18,14,.7)}

/* ---------- tab bar: floating pill with a jelly lozenge ---------- */
body{padding-bottom:calc(var(--tab-h) + 28px + var(--safe-b))}
.tabbar{
  left:max(16px,env(safe-area-inset-left,0px));right:max(16px,env(safe-area-inset-right,0px));
  bottom:calc(14px + var(--safe-b));
  border-radius:999px;border-top:0;padding:5px;gap:4px;
  background:linear-gradient(180deg,rgba(30,21,16,.52) 0%,rgba(16,11,8,.84) 100%);
  transform-origin:50% 100%;
  transition:scale .3s var(--spring),box-shadow .2s ease;
}
/* interactive glass: the whole bar swells and brightens while touched */
.tabbar.lifting{
  scale:1.04;
  box-shadow:inset 0 1px 0 rgba(255,246,230,.42),inset 0 -1px 0 rgba(0,0,0,.3),
    0 0 0 1px rgba(255,255,255,.12),0 26px 50px -18px rgba(0,0,0,.9),0 4px 10px rgba(0,0,0,.3);
}
.tabbar.lg-fallback{background:linear-gradient(180deg,rgba(30,21,16,.66) 0%,rgba(16,11,8,.9) 100%)}
.tabbar button{
  position:relative;z-index:1;
  height:calc(var(--tab-h) - 10px);padding:0;border-radius:999px;gap:3px;justify-content:center;
  font-size:12.5px;font-weight:700;letter-spacing:.01em;color:var(--paper);
  text-shadow:0 1px 2px rgba(0,0,0,.85),0 0 6px rgba(0,0,0,.5);
  background:none !important;box-shadow:none;
  transition:color .12s ease,scale .14s ease-out;
  transform-origin:50% 55%;
}
.tabbar button svg{
  width:24px;height:24px;stroke-width:1.9;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.8));
  transition:transform .18s var(--spring);
}
.tabbar button:active svg{transform:scale(.86)}
.tabbar button.on{color:var(--accent)}
.tabbar button.on svg{animation:lg-pop .3s var(--spring)}
@keyframes lg-pop{0%{transform:scale(.72)}100%{transform:scale(1)}}

/* the lozenge is ONE element that glides to the active tab. Matched to a
   60fps screen recording of a real iOS 26 tab bar (Home Depot, 2026-08-22):
   touch   -> the WHOLE bar swells ~4% and the lozenge brightens into a lens
              that sits OVER the icons and refracts them.
   travel  -> the lens elongates: its leading edge reaches the target in
              ~100ms, the trailing edge lags ~350ms, so it spans both tabs
              mid-flight, then contracts. Tint switches early, in flight.
   settle  -> lens and bar relax together; ~430ms end to end. */
.tabbar{
  overflow:visible;
  /* a long-press must lift the lens, never start text selection or the loupe;
     a horizontal drag along the bar must never pan the page */
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;touch-action:none;
}
.tabbar button{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}
.tab-ind{
  position:absolute;top:5px;bottom:5px;left:0;right:100%;border-radius:999px;z-index:2;
  pointer-events:none;
  background:rgba(244,235,217,.13);
  box-shadow:inset 0 1px 0 rgba(255,246,230,.28),inset 0 -1px 0 rgba(0,0,0,.22),0 8px 18px -8px rgba(0,0,0,.8);
  /* glass.js sets left/right durations per move (leading edge fast, trailing slow) */
  transition:left .4s var(--spring),right .4s var(--spring),opacity .15s ease,
             scale .22s var(--spring),background .12s ease,box-shadow .12s ease;
  transform-origin:50% 50%;
}
.tab-ind.still{transition:none !important}
.tab-ind.lift{
  scale:1 1.15;
  background:rgba(255,248,236,.26);
  box-shadow:inset 0 1.5px 0 rgba(255,255,255,.65),inset 0 -1px 0 rgba(0,0,0,.18),
             0 0 0 1px rgba(255,255,255,.22),0 14px 30px -8px rgba(0,0,0,.7);
}
.tabbar button:active svg{transform:none}

/* ---------- app bar: transparent over a readable scrim; logo stays matte ---------- */
.appbar{
  background:transparent;border-bottom:0;backdrop-filter:none;-webkit-backdrop-filter:none;
  pointer-events:none;
}
.appbar::before{
  content:"";position:absolute;left:0;right:0;top:0;height:calc(100% + 28px);pointer-events:none;z-index:0;
  background:linear-gradient(180deg,rgba(18,13,11,.98) 0%,rgba(18,13,11,.94) 50%,rgba(18,13,11,.72) 72%,rgba(18,13,11,0) 100%);
}
/* the row sits ABOVE the scrim; an absolute ::before otherwise paints over the logo */
.appbar .row{position:relative;z-index:1;gap:12px;height:68px}
.appbar .row > *{pointer-events:auto}
.appbar .iconbtn{width:46px;height:46px;border-radius:999px;border:1px solid var(--glass-edge)}
.appbar .iconbtn:hover{border-color:var(--glass-hi)}
.appbar .iconbtn:active{transform:scale(.92)}
.appbar .iconbtn svg{width:21px;height:21px}

/* hero camera: glass circle over the shelf photo (best refraction in the app) */
.shelf-hero .hero-cam{
  width:42px;height:42px;border-radius:999px;top:12px;right:12px;
  background:var(--glass-tint);border:1px solid var(--glass-edge);
  backdrop-filter:none;-webkit-backdrop-filter:none; /* liquid-glass.js sets it */
}
.shelf-hero .hero-cam:active{transform:scale(.92)}

/* toast: glass pill (was opaque cream) */
.toast{
  bottom:calc(var(--tab-h) + 34px + var(--safe-b));
  background:var(--glass-tint);color:var(--paper);
  border-radius:999px;padding:11px 20px;
  animation:lg-rise .45s var(--spring);
}
@keyframes lg-rise{0%{opacity:0;transform:translate(-50%,14px) scale(.9)}100%{opacity:1;transform:translate(-50%,0) scale(1)}}

/* sheet: frosted material; the shelf refracts along the top edge */
.sheet-back{background:rgba(0,0,0,.38)}
.sheet{
  position:relative;background:rgba(28,20,16,.7);
  border-top:1px solid var(--glass-edge);
  border-top-left-radius:28px;border-top-right-radius:28px;
  animation:lg-sheet .5s var(--spring);
}
@keyframes lg-sheet{0%{transform:translateY(6%) scale(.985);opacity:.6}100%{transform:none;opacity:1}}
.sheet.lg-fallback{background:rgba(28,20,16,.92)}
.sheet .grab{background:rgba(244,235,217,.28)}

/* segmented control inside the sheet: glass track, lit thumb */
.seg{background:rgba(0,0,0,.28);border-color:rgba(244,235,217,.1);border-radius:999px}
.seg button{border-radius:999px;transition:background .25s ease,color .2s ease}
.seg button.on{background:rgba(244,235,217,.14);color:var(--paper);box-shadow:inset 0 1px 0 rgba(255,246,230,.2)}

@media (prefers-reduced-motion:reduce){
  .tab-ind,.tabbar button.on svg,.toast,.sheet{animation:none !important;transition:none !important}
}

/* ---------- >= 768: the rail is plain; glass on a flat ink wall shows nothing ---------- */
@media(min-width:768px){
  body{padding-bottom:32px}
  .tabbar,.tabbar.lg{
    left:0;right:auto;bottom:0;border-radius:0;padding:18px 12px 16px;
    background:transparent;border:0;border-right:1px solid var(--line);box-shadow:none;
    backdrop-filter:none !important;-webkit-backdrop-filter:none !important;
  }
  .tabbar.lg::before,.tab-ind{display:none}
  .tabbar.lifting{scale:1;box-shadow:none}
  .tabbar button{height:auto;padding:11px 14px;border-radius:12px;font-size:14px;letter-spacing:0;color:var(--muted);text-shadow:none}
  .tabbar button svg{filter:none;animation:none}
  .tabbar button.on{background:rgba(212,83,27,.13) !important;color:var(--accent)}
  .toast{bottom:32px}
  .sheet{border-radius:28px;border:1px solid var(--glass-edge)}
}
