/* styles.css — Sphinx Market. Black, red &amp; white warehouse-club theme.
   No dark mode toggle — the header/hero themselves are the "dark" surfaces. */

:root{
  --brand-navy:#0d0d0d;        /* was navy — now near-black, used for hero gradients, active pills */
  --brand-navy-2:#000000;
  --brand-navy-dark:#000000;
  --brand-red:#c8102e;
  --brand-red-dark:#a30d25;
  /* One single black for every header surface. The topbar and the main header
     row used to be #0a0a0a and #000000 respectively, which read as a visible
     seam between the two rows — and neither matched the fade below them.
     Pushed to true #000000 (the darkest a screen can show) rather than
     settling back on #0a0a0a — every hardcoded rgba(10,10,10,…) fade/overlay
     that used to match this value by eye (.dc-overlay, .dc-edge-fade,
     .pm-arrow, .pf-gallery-remove, .tile-edit-btn) is updated to rgba(0,0,0,…)
     alongside it, so nothing reintroduces the exact seam this variable was
     created to kill. */
  --header-black:#000000;
  /* Buttons and active controls are white on the deep blacks (black text); the red stays only for the logo, badges and
     destructive actions. */
  --btn-bg:#ffffff;
  --btn-bg-hover:#d6d6d6;
  --btn-ink:#000000;
  --brand-blue:var(--header-black);  /* header background */
  --brand-blue-2:#000000;      /* subtle shading for the second header row */
  --brand-blue-dark:#c8102e;   /* icon/hover accent on white surfaces — red */
  --brand-gold:#ffffff;        /* logo wordmark + mark + cart count — white on the deep blacks (was red) */
  --brand-gold-light:#d6d6d6;
  /* Full black theme — the header/hero were always the "dark" surfaces; the
     shop, cards, footer and modals now match rather than sitting on white.
     --bg is the page itself — deliberately NOT the same black as the header
     any more (that was --header-black, a seamless match); it now sits a
     step lighter than --header-black and a step darker than --bg-alt, so
     the page reads as its own middle surface between the two: a visible
     seam under the header instead of the page melting into it, and the
     product cards (--bg-alt) still lift a further, distinct step above the
     page they sit on. --bg-alt is the "elevated surface" used for every
     card, modal, drawer and input; --line is a shade up again, used for
     borders and for small controls that sit on top of a --bg-alt panel (so
     they don't blend into it). */
  --bg:#000000;
  /* A recessed surface: a step darker than --bg (and still a step lighter
     than --header-black), for a section that should sit INTO the page rather
     than on it — the appliance advertising rows, whose cards then lift off it
     the same way the product cards lift off --bg. Close enough to --bg that
     the edge blends instead of reading as a box. */
  --bg-deep:#000000;
  --bg-alt:#000000;
  --ink:#f2f3f5;
  --muted:#a3a3a3;
  --line:#262626;
  --line-strong:#3d3d3d;
  --gold-star:#e8a409;
  --radius:8px;
  --shadow:0 1px 2px rgba(0,0,0,.3), 0 1px 3px rgba(0,0,0,.35);
  --shadow-lg:0 8px 24px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.35);
  --header-h:76px;
  /* Width of the permanent right-edge side rail — shared by .side-rail's own
     width, .page-shift's padding-right (the page is inset by exactly this
     much) and .header-wrap's negative margin-right (which cancels that inset
     for the header alone, so header and rail meet at the true edge). */
  --rail-w:30px;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ margin:0; padding:0; }
/* Scroll anchoring OFF, globally. The browser's own default heuristic
   nudges scrollTop to compensate whenever it thinks content shifted above
   the viewport — confirmed live that dockDeptBar()'s own DOM reparenting
   (app.js, moving #deptBar/.header-fill-strip out to <body> when the
   filters panel opens) was enough to trip it: window.scrollY jumped from
   837 to ~315 — a real, persistent scroll, not a one-frame rendering
   artifact — the instant the panel opened, dragging the hero/shop deck
   most of the way back toward the hero on its own. That's catastrophic
   for a page whose entire hero<->shop transition (wireDeck()) and
   scroll-snap markers are driven by reading scrollY as ground truth: the
   anchoring "fix" and this page's own scroll math fight over the same
   number. Disabled everywhere rather than only on whatever container
   happened to trip it this time — this page writes scroll position
   deliberately in enough places (wireDeck, wireTopbar, the filters panel
   itself) that the browser's own guess is never wanted. */
html{ overflow-anchor:none; }
/* The canvas behind everything. Rubber-band overscroll at the top drags the
   painted page down and exposes this, so it must not be white — otherwise a
   white band appears above the header the moment the user overscrolls. Setting
   it on <html> means <body> no longer propagates its own background to the
   canvas, while still painting white behind the page content itself. */
html{ background:var(--header-black); }
/* Scrollbar hidden, not just styled — the page still scrolls normally
   (wheel/trackpad/keyboard/drag), this only removes the browser's own
   painted scrollbar track/thumb. It sits at the true right edge, the same
   real estate .side-rail occupies, and renders as native browser chrome
   ON TOP of the page — z-index can't touch it, so no amount of layering
   the rail differently would ever stop the two from visibly overlapping.
   Hiding it is the only fix. scrollbar-width covers Firefox, -ms-overflow-
   style covers old Edge/IE, and the ::-webkit-scrollbar rule below covers
   Chrome/Safari/Chromium-Edge. */
html{ scrollbar-width:none; -ms-overflow-style:none; }
html::-webkit-scrollbar{ display:none; width:0; height:0; }
body{
  background:var(--bg);
  color:var(--ink);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  line-height:1.4;
}
/* Locks the page's own scroll while the services page is open (see
   wireSideRail() in app.js, toggled in the same handler that opens the
   page itself) — without it, .services-page being `position:fixed` meant
   it just sat on top of the document while the document underneath kept
   scrolling normally beneath it, visible the instant the user scrolled
   past wherever the page's own content ended. */
body.services-open{ overflow:hidden; }
/* Same reasoning as body.services-open above, for the deals page. */
body.deals-open{ overflow:hidden; }
a{ color:inherit; }
button{ font-family:inherit; }
img{ max-width:100%; display:block; }

/* Wraps header+main+footer (see index.html) so the page can be inset by the
   permanent side rail and pushed over when the filters panel opens — both by
   resizing/translating THIS box, never by overlapping fixed-position chrome
   on top of it. padding-right is the permanent margin for .side-rail; the
   transform is only added while the filters panel is open (see wireFilters()
   in app.js, which measures the panel's real rendered width rather than
   assuming a fixed number, so this stays correct at any viewport size). */
.page-shift{
  padding-right:var(--rail-w);
  /* margin-left, not transform — a transform only repaints this box in a new
     spot without changing its actual layout width, which is what made the
     page scrollable/clipped instead of genuinely resizing. Animating
     margin-left is real box-model reflow: with width left at its default
     auto, the browser recomputes this box's width to keep fitting between
     the margin and the padding-right reserved for the rail, so header, hero,
     dept bar and grid all actually re-lay-out narrower — the real
     "squish," not a visual slide. */
  margin-left:0;
  transition:margin-left .28s cubic-bezier(.4,0,.2,1);
}

/* ================= DECK: one-swipe intro -> products transition =================
   The page scrolls NATIVELY — no wheel/touch/key handlers, nothing
   preventDefault()ed. The "swipe" is a LOOK, not a mechanism: panel-hero is
   position:sticky and panel-shop is an ordinary, later, opaque,
   higher-z-index block, so normal document flow does the "panel rising over
   the pinned intro" motion for free. wireDeck() in app.js only adds the
   scroll-position-driven dissolve, and the two zero-height snap markers
   below give it exactly two resting places.

   Deviation forced by this site's own header: since header-wrap is
   position:sticky with real, constant flow height (tucking only transforms
   it, never resizes it — see .header-wrap's comment), panel-hero pins just
   below it at top:var(--header-wrap-h) instead of top:0. panel-shop stays a
   flat 100dvh so it always rises to fully cover the viewport, with the
   header staying on top throughout via its own higher z-index. */
html{ scroll-snap-type:y mandatory; }
@media (prefers-reduced-motion:reduce){ html{ scroll-snap-type:none; } }

/* Zero-height mandatory markers — the ONLY two scroll-snap-align targets on the
   page. scroll-snap-stop:always is the operative bit: a scroll gesture is
   forbidden from passing OVER one of these, so however hard the flick, it lands
   here — enforced natively, so momentum obeys it too. Deliberately their own
   elements rather than the panels themselves: a snap AREA taller than the
   viewport can be skipped once scroll is already inside it (coming up out of
   the grid would sail straight past the boundary), and the STICKY panel-hero
   specifically must never be its own snap target either, since a sticky
   element's box moves with the scroll and using it as a snap target can chase
   its own tail. */
.snap-home,.snap-shop{ height:0; scroll-snap-align:start; scroll-snap-stop:always; }

/* Deliberately NO position and NO z-index here. #deck sits as an ordinary
   sibling of #headerWrap inside #pageShift (itself unpositioned), so leaving
   it position:static means it never becomes a new positioned/stacking-context
   ancestor sitting between #headerWrap (effective z-index:100, see its own
   comment) and the fixed-chrome layer declared after #pageShift closes
   (filters-scrim:107, drawer:110, filters-panel:112) — .panel-hero/.panel-shop
   below compete in that SAME outer context #headerWrap already dominates, at
   z-index 1/2, nowhere close to contesting any of those numbers. */
.deck{ }
.panel{ position:relative; }

.panel-hero{
  position:sticky;
  /* Not top:0 — #headerWrap already occupies real, constant flow height above
     this and is itself pinned at the true top:0. Sticking panel-hero to top:0
     too would fight the header for the same offset and sit partially covered
     by it for the whole pinned duration; offsetting the trigger by the
     header's own (live, ResizeObserver-tracked) height instead pins panel-hero
     directly below it, with no overlap. */
  top:var(--header-wrap-h,90px);
  height:100vh; height:calc(100dvh - var(--header-wrap-h,90px));
  min-height:300px;
  z-index:1;
  /* Clips sideways only (the slides slide across horizontally); vertically it
     must stay open so the slide artwork can continue UP behind the see-through
     header — see .dc-slide's inset. */
  overflow-x:clip; overflow-y:visible;
  /* Room for the docked dept bar (0 unless the filters panel has docked it —
     see dockDeptBar() in app.js): the slideshow starts below the bar and
     shrinks into what's left, instead of sitting under it. Padding rather
     than a smaller box, so this element's own size — and with it the deck's
     scroll-range maths — never changes. */
  padding-top:var(--dept-dock-h,0px);
  /* `transform` here is written by JS, not CSS — see paintShift() in
     wireTopbar() (app.js), which writes the SAME shiftPx to both header-wrap
     and this element's `transform` in one call/frame. A separate CSS rule
     keyed off a class instead would snap instantly while the header's own
     280ms eased slide (tickTuck()) was still animating, visibly decoupling
     the two. `top` stays at the constant untucked value always — closing the
     gap happens entirely via transform, consistent with panel-hero's
     `height` never changing (see below) and header-wrap's tucking staying
     transform-only. Trade-off: panel-hero's bottom edge rises with it,
     opening an equally sized gap at the very bottom at full tuck — accepted,
     since panel-shop covers it moments later in the same scroll gesture. */
}
#dealsSlideshow{ height:100%; will-change:transform,opacity; }

.panel-shop::-webkit-scrollbar{ display:none; width:0; height:0; }
.panel-shop{
  position:relative;
  z-index:2;
  background:var(--bg);
  /* Flat 100dvh — NOT header-adjusted like panel-hero. This is load-bearing:
     with #headerWrap's height HH and panel-hero's height (100dvh-HH), the
     document's total height is HH + (100dvh-HH) + panel-shop's own height —
     the HH terms cancel only if panel-shop's own height is a flat 100dvh,
     which makes the document's total scroll range exactly 100dvh regardless
     of HH, landing the natural scroll-clamp exactly at panel-shop's own top
     edge every time. Subtracting HH here too (as it's subtracted above) would
     leave the document's max scroll HH short of that edge. */
  height:100vh; height:100dvh;
  overflow-y:auto; overflow-x:hidden;
  /* Scrollbar hidden (page still scrolls normally): a classic, always-visible
     one would take its ~15px out of the products' width and sit as a strip
     between them and the side rail. Same reasoning as html's own, above. */
  scrollbar-width:none; -ms-overflow-style:none;
  /* NOT contain — a flick that tops out inside the grid must be able to chain
     into the NEXT gesture and pull the document back toward the hero ("top
     out, then swipe again," the browser's own native chaining behaviour).
     contain would block that permanently once the grid topped out once. */
  overscroll-behavior-y:auto;
  -webkit-overflow-scrolling:touch;
  /* Clears #headerWrap, which stays visually pinned on top (z-index:100) for
     as long as panel-shop is on screen — without this, its own top content
     (the category tiles) would render straight under the header. Plus
     --dept-dock-h: the docked dept bar (0 otherwise) sits between the header
     and this content, so the tiles start below it, not under it. */
  padding-top:calc(var(--header-wrap-h,90px) + var(--dept-dock-h,0px));
  box-shadow:0 -46px 90px rgba(0,0,0,.55);
}
/* --header-wrap-h is the header's UNTUCKED height — constant, per its own
   comment, because tucking is a transform and transforms never change flow
   height. But the header's ACTUAL VISIBLE bottom edge, once tucked, sits
   --topbar-h higher than that — and body.topbar-hidden (toggled by the
   exact same tuck logic, see wireTopbar()/tickTuck() in app.js) is
   ALWAYS active once scrolled anywhere near "shop" (tucking triggers at
   just 8px of scroll, long before the deck's own snap point). Left as a
   flat var(--header-wrap-h,90px), this padding was sized for a header
   that's essentially never actually that tall while panel-shop is on
   screen — a permanent, not transient, gap between the header's real
   bottom edge and the category tiles below it: confirmed live via
   getBoundingClientRect() on both, a solid --topbar-h (22px) short and
   nothing else painted in it, sitting right above the tiles' own white
   product photos. */
body.topbar-hidden .panel-shop{
  /* calc(header-wrap-h - topbar-h) = the tucked header's own real height —
     zero slack, header bottom flush with the tile row's top edge. A flat
     14px (the header's real ~40px minus 26) was tried and requested
     explicitly at one point, but it overlaps the tile row by that same
     26px everywhere panel-shop is scrollable, not just once you've
     scrolled past it — including the very first frame a swipe from the
     hero lands here, where "topping out" at the shop snap point put the
     category tiles' top ~26px directly under the still-opaque header,
     reading as the swipe stopping short / in the wrong place. Flush
     clearance fixes that landing frame; it's the same value #headerWrap
     itself already uses when NOT tucked (its own comment two rules up). */
  padding-top:calc(var(--header-wrap-h,90px) - var(--tuck-dist,19px) + var(--dept-dock-h,0px));
}
/* The page eases down/up by the docked bar's height in step with the bar's
   own slide in (docking) / out (undocking) — timings match SLIDE_IN_MS and
   SLIDE_OUT_MS in app.js. Only while app.js has one of these classes on
   <html>, so the tuck's own padding-top change above stays instant. The
   spacer gives back what the padding takes, so the grid stays where it is. */
html.dept-docking .panel-hero,
html.dept-docking .panel-shop{ transition:padding-top .58s cubic-bezier(.22,1,.36,1); }
html.dept-docking .dept-bar-spacer{ transition:height .58s cubic-bezier(.22,1,.36,1), margin-bottom .58s cubic-bezier(.22,1,.36,1); }
html.dept-undocking .panel-hero,
html.dept-undocking .panel-shop{ transition:padding-top .34s cubic-bezier(.4,0,.2,1); }
html.dept-undocking .dept-bar-spacer{ transition:height .34s cubic-bezier(.4,0,.2,1), margin-bottom .34s cubic-bezier(.4,0,.2,1); }

/* Was going to be a progressive-enhancement CSS scroll-timeline layer here
   (animation-timeline:scroll(), same idea as the original Sphinxmarket's own
   build) — removed after finding, live, that it visibly disagreed with
   wireDeck()'s own JS-computed opacity at the same scroll position (its
   0/70/100% keyframe curve doesn't track the same progress as the JS's
   span/ease math), and per normal cascade rules a live CSS animation
   OUTRANKS the plain inline style the JS writes to the same property. The
   result wasn't invisible-and-harmless like intended — the hero stayed
   partially opaque for longer than the JS math says it should have, right
   as panel-shop was rising over it, and that lingering ghost of the hero's
   own dark overlay read as a stray dark band across the freshly-revealed
   category tiles. The JS in wireDeck() is the one actually verified correct
   (shopTop()-derived span, not a flat 100vh/100dvh guess), so it's now the
   only thing driving this — no second mechanism left to disagree with it. */
/* Once mostly dissolved, the (now invisible) hero must not keep catching
   clicks/focus meant for whatever's risen over it. */
body.at-shop .panel-hero{ pointer-events:none; }

input,select,button{ outline-offset:2px; }
::selection{ background:rgba(255,255,255,0.144); }

/* ================= SITE HEADER (Whole-Foods-style two-row layout) ================= */
/* header-wrap holds the utility topbar + the main header as one sticky unit.
   Hiding the topbar slides the whole unit up by that row's height via
   `transform` (applied inline by wireTopbar()/tickTuck() in app.js) rather
   than animating max-height, which used to relayout the sticky header every
   frame and stutter — a transform is composited, with no layout/reflow.
   .side-rail is a literal DOM child of this element (see index.html) and
   `position:absolute`, not fixed — see .side-rail's own comment for why,
   and for the positioning math that follows from header-wrap being its
   containing block. */
/* 22px, was 34 → 30 → 26 — the mini hiding bar's height. (.topbar-inner
   used to hardcode its own height:34px regardless of this variable, which
   silently capped the visible row at 34px through the last two rounds of
   shrinking it here — see .topbar-inner's comment. Now that it reads this
   same variable, changing it here actually moves the visible row.) Every
   other measurement that depends on this (the tuck slide distance,
   .side-rail's top offset and height, the overscroll cover band) reads
   this same variable too, so they all shrink to match automatically —
   nothing else needs editing. */
:root{ --topbar-h:19px; }
/* How far the header slides up when it tucks. Deliberately 8px SHORTER than the
   mini bar is tall: the last 8px of the (empty, black) mini bar stay on screen,
   so the main row reads 8px thicker while tucked, easing in and out with the
   slide. Keep this a plain px value — app.js reads it. */
:root{ --tuck-dist:13px; --tuck-lift:2px; --tuck-shrink:0; }
/* 13 = 11 + 2: the dept bar's chips sit flush under the tucked header, so lifting them 2px means the header's (empty, black) bottom
   edge rises 2px with them. --tuck-lift drops by the same 2px so the row's text stays exactly where it was. The chips→tile-bar gap is
   kept by the bar's margin-bottom (9.5px, below). Not used while the Filters panel is open (27px, next rule). */
/* Filters panel open: the tucked header slides up to the full mini-bar height (19px), so the
   main bar is 8px thinner and the docked department bar sits better against it. The
   contents' lift follows (half of what's left of the mini bar: (19 - 19) / 2 = none). */
html:has(.page-shift.filters-open){ --tuck-dist:27px; --tuck-lift:-7px; --tuck-shrink:.08; }   /* -7px, was -4px: the header's contents sit 3px lower while the Filters panel is open */
/* ^ 27px slides the header past the whole mini bar (19px) and takes 8px more off the
   main row (its 3px top padding and 5px of the widgets). The contents drop 4px
   (negative lift) to stay centred in what's left, and the right-hand group (location /
   account / cart) scales to 92% from its right edge so it still fits inside the
   thinner bar without moving off the page margin (see .sh-actions below). */
.header-wrap{
  position:sticky; top:0; z-index:100;
  /* One background for the whole header (mini bar + main bar). Alpha follows
     --tuck, written every frame by paintShift() in app.js: see-through when the
     header is fully open at the top of the page, solid once it has tucked. */
  background:rgba(0,0,0,var(--hdr-solid,1)); /* see-through until the product page nears, then solid (wireHeaderSolid in app.js) */
  transition:margin-left .28s cubic-bezier(.4,0,.2,1);
  /* Full-bleed: cancels .page-shift's rail-gutter padding-right for this box
     only, so the header rows (and their backgrounds) run to the true right
     edge and the rail below reads as the same bar continued down. A longhand
     in the BASE rule — the filters-open rule below owns margin-left, and the
     two margins together keep width:auto at exactly the viewport width on
     every frame of the transition. */
  margin-right:calc(var(--rail-w) * -1);
  /* 100, was 40 — raised specifically so .side-rail (nested inside this
     element, z-index:90 of its own) actually outranks .services-page
     (z-index:80, a body-level sibling of this element). A child's z-index
     only competes against OTHER CHILDREN of the same stacking context —
     .header-wrap's own position+z-index makes it one, so from outside,
     the entire header+rail subtree stacks at THIS number, not at
     whatever the rail's own z-index says. The rail disappeared behind
     the services page entirely at the old z-index:40 despite its own
     z-index:90, for exactly this reason. Still safely under the real
     modal-style overlays (drawer-scrim 105, filters-scrim 107, drawer
     110, filters-panel 112), which should and still do cover the header
     when open. */
}
.page-shift.filters-open .header-wrap{
  position:sticky;
  z-index:114;
  /* Cancels .page-shift's own margin-left push (same duration and curve, so
     the two offset each other every frame) — the header stays put while the
     page slides over. Deliberately NO explicit width: width:auto grows by
     exactly this negative margin, so the box stays the full viewport width
     (the base rule's margin-right handles the rail gutter) and nothing
     inside it — centred search bar, logo, cart, rail — moves or rescales.
     A calc() width used to live here; auto -> calc() can't be transitioned,
     so it snapped over-wide on frame one. */
  margin-left:calc(-1 * var(--filters-width));
}
.site-header{ position:relative; }
.sh-row{ background:none; } /* see .header-wrap */
/* 4px, was 9 then 6 — the main row's ("fat bar") share of making the
   header thinner overall (see --topbar-h above for the utility row's
   own share). */
.sh-top{ padding:3px 0; }
/* While tucked the visible header is the main row plus the 3px strip of mini bar
   left above it (see --tuck-dist; 8px now), so the row's contents lift by half of that
   to stay centred in what's actually showing. --tuck is 0 open .. 1 tucked. */
.sh-top{ transform:translateY(calc(var(--tuck, 0) * var(--tuck-lift, 4px) * -1)); }
/* The mini bar's contents fade out quickly as the slide starts, since its
   bottom 8px no longer slide fully out of view. */
.topbar-inner{ opacity:calc(1 - var(--tuck, 0) * 4); }

/* Always present and always full height — only ever moved out of sight by the
   wrapper above, never collapsed or re-rendered. */
.topbar{
  /* No background of its own: the header-wrap paints one see-through layer for
     both rows (see .header-wrap). Two overlapping translucent layers made a
     darker seam wherever the rows overlapped mid-slide. */
  color:#fff;
  /* No overflow property at all — .acct-menu (top:calc(100% + 10px)) opens
     downward past this 22px row, and overflow:hidden would clip it. Mixing
     overflow-x:visible with overflow-y:hidden isn't a fix either: per spec,
     a `visible` value on one axis computes to `auto` when the other axis
     isn't also `visible`, which still clips. Plain `overflow:visible` (or
     omitting the property) is the only way to get an unclipped axis here. */
  height:var(--topbar-h);
}
.topbar-inner{
  /* height:var(--topbar-h), not a hardcoded 34px — that hardcoded value
     was left over from before --topbar-h existed as a variable, and every
     later reduction to --topbar-h (34→30→26) shrank .topbar's own outer
     box but not this inner content box, which kept forcing itself back to
     34px regardless. .topbar no longer has overflow:hidden (removed for
     an earlier fix), so the extra height didn't get clipped — it just
     silently spilled past .topbar's shorter box, which is very likely why
     "slim it down more" kept being asked for: the variable was changing,
     the visible row wasn't. */
  max-width:1400px; height:var(--topbar-h);
  display:flex; align-items:center; justify-content:flex-end;
  /* margin-left:auto right-aligns this capped box. .topbar itself already
     spans the full viewport (see .header-wrap's margin-right), so no
     overhang is needed — the right padding below alone sets the phone
     number's distance from the true edge. */
  margin:0 0 0 auto;
  /* Left padding matches the logo row's own 24px gutter. Right padding is
     5px — .side-rail-item's own 4px padding plus ~1px of the glyph's own
     side bearing (see that rule's comment: it now uses align-items:
     flex-start instead of the browser's default text-align:center for a
     <button>, specifically because centering's offset depends on the
     rendered glyph COLUMN width, which isn't stable across page loads —
     confirmed directly, it measured both 4.25px and 8.25px off the edge
     at the same viewport width on different loads. flex-start pins the
     text to the padding edge instead, which only depends on the glyph's
     own side bearing — a real font metric, not emergent shaping, and
     confirmed stable at 5px across repeated reloads). */
  padding:0 24px; /* right = left now that the side rail is gone */
}
/* font:inherit matters here — a <button> does not inherit the page font by
   default, so without it this rendered in the UA's own button face and looked a
   different size from the links beside it despite the matching font-size. */
.topbar-a11y{
  background:none; border:none; color:#fff; font:inherit;
  font-size:12.5px; font-weight:600;
  opacity:.85; cursor:pointer; padding:0;
}
.topbar-a11y:hover{ opacity:1; text-decoration:underline; }
/* Groups the left-hand links so they sit together, with the same 20px rhythm
   as .topbar-right, while the flex row still pushes the two groups apart. */
.topbar-left{ display:flex; align-items:center; gap:20px; }
/* translateY nudges the icons/links down a couple px within the bar
   without touching the bar's own height or its vertical centering math —
   a transform here just repaints this row slightly lower, it doesn't
   resize or reflow .topbar/.topbar-inner at all. */
.topbar-right{ display:flex; align-items:center; gap:20px; transform:translateY(3px); }
.topbar-link{
  background:none; border:none; color:#fff; text-decoration:none; font:inherit;
  font-size:12.5px; font-weight:600; opacity:.85; cursor:pointer; padding:0;
}
.topbar-link:hover{ opacity:1; text-decoration:underline; }
.topbar-phone{ color:#fff; text-decoration:none; font-size:12.5px; font-weight:800; }
/* macOS-Dock-style magnification: each character is its own element so it can
   scale and tint independently with the cursor's distance (see wirePhoneDock).
   transform-origin sits on the baseline so digits grow upward instead of
   drifting, and the transition is deliberately short — long enough to smooth
   the motion, short enough that it still tracks the pointer. */
.ph-d{
  display:inline-block;
  transform-origin:50% 100%;
  transition:transform .12s ease-out;
  position:relative;   /* positioned so the digits paint above the glass lens (.ph-glass) behind them */
}
.topbar-phone{ position:relative; }
/* Liquid-glass lens under the hovered digits — the SAME recipe as the search bar (body:not(.topbar-hidden) .searchbar, "LIQUID-GLASS
   SEARCH BAR" further down): the page behind is bent through the #kmLiquidGlass lens with a touch of blur and a saturation/brightness lift,
   a faint white tint with the 135° diagonal sheen, a bright rim, hot top-left / softer bottom-right edge highlights, a gloss sheen across the
   upper half (::before) and a soft drop shadow. wirePhoneDock() slides it with the pointer via `translate`; `scale` + opacity pop it in. */
.ph-glass{
  position:absolute; left:0; top:50%; width:34px; height:22px; margin-top:-11px;
  border-radius:11px; pointer-events:none;
  opacity:0; scale:.72;
  transition:translate .12s ease-out, scale .28s cubic-bezier(.22,1,.36,1), opacity .18s ease-out;
  background-color:rgba(255,255,255,.07);
  background-image:linear-gradient(135deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.03) 36%, rgba(255,255,255,0) 60%, rgba(255,255,255,.10) 100%);
  -webkit-backdrop-filter:blur(16px) saturate(1.8) brightness(1.1);
          backdrop-filter:blur(16px) saturate(1.8) brightness(1.1);
  -webkit-backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12);
          backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12);
  border:1px solid rgba(255,255,255,.30);
  box-shadow:
    inset 2px 2px 3px -1px rgba(255,255,255,.85),
    inset -2px -2px 3px -1px rgba(255,255,255,.45),
    inset 0 0 0 1px rgba(255,255,255,.10),
    inset 0 0 22px rgba(255,255,255,.10),
    0 1px 2px rgba(0,0,0,.18),
    0 6px 16px rgba(0,0,0,.28);
}
.ph-glass.is-on{ opacity:1; scale:1; }
/* Clicked: the lens swells over the whole number (width/translate are set inline by wirePhoneDock) with a springy ease-out, a touch taller. */
.ph-glass.is-engulf{
  height:24px; margin-top:-12px; border-radius:12px;
  transition:translate .52s cubic-bezier(.22,1,.36,1), width .52s cubic-bezier(.22,1,.36,1), height .52s cubic-bezier(.22,1,.36,1),
             margin-top .52s cubic-bezier(.22,1,.36,1), border-radius .52s cubic-bezier(.22,1,.36,1), scale .52s cubic-bezier(.22,1,.36,1), opacity .18s ease-out;
}
.ph-glass::before{
  content:""; position:absolute; left:4px; right:4px; top:1px; height:46%;
  border-radius:9px 9px 40% 40% / 9px 9px 7px 7px;
  background:linear-gradient(180deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.08) 70%, rgba(255,255,255,0) 100%);
  pointer-events:none;
}
@media (max-width:700px){ .topbar-a11y, .topbar-link{ display:none; } }

/* ── Search: everything is stitched into the row it belongs to ──────────────
   The two topbar icons are ordinary flex children of .topbar-right, so the
   topbar's own max-height collapse clips them for free. The search bar is
   absolutely positioned inside the header row, so it rides the header through
   scroll, collapse and overscroll. Its submit magnifier and close X are
   children of the bar, welded to its edges as it grows. No JS positioning. */
.tsearch{ position:relative; display:flex; align-items:center; width:16px; height:16px; flex:0 0 auto; }
.tsearch-toggle, .tsearch-close{
  position:absolute; inset:0;
  background:none; border:none; color:#ffffff; cursor:pointer;
  display:flex; align-items:center; justify-content:center; padding:0;
  transition:opacity .25s ease;
}
/* ── Search choreography ────────────────────────────────────────────────────
   Strictly sequenced so nothing ever moves through anything else. The icon is
   always clear of the header — parked above the viewport — for the whole time
   the location/account widgets are in motion.

   Each step waits for the one before it to finish, so no two things ever
   occupy the same space at once. The icon leads on open and trails on close,
   because it is the thing standing in the widgets' path.

   OPEN                                     CLOSE
   0.00  icon rises out of frame (.35s)     0.00  X + submit fade out (.2s)
   0.35  widgets slide out (.8s) → 1.15     0.00  icon rises out of frame (.35s)
   0.75  bar grows (.85s)       → 1.60      0.10  bar shrinks (.8s)      → 0.90
   1.15  icon drops in (.45s)   → 1.60      0.75  widgets slide back (.8s)→ 1.55
   1.60  bar's submit fades in              1.10  icon drops home (.45s) → 1.55
   1.70  topbar X fades in                  1.55  source icon fades back      */
.tsearch-toggle{ opacity:.9; }
.tsearch-toggle:hover{ opacity:1; }
/* Delayed only while closing, for the same reason as .header-search-btn. */
body.search-closing .tsearch-toggle{ transition-delay:1.55s; }
/* Hides at once on open (the flying stand-in takes over from it); on close it
   waits for the icon to land before fading back in — hence the delay above. */
body.search-open .tsearch-toggle{ opacity:0; pointer-events:none; transition-delay:0s; }
.tsearch-close{ opacity:0; pointer-events:none; }
body.search-open .tsearch-close{ opacity:.85; pointer-events:auto; transition-delay:1.9s; }
body.search-open .tsearch-close:hover{ filter:drop-shadow(0 0 3px rgba(255,255,255,.75)); }

/* The travelling magnifier. Hidden until JS pins it over the topbar icon and
   sends it to where the bar's own submit button will be. Both endpoints use the
   same red, so the handover in and out of the flight is invisible. */
.search-fly{
  position:fixed; z-index:60; width:16px; height:16px;
  display:none; align-items:center; justify-content:center;
  color:#ffffff; pointer-events:none;
}
.search-fly svg{ width:100%; height:100%; }
.search-fly svg *{ stroke-width:2; }
.search-fly.flying{ display:flex; }
/* Launching from the fat header's icon, which is white, 20px and 1.8-stroke
   rather than the topbar's red 16px 2-stroke. Starting in that skin and
   transitioning out of it is what stops it snapping to the wrong colour and
   size the instant it leaves. */
.search-fly.from-header{ width:20px; height:20px; color:#fff; }
.search-fly.from-header svg *{ stroke-width:1.8; }
.search-fly.moving{
  transition:
    top .7s cubic-bezier(.32,.72,.24,1),
    left .7s cubic-bezier(.32,.72,.24,1),
    width .7s cubic-bezier(.32,.72,.24,1),
    height .7s cubic-bezier(.32,.72,.24,1),
    color .55s ease;
}
.search-fly.moving svg *{ transition:stroke-width .7s ease; }

/* Arced route, used whenever the flight starts or ends at the fat header's
   icon. A direct line between there and the bar passes straight through the
   location widget while it is sliding, so the icon visibly clips through it.
   Instead it exits upward out of frame, is repositioned horizontally while
   hidden, and drops back down onto its destination.

   Only `top` is transitioned in each leg: `left`, size and colour are changed
   during the off-screen moment between them, where the switch cannot be seen.
   Accelerating out (ease-in) and decelerating in (ease-out) makes the two legs
   read as one continuous arc rather than two separate moves. */
.search-fly.rising{ transition:top .35s cubic-bezier(.4,0,1,1); }
.search-fly.falling{ transition:top .45s cubic-bezier(0,0,.2,1); }
.search-fly.no-move{ transition:none !important; }

/* The bar itself: centred in the header row, grows open from nothing. */
.searchbar{
  position:absolute; top:50%; left:50%; transform:translate(-50%,calc(-50% + 1px)); /* +1px: nudged down */
  width:0; max-width:92vw; height:30px; border-radius:15px; background:var(--bg-alt);
  /* Against the black header, a shadow alone doesn't read — the border is
     what actually separates the bar from the row it's sitting on. */
  border:1px solid var(--line-strong);
  box-shadow:var(--shadow-lg); z-index:30; opacity:0; pointer-events:none;
  /* A min()/max-width target isn't reliably interpolated, so the animated
     value is a plain px width with max-width as a static cap. */
  transition:width .8s cubic-bezier(.22,1,.36,1), opacity .45s ease;
  transition-delay:.1s;
}
/* Grows only once the widgets are part-way clear of its footprint, and shrinks
   early on close so the space is free again before they slide back. */
body.search-open .searchbar{
  width:var(--sb-w,640px); opacity:1; pointer-events:auto;
  transition:width .85s cubic-bezier(.22,1,.36,1), opacity .45s ease;
  transition-delay:.75s;
}
.tsearch-input{
  width:100%; height:100%; border:none; border-radius:15px; background:none;
  padding:0 40px 0 18px; font-size:13.5px; color:var(--ink);
}
.tsearch-input:focus{ outline:none; }
#topbarSearchForm{ width:100%; height:100%; }

/* Welded to the bar's right edge — they move with it because they are it. */
.sb-submit, .sb-close{
  position:absolute; top:50%; translate:0 -50%;
  background:none; border:none; color:#ffffff; cursor:pointer;
  display:flex; align-items:center; justify-content:center; padding:0;
  width:16px; height:16px; opacity:0; pointer-events:none;
  /* Short on purpose: this fades in underneath the flying stand-in, so the
     quicker it reaches full opacity the wider the safe overlap before the
     stand-in is removed. A long fade here is what let the icon blink. */
  transition:opacity .12s ease;
}
.sb-submit{ right:14px; }
/* Sits just outside the bar, and only while the topbar (with its own X) is
   hidden — so there is always exactly one way out of search on screen. */
.sb-close{ right:-34px; }
/* Hover must NOT change opacity on these three (the bar's X / search icon): their fade-in is a transition with a long delay, and a hover that changed the
   opacity target restarted that delay from zero, so with the mouse already resting on the spot the X stayed invisible for another 1.8s (or never, if the
   pointer twitched). The hover is a glow instead, which leaves the fade-in alone. */
/* Both appear only once the bar has finished opening, so nothing is ever left
   hanging off an edge that hasn't arrived yet. */
/* 1.8s (was 1.6s; the drop was delayed .2s) — the exact moment the flying magnifier touches down, so the real
   button is already underneath it when the stand-in disappears. */
body.search-open .sb-submit{ opacity:.9; pointer-events:auto; transition-delay:1.8s; }
body.search-open .sb-submit:hover{ filter:drop-shadow(0 0 3px rgba(255,255,255,.75)); }
body.search-open.topbar-hidden .sb-close{ opacity:.9; pointer-events:auto; }
body.search-open.topbar-hidden .sb-close:hover{ filter:drop-shadow(0 0 3px rgba(255,255,255,.75)); }
/* Slides down into place when the topbar hides and hands over the X. */
@keyframes sbCloseDrop{ from{ opacity:0; transform:translateY(-22px); } to{ opacity:.9; transform:none; } }
body.search-open.topbar-hidden .sb-close{ animation:sbCloseDrop .42s cubic-bezier(.22,1,.36,1) both; }

/* Belongs to the main header's icon cluster, so it is styled exactly like its
   neighbours there — white, 20px, 1.8 stroke, 4px padding — rather than the red
   used for the topbar's own icons. Matching the siblings is what makes it read
   as part of the bar instead of something bolted onto it.

   Only present once the topbar (and its magnifier) has scrolled away, and only
   while search is closed — with it open the bar itself is on screen. Collapsed
   to zero width rather than display:none so it doesn't jolt the row's layout. */
.header-search-btn{
  background:none; border:none; color:#fff; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  padding:0; width:0; opacity:0; overflow:hidden; pointer-events:none; flex:0 0 auto;
  transition:width .25s ease, opacity .25s ease, padding .25s ease;
  transition-delay:0s;
}
/* The slot is held open for as long as the topbar is hidden, whether or not
   search is open — only the opacity changes. Collapsing the width while search
   was open would have made this button unmeasurable, and the return flight
   needs its resting position to aim at. */
body.topbar-hidden .header-search-btn{ width:28px; padding:4px; }
body.topbar-hidden:not(.search-open) .header-search-btn{ opacity:.9; pointer-events:auto; }
/* The wait-for-the-icon-to-land delay belongs ONLY to the close sequence. It
   used to sit on the base rule, which also gated the button's very first
   appearance — so simply scrolling down left you staring at an empty slot for
   1.55s before the icon showed up. */
body.search-closing .header-search-btn{ transition-delay:0s, 1.55s, 0s; }
body.topbar-hidden:not(.search-open) .header-search-btn:hover{ opacity:1; }
body.search-open .header-search-btn{ transition-delay:0s; }

.tsearch-suggest{
  position:absolute; top:calc(100% + 10px); left:0; width:100%;
  background:var(--bg-alt); border:1px solid var(--line-strong); border-radius:10px; box-shadow:var(--shadow-lg);
  max-height:0; overflow:hidden auto; opacity:0; z-index:40; pointer-events:none;
  transition:max-height .5s cubic-bezier(.22,1,.36,1), opacity .4s ease;
}
body.search-open .tsearch-suggest.has-results{ max-height:360px; opacity:1; pointer-events:auto; }
.sh-inner{
  display:flex; align-items:center; gap:22px;
  position:relative; /* containing block for .searchbar */
  /* No max-width here (unlike .topbar-inner, which holds a single
     right-aligned item) — this row has a left item (.logo) and a right
     group (.sh-actions, margin-left:auto), so it needs to span the FULL
     header width for those two to land at its actual edges, the same way
     .dept-bar spans edge to edge below it. Capping this at max-width:1400px
     and right-aligning the whole capped box (as one flex item) used to bunch
     both together near the right on any viewport wider than ~1400px + the
     rail, leaving a growing gap where the logo should be.
     No margin-right: .header-wrap's own margin-right:-rail-w already
     cancels the inset .page-shift reserves for the rail (this row sits
     ABOVE the rail — the rail starts at the header's bottom edge — not
     beside it), so this row's right edge IS the true viewport edge and the
     padding below takes over from there. */
  /* Left padding matches the topbar's own 24px gutter. Right padding is
     1px, not 5px like .topbar-inner uses for the phone number — 4px less,
     on purpose. 5px is where the rail's text actually sits off the true
     screen edge (see .side-rail-item's and .topbar-inner's comments) — but
     the VISIBLE cart content isn't flush with this row's edge the way the
     phone number is flush with the topbar row's edge: .cart-widget has
     its own `padding:4px` (its click/hover target), which insets the
     "Cart" label 4px further in from ITS OWN box edge. Left at 5px, the
     visible cart text would land 4px short of where the phone number and
     rail text visibly sit — correct box math, wrong pixel. Subtracting
     that 4px here (5 - 4 = 1) cancels it out, so all three — phone text,
     cart text, rail text — land on the same visible pixel, not just their
     invisible bounding boxes. */
  padding:0 24px; /* right = left now that the side rail is gone */
}
.sh-top .sh-inner{ flex-wrap:nowrap; }

.logo{
  display:flex; align-items:center; gap:8px; text-decoration:none; color:var(--brand-gold);
  flex:0 0 auto;
  /* Header "open" = mini bar showing. The logo grows to fill that taller
     header and centres in it, then eases back to normal size and its normal
     position as the mini bar tucks away. --tuck (0 open .. 1 tucked) is
     written every frame of the slide by paintShift() in app.js, so this tracks
     the scroll interaction exactly. Grows from its left edge so it stays
     aligned with the page margin; the shift is half the mini bar's height,
     which moves its centre from the main row's centre to the whole visible
     header's centre. */
  transform-origin:left center;
  transform:translateY(calc((1 - var(--tuck, 1)) * var(--topbar-h) * -.5 - 1px)) scale(calc((1 + (1 - var(--tuck, 1)) * .2) * (1 - var(--tuck, 0) * var(--tuck-shrink, 0))));
}
/* (The last factor in the scale above shrinks the logo along with the right-hand
   group while the Filters panel is open — see --tuck-shrink.) */
/* Search open: back to normal size so the location widget has room beside it
   (the transitions only run for this switch — scroll updates are per-frame). */
body.search-open .logo{ transform:translateY(-1px); transition:transform .6s cubic-bezier(.22,1,.36,1); }
body.search-closing .logo{ transition:transform .6s cubic-bezier(.22,1,.36,1); }
/* The Sphinx Market logo: the cat and the name are two separate pieces, painted in the brand colour. */
.logo-lockup{ --lh:34px; --ht:calc(var(--lh) * .96239); --cat-grow:3px; --cat-up:1px; --cat-left:6px; display:flex; align-items:center; flex:none;
  gap:calc(var(--ht) * .13344); height:var(--lh); padding-left:calc(var(--lh) * .01876); color:var(--brand-gold); }
/* The name keeps its size and place; the cat is its own piece: +4px taller than the line of lettering (centred, so the text does not move) and 2px higher. */
.logo-cat, .logo-name{ display:block; flex:none; background:currentColor; -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat; -webkit-mask-position:center; mask-position:center; -webkit-mask-size:100% 100%; mask-size:100% 100%; }
.logo-name{ height:var(--ht); aspect-ratio:5.50407; -webkit-mask-image:url(/brand/sphinx-name.svg?v=5); mask-image:url(/brand/sphinx-name.svg?v=5); }
.logo-cat{ height:calc(var(--ht) + var(--cat-grow)); aspect-ratio:.92308; margin-inline:calc(var(--cat-grow) * -.46154); transform:translate(calc(var(--cat-left) * -1), calc(var(--cat-up) * -1));
  -webkit-mask-image:url(/brand/sphinx-cat.svg?v=5); mask-image:url(/brand/sphinx-cat.svg?v=5); }
/* Engraved-script wordmark. Was optically centred with a -2.5px translateY
   correction, tuned back when .sh-top's padding was 9px (a much taller
   row) — verified live: the crown icon (.logo-mark) sits at the row's
   exact vertical centre with no correction needed, while the word (with
   that -2.5px still applied) measured 2.5px above it. Each later round of
   thinning the header (.sh-top's padding: 9→6→4px) shrank the row this
   correction was calibrated against without the correction itself ever
   being re-measured, so it drifted from "optically centred" to "sits
   visibly above the icon it's supposed to line up with." Removed rather
   than re-tuned — measured directly, 0 is what actually centers it now. */
.logo-word{
  font-family:'Pinyon Script','Snell Roundhand','Apple Chancery',cursive;
  font-size:31.5px; font-weight:400; letter-spacing:.5px; white-space:nowrap; color:var(--brand-gold);
  /* Script faces carry an enormous default line box (47px at 34px type) which
     would inflate the whole header row; pinned so the type sizes the mark, not
     the header. */
  line-height:26px;
}

.loc-widget{
  display:flex; align-items:center; gap:8px; background:none; border:none; color:#fff;
  cursor:pointer; flex:0 0 auto; padding:4px; text-align:left; position:relative;
  /* Slides left (translateX set in JS) while the centered search overlay is
     open, so the expanded search box never sits on top of its text. Leads the
     sequence on open (no delay); waits for the bar to shrink on close. */
  /* .35s both ways: exactly the time the icon takes to rise clear of the
     header, so these never start moving while it is still crossing them. */
  transition:transform .8s cubic-bezier(.22,1,.36,1), opacity .3s ease;
  transition-delay:.75s, 0s;
}
.loc-widget svg{ flex:0 0 auto; }
.loc-text{ display:flex; flex-direction:column; font-size:12.5px; line-height:1.35; }
.loc-text small{ opacity:.9; }
.loc-text b{ font-weight:700; }
.loc-text u{ text-decoration:underline; font-weight:700; font-size:12.5px; }

/* Trending / common searches — shown when the bar is focused but still empty. */
.sg-head{
  padding:12px 14px 6px; font-size:10.5px; font-weight:800; letter-spacing:.07em;
  text-transform:uppercase; color:var(--muted);
}
.sg-head + .sg-head{ border-top:1px solid var(--line); margin-top:4px; }
.sg-term{
  display:flex; align-items:center; gap:10px; padding:9px 14px;
  cursor:pointer; font-size:13.5px; color:var(--ink);
}
.sg-term:hover, .sg-term.hi{ background:var(--line); }
.sg-term svg{ color:#ffffff; flex:0 0 auto; }
.sg-chips{ display:flex; flex-wrap:wrap; gap:8px; padding:4px 14px 14px; }
.sg-chip{
  border:1px solid var(--line-strong); background:var(--line); border-radius:999px;
  padding:6px 13px; font-size:12.5px; font-weight:600; color:var(--ink); cursor:pointer;
}
.sg-chip:hover{ border-color:#ffffff; color:#ffffff; }

/* Search suggestion items — reused inside the topbar's .tsearch-suggest panel. */
.sg-item{
  display:flex; align-items:center; gap:10px; padding:9px 14px; cursor:pointer; font-size:13.5px;
}
.sg-item:hover, .sg-item.hi{ background:var(--line); }
.sg-item img{ width:30px; height:30px; border-radius:4px; object-fit:cover; flex:0 0 auto; }
.sg-name{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--ink); }
.sg-price{ color:var(--muted); font-weight:600; font-size:12.5px; }
.sg-empty{ padding:16px; text-align:center; color:var(--muted); font-size:13px; }

/* Groups account + cart so they hug the right edge — the old header search
   bar used to fill the middle; now that space is just empty header, and this
   wrapper's auto margin pushes the group to the far right corner. */
.sh-actions{ display:flex; align-items:center; gap:14px; margin-left:auto; flex:0 0 auto; }
/* Only does anything while the Filters panel is open (--tuck-shrink is 0 otherwise). */
.sh-actions{ transform-origin:right center; transform:scale(calc(1 - var(--tuck, 0) * var(--tuck-shrink, 0))); }

/* Slides left (translateX set in JS) while search is open, closing the gap
   the location widget leaves behind when it slides away from this group. */
.acct-widget{
  position:relative; flex:0 0 auto;
  transition:transform .8s cubic-bezier(.22,1,.36,1); transition-delay:.75s;
}
/* Opening: widgets go first (no delay). Closing keeps the .37s above so the
   search bar collapses before they slide back into its footprint. */
/* .35s on open — exactly the icon's rise time. Starting at 0 (as this did) is
   what made the icon clip through the location widget: both were moving through
   the same space for the whole rise. On close the delay is longer still (.75s,
   from the base rule) so the bar has collapsed out of the way first. */
body.search-open .loc-widget, body.search-open .acct-widget{ transition-delay:.35s; }
/* Applied for the duration of a measurement only (see shiftHeaderForSearch). */
.loc-widget.no-anim, .acct-widget.no-anim{ transition:none !important; }
.acct-btn{
  display:flex; align-items:center; gap:8px; background:none; border:none; color:#fff;
  cursor:pointer; padding:4px;
}
.acct-text{ display:flex; flex-direction:column; align-items:flex-start; font-size:12.5px; line-height:1.35; }
.acct-text small{ opacity:.9; }
.acct-text b{ display:flex; align-items:center; gap:4px; font-weight:700; }
.acct-menu{
  position:absolute; top:calc(100% + 10px); right:0; background:var(--bg-alt); border:1px solid var(--line);
  border-radius:8px; box-shadow:var(--shadow-lg); min-width:170px; padding:6px; z-index:60;
}
.acct-menu button{
  display:block; width:100%; text-align:left; background:none; border:none; color:var(--ink);
  font-size:13.5px; font-weight:600; padding:9px 10px; border-radius:6px; cursor:pointer;
}

@media (hover:hover){ .acct-menu button:hover{ background:var(--line); } }
/* The rule above sets display:block, which beats the UA's [hidden]{display:none}: without this, Sign In and Sign Out both show for everyone. */
.acct-menu button[hidden]{ display:none; }

/* Weekly deals — a small continuously-rotating icon sitting on the black
   topbar next to Order Tracking, far enough left that the search panel
   expanding downward from .tsearch never covers it. */
.deals-widget{ position:relative; flex:0 0 auto; display:flex; }
.deals-spin-btn{
  display:flex; align-items:center; justify-content:center; background:none; border:none;
  color:#ffffff; cursor:pointer; padding:2px; opacity:.9;
}
.deals-spin-btn:hover{ opacity:1; }
.deals-spin-icon{ animation:dealsSpin 3.2s linear infinite; transform-origin:center; }
/* (hovering used to pause it instantly; iconfx.js now eases it to a stop and back up to speed through the animation's playback rate) */
@keyframes dealsSpin{ from{ transform:rotate(0deg); } to{ transform:rotate(360deg); } }
@media (max-width:520px){ .deals-label{ display:none; } }
/* Deals drawer (#dealsDrawer) — replaced the old hover dropdown (.deals-menu/
   .dm-*) with a proper slide-in panel, same .drawer/.drawer-scrim the cart
   already uses (see index.html), so it comes from the right with the same
   motion and doesn't need its own transform/scrim rules here. Only the
   BODY content is bespoke: one heading + a stack of rows per category,
   sourced from the same curated appliance deals as the homepage's own
   "Deals & Promotions" bars (renderDealsDrawer() in app.js) — a shopper
   sees the exact same set either way. */
.deal-group + .deal-group{ margin-top:22px; }
.deal-group-title{
  font-size:13px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.4px;
  margin:0 0 10px;
}
.deal-row{
  display:flex; gap:12px; align-items:center; padding:10px; border-radius:10px; text-decoration:none;
  color:inherit; border:1px solid transparent; position:relative;
}

@media (hover:hover){ .deal-row:hover{ background:var(--line); border-color:var(--line-strong); } }
.deal-row + .deal-row{ margin-top:4px; }
.deal-row-thumb{
  width:56px; height:56px; border-radius:8px; background:var(--bg) center/cover no-repeat; flex:0 0 auto;
  border:1px solid var(--line);
}
.deal-row-info{ min-width:0; flex:1; }
.deal-row-name{
  font-size:13.5px; font-weight:700; color:var(--ink); line-height:1.3; margin-bottom:4px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.deal-row-price{ display:flex; align-items:baseline; gap:7px; font-size:13px; }
.deal-row-price .card-price{ font-weight:800; color:var(--ink); }
.deal-row-price .card-list{ color:var(--muted); text-decoration:line-through; font-size:11.5px; }
.deal-row-badge{
  flex:0 0 auto; background:var(--brand-red); color:#fff; font-size:11px; font-weight:800;
  padding:3px 7px; border-radius:5px; letter-spacing:.2px; align-self:flex-start;
}
/* Admin-only quick-edit pencil on each deal widget — same hidden-unless-
   body.is-admin gate and look as .card-admin/.card-edit on the main grid.
   A normal flex item after the badge (not absolutely positioned) — the row
   is a flex container, so it just takes its own slot at the end rather than
   risking an overlap with the badge, which is flex-positioned itself. */
.deal-row-edit{
  display:none; flex:0 0 auto; width:24px; height:24px; border-radius:50%; align-self:center;
  border:none; cursor:pointer; font-size:11px; align-items:center; justify-content:center;
  background:rgba(255,255,255,.95); color:var(--header-black); box-shadow:var(--shadow);
}
body.is-admin .deal-row-edit{ display:flex; }
.deal-row-edit:hover{ background:#fff; color:var(--brand-navy); }
.deals-drawer-empty{ padding:40px 10px; text-align:center; color:var(--muted); font-size:13px; }

.cart-widget{
  display:flex; align-items:center; gap:8px; background:none; border:none; color:#fff;
  cursor:pointer; flex:0 0 auto; padding:4px;
}
.cw-icon{ position:relative; display:flex; }
/* The cart's little boxes live on a canvas behind the icon's strokes (cartphysics.js): the basket outline draws over them, so they look like they sit inside it. */
.cw-icon > svg{ position:relative; z-index:1; }
.cw-icon .cart-count{ z-index:2; }
.cart-count{                       /* 2px smaller than before (was 18px tall, 11px type, top -6 / right -8; the centre stays where it was) */
  position:absolute; top:-5px; right:-7px; background:var(--brand-gold); color:var(--brand-navy-dark);
  font-size:10px; font-weight:800; min-width:16px; height:16px; border-radius:8px;
  display:grid; place-items:center; padding:0 4px; overflow:hidden;       /* grid: the old and new number sit in the same cell while the counter rolls (cartphysics.js) */
}
/* Always its own compositor layer. While the hover squeeze plays the badge is on one, which paints the number exactly centred; the moment it ended the
   badge dropped back onto the page's layer, where the number is snapped to whole pixels and landed off-centre (the 'messed up' look). Keeping it on
   its own layer in both states means it is painted the same way whether or not the pointer is over the cart. */
.cart-count{ will-change:transform; transform:scale(1); }   /* scale(1), not none: it is the exact state the hover squeeze ends in, so rest and hover paint the same */
/* The badge is a tally counter: one wheel per digit (cartphysics.js showBadge); a wheel is one digit tall and its strip of digits slides up or down inside it. */
.cart-count .cc-digits{ grid-area:1/1; display:inline-flex; font-variant-numeric:tabular-nums; }
.cart-count .cc-wheel{ display:block; height:12px; overflow:hidden; }
.cart-count .cc-strip{ display:flex; flex-direction:column; will-change:transform; }
.cart-count .cc-strip > span{ display:block; height:12px; line-height:12px; text-align:center; }
.cw-label{ font-size:13.5px; font-weight:700; }

/* Cart-icon pulse once a flying product photo "lands" (see flyToCart()/
   bumpCart() in app.js). Scoped to .cw-icon, not the whole button, so the
   "Cart" label text stays put while just the icon+badge react. */
@keyframes cart-bump{
  0%{ transform:scale(1); }
  35%{ transform:scale(1.22); }
  62%{ transform:scale(.94); }
  100%{ transform:scale(1); }
}
.cart-bump .cw-icon{ animation:cart-bump .4s ease; }

/* Hovering the cart: the icon squeezes 1px smaller (25.5px -> 24.5px), then springs back to its normal size with a tiny overshoot. Only the drawing
   itself (the SVG) moves, so the count badge and the little boxes (cartphysics.js) are not squeezed. It replays every time the pointer enters. */
@keyframes cart-squeeze{
  0%{ transform:scale(1); }
  32%{ transform:scale(.9608); }          /* 24.5 / 25.5: exactly 1px smaller (the icon is 25.5px) */
  68%{ transform:scale(1.016); }          /* the spring-back overshoots by about 0.4px */
  100%{ transform:scale(1); }
}
.cart-widget:hover .cw-icon > svg, .cart-widget.cart-hop .cw-icon > svg{ animation:cart-squeeze .42s cubic-bezier(.3,.7,.4,1) both; transform-origin:50% 50%; }
/* The count badge does the same on hover, but by 2px (16px -> 14px, overshoot about 0.8px), at the same moment as the icon. */
@keyframes cart-squeeze-badge{
  0%{ transform:scale(1); }
  32%{ transform:scale(.875); }           /* 14 / 16: exactly 2px smaller */
  68%{ transform:scale(1.05); }
  100%{ transform:scale(1); }
}
.cart-widget:hover .cart-count, .cart-widget.cart-hop .cart-count{ animation:cart-squeeze-badge .42s cubic-bezier(.3,.7,.4,1) both; transform-origin:50% 50%; }
@media (prefers-reduced-motion:reduce){ .cart-widget:hover .cw-icon > svg, .cart-widget:hover .cart-count, .cart-widget.cart-hop .cw-icon > svg, .cart-widget.cart-hop .cart-count{ animation:none; } }

/* The flying clone itself — a fixed-position copy of whatever product photo
   was clicked, positioned exactly over the original by app.js, then eased
   to the cart icon's rect via a single transform+opacity transition. z-index
   comfortably clears every overlay/header layer in this file (max is 113)
   so it's never occluded mid-flight regardless of what's open. */
.fly-to-cart{
  position:fixed; z-index:250; pointer-events:none; margin:0;
  border-radius:8px; object-fit:cover; background-size:cover; background-position:center;
  transition:transform .55s cubic-bezier(.3,.06,.2,1), opacity .55s ease .15s;
  will-change:transform, opacity;
}

/* ================= DEALS SLIDESHOW (admin-editable, replaces the old static hero) ================= */
/* main::before used to live here: a solid 22px black band pinned just above
   <main>'s own top edge, covering a flash that appeared there during the
   header-tuck transform back when <main> sat directly under the header at
   the very top of the page. The swipe-deck refactor moved <main> — it now
   starts partway down #panelShop, right after .cat-tiles-wrap — so that
   fixed-height band, still anchored 22px above <main>'s (relocated) top
   edge, was landing across the bottom ~20px of the tile row instead: a
   solid rgb(10,10,10) rectangle with its own hardcoded background, nothing
   to do with any panel's background color. That's the bar this whole
   thread was about. Whatever flash it was covering belongs at the real top
   of the page (#snapHome/.panel-hero) now, not at <main> — removed rather
   than re-anchored, since no flash has actually been reported there. */
main{ position:relative; }

/* Base colour matches --header-black exactly. It was --brand-navy (#0d0d0d),
   three values lighter than the fade sitting on top of it — enough to leave a
   faint step wherever the slide art is dark or still loading. */
.dc-root{
  position:relative; width:100%; height:360px; overflow-x:clip; overflow-y:visible; background:var(--header-black);
}
.dc-root{ -webkit-user-select:none; user-select:none; }   /* a mouse drag swipes the slides, it must not select their text */
.dc-root[hidden]{ display:none; }
/* Triangular corner gradient, in exactly the same box as the left-to-right
   gradient below (230px wide, header height + 14px, top-right). `to bottom left`
   on a non-square box runs corner to corner, and its 50% line passes through the
   other two corners — so fading to clear at 50% leaves a right triangle with its
   right angle at the top-right, spanning the full box. Darkest in that corner.
   z-index 3 so it sits above the slides (z 1/2, which come later in the DOM). */
.dc-track{ position:relative; width:100%; height:100%; }
/* Motion lives entirely in animateHeroSlide() (app.js) via Web Animations —
   the same translateX + easing language as the dept bar's dock slide and the
   products panel's load-in (see EASE_IN/SLIDE_IN_MS there). No CSS transition
   here on purpose: z-index is the only thing that has to be right AT REST
   (which slide is on top, fully covering the identically-sized ones behind
   it) and that's a plain, always-correct class toggle — the transient slide-
   across only needs to be right WHILE it runs, which a cancellable JS
   animation handles far more safely under rapid clicking than a CSS
   transition + opacity crossfade ever did. */
.dc-slide{
  /* Reaches up past the slideshow's own top edge by the header's height, so the
     artwork is also what shows through the see-through header when it's fully
     open. The text is pushed back down by the same amount (.dc-overlay). */
  position:absolute; inset:calc(-1 * var(--header-wrap-h, 90px)) 0 0 0; pointer-events:none; z-index:1;
  /* Default backdrop for a slide with no photo (a photo, set inline, replaces
     it): a soft brand-red glow off to the right on a graphite ramp, so an
     unphotographed slide reads as designed rather than an empty black box. */
  background-color:var(--brand-navy);
  background-image:
    radial-gradient(ellipse 55% 70% at 82% 55%, rgba(255,255,255,0.176), transparent 70%),
    radial-gradient(ellipse 40% 50% at 70% 20%, rgba(255,255,255,.05), transparent 70%),
    linear-gradient(135deg, #000000 0%, #0a0a0a 60%, #111111 100%);
  background-size:cover; background-position:center;
}
.dc-slide.active{ pointer-events:auto; z-index:2; }
/* Slides that aren't showing are fully transparent, so the fade transition (see
   animateHeroSlide in app.js) goes old -> nothing -> new, instead of revealing a
   third slide stacked underneath. The animation overrides this while it runs. */
.dc-slide:not(.active){ opacity:0; }
/* Neutral black, matching --header-black. This was rgb(7,17,31) — a navy tint
   left over from the old palette — which put a blue cast on the top of the
   slideshow while the fade above it was neutral. That hue difference read as a
   seam even when the alpha ramp itself was smooth. */
.dc-overlay{
  position:absolute; inset:0; padding-top:var(--header-wrap-h, 90px); box-sizing:border-box;
  background:linear-gradient(90deg,rgba(0,0,0,.78) 0%,rgba(0,0,0,.48) 55%,rgba(0,0,0,.12) 100%);
}
/* Thin vignette at the slideshow's own left/right edges — not the readability
   scrim above (.dc-overlay, which only darkens toward the text side). This is
   symmetric and purely about echoing the tile rail's edge fade below it, so
   the two read as one continuous idea rather than the banner ending on a
   hard cut into the rail's fade. Same eased 5-stop curve, into the page's own
   black rather than a mid-grey, so it reads as the banner easing into the
   page rather than a grey stripe painted over the photo. */
.dc-edge-fade{
  position:absolute; inset:calc(-1 * var(--header-wrap-h, 90px)) 0 0 0; z-index:4; pointer-events:none;
  /* Left edge only — the right edge now sits flush against the solid side
     rail, so a soft fade there just looked muddy right before a hard edge. */
  background:linear-gradient(90deg,
    var(--header-black) 0, rgba(0,0,0,.72) 3px, rgba(0,0,0,.38) 7px, rgba(0,0,0,.12) 11px, rgba(0,0,0,0) 16px);
}
/* 88px sides: the arrows sit at 18px and are 38px wide (to 56px), so the
   text column starts 32px clear of them instead of running underneath. */
.dc-inner{ max-width:1400px; height:100%; margin:0 auto; padding:0 88px; display:flex; align-items:center; }
.dc-text{ max-width:560px; color:#fff; }
.dc-text h1{ font-size:clamp(24px,3.6vw,38px); font-weight:800; line-height:1.15; margin:0 0 12px; }
.dc-text p{ font-size:15px; color:#dcdee3; margin:0 0 22px; }
.hero-cta{
  display:inline-block; background:var(--btn-bg); color:var(--btn-ink); font-weight:700;
  padding:13px 30px; border-radius:6px; text-decoration:none; font-size:14px;
  letter-spacing:.2px;
}

@media (hover:hover){ .hero-cta:hover{ background:var(--btn-bg-hover); color:var(--btn-ink);} }
.dc-arrow{
  position:absolute; top:50%; transform:translateY(-50%); background:rgba(255,255,255,.16);
  border:none; color:#fff; width:38px; height:38px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; z-index:3; transition:background .15s;
}

@media (hover:hover){ .dc-arrow:hover{ background:rgba(255,255,255,.32); } }
.dc-prev{ left:18px; }
.dc-next{ right:18px; }
.dc-dots{ position:absolute; bottom:16px; left:0; right:0; display:flex; justify-content:center; gap:8px; z-index:3; }
.dc-dot{
  width:8px; height:8px; border-radius:50%; border:none; background:rgba(255,255,255,.45); cursor:pointer; padding:0;
}
.dc-dot.active{ background:#fff; width:22px; border-radius:4px; }
.dc-manage-btn{
  position:absolute; top:16px; right:16px; background:rgba(255,255,255,.92); color:var(--brand-navy);
  border:none; border-radius:6px; padding:8px 14px; font-weight:700; font-size:12.5px; cursor:pointer; z-index:3;
}
.dc-manage-btn:hover{ background:#fff; }
@media (max-width:700px){
  .dc-root{ height:300px; }
  .dc-inner{ padding:0 24px; }
  /* Too narrow for arrows beside the text — they drop to the bottom corners,
     level with the dots. */
  .dc-arrow{ width:32px; height:32px; top:auto; bottom:6px; transform:none; }
}

/* Slide manager (admin) — list rows + thumbnails inside the shared form modal */
.slides-list{ display:flex; flex-direction:column; gap:10px; margin-top:6px; }
.slide-row{ display:flex; align-items:center; gap:12px; border:1px solid var(--line); border-radius:8px; padding:10px 12px; }
.slide-row-thumb{
  width:64px; height:44px; border-radius:6px; background:var(--bg-alt) linear-gradient(135deg,var(--brand-navy),var(--brand-navy-2));
  background-size:cover; background-position:center; flex:0 0 auto;
}
.slide-row-info{ flex:1; min-width:0; }
.slide-row-title{ font-size:13.5px; font-weight:700; color:var(--ink); }
.slide-row-sub{ font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.slide-row-actions{ display:flex; gap:12px; flex:0 0 auto; }
.slide-row-actions .flink{ font-size:12.5px; text-decoration:underline; padding:0; color:var(--muted); }

@media (hover:hover){ .slide-row-actions .flink:hover{ color:#ffffff; } }

/* ================= CATEGORY TILES ================= */
/* The same auto-scrolling ticker as the department bar on the previous site
   (ported into wireCatRail()/runCatRail() in app.js): a native horizontal
   scroller that drifts on its own via requestAnimationFrame, duplicates its
   content only when it overflows so it can wrap seamlessly, and eases to a
   stop the instant you hover, touch, or wheel it — no arrow buttons, the
   rail itself is the whole control. Big, image-led cells: the product photo
   is the tile and the name is the only text on it. */
/* No left padding of its own anymore — .cat-tiles-track's own left padding
   (below) is now wide enough (40px, for the fade — see .cat-tiles' own
   comment) to serve as the page-edge alignment gutter by itself. Stacking a
   separate 16px here on TOP of that (left over from when the fade gutter
   was only 8px, and this 16px made up the difference to reach .shop's 24px
   indent) just pushed the first tile out to 56px total — a big flat dead
   gap with no gradient or content in it at all, which is exactly the
   "wasted space" the fade width increase accidentally created. */
.cat-tiles-wrap{
  margin:0; padding:4px 0 4px 0;
}
.cat-tiles{
  overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch;
  scrollbar-width:none; -ms-overflow-style:none; cursor:grab;
  /* See .dept-scroll's own comment — same native-bounce-vs-recenter() fight
     at the true scroll ends, same fix. */
  overscroll-behavior-x:contain;
  /* Left edge: eased 40px ramp. Right edge: same shape, narrowed to 25px so
     it sits closer to the true edge instead of cutting in as early. */
  -webkit-mask-image:linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,.22) 10px, rgba(0,0,0,.55) 20px, rgba(0,0,0,.85) 30px, #000 40px,
    #000 calc(100% - 25px), rgba(0,0,0,.85) calc(100% - 19px), rgba(0,0,0,.55) calc(100% - 13px),
    rgba(0,0,0,.22) calc(100% - 6px), rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,.22) 10px, rgba(0,0,0,.55) 20px, rgba(0,0,0,.85) 30px, #000 40px,
    #000 calc(100% - 25px), rgba(0,0,0,.85) calc(100% - 19px), rgba(0,0,0,.55) calc(100% - 13px),
    rgba(0,0,0,.22) calc(100% - 6px), rgba(0,0,0,0) 100%);
}
.cat-tiles::-webkit-scrollbar{ display:none; }
/* Right edge: padding still matches the mask width exactly (25px), keeping
   a resting tile fully outside the fade there. Left edge: no padding at
   all now, on purpose — the first tile sits flush against the true page
   edge, so the full 40px fade plays out directly on its own artwork instead
   of dissolving a stretch of empty space nobody ever sees move. Only the
   very first tile at rest ever shows it this way; every other tile still
   only fades mid-drift, the same as before. */
.cat-tiles-track{ display:flex; gap:12px; width:max-content; padding:0 25px 0 0; }
.tile{
  flex:0 0 244px; width:244px;
  position:relative; background:var(--bg-alt) center/cover no-repeat; border:1px solid var(--line);
  border-radius:13px; padding:14px 12px; min-height:146px; overflow:hidden;
  display:flex; align-items:flex-end; justify-content:center;
  text-align:center; cursor:pointer; transition:box-shadow .15s, transform .15s, border-color .15s;
}

@media (hover:hover){ .tile:hover{ box-shadow:var(--shadow-lg); transform:translateY(-2px); border-color:var(--line-strong); } }
/* When a department has an admin-uploaded image, it becomes the tile
   background (set once, the first time that department is created — see
   maybeSaveDeptImage() in server.js) with a dark scrim so the label stays
   legible. Tiles show only the name — no icon, no item count. */
.tile.has-image::before{
  content:''; position:absolute; inset:0; z-index:0;
  background:linear-gradient(180deg,rgba(0,0,0,0) 35%,rgba(0,0,0,.72) 100%);
}
.tile.has-image .tile-name{ color:#fff; }
.tile-text{ position:relative; z-index:1; width:100%; }
.cat-tiles .tile-name{ font-size:16px; }
.tile-name{
  font-weight:700; font-size:15px; color:var(--ink); line-height:1.3;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
/* Placeholder slots padding out the strip past the real listings — dashed,
   inert for shoppers, and only clickable (to open the new-listing form) for
   the signed-in admin. */
.tile-blank{
  align-items:center; justify-content:center; background:var(--bg-alt);
  border:1.5px dashed var(--line-strong); cursor:default;
}

@media (hover:hover){ .tile-blank:hover{ box-shadow:none; transform:none; } }
.tile-blank-plus{ color:var(--muted); opacity:.45; }
body.is-admin .tile-blank{ cursor:pointer; }
body.is-admin .tile-blank:hover{ border-color:#ffffff; }
body.is-admin .tile-blank:hover .tile-blank-plus{ color:#ffffff; opacity:1; }

/* ================= PROMO / DEALS BARS ================= */
/* Inserted between chunks of the product grid (see loadProducts() in app.js).
   A direct copy of the multi-size listing strip above (.cat-tiles-wrap /
   .cat-tiles / .cat-tiles-track / .tile, driven by the same createRail()
   treadmill engine — see wirePromoBars() in app.js) — same auto-drifting
   rail, same edge-fade mask, same hover/grab behaviour — just wider tiles,
   so 3 sit in view at once instead of the ~6 the narrower dept tiles fit. */
.promo-bar{ margin:4px 0 32px; }
.promo-bar-head{ display:flex; align-items:baseline; gap:8px; margin-bottom:12px; }
.promo-bar-title{ font-size:18px; font-weight:800; color:var(--ink); }
.promo-bar-title::before{ content:''; display:inline-block; width:5px; height:16px; background:var(--brand-red); border-radius:2px; margin-right:8px; vertical-align:-2px; }
.promo-tiles-wrap{ padding:0; }
.promo-tiles{
  overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch;
  scrollbar-width:none; -ms-overflow-style:none; cursor:grab;
  /* See .dept-scroll's own comment — same native-bounce-vs-recenter() fight
     at the true scroll ends, same fix. */
  overscroll-behavior-x:contain;
  /* Same eased 40px ramp as .dept-scroll/.cat-tiles' left edge, on both
     sides — every horizontal-scroll bar on the page now dissolves into the
     rail by the same amount. (Previously an 8px ramp cloned from .cat-tiles'
     old, too-subtle style — barely visible at this tile size.) */
  -webkit-mask-image:linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,.22) 10px, rgba(0,0,0,.55) 20px, rgba(0,0,0,.85) 30px, #000 40px,
    #000 calc(100% - 40px), rgba(0,0,0,.85) calc(100% - 30px), rgba(0,0,0,.55) calc(100% - 20px),
    rgba(0,0,0,.22) calc(100% - 10px), rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,.22) 10px, rgba(0,0,0,.55) 20px, rgba(0,0,0,.85) 30px, #000 40px,
    #000 calc(100% - 40px), rgba(0,0,0,.85) calc(100% - 30px), rgba(0,0,0,.55) calc(100% - 20px),
    rgba(0,0,0,.22) calc(100% - 10px), rgba(0,0,0,0) 100%);
}
.promo-tiles::-webkit-scrollbar{ display:none; }
/* Track padding matches the mask width exactly on both edges (40px) — same
   invariant as .cat-tiles-track, so a resting tile never touches the fade. */
.promo-tiles-track{ display:flex; gap:12px; width:max-content; padding:0 40px; }
/* Same box as .tile (background-image cover, rounded corners, hover lift) —
   just a wider flex-basis, roughly double, so half as many fit per view. */
.promo-tile{
  flex:0 0 438px; width:438px;
  position:relative; background:var(--bg-alt) center/cover no-repeat; border:1px solid var(--line);
  border-radius:12px; padding:12px 14px; min-height:190px; overflow:hidden;
  display:flex; align-items:flex-end; cursor:pointer; transition:box-shadow .15s, transform .15s, border-color .15s;
}

@media (hover:hover){ .promo-tile:hover{ box-shadow:var(--shadow-lg); transform:translateY(-2px); border-color:var(--line-strong); } }
.promo-tile::before{
  content:''; position:absolute; inset:0; z-index:0;
  background:linear-gradient(180deg,rgba(0,0,0,0) 40%,rgba(0,0,0,.82) 100%);
}
.promo-tile-badge{
  position:absolute; top:10px; left:10px; z-index:1; background:var(--brand-red); color:#fff;
  font-size:11.5px; font-weight:800; padding:4px 8px; border-radius:5px; letter-spacing:.2px;
}
/* Admin-only quick-edit pencil, opposite corner from the discount badge —
   same hidden-unless-body.is-admin gate as .card-admin/.card-edit. */
.promo-tile-edit{
  display:none; position:absolute; top:10px; right:10px; z-index:2; width:26px; height:26px;
  border-radius:50%; border:none; cursor:pointer; font-size:12px; align-items:center; justify-content:center;
  background:rgba(255,255,255,.95); color:var(--header-black); box-shadow:var(--shadow);
}
body.is-admin .promo-tile-edit{ display:flex; }
.promo-tile-edit:hover{ background:#fff; color:var(--brand-navy); }
.promo-tile-text{ position:relative; z-index:1; width:100%; }
.promo-tile-text .tile-name{ color:#fff; margin-bottom:6px; }
.promo-tile-price{ display:flex; align-items:baseline; gap:8px; }
.promo-tile-price .card-price{ color:#fff; }
.promo-tile-price .card-list{ color:#c9cbd0; }
@media (max-width:860px){
  .promo-tile{ flex-basis:376px; width:376px; }
}
@media (max-width:520px){
  .promo-tiles-track{ gap:10px; padding:0 8px; }
  /* Base rule's 40px ramp would eat a huge chunk of a tile this narrow —
     scaled back down to an 8px ramp here, same reasoning as .cat-tiles'
     and .dept-scroll's own mobile overrides. */
  .promo-tiles{
    -webkit-mask-image:linear-gradient(90deg,
      rgba(0,0,0,0) 0, rgba(0,0,0,.35) 2px, rgba(0,0,0,.72) 4px, rgba(0,0,0,.94) 6px, #000 8px,
      #000 calc(100% - 8px), rgba(0,0,0,.94) calc(100% - 6px), rgba(0,0,0,.72) calc(100% - 4px),
      rgba(0,0,0,.35) calc(100% - 2px), rgba(0,0,0,0) 100%);
    mask-image:linear-gradient(90deg,
      rgba(0,0,0,0) 0, rgba(0,0,0,.35) 2px, rgba(0,0,0,.72) 4px, rgba(0,0,0,.94) 6px, #000 8px,
      #000 calc(100% - 8px), rgba(0,0,0,.94) calc(100% - 6px), rgba(0,0,0,.72) calc(100% - 4px),
      rgba(0,0,0,.35) calc(100% - 2px), rgba(0,0,0,0) 100%);
  }
  .promo-tile{ flex-basis:314px; width:314px; min-height:160px; }
}

/* ================= APPLIANCE ADVERTISING ROWS ================= */
/* Five cards across, drifting on the same rail engine as the other bars
   (createRail() in app.js) with arrows for paging by hand. Sits on its own
   recessed --bg-deep panel (see the variable's comment) so the section reads
   as a distinct ad unit with the cards lifting off it.
   Sized from the reference carousel's proportions: a 367px card there has a
   12px inset, a square image 343px across, then chips, a two-line title, the
   rating, a price block and a 66px button — roughly 1 : 2.15 overall, a gap
   of about 7% of a card, and text scaling with the card. Here that becomes:
   the card's width comes from the row (flex-basis below), its height from
   aspect-ratio, and everything inside is sized in em off a font-size taken
   from the card's own width (container query units), so the whole card
   scales as one piece at any row width instead of only the box shrinking
   around fixed-size text. */
.ad-row{
  /* The spotlight and the info panel that grows out of it are one shape, so
     they share one flat colour (a gradient would seam where they join). */
  --ad-spot-bg:#0d0d0d;
  --ad-card-bg:var(--bg-alt); /* same as every other card on the page */
  --ad-lit-bg:#141414;   /* the selected card's tone */
  --ad-lit-line:#444444;
  --ad-tech-bg:#080808; /* the tech slide: between the row (--bg-deep) and the spotlight */
  --ad-ease:cubic-bezier(.22,.9,.28,1);
  --ad-fade:10px; /* width of the fade zone at each end of the carousel */
  /* No side padding, and the row bleeds out by exactly the fade zone on each
     side (the .ad-row margin below): a card at rest in the first position
     then sits dead on the product grid's left edge, and the five (or however
     many columns the grid has — see layoutApplianceRows()) line up with the
     grid's own columns, same width, same gap. 16px above the title and 8px
     below the dots. */
  background:var(--bg-deep); border-radius:14px; padding:16px 0 8px;
  /* Recessed, not raised: a soft shade falling in from the top edge plus a
     hairline of light along the bottom lip, the way a shallow tray reads. */
  box-shadow:inset 0 8px 18px -8px rgba(0,0,0,.6), 0 1px 0 rgba(255,255,255,.035);
}
.ad-row{ margin:32px calc(var(--ad-fade) * -1); }
.ad-row .promo-bar-head{ margin-bottom:24px; padding:0 16px; } /* 14px of air under the title, plus the 10px the tech slide stands above the stage */
/* 34px each side is the fade zone: cards ease out over it at both ends of the
   row, like the dept bar and tile strip, and a card at rest in the first
   position sits just clear of it. */
.ad-viewport{ container-type:inline-size; container-name:adrow; padding:0 var(--ad-fade); }
/* --ad-per / --ad-gap live on .ad-stage, not .ad-viewport: a container query
   can restyle a container's descendants, never the container itself. */
.ad-stage{
  /* Column count and gap are the product grid's own, copied onto the row by
     layoutApplianceRows(), so the cards are the same size as the grid's. */
  --ad-per:var(--grid-cols, 5); --ad-gap:var(--grid-gap, 20px); position:relative;
  /* One card's width — the spotlight below is cut to it. */
  --ad-card-w:calc((100cqw - (var(--ad-per) - 1) * var(--ad-gap)) / var(--ad-per));
}
/* No scroll-snap: the rail engine drifts and recentres by writing scrollLeft
   every frame, and mandatory snapping would pull it back to a card edge
   between writes (the same reason the other rails have none). */
.ad-scroller{
  overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  scrollbar-width:none; -ms-overflow-style:none;
  /* Headroom for the hover lift and its shadow, which overflow-y:hidden
     would otherwise shave off. */
  padding:4px 0 10px;
  position:relative; z-index:1; /* above the spotlight */
  /* Runs out 34px past the cards' area on both sides (into .ad-viewport's
     padding) and puts the same 34px back as padding on the track, so the
     first position — a card's offsetLeft 34px in, see rail.inset — sits just
     past the fade, and drifting cards ease out across it instead of being cut
     hard at an edge. Same eased five-stop ramp as the other bars. */
  margin:0 calc(var(--ad-fade) * -1);
  -webkit-mask-image:linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,.22) calc(var(--ad-fade) * .235), rgba(0,0,0,.55) calc(var(--ad-fade) * .47),
    rgba(0,0,0,.85) calc(var(--ad-fade) * .735), #000 var(--ad-fade),
    #000 calc(100% - var(--ad-fade)), rgba(0,0,0,.85) calc(100% - var(--ad-fade) * .735),
    rgba(0,0,0,.55) calc(100% - var(--ad-fade) * .47), rgba(0,0,0,.22) calc(100% - var(--ad-fade) * .235),
    rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,.22) calc(var(--ad-fade) * .235), rgba(0,0,0,.55) calc(var(--ad-fade) * .47),
    rgba(0,0,0,.85) calc(var(--ad-fade) * .735), #000 var(--ad-fade),
    #000 calc(100% - var(--ad-fade)), rgba(0,0,0,.85) calc(100% - var(--ad-fade) * .735),
    rgba(0,0,0,.55) calc(100% - var(--ad-fade) * .47), rgba(0,0,0,.22) calc(100% - var(--ad-fade) * .235),
    rgba(0,0,0,0) 100%);
}
.ad-scroller::-webkit-scrollbar{ display:none; }
/* No scrolling the list by hand while the info panel is open — it stays put
   under the panel. (Dots and cards still move it: that's scripted scrolling,
   which overflow:hidden doesn't stop.) */
.ad-row.info-open .ad-scroller{ overflow-x:hidden; touch-action:pan-y; }
/* The spotlight: just a soft lit backdrop, fixed at the first position, that
   the cards drift across. It stands 10px proud of the card on every side
   (.ad-viewport's 10px side padding makes room for the left, so the spot's
   edge lines up with the section title), with a corner radius of the card's
   10px plus that 10px so the two curves are concentric. */
/* The tech slide: one more layer of background, behind the whole slide — the
   full width of the row, under every card that's in view. The row (--bg-deep)
   is the floor and this stands a step up from it; it has no edges of its own
   at the ends — it dissolves into the row over the same fade zone the cards
   do, so what the cards fade into and the band fading out are one and the same
   gradient, instead of a rounded box whose corners and outline show through
   the cards' fade as a second, competing edge. The spotlight (below) is the
   one crisp shape on it. */
.ad-tech{
  position:absolute; z-index:0; pointer-events:none;
  left:calc(var(--ad-fade) * -1); right:calc(var(--ad-fade) * -1); top:-10px; bottom:-4px;
  background:var(--ad-tech-bg);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
  -webkit-mask-image:linear-gradient(90deg, transparent 0, #000 calc(var(--ad-fade) * 1.6), #000 calc(100% - var(--ad-fade) * 1.6), transparent 100%);
  mask-image:linear-gradient(90deg, transparent 0, #000 calc(var(--ad-fade) * 1.6), #000 calc(100% - var(--ad-fade) * 1.6), transparent 100%);
}
.ad-spot{
  position:absolute; z-index:0; pointer-events:none;
  left:-10px; top:-6px; bottom:0; width:calc(var(--ad-card-w) + 20px);
  border-radius:20px;
  background:var(--ad-spot-bg);
  /* Its bottom corners square off while the panel is open (below), because
     it stops being a self-contained tile and becomes the stem of the panel. */
  /* Only there while a product is selected. It fades in as the panel starts
     to grow out of it. Closing, it doesn't fade: it stays exactly as it is
     until the panel's stem has folded up into it, then retracts upward out of
     sight (a wipe, the way the stem did) — the last step of the close, so
     nothing of the column goes early. */
  opacity:0; clip-path:inset(0 0 100% 0);
  transition:border-radius .25s ease .85s, clip-path .34s cubic-bezier(.4,0,.2,1) 1.1s, opacity 0s linear 1.44s;
}
.ad-row.info-open .ad-spot{
  opacity:1; clip-path:inset(0);
  border-bottom-left-radius:0; border-bottom-right-radius:0;
  transition:border-radius .2s ease .1s, clip-path 0s, opacity .22s ease;
}
.ad-track{ display:flex; gap:var(--ad-gap); width:max-content; padding:0 var(--ad-fade); }
@media (max-width:640px){ .ad-row{ --ad-fade:6px; } } /* a phone's right gutter is only 6px */
.ad-card{
  /* 100cqw is the row's own width (.ad-viewport is the container), not the
     track's — the track is as wide as all its cards put together, so a
     percentage of it would be circular. */
  flex:0 0 calc((100cqw - (var(--ad-per) - 1) * var(--ad-gap)) / var(--ad-per));
  container-type:inline-size;
  aspect-ratio:367 / 790;
  background:var(--ad-card-bg);
  border:1px solid var(--line);
  border-radius:10px;
  overflow:hidden; cursor:pointer;
  transition:box-shadow .15s, transform .15s, border-color .3s, background-color .3s;
}
.ad-card:hover{ box-shadow:var(--shadow-lg); transform:translateY(-2px); border-color:var(--line-strong); }
/* The card whose info panel is open (or that's being pressed) is lit. */
.ad-card.is-sel, .ad-card:active{ background:var(--ad-lit-bg); border-color:var(--ad-lit-line); }
.ad-card:focus-visible{ outline:2px solid #ffffff; outline-offset:2px; }
.ad-in{
  /* ~6.1% of the card's width, so 1em here is the unit everything else in
     the card is measured in. Clamped so it stays readable when the row is
     squeezed (the filters panel open) and doesn't balloon when it's wide. */
  font-size:clamp(10.5px, 6.1cqw, 16px);
  display:flex; flex-direction:column; height:100%; box-sizing:border-box;
  padding:.55em;
}
.ad-media{
  position:relative; flex:0 0 auto; aspect-ratio:1; overflow:hidden;
  border-radius:.5em; background:#151517;
}
.ad-media img{ display:block; width:100%; height:100%; object-fit:cover; }
/* Admin-only quick edit, same hidden-unless-body.is-admin gate as
   .promo-tile-edit/.card-admin. */
.ad-edit{
  display:none; position:absolute; top:.5em; right:.5em; z-index:2;
  width:2.1em; height:2.1em; border-radius:50%; border:none; cursor:pointer;
  align-items:center; justify-content:center; font-size:.85em;
  background:rgba(255,255,255,.95); color:var(--header-black); box-shadow:var(--shadow);
}
body.is-admin .ad-edit{ display:flex; }
/* Room for two rows of chips whether or not a card has them, so every
   title in a row starts at the same height. */
.ad-chips{ display:flex; flex-wrap:wrap; align-content:flex-start; gap:.4em .35em; margin-top:.9em; min-height:3.7em; }
.ad-chip{
  display:inline-flex; align-items:center; height:1.75em; box-sizing:border-box;
  padding:0 1.05em 0 .65em; font-size:.78em; font-weight:700; line-height:1; white-space:nowrap; color:#fff;
  /* Cut on the trailing edge, like the reference's tags. */
  clip-path:polygon(0 0, 100% 0, calc(100% - .55em) 100%, 0 100%);
}
.ad-chip-red{ background:var(--brand-red); }
.ad-chip-slate{ background:#33333c; color:#e9e9ee; }
.ad-chip-green{ background:#0e8a5a; }
.ad-title{
  margin:.35em 0 0; min-height:2.7em; font-size:1em; font-weight:500; line-height:1.35; color:var(--ink);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.ad-rating{ display:flex; align-items:center; gap:.4em; margin-top:.5em; font-size:.8em; color:var(--muted); }
/* Partial stars: a gradient hard-stopped at the rating's share of five,
   clipped to the glyphs, so 4.6 reads as 4.6 rather than rounding to 5. */
.ad-stars{
  letter-spacing:.06em; font-size:1.15em; line-height:1;
  background:linear-gradient(90deg, var(--gold-star) var(--fill,0%), #3a3a42 var(--fill,0%));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.ad-price-block{ margin-top:auto; padding-top:.9em; }
.ad-price-label{ font-size:.78em; color:var(--muted); }
.ad-price{ font-size:1.55em; font-weight:800; line-height:1.15; letter-spacing:-.01em; color:var(--ink); font-variant-numeric:tabular-nums; }
.ad-price sup{ font-size:.5em; font-weight:800; vertical-align:top; position:relative; top:.15em; margin-left:.05em; }
/* Always present (empty when there's no saving) so the button below sits at
   the same height on every card. */
.ad-save{ min-height:1.4em; font-size:.8em; font-weight:600; color:#3ecf8e; }
.ad-cta{
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
  height:2.9em; margin-top:.5em; border-radius:.35em;
  background:var(--btn-bg); color:var(--btn-ink); font-size:1.02em; font-weight:700;
  transition:background .15s, opacity .3s ease, visibility 0s;
}
/* The selected card's button goes while its panel is open — the panel is the
   details now. Its space stays, so the card doesn't change height. */
.ad-card.is-sel .ad-cta{ opacity:0; visibility:hidden; transition:background .15s, opacity .3s ease, visibility 0s .3s; }
.ad-card:hover .ad-cta{ background:var(--btn-bg-hover); color:var(--btn-ink);}
/* Blank slot — the same dashed look as .tile-blank / .dept-chip-blank, at
   card size, so an unfilled row keeps its five-across shape. */
.ad-card-blank{
  display:flex; align-items:center; justify-content:center;
  background:var(--bg-alt); border:1.5px dashed var(--line-strong); cursor:default;
}
.ad-card-blank:hover{ box-shadow:none; transform:none; border-color:var(--line-strong); }
body.is-admin .ad-card-blank{ cursor:pointer; }
body.is-admin .ad-card-blank:hover{ border-color:#ffffff; }
body.is-admin .ad-card-blank:hover .tile-blank-plus{ color:#ffffff; opacity:1; }
/* Info panel. It isn't a separate box appearing under the dots — it's the
   spotlight growing, and the dots are part of what grows: the panel's
   background starts right under the cards (the foot's top edge), so the dots
   sit inside it as its first row. In order (open):
     1. the panel background, still only as wide as the spotlight, drops out
        from under it and down past the dots (.ad-foot-bg, a clip that
        reveals top-down) — the column just gets longer;
     2. the info drawer's height grows below the dots, lengthening it more;
     3. the background opens sideways to the full row width (.ad-foot-bg-in,
        a second clip) while a small concave fillet fades in at the join and
        the content arrives.
   Closing plays the same steps in reverse. The drawer's height is a grid
   track going 0fr -> 1fr because a height transition can't animate to
   `auto`. Backgrounds are only ever *clipped*, and the content is laid out
   at full width throughout, so nothing reflows mid-animation. --col-l/--col-r (the
   spotlight's width) is set from JS. */
.ad-foot{
  /* 18px above the dots = the 4px rim under the tech slide + 14px of air, the
     same 14px as under the title. */
  position:relative; padding:18px 0 8px;
  /* Inset to the spotlight's own left edge, both sides: the spotlight and the
     panel it grows into share one straight left wall (no step, no second
     corner), and the panel ends the same distance in from the right. */
  margin:0 calc(var(--ad-fade) - 10px);
  /* The panel scales to its own width: everything in it is in em, off the
     font-size set on .ad-info from this container's width (cqw), so a wide
     row gets larger type and a wide layout instead of small text floating in
     a big empty box. */
  container-type:inline-size;
  --ad-info-fs:clamp(13px, 1.2cqw, 18px);
}
.ad-foot-bg{
  position:absolute; left:0; right:0; top:-1px; bottom:0; pointer-events:none;
  clip-path:inset(0 0 100% 0);
  transition:clip-path .3s ease-in .8s;
}
.ad-foot-bg-in{
  position:absolute; inset:0; background:var(--ad-spot-bg);
  clip-path:inset(0 calc(100% - var(--col-r, 270px)) 0 var(--col-l, 0px) round 0 0 20px 20px);
  transition:clip-path .4s ease-in-out .1s;
}
.ad-row.info-open .ad-foot-bg{
  clip-path:inset(0 0 0 0);
  transition:clip-path .35s var(--ad-ease);
}
.ad-row.info-open .ad-foot-bg-in{
  clip-path:inset(0 0 0 0 round 0 20px 20px 20px);
  transition:clip-path .55s var(--ad-ease) .65s;
}
/* The concave corner where the stem meets the wide part of the panel: a
   square filled everywhere except a quarter circle, sitting in the notch.
   10px, so it fits in the gap under the cards. */
.ad-foot::before{
  content:""; position:absolute; pointer-events:none;
  left:var(--col-r, 270px); top:-10px; width:10px; height:10px;
  background:radial-gradient(circle at 100% 0, transparent 9.5px, var(--ad-spot-bg) 10px);
  opacity:0; transition:opacity .12s ease;
}
.ad-row.info-open .ad-foot::before{ opacity:1; transition:opacity .25s ease .8s; }
.ad-dots, .ad-info{ position:relative; }
/* The row the dots sit in: the name to their left, the price and buttons to
   their right, all filling what used to be empty space either side of the
   pill. The columns are equal, so the pill stays dead centre, and the name
   column is bounded by it — a long name wraps onto more lines rather than
   running up to the dots. */
.ad-topbar{
  position:relative; z-index:1; display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items:center; column-gap:2em; padding:0 1.8em; font-size:var(--ad-info-fs);
}
/* The two halves open like the drawer below (0fr -> 1fr), on the same clock. */
.ad-slot{
  min-width:0; display:grid; grid-template-rows:0fr; visibility:hidden;
  transition:grid-template-rows .45s var(--ad-ease) .4s, visibility 0s .85s;
}
.ad-row.info-open .ad-slot{
  grid-template-rows:1fr; visibility:visible;
  transition:grid-template-rows .5s var(--ad-ease) .3s, visibility 0s;
}
.ad-slot-clip{ min-height:0; overflow:hidden; }
.ad-slot .ad-fade{ padding:.6em 0; }
.ad-slot-right .ad-fade{
  display:flex; align-items:center; justify-content:flex-end; gap:1.8em;
  padding-right:1.4em; /* keeps clear of the close button in the corner */
}
.ad-info{
  display:grid; grid-template-rows:0fr; visibility:hidden; font-size:var(--ad-info-fs);
  transition:grid-template-rows .45s var(--ad-ease) .4s, visibility 0s .85s;
}
.ad-row.info-open .ad-info{
  grid-template-rows:1fr; visibility:visible;
  transition:grid-template-rows .5s var(--ad-ease) .3s, visibility 0s;
}
.ad-info-clip{ min-height:0; overflow:hidden; }
.ad-info-body{ padding:.4em 1.8em 1.2em; }
/* Body: three columns that share the panel's width. */
.ad-info-cols{
  display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:1.4em 2.6em; align-items:start;
  padding-top:1.2em; border-top:1px solid var(--line-strong);
}
/* Overview and Highlights share the first column, so the three columns come
   out about the same height instead of one running long. */
.ad-info-stack{ display:grid; gap:1.4em; align-content:start; }
/* Content: hidden until the panel is open sideways, then rises in, one part
   after another. While swapping between products it's a quick crossfade. */
.ad-fade{ opacity:0; transform:translateY(8px); transition:opacity .18s ease, transform .18s ease; }
.ad-row.info-open .ad-fade{
  opacity:1; transform:none;
  transition:opacity .4s ease .95s, transform .55s var(--ad-ease) .95s;
}
.ad-row.info-open .ad-slot-right .ad-fade{ transition-delay:1.02s; }
.ad-row.info-open .ad-info-body{ transition-delay:1.08s; }
.ad-row.info-open.swapping .ad-fade{ transition:opacity .16s ease, transform .16s ease; transition-delay:0s; }
.ad-row.info-open .ad-fade.out{ opacity:0; }
.ad-info-kicker{ font-size:.78em; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); }
.ad-info-title{ margin:.2em 0 0; font-size:1.55em; font-weight:700; line-height:1.2; color:var(--ink); }
.ad-info-main .ad-rating{ font-size:.95em; margin-top:.4em; }
.ad-info-buy{ display:flex; flex-direction:column; align-items:flex-start; }
.ad-info-buy .ad-price-label{ font-size:.8em; }
.ad-info-buy .ad-price{ font-size:1.9em; }
.ad-info-saveline{ display:flex; align-items:baseline; gap:.7em; margin-top:.1em; }
.ad-info-was{ font-size:.9em; color:var(--muted); text-decoration:line-through; }
.ad-info-buy .ad-save{ min-height:0; font-size:.9em; }
.ad-info-actions{ display:flex; flex-direction:column; gap:.5em; min-width:11em; }
.ad-info-cta{
  height:2.6em; min-height:40px; padding:0 1.4em; border:1px solid var(--btn-bg); border-radius:.4em;
  background:var(--btn-bg); color:var(--btn-ink); font:inherit; font-weight:700; cursor:pointer;
  transition:background .15s, border-color .15s, color .15s;
}
.ad-info-cta:hover{ background:var(--btn-bg-hover); border-color:var(--btn-bg-hover); color:var(--btn-ink);}
.ad-info-cta-alt{ background:transparent; color:var(--ink); border-color:var(--line-strong); }
.ad-info-cta-alt:hover{ background:transparent; border-color:var(--ink); }
/* Body sections */
.ad-info-sec h5{ margin:0 0 .6em; font-size:.75em; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--muted); }
.ad-info-desc{ margin:0; font-size:1em; line-height:1.55; color:#d3d5db; }
.ad-info-sec .ad-chips{ min-height:0; margin-top:.8em; font-size:1em; }
.ad-info-list{ margin:0; padding:0; list-style:none; display:grid; gap:.5em; }
.ad-info-list li{ position:relative; padding-left:1.4em; font-size:1em; line-height:1.4; color:#d3d5db; }
.ad-info-list li::before{
  content:""; position:absolute; left:.1em; top:.42em; width:.55em; height:.3em;
  border-left:2px solid #3ecf8e; border-bottom:2px solid #3ecf8e; transform:rotate(-45deg);
}
/* Installation, under the overview: what the home needs in place, then what
   the free install does and doesn't cover. */
.ad-info-reqs li::before{
  width:.4em; height:.4em; left:.2em; top:.55em; border:none; border-radius:50%;
  background:var(--brand-red); transform:none;
}
.ad-info-note{ margin:.7em 0 0; font-size:.92em; line-height:1.45; color:#b4b8c0; }
.ad-info-note b{ display:block; margin-bottom:.1em; font-size:.85em; letter-spacing:.06em; text-transform:uppercase; color:var(--ink); }
/* Facts: a two-column list with hairlines between rows. */
.ad-info-facts{ display:grid; grid-template-columns:auto minmax(0,1fr); gap:0 1.4em; margin:0; }
.ad-info-facts dt, .ad-info-facts dd{ margin:0; padding:.42em 0; border-bottom:1px solid var(--line-strong); }
.ad-info-facts dt{ font-size:.75em; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); align-self:center; }
.ad-info-facts dd{ font-size:1em; font-weight:600; color:var(--ink); }
.ad-info-facts dt:nth-last-of-type(1), .ad-info-facts dd:last-of-type{ border-bottom:none; }
/* The close button belongs to the whole panel, not the info card: the panel
   starts at the top of the dots row, so its corner is up there. Inset 12px,
   which with the panel's 20px radius keeps it visually concentric with the
   corner. Hidden until the panel has opened sideways. */
.ad-info-close{
  position:absolute; top:18px; right:16px; z-index:3; width:34px; height:34px; border-radius:50%;
  border:1px solid var(--line-strong); background:var(--ad-spot-bg); color:var(--muted); cursor:pointer;
  font-size:20px; line-height:1; padding:0 0 2px; display:flex; align-items:center; justify-content:center;
  opacity:0; visibility:hidden;
  transition:opacity .15s ease, visibility 0s .15s, color .15s, border-color .15s;
}
.ad-row.info-open .ad-info-close{
  opacity:1; visibility:visible;
  transition:opacity .4s ease 1.1s, visibility 0s 1.1s, color .15s, border-color .15s;
}
.ad-info-close:hover{ color:var(--ink); border-color:var(--ink); }
/* Narrower panels (sized off the panel, not the viewport, so this also holds
   when the filters drawer squeezes the row). Below ~1100px the two halves no
   longer fit either side of the dots, so the row stacks: dots, then the name,
   then price and buttons. */
@container (max-width:1100px){
  .ad-topbar{ grid-template-columns:minmax(0,1fr); }
  .ad-topbar .ad-dots{ order:-1; }
  .ad-slot-right .ad-fade{ padding-right:0; justify-content:space-between; }
  .ad-slot-right .ad-info-actions{ flex:0 1 20em; }
}
@container (max-width:900px){
  .ad-info-cols{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .ad-info-cols > .ad-info-sec:last-child{ grid-column:1 / -1; }
}
@container (max-width:520px){
  .ad-info-cols{ grid-template-columns:minmax(0,1fr); }
  .ad-slot-right .ad-fade{ gap:1em; }
  .ad-slot-right .ad-info-actions{ flex:1 1 0; min-width:0; }
}
/* Ten dots make a pill ~276px wide, so the close button only has to leave its
   corner when the panel is too narrow to fit both side by side: then it drops
   to the corner of the info area just under the pill, and the name gives it
   room. */
@container (max-width:380px){
  .ad-info-close{ top:66px; }
  .ad-slot-left .ad-fade{ padding-right:42px; }
}
/* Slide dots. Same pill shape as the reference carousel's, but in this
   store's colours rather than its white: a raised --bg-alt pill with a
   hairline border, muted rings for the slides not in view, and the brand
   red for the one that is. Buttons, so they're keyboard-reachable and
   clicking one moves the rail to that slide. */
.ad-dots{
  display:flex; align-items:center; gap:4px; width:max-content;
  position:relative; z-index:2; /* over the spotlight column as it extends past */
  margin:0 auto; padding:5px 10px; border-radius:999px;
  background:var(--bg-alt); border:1px solid var(--line-strong);
  box-shadow:0 2px 8px rgba(0,0,0,.45);
}
.ad-dots[hidden]{ display:none; }
.ad-dot{
  width:22px; height:22px; padding:0; border:none; background:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; border-radius:50%;
}
.ad-dot::before{
  content:""; box-sizing:border-box; width:12px; height:12px; border-radius:50%;
  border:1.5px solid var(--muted); background:transparent;
  transition:background .2s, border-color .2s, transform .2s;
}
.ad-dot:hover::before{ border-color:var(--ink); transform:scale(1.15); }
.ad-dot:focus-visible{ outline:2px solid #ffffff; outline-offset:1px; }
.ad-dot.on::before{ background:var(--btn-bg); border-color:var(--btn-bg); }


/* ================= SHOP ================= */
.shop{
  /* No right padding and no max-width: the product grid and dept bar run
     straight to the side rail (which sits over .page-shift's reserved
     --rail-w strip), like the tile strip above them. Only the left keeps its
     24px gutter. */
  /* Left 40px: clears the fixed Filters tab (30px wide at x 0) by 10px, so
     it never sits over a card, chip or price. Right 10px: the same clearance
     from the side rail, which the grid used to run hard against. */
  margin:0; padding:12px 40px 90px 40px; /* right = left now that the side rail is gone */
}

/* Department filter — the same continuous auto-scrolling rail engine as the
   tile strip above the fold (see buildDeptBar()/wireDeptRail()/runDeptRail()
   in app.js), ported from the previous site's dept bar and recoloured for
   this palette: red for the active/hover accent instead of the old gold. */
/* gap:0 — the ALL chip's spacing from the scrollable rail now comes
   entirely from .dept-track's own left padding (10px, below), matching the
   10px gap between chips inside the rail exactly. It used to be dept-bar's
   own 20px gap PLUS dept-track's 16px mask-clearance padding stacked
   together (36px total) — visibly far wider than the 10px between any two
   scrolling chips, which is what made ALL look like it wasn't really part
   of the same row. */
.dept-bar{ display:flex; align-items:center; gap:0; margin-bottom:16px; }
/* Sticks under the header once the page scrolls past it, like a header row of
   its own. `top:0` because a sticky element's offset is measured from the
   scroller's padding edge inward, and .panel-shop's padding-top is already the
   tucked header's real height — so 0 here lands it flush under the header. The strip behind it (::before, header black,
   running out to the left page edge) only shows once it has actually stuck
   (.is-stuck, set from wireDeptSticky()), so in its resting place the bar looks
   exactly as it did. Not applied while docked into the header. */
.dept-bar:not(.dept-bar-docked){
  position:sticky; top:0; z-index:60;
}
.dept-bar:not(.dept-bar-docked)::before{
  content:""; position:absolute; z-index:-1; pointer-events:none;
  left:-40px; right:0; top:-6px; bottom:-8px;
  background:var(--header-black); box-shadow:0 6px 14px -6px rgba(0,0,0,.7);
  opacity:0; transition:opacity .2s ease;
}
.dept-bar.is-stuck:not(.dept-bar-docked)::before{ opacity:1; }
/* "Docked" state — engaged only while the filters panel is open (see
   dockDeptBar()/undockDeptBar() in wireFilters(), app.js). The bar leaves its
   in-flow slot below the tile rail and hangs off the bottom edge of the header
   as a real third header row, inside .dept-dock below. Because it is a child
   of #headerWrap it moves with everything the header does — the tuck slide,
   the full-bleed width that spans the newly-opened panel too — with no
   position bookkeeping of its own. The slides in and out of frame are driven
   from JS (Web Animations); nothing here transitions. */
.dept-dock{
  /* 1px up into the header (and the bar below gets 1px more top padding to make
     up for it): the header's height is fractional (63.94px), so its bottom edge and
     this box's top edge land between device pixels, and the page content underneath
     (product photos) showed through as a thin line along the seam. */
  position:absolute; top:calc(100% - 2px); left:0; right:0; /* 2px up into the header: 1px seam overlap + 1px closer */
  /* Clips the bar while it slides in from / out to the right, so the page
     never grows a horizontal overflow mid-slide. Below the rail (z 90) and
     the header menus (z 40+), which is where it sits on the header. */
  z-index:1; overflow:hidden;
}
.dept-bar.dept-bar-docked{
  margin:0; box-sizing:border-box;
  background:var(--header-black);
  /* Vertical padding, not just horizontal — undocked, the bar's only
     breathing room is margin-bottom (16px, on the OUTSIDE), so it has
     none of its own once it's docked as a self-contained strip with
     things sitting flush above (the header) and below (the filters
     panel's own content) it. 5px each side keeps the chips off the strip's
     own top/bottom edges without padding it out past the header row above.
     Panel content and the page are pushed down to clear this exact (taller)
     height, read live — see dockDeptBar() in app.js. Right padding clears
     the side rail, which overlaps the bar's right end (it starts where the
     header ends). */
  /* 7 / 4: the top 3px of the bar tucks up under the header's bottom edge (see .dept-dock),
     so this puts the chips dead centre in the band that's actually visible between the
     header's bottom edge and the bar's bottom edge (4.5px above and below). */
  padding:7px var(--rail-w, 30px) 4px 16px;
}
/* Stands in for the bar in the page flow while it hangs off the header (JS
   sets its height — see dockDeptBar()). */
.dept-bar-spacer{ margin-bottom:16px; }
/* Paints the header's own colour across the filters panel too — see its
   own long comment in wireFilters() (app.js) for why this is a plain
   decorative fill behind the real #headerWrap rather than pulling the
   real header out of flow the way #deptBar was. width/height start at 0
   (invisible, takes no space) and are written by dockDeptBar()/
   undockDeptBar(). The SAME duration/curve as .page-shift's own
   margin-left transition (the thing that's actually sliding the real
   header over) — kept in lockstep on purpose, so this reads as filling in
   behind the real header as it moves, not a separately-timed effect. */
.header-fill-strip{
  position:fixed; top:0; left:0; z-index:99; /* just under #headerWrap's own 100 — sits behind it, never over it */
  width:0; height:0; overflow:hidden;
  background:var(--header-black);
  pointer-events:none;
  transition:width .28s cubic-bezier(.4,0,.2,1), height .28s cubic-bezier(.4,0,.2,1);
}
/* Fixed on the left, outside the scroller — the mirror image of the old
   bar's search field pinned to the right of its own flex:1 rail. Never
   shrinks, and never joins the rotating set. */
.dept-chip-all{ flex:none; }
.dept-rail{ position:relative; flex:1; min-width:0; }
.dept-scroll{
  overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch;
  scrollbar-width:none; -ms-overflow-style:none; cursor:grab;
  /* Without this, dragging past either true end triggers the browser's own
     elastic rubber-band animation, which keeps writing scrollLeft on its own
     and fights recenter()'s attempt to pull the position back to centre —
     a visible stutter/bounce right at the edge. */
  overscroll-behavior-x:contain;
  /* Same eased 40px ramp on both edges — no crescent, no mask-composite,
     no per-edge special casing. */
  -webkit-mask-image:linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,.22) 10px, rgba(0,0,0,.55) 20px, rgba(0,0,0,.85) 30px, #000 40px,
    #000 calc(100% - 40px), rgba(0,0,0,.85) calc(100% - 30px), rgba(0,0,0,.55) calc(100% - 20px),
    rgba(0,0,0,.22) calc(100% - 10px), rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,.22) 10px, rgba(0,0,0,.55) 20px, rgba(0,0,0,.85) 30px, #000 40px,
    #000 calc(100% - 40px), rgba(0,0,0,.85) calc(100% - 30px), rgba(0,0,0,.55) calc(100% - 20px),
    rgba(0,0,0,.22) calc(100% - 10px), rgba(0,0,0,0) 100%);
}
.dept-scroll::-webkit-scrollbar{ display:none; }
/* Track padding matches the mask width exactly on both edges (40px) —
   same invariant as the tile strip, so a resting chip never touches the fade. */
.dept-track{ display:flex; gap:10px; width:max-content; padding:0 40px; }
.dept-chip{
  white-space:nowrap; flex:none; background:var(--line); border:1px solid var(--line-strong);
  color:var(--muted); padding:9px 18px; border-radius:20px; font-size:12px; font-weight:700;
  letter-spacing:.4px; text-transform:uppercase; cursor:pointer;
  transition:color .18s, border-color .18s, background .18s;
}

@media (hover:hover){ .dept-chip:hover{ color:var(--ink); border-color:#ffffff; background:rgba(255,255,255,0.112); } }
.dept-chip.active{ background:var(--btn-bg); border-color:var(--btn-bg); color:var(--btn-ink); }

@media (hover:hover){ .dept-chip.active:hover{ background:var(--btn-bg-hover); border-color:var(--btn-bg-hover); color:var(--btn-ink);} }
/* A department with no products yet: only the admin is sent it (see GET /api/departments), dashed so it reads as unfinished. */
.dept-chip.is-empty{ border-style:dashed; opacity:.7; }
/* Filler slots padding the rail out past the real departments — dashed and
   inert for shoppers, same treatment as the tile strip's blank tiles, only
   clickable (to open the new-product form) for the signed-in admin. */
.dept-chip-blank{
  background:var(--bg-alt); border:1.5px dashed var(--line-strong); color:var(--muted);
  opacity:.55; cursor:default;
}

@media (hover:hover){ .dept-chip-blank:hover{ color:var(--muted); border-color:var(--line-strong); background:var(--bg-alt); } }
body.is-admin .dept-chip-blank{ cursor:pointer; opacity:.7; }
body.is-admin .dept-chip-blank:hover{ border-color:#ffffff; color:#ffffff; opacity:1; }

.shop-head{
  display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; gap:16px;
  flex-wrap:wrap;
}
/* The title and sort control that used to live here are gone, so for every
   shopper who isn't the admin (the only one who still sees the Add Product
   button inside it) this row is fully empty — collapse it rather than
   leaving its margin behind as dead space above the sub-nav. */
body:not(.is-admin) .shop-head{ display:none; margin-bottom:0; }
.shop-head h2{ font-size:22px; font-weight:800; color:var(--ink); margin:0; }
.shop-head-actions{ display:flex; align-items:center; gap:14px; }
/* White on black rather than the old navy — navy (#0d0d0d) is now almost the
   same shade as the page itself and the button would nearly disappear. */
.btn-admin-add{
  background:#fff; color:var(--header-black); border:none; border-radius:6px;
  padding:9px 16px; font-weight:700; font-size:13px; cursor:pointer;
}
.btn-admin-add:hover{ background:#e2e2e2; }
.btn-admin-add.alt{ background:var(--btn-bg); color:var(--btn-ink); }
.btn-admin-add.alt:hover{ background:var(--btn-bg-hover); color:var(--btn-ink);}
.admin-toolbar{ margin-bottom:16px; }
.sort-label{ font-size:13px; color:var(--muted); font-weight:600; }
.sort-label select{
  margin-left:8px; border:1px solid var(--line); border-radius:6px; padding:8px 10px;
  font:inherit; font-size:13px; color:var(--ink); background:var(--bg-alt);
}
/* Subcategory selection used to live here as its own row of chips
   (.sub-nav, directly under the dept bar) — moved into the filters panel
   instead (#filterCategoryGroup, styles below), as a select. */

.grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:20px;
}
/* Two chunks back to back (no appliance row or banner between them) get the
   same space as the rows inside a chunk, instead of butting together. */
#grid > .grid + .grid{ margin-top:20px; }
.empty-state{ grid-column:1/-1; text-align:center; padding:60px 20px; color:var(--muted); }

.card{
  background:var(--bg-alt); border:1px solid var(--line); border-radius:10px; overflow:hidden;
  display:flex; flex-direction:column; transition:box-shadow .15s, transform .15s;
}

@media (hover:hover){ .card:hover{ box-shadow:var(--shadow-lg); transform:translateY(-2px); } }
/* One re-featured deal card sprinkled into the ordinary grid every 3 rows
   (sprinkleLegendaryDeals() in app.js) — gold/orange, always, regardless of
   theme, same convention as a "legendary" item-rarity glow in a game: it
   reads as special on sight, no label required, though .badge-legendary
   below adds one anyway for clarity. z-index lifts it just enough that the
   glow isn't clipped by an adjacent card's own box-shadow on hover. */
@keyframes legendary-glow{
  0%, 100%{ box-shadow:0 0 10px 2px rgba(255,145,0,.55), 0 0 22px 7px rgba(255,175,40,.28); }
  50%{ box-shadow:0 0 18px 5px rgba(255,170,20,.9), 0 0 40px 15px rgba(255,190,60,.45); }
}
.card-legendary{
  position:relative; z-index:1; border-color:#ffb238;
  animation:legendary-glow 2.4s ease-in-out infinite;
}

@media (hover:hover){ .card-legendary:hover{ box-shadow:var(--shadow-lg), 0 0 24px 8px rgba(255,175,40,.6); } }
/* Stays a true square, and object-fit:cover below means the photo fills it
   edge to edge — never letterboxed. Card height is trimmed from the text block
   underneath instead, not from the artwork. */
.card-img{
  aspect-ratio:1; background:var(--bg-alt); position:relative; cursor:pointer; overflow:hidden;
}

.card-img img{ width:100%; height:100%; object-fit:cover; }
/* Culling: a card that is far off screen is not laid out or painted at all (content-visibility) until it nears the viewport; the intrinsic size
   keeps its place in the grid (and the scrollbar steady) in the meantime. Its photo still loads — the loading screen asks for them. */
#grid .card{ content-visibility:auto; contain-intrinsic-size:auto 425px; }
/* Hover preview (wireCardPreview() in app.js): the card's other photos are stacked over its own, hidden, and faded in one after another. */
.card-preview{ position:absolute; inset:0; pointer-events:none; opacity:1; transition:opacity .25s ease; }
.card-preview.is-off{ opacity:0; }
.card-preview > img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; opacity:0; transition:opacity .55s ease; }
.card-preview > img.on{ opacity:1; }
.card-preview-dots{ position:absolute; left:0; right:0; bottom:8px; display:flex; justify-content:center; gap:5px; }
.card-preview-dots i{ width:5px; height:5px; border-radius:50%; background:rgba(255,255,255,.5); box-shadow:0 0 0 .5px rgba(0,0,0,.35); transition:background .3s, transform .3s; }
.card-preview-dots i.on{ background:#fff; transform:scale(1.25); }
.badge-prime{
  position:absolute; top:8px; left:8px; background:var(--brand-navy); color:#fff;
  font-size:10.5px; font-weight:700; padding:3px 8px; border-radius:4px; letter-spacing:.2px;
}
.badge-multi{
  position:absolute; bottom:8px; left:8px; background:var(--brand-red); color:#fff;
  font-size:10.5px; font-weight:700; padding:3px 8px; border-radius:4px; letter-spacing:.2px; z-index:2;
}
/* Ad-transparency label for a temporarily sponsored product (sponsored_until
   in the future — see db.js) — deliberately understated/neutral, not the
   brand red used for real discounts, same convention as any storefront's
   "Sponsored" tag. Bottom-right: the one card corner .badge-prime (top-left),
   .badge-multi (bottom-left) and .card-admin (top-right) don't already use. */
.badge-sponsored{
  position:absolute; bottom:8px; right:8px; background:rgba(0,0,0,.72); color:#fff;
  font-size:10px; font-weight:700; padding:3px 7px; border-radius:4px; letter-spacing:.2px; z-index:2;
}
/* Full-width ribbon across the top edge, not a centered pill — a centered
   pill at top:8px sat in the exact same row as .badge-prime's top-left
   "Free 2-Day" tag, and on a card that's both legendary AND prime (common —
   the legendary pool is drawn from real, already-appealing deal stock) the
   two visibly overlapped, "Free 2-Day" text bleeding into "Legendary Deal".
   A full-width band can't collide with a corner badge on the SAME row by
   construction; .card-legendary's own rule below pushes .badge-prime/
   .card-admin down clear of the ribbon's height instead, so this never
   happens regardless of which badges a given legendary card carries. Corners
   come out already rounded to match .card's own radius for free, since the
   ribbon is flush against .card-img's top edge inside .card's overflow:hidden
   clip — no separate border-radius needed here. */
.badge-legendary{
  position:absolute; top:0; left:0; right:0; z-index:3; text-align:center;
  background:linear-gradient(135deg,#ffc25c,#ff8a1e); color:#2a1400;
  font-size:11.5px; font-weight:800; letter-spacing:.2px; white-space:nowrap;
  padding:7px 10px; box-shadow:0 2px 10px rgba(255,130,0,.45);
}
/* Clears the ribbon's own height (~34px) so these two never sit under it —
   see .badge-legendary's own comment for the overlap this replaces. */
.card-legendary .badge-prime{ top:42px; }
.card-legendary .card-admin{ top:42px; }
/* Admin-only edit/delete controls on each product box — hidden unless a
   signed-in admin session toggles body.is-admin (see refreshMe() in app.js). */
.card-admin{ display:none; position:absolute; top:8px; right:8px; gap:6px; z-index:3; }
body.is-admin .card-admin{ display:flex; }
.card-admin button{
  width:26px; height:26px; border-radius:50%; border:none; cursor:pointer;
  font-size:12px; display:flex; align-items:center; justify-content:center;
  /* Fixed dark, not var(--ink) — this sits on a solid white circle regardless
     of the page theme, so it needs its own colour rather than the page's
     (now light) text colour. */
  background:rgba(255,255,255,.95); color:var(--header-black); box-shadow:var(--shadow);
}
.card-edit:hover{ background:#fff; color:var(--brand-navy); }
.card-del:hover{ background:#fff; color:#ffffff; }
/* All of the card's height reduction is taken here, in the text block below
   the square image — tighter padding, gaps and line-heights. */
.card-body{ padding:8px 12px 10px; display:flex; flex-direction:column; gap:2px; flex:1; }
.card-brand{ font-size:10px; line-height:1.3; text-transform:uppercase; letter-spacing:.4px; color:var(--muted); font-weight:700; }
/* Still clamps at two lines, but no min-height: reserving both lines padded out
   every card whose name only needed one. */
.card-name{
  font-size:13.5px; font-weight:600; color:var(--ink); line-height:1.25; cursor:pointer;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}

@media (hover:hover){ .card-name:hover{ text-decoration:none; } }
.card-rating{ display:flex; align-items:center; gap:5px; font-size:11.5px; line-height:1.3; color:var(--muted); }
.stars{ color:var(--gold-star); letter-spacing:1px; font-size:11.5px; }
.card-price-row{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; line-height:1.25; }
.card-price{ font-size:17px; font-weight:800; color:var(--ink); }
.card-list{ font-size:12px; color:var(--muted); text-decoration:line-through; }
.card-unit{ font-size:11.5px; line-height:1.3; color:var(--muted); }
/* The CTA wrapper is the flex child of .card-body, so this is where the
   push-to-bottom belongs — margin-top:auto on the button itself did nothing,
   since its parent is this div rather than the flex column. */
.card-cta{ margin-top:auto; padding-top:6px; }
.add-btn{
  display:block; width:100%;
  background:var(--btn-bg); color:var(--btn-ink); border:none; border-radius:6px;
  padding:8px; font-weight:700; font-size:12.5px; cursor:pointer;
}

@media (hover:hover){ .add-btn:hover{ background:var(--btn-bg-hover); color:var(--btn-ink);} }
/* Same deal — .card-cta already handles pushing this row to the bottom. */
.qty-row{
  display:flex; align-items:center; justify-content:space-between;
  background:var(--brand-navy); border-radius:6px; color:#fff; padding:4px 6px;
}
.qty-row button{
  background:rgba(255,255,255,.14); border:none; color:#fff; width:28px; height:28px;
  border-radius:5px; font-size:16px; cursor:pointer; line-height:1;
}

@media (hover:hover){ .qty-row button:hover{ background:rgba(255,255,255,.24); } }
.qty-row span{ font-weight:700; font-size:14px; }

/* ================= FOOTER ================= */
/* The same black as the header (var(--header-black), not --brand-navy) so
   there's no seam between it and the now-black page above it. */
.footer{ background:var(--header-black); color:#c9cbd1; margin-top:40px; }
.footer-inner{
  max-width:1400px; margin:0 auto; padding:44px 40px 28px;
  display:grid; grid-template-columns:2fr 1fr 1fr; gap:32px;
}
.footer-col h4{ color:#fff; font-size:14px; margin:0 0 12px; }
.flink{
  display:block; background:none; border:none; color:#c9cbd1; font:inherit;
  text-align:left; padding:4px 0; cursor:pointer; text-decoration:none; font-size:13.5px;
}

@media (hover:hover){ .flink:hover{ color:#fff; } }
.foot-logo{
  font-family:'Playfair Display',Georgia,serif; font-size:21px; font-weight:800;
  color:var(--brand-gold-light); margin-bottom:10px;
}
.footer-brand p{ font-size:13px; color:#a4a7ae; max-width:340px; }
.footer-bottom{
  border-top:1px solid rgba(255,255,255,.12); text-align:center; padding:16px;
  font-size:12px; color:#8d9098;
}
.flink-inline{ color:inherit; text-decoration:none; }

@media (hover:hover){ .flink-inline:hover{ color:#fff; text-decoration:underline; } }
.co-zone{ font-size:11px; color:var(--muted); margin-left:6px; font-weight:500; }

/* ================= OVERLAYS / MODALS ================= */
.overlay{
  position:fixed; inset:0; background:rgba(0,0,0,.5); display:flex;
  align-items:center; justify-content:center; z-index:100; padding:20px;
}
.overlay[hidden]{ display:none; }
.product-modal,.checkout-modal,.account-modal,.orders-modal,.product-form-modal{
  background:var(--bg-alt); border-radius:12px; width:100%;
  overflow:auto; padding:0; position:relative; box-shadow:var(--shadow-lg);
}
.checkout-modal,.account-modal,.orders-modal,.product-form-modal{ max-width:680px; max-height:86vh; }
/* Noticeably roomier than the other (form-shaped) modals above — this one's
   showing off a photo gallery, not collecting input, so it gets the extra
   width and a taller cap to match. */
.product-modal{ max-width:960px; max-height:60vh; }
/* One shade up from the modal panel itself (--line, not --bg-alt) — otherwise
   the close button is the exact same colour as what it's sitting on. */
.modal-close{
  position:absolute; top:14px; right:14px; background:var(--line); border:none;
  width:32px; height:32px; border-radius:50%; font-size:18px; cursor:pointer; color:var(--ink);
  display:flex; align-items:center; justify-content:center; z-index:2;
}

@media (hover:hover){ .modal-close:hover{ background:var(--line-strong); } }

.pm-body{ display:grid; grid-template-columns:1fr 1fr; gap:0; }
.pm-img{ background:var(--bg-alt); position:relative; }
.pm-img img{ width:100%; height:100%; object-fit:cover; }
.pm-info{ padding:36px; display:flex; flex-direction:column; gap:12px; }
.pm-info .card-brand{ margin-top:6px; }
.pm-info h3{ font-size:23px; font-weight:800; margin:0; }
.pm-desc{ font-size:14.5px; color:var(--muted); line-height:1.65; }
.pm-price-row{ display:flex; align-items:baseline; gap:10px; margin:6px 0; }
.pm-price{ font-size:29px; font-weight:800; }
/* The delivery line from location.js (colours and the "Change" link are styled there). */
.pm-eta{ font-size:14px; }
@media (max-width:560px){ .pm-body{ grid-template-columns:1fr; } .pm-info{ padding:24px; } .pm-gallery{ height:64vw; max-height:360px; } }

/* Photo-slides carousel filling .pm-img — same crossfade/arrow/dot language
   as the homepage deals slideshow (.dc-*), just scoped to a square pane
   instead of a full-width hero. Single-image products render one slide with
   the arrows/dots omitted entirely (see openProductModal() in app.js), so
   this degrades to a plain photo with zero extra markup either way. */
.pm-gallery{ position:relative; height:min(60vh,468px); overflow:hidden; }
.pm-slides{ position:relative; width:100%; height:100%; }
.pm-slide{
  position:absolute; inset:0; transition:transform .42s cubic-bezier(.22,1,.36,1);
  background-size:cover; background-position:center; will-change:transform;
}   /* the photos sit in a row and slide (transform set by layoutPm() in app.js); the gallery's overflow:hidden hides the ones off to the side */
.pm-gallery{ touch-action:pan-y; -webkit-user-select:none; user-select:none; }
.pm-slide-placeholder{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
  background:linear-gradient(135deg,var(--line),var(--bg-alt)); color:var(--muted);
  text-transform:uppercase; letter-spacing:.08em; font-size:12px; font-weight:800;
}
.pm-slide-placeholder small{ color:var(--muted); font-size:10px; font-weight:600; text-transform:none; letter-spacing:0; }
.pm-arrow{
  position:absolute; top:50%; transform:translateY(-50%); background:rgba(0,0,0,.45);
  border:none; color:#fff; width:34px; height:34px; border-radius:50%; cursor:pointer;
  display:flex; align-items:center; justify-content:center; z-index:3; font-size:13px;
  transition:background .15s;
}

@media (hover:hover){ .pm-arrow:hover{ background:rgba(0,0,0,.68); } }
.pm-prev{ left:12px; }
.pm-next{ right:12px; }
.pm-dots{ position:absolute; bottom:12px; left:0; right:0; display:flex; justify-content:center; gap:7px; z-index:3; }
.pm-dot{
  width:7px; height:7px; border-radius:50%; border:none; background:rgba(255,255,255,.55); cursor:pointer; padding:0;
  box-shadow:0 0 0 1px rgba(0,0,0,.25);
}
.pm-dot.active{ background:#fff; width:18px; border-radius:4px; }
.pm-nutrition{ padding:18px; border-top:1px solid var(--line); background:var(--bg-alt); }
.nutrition-label{ background:#08090a; color:#f2f3f5; border:2px solid #ffffff; border-radius:4px; padding:12px; font-family:Arial,Helvetica,sans-serif; box-shadow:none; }
.nutrition-label h4{ margin:0; border-bottom:7px solid #f2f3f5; padding-bottom:4px; font-size:25px; line-height:1; letter-spacing:-.02em; }
.nutrition-serving-count{ padding:5px 0 7px; border-bottom:1px solid #f2f3f5; font-size:10px; font-weight:700; }
.nutrition-serving-size{ display:flex; justify-content:space-between; gap:12px; padding:6px 0; border-bottom:4px solid #f2f3f5; font-size:11px; }
.nutrition-serving-size strong{ font-weight:800; text-align:right; }
.nutrition-calories{ display:grid; grid-template-columns:1fr auto; align-items:end; padding:6px 0 5px; border-bottom:1px solid #f2f3f5; }
.nutrition-calories span{ grid-column:1/-1; font-size:9px; font-weight:700; }
.nutrition-calories strong{ font-size:22px; line-height:1; }
.nutrition-calories b{ font-size:31px; line-height:.9; }
.nutrition-daily-value{ padding:4px 0; border-bottom:4px solid #f2f3f5; text-align:right; font-size:9px; font-weight:800; }
.nutrition-row{ display:flex; justify-content:space-between; gap:10px; padding:4px 0; border-bottom:1px solid #5a5e66; font-size:10px; line-height:1.2; }
.nutrition-row b{ white-space:nowrap; }
.nutrition-bold{ font-weight:700; }
.nutrition-indent{ padding-left:12px; }
.nutrition-subrow{ padding-left:24px; }
.nutrition-protein{ border-bottom:7px solid #f2f3f5; padding-bottom:6px; }
.nutrition-footnote{ margin:8px 0 0; font-size:8.5px; line-height:1.25; }
.nutrition-admin{ border:1px solid var(--line); border-radius:6px; margin:18px 0 0; padding:14px; }
.nutrition-admin legend{ padding:0 6px; color:var(--ink); font-size:13px; font-weight:800; }
.nutrition-admin .form-row{ margin-bottom:8px; }
.nutrition-admin input{ min-width:0; }
/* Same boxed-fieldset look as .nutrition-admin, for the temporary
   sponsored-ad controls on the product edit form (openProductForm()). */
.sponsor-admin{ border:1px solid var(--line); border-radius:6px; margin:18px 0 0; padding:14px; }
.sponsor-admin legend{ padding:0 6px; color:var(--ink); font-size:13px; font-weight:800; }
.sponsor-admin .form-hint{ margin:0 0 10px; }
.sponsor-btn-row{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.sponsor-btn-row .btn-secondary{ width:auto; margin-top:0; padding:7px 12px; font-size:12.5px; }
.sponsor-btn-row .flink{ margin-left:auto; }

.form-pad{ padding:28px; }
.form-pad h3{ margin:0 0 18px; font-size:19px; font-weight:800; }
.form-row{ margin-bottom:14px; }
.form-grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.chk-row{ display:flex !important; align-items:center; gap:8px; font-size:13.5px !important; color:var(--ink) !important; font-weight:600 !important; margin-bottom:0 !important; }
.chk-row input{ width:auto; }
textarea{
  width:100%; border:1px solid var(--line); border-radius:6px; padding:10px 12px; font:inherit;
  font-size:14px; resize:vertical; background:var(--line); color:var(--ink);
}
.btn-secondary{ margin-top:10px; }
.form-hint{ font-size:12.5px; color:var(--muted); margin:-8px 0 16px; line-height:1.5; }
/* Bought price → sell price → profit, trading-ticker style (profitReadoutHTML()
   in app.js, live-updated as the Bought price/Price inputs change): tabular
   figures so the three numbers stay aligned as they change, green/"+" for a
   profit and red/"−" for a loss — same up/down convention as any trading
   app, never the brand red (that's reserved for discounts elsewhere). */
.profit-readout{
  display:flex; align-items:baseline; gap:10px; font-variant-numeric:tabular-nums;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:14px; font-weight:700;
  background:var(--line); border-radius:6px; padding:10px 14px; margin:-6px 0 16px;
}
.profit-cost{ color:var(--muted); }
.profit-cost::after{ content:'\2192'; margin-left:10px; color:var(--muted); font-weight:400; }
.profit-price{ color:var(--ink); }
.profit-delta{ margin-left:auto; }
.profit-up{ color:#089981; }
.profit-down{ color:#f23645; }
.profit-flat{ color:var(--muted); }
/* Shown in place of cost/delta when Bought price is still blank — see
   profitReadoutHTML()'s own comment for why that's never silently treated
   as $0. */
.profit-hint{ margin-left:auto; color:var(--muted); font-family:Inter,sans-serif; font-weight:600; font-size:12.5px; }
@media (max-width:480px){ .form-grid-2{ grid-template-columns:1fr; } }

/* Drag-and-drop product photo picker (admin product/listing forms) — filled
   with --line, not --bg-alt: this sits inside a --bg-alt modal, so matching
   the modal's own colour would make it invisible until hovered. */
.photo-drop{
  position:relative; border:2px dashed var(--line-strong); border-radius:10px;
  min-height:140px; display:flex; align-items:center; justify-content:center;
  cursor:pointer; overflow:hidden; background:var(--line); transition:border-color .15s, background .15s;
}
.photo-drop:hover, .photo-drop.drag{ border-color:#ffffff; background:rgba(255,255,255,0.08); }
.photo-drop img{ width:100%; height:140px; object-fit:contain; padding:8px; }
.photo-drop-empty{
  display:flex; flex-direction:column; align-items:center; gap:8px; color:var(--muted);
  font-size:13px; padding:20px; text-align:center;
}

/* Extra-photos manager (admin edit form) — a small thumbnail grid ending in
   an "add" tile, each thumbnail saving/deleting itself immediately (see
   wireProductGallery() in app.js). Same --line fill as .photo-drop above,
   for the same reason (sits inside a --bg-alt modal). */
.pf-gallery{ display:flex; flex-wrap:wrap; gap:10px; }
.pf-gallery-thumb{
  position:relative; width:72px; height:72px; border-radius:8px; overflow:hidden;
  background:var(--line); border:1px solid var(--line-strong);
}
.pf-gallery-thumb img{ width:100%; height:100%; object-fit:cover; }
.pf-gallery-remove{
  position:absolute; top:3px; right:3px; width:20px; height:20px; border-radius:50%;
  background:rgba(0,0,0,.65); color:#fff; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; font-size:13px; line-height:1;
}
.pf-gallery-remove:hover{ background:var(--brand-red); }
.pf-gallery-add{
  width:72px; height:72px; border-radius:8px; border:2px dashed var(--line-strong);
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--muted);
  transition:border-color .15s, color .15s;
}
.pf-gallery-add:hover{ border-color:#ffffff; color:#ffffff; }

/* Tile image crop/resize editor (admin) — a canvas the exact aspect ratio of
   a homepage tile, with pointer-drag panning and a zoom slider. Same --line
   fill as the photo dropzone above, for the same reason. */
.crop-stage{
  position:relative; width:100%; max-height:60vh; margin-bottom:14px;
  border-radius:10px; overflow:hidden; background:var(--line); border:1px solid var(--line-strong);
}
.crop-stage canvas{ display:block; cursor:grab; touch-action:none; }
.crop-stage canvas:active{ cursor:grabbing; }
.crop-controls{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; margin-bottom:14px; }
.crop-zoom-label{
  display:flex; align-items:center; gap:8px; font-size:12.5px; font-weight:600; color:var(--muted); flex:1 1 160px;
}
.crop-zoom-label input[type="range"]{ flex:1; accent-color:#ffffff; }
#cropReplaceBtn{ width:auto; margin-top:0; padding:9px 14px; font-size:13px; }

/* Admin-only pencil icon on each homepage tile, opening the cropper above. */
.tile-edit-btn{
  display:none; position:absolute; z-index:2; top:8px; right:8px;
  align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%;
  background:rgba(0,0,0,.62); border:1px solid rgba(255,255,255,.25); color:#fff;
  cursor:pointer; padding:0; transition:background .15s, transform .15s;
}
.tile-edit-btn:hover{ background:var(--btn-bg); transform:scale(1.08); color:var(--btn-ink);}
body.is-admin .tile-edit-btn{ display:flex; }

/* Multi-size listing form: dynamic size/variant rows */
.variant-headers{
  display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr 30px; gap:8px;
  font-size:11px; font-weight:700; color:var(--muted); text-transform:uppercase;
  letter-spacing:.3px; padding:0 2px 4px;
}
.variant-row{ display:grid; grid-template-columns:1.6fr 1fr 1fr 1fr 30px; gap:8px; margin-bottom:8px; align-items:center; }
.variant-row input{
  border:1px solid var(--line); border-radius:6px; padding:8px 10px; font:inherit; font-size:13px; width:100%;
  background:var(--line); color:var(--ink);
}
.variant-remove{
  background:var(--line); border:1px solid var(--line-strong); border-radius:6px; width:30px; height:34px;
  cursor:pointer; color:#ffffff; font-size:12px;
}
.variant-remove:disabled{ opacity:.35; cursor:not-allowed; }
@media (max-width:600px){
  .variant-headers{ display:none; }
  .variant-row{ grid-template-columns:1fr 1fr; grid-template-areas:"label label" "price list" "stock remove"; }
}

/* Storefront size picker (inside the quick-view modal for grouped listings) */
.variant-picker{ display:flex; flex-wrap:wrap; gap:8px; margin:6px 0 4px; }
.variant-chip{
  background:var(--line); border:1px solid var(--line-strong); border-radius:20px; padding:8px 16px;
  font-size:13px; font-weight:600; cursor:pointer; color:var(--ink);
}

@media (hover:hover){ .variant-chip:hover{ border-color:var(--muted); } }
.variant-chip.active{ background:var(--btn-bg); border-color:var(--btn-bg); color:var(--btn-ink); }
.pm-admin-row{ display:flex; gap:16px; margin-top:4px; }
.pm-admin-row .flink{ font-size:12.5px; text-decoration:underline; padding:0; color:var(--muted); }
.pm-admin-row .flink:hover{ color:#ffffff; }
.form-row label{ display:block; font-size:12.5px; font-weight:600; color:var(--muted); margin-bottom:5px; }
.form-row input{
  width:100%; border:1px solid var(--line); border-radius:6px; padding:10px 12px; font:inherit; font-size:14px;
  background:var(--line); color:var(--ink);
}
.form-row input:focus{ outline:2px solid #ffffff; outline-offset:1px; }
.form-err{ color:#ffffff; font-size:12.5px; margin:-6px 0 12px; }
.btn-primary{
  width:100%; background:var(--btn-bg); color:var(--btn-ink); border:none; border-radius:6px;
  padding:13px; font-weight:700; font-size:14.5px; cursor:pointer;
}

@media (hover:hover){ .btn-primary:hover{ background:var(--btn-bg-hover); color:var(--btn-ink);} }
.btn-secondary{
  width:100%; background:var(--line); color:var(--ink); border:1px solid var(--line-strong);
  border-radius:6px; padding:13px; font-weight:700; font-size:14.5px; cursor:pointer; margin-top:8px;
}

@media (hover:hover){ .btn-secondary:hover{ background:var(--line-strong); } }
.form-note{ font-size:12px; color:var(--muted); text-align:center; margin-top:12px; }

.co-summary{ background:var(--line); border-radius:8px; padding:14px 16px; margin-bottom:18px; font-size:13.5px; }
.co-summary-row{ display:flex; justify-content:space-between; padding:3px 0; color:var(--muted); }
.co-summary-row.total{ color:var(--ink); font-weight:800; font-size:15px; border-top:1px solid var(--line); margin-top:6px; padding-top:8px; }
/* Side padding too: this used to zero it, which left the confirmation's buttons touching the modal's edges. */
.co-success{ text-align:center; padding:10px 28px 28px; }
.co-success .big-check{ font-size:44px; color:#1a8a4a; margin-bottom:10px; }
/* The address picker (location.js) brings its own labels and fields; this is only its heading and the delivery-date
   box under it (the text colours inside come from location.css). The wrapper is deliberately not a .form-row: that
   class restyles every <input> inside it (full width, padded, filled), which flattens the picker's radio buttons. */
.co-address{ margin-bottom:14px; }
.co-group-label{ font-size:13px; font-weight:700; color:var(--ink); margin-bottom:8px; }
.co-eta{ display:flex; flex-direction:column; gap:2px; background:var(--line); border-radius:8px; padding:12px 14px; margin:0 0 16px; font-size:13.5px; line-height:1.4; }
.co-eta-none{ color:var(--muted); }
.co-eta-done{ text-align:left; margin:16px 0 18px; }
@media (max-width:480px){ .checkout-modal .form-pad{ padding:22px 18px; } }

.orders-list{ display:flex; flex-direction:column; gap:12px; }
.order-row{ border:1px solid var(--line); border-radius:8px; padding:14px 16px; }
.order-row-head{ display:flex; justify-content:space-between; font-size:13.5px; font-weight:700; }
.order-row-meta{ font-size:12px; color:var(--muted); margin-top:2px; }
.orders-empty{ text-align:center; padding:40px 10px; color:var(--muted); }

/* ================= CART DRAWER ================= */
.drawer-scrim{ position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:105; }
.drawer-scrim[hidden]{ display:none; }
.drawer{
  position:fixed; top:0; right:0; height:100%; width:400px; max-width:92vw; background:var(--bg-alt);
  box-shadow:-8px 0 24px rgba(0,0,0,.5); transform:translateX(100%); transition:transform .25s ease;
  z-index:110; display:flex; flex-direction:column;
}
.drawer.open{ transform:translateX(0); }

/* Services page — a full takeover of everything below the header, not a
   narrow side panel. top:var(--header-wrap-h) starts it exactly where the
   real header ends (same live-measured variable .side-rail positions
   itself from), so it never covers the header and stays correct at any
   viewport size or header height. z-index sits above .side-rail (90) and
   the filters tab, but there's no scrim — with the header the only thing
   left showing, and this page opaque, there's nothing left to dim. */
/* right:0 (full width, reaching all the way to the true edge — BEHIND
   where the rail sits) plus a z-index BELOW .side-rail's (90) is what
   actually makes this read as an extension of the rail rather than a
   separate piece flying over it. An earlier version stopped this page's
   own box at right:var(--rail-w) so it would never geometrically overlap
   the rail — correct at rest, but the whole box still slid across ON TOP
   of the rail during the animation itself (both were fixed-position
   siblings, and this one had the higher z-index), so the rail visibly
   disappeared and reappeared as the page swept past it. Going full-width
   and letting the ALWAYS-ON-TOP rail cover the rightmost rail-w of it
   instead means the rail never disappears at any point in the animation
   — the page genuinely looks like it's emerging from behind a fixed
   rail, not racing across in front of one. */
/* top:0, not var(--header-wrap-h) — this page now extends all the way up
   BEHIND the header instead of starting where the header ends. The old
   version measured the header's EXPANDED height and started there, which
   is correct only while the header is actually expanded: scroll down
   first (tucking the topbar away via transform — see wireTopbar()/
   tickTuck() in app.js) and then open this page, and it started well
   below the now-shorter, COLLAPSED header, leaving a visible gap between
   the header's real bottom edge and this page's top edge. --header-wrap-h
   is a fixed measurement of the header's full box (unaffected by the
   tuck transform), so it can't track which of the two states the header
   is actually in at open time. Extending this page behind the header
   entirely sidesteps that: .header-wrap's own z-index (100) already
   outranks this page's (80 — see that rule's comment for why it has to,
   for the rail to render in front too), so the header's own opaque
   background simply paints over however much of this page currently
   falls behind it, in EITHER state, with no gap possible either way. */
.services-page{
  position:fixed; top:0; right:0; bottom:0; left:0;
  background:var(--bg); z-index:80;
  transform:translateX(100%);
  /* .65s, not .4 — slower and smoother: long enough for the eased curve
     below to read as a deliberate glide, not a quick snap. will-change
     promotes this to its own compositing layer for the duration of the
     transition, so the browser never has to repaint the (heavy, full-
     viewport) box on the main thread frame-by-frame — that's what
     "smoother" concretely comes from, not just the timing number. */
  transition:transform .65s cubic-bezier(.16,1,.3,1);
  will-change:transform;
  display:flex; flex-direction:column; overflow:hidden;
}
.services-page.open{ transform:translateX(0); }
.services-page-body{
  flex:1; overflow:auto;
  /* Top padding is --header-wrap-h so the actual card content starts
     right where an EXPANDED header ends, same as before — only the
     page's own background extends further up now, not the content. */
  padding:calc(var(--header-wrap-h, 90px) + 24px) calc(24px + var(--rail-w)) 24px 24px;
  /* repeat(3, 1fr), not auto-fill — a fixed 3-column grid, so cards land
     in actual rows of 3 regardless of viewport width, rather than
     auto-fill's "as many 240px-minimum columns as currently fit". */
  display:grid; grid-template-columns:repeat(3, 1fr); gap:20px;
  align-content:start;
  /* max-content rows: the cards are overflow:hidden (so their minimum height
     counts as 0), and in this fixed-height, scrolling grid auto rows were
     being squeezed to fit — clipping a card's description instead of letting
     the page scroll. */
  grid-auto-rows:max-content;
}
/* Cards fade and rise in on a slight stagger once the page is open, rather
   than just appearing instantly the moment the slide finishes — small
   detail, but it's the difference between the page feeling like a single
   flat slide versus content that's genuinely settling into place. Base
   state (hidden) lives outside .open so closing and reopening always
   replays it fresh: once .open is removed, nothing matches the animation
   rule any more and the card snaps back to this starting state, ready to
   animate in again next time rather than staying visible underneath the
   next slide-in. */
.services-page .service-card{ opacity:0; transform:translateY(16px); }
.services-page.open .service-card{
  animation:servicesCardIn .5s cubic-bezier(.16,1,.3,1) forwards;
}
/* Delays scaled up to match the slide's own .65s (was .4s) — kept at the
   same ~1/3 and ~1/2 fraction of the slide's duration as before, so the
   cards still start settling in only once the panel itself is most of the
   way open, rather than fading in while it's still visibly mid-slide. */
.services-page.open .service-card:nth-child(1){ animation-delay:.13s; }
.services-page.open .service-card:nth-child(2){ animation-delay:.23s; }
.services-page.open .service-card:nth-child(3){ animation-delay:.33s; }
@keyframes servicesCardIn{
  from{ opacity:0; transform:translateY(16px); }
  to{ opacity:1; transform:translateY(0); }
}
/* Users with motion sensitivity turned on get the content instantly,
   fully visible, no movement — only the panel's own slide (a position
   change, not a decorative flourish) still happens. */
@media (prefers-reduced-motion:reduce){
  .services-page .service-card{ opacity:1; transform:none; }
  .services-page.open .service-card{ animation:none; }
}
@media (max-width:700px){
  /* Below 700px, 3 real columns would squeeze each card under ~200px —
     drop to 1 per row rather than let them crush. */
  .services-page-body{ grid-template-columns:1fr; }
}
.service-card{
  background:var(--bg-alt); border:1px solid var(--line); border-radius:var(--radius);
  overflow:hidden;
}
.service-card-img{
  height:140px; display:flex; align-items:center; justify-content:center;
  background:var(--line); color:var(--muted);
}
.service-card-title{ margin:16px 16px 4px; font-size:16px; font-weight:800; }
.service-card-desc{ margin:0 16px 16px; color:var(--muted); font-size:13.5px; line-height:1.5; }

/* ================= DEALS PAGE (#dealsDrawer, a .services-page instance) ============
   Persistent close affordance — a direct child of .services-page, NOT of the
   scrolling .deals-page-body below it, so it stays put in the viewport's
   corner regardless of how far the body itself has scrolled. Cleared by the
   same header-wrap-h/rail-w insets .deals-page-body uses, for the same
   reason: don't sit under the header or behind the rail. */
.deals-page-close{
  position:absolute; top:calc(var(--header-wrap-h, 90px) + 14px); right:calc(var(--rail-w) + 14px);
  width:36px; height:36px; border-radius:50%; border:1px solid var(--line);
  background:var(--bg-alt); color:var(--ink); font-size:20px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center; z-index:2;
}
.deals-page-close:hover{ background:var(--line); }
.deals-page-body{
  height:100%; overflow:auto;
  /* Same clearance logic as .services-page-body: header height on top, the
     rail's width on the right. Centred with a max-width instead of that
     block's 3-column grid — this page reads as one long scrollable sheet of
     sections, not a card wall. */
  padding:calc(var(--header-wrap-h, 90px) + 56px) calc(24px + var(--rail-w)) 60px 24px;
  max-width:1100px; margin:0 auto;
  /* A flex item (its parent is display:flex), so without these its default
     min-width:auto let the Featured rail's full-length track stretch it far
     past the drawer, hiding everything right of the side rail. */
  flex:1 1 auto; min-width:0; width:100%;
}
.deals-page-titlerow{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin:0 0 28px; flex-wrap:wrap; }
.deals-page-title{ font-size:26px; font-weight:800; margin:0; }
/* openDealsManager()'s own header — its "+ Add Discounts" button (opens
   openAddDiscountsManager() as a second, stacked popup) sits next to that
   modal's own h3 instead of the Deals page having a second top-level button
   of its own. */
.deals-picker-headrow{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.deals-picker-headrow h3{ margin:0; }
.deals-manage-btn{
  background:var(--bg-alt); color:var(--ink); border:1px solid var(--line-strong); border-radius:7px;
  padding:9px 16px; font-size:12.5px; font-weight:700; cursor:pointer;
}
.deals-manage-btn:hover{ border-color:#ffffff; color:#ffffff; }

/* Deals eligibility picker (openDealsManager() in app.js) — reuses the
   shared admin form modal (#productFormOverlay/#productFormModal), same as
   the deals slideshow manager. Appliances and every other product are two
   visually separate lists (own heading) rather than one flat alphabetical
   list with a department tag on each row — the two behave differently
   (Appliances never show as ordinary listings at all, see is_deal's own
   comment in db.js) and reading that difference off a small inline label
   buried in a long list is easy to miss; a hard section break isn't.
   No max-height/overflow of its own (used to be capped at 280px with its
   own scrollbar) — on openAddDiscountsManager()'s much bigger list (every
   undiscounted product, easily 50+ rows) that nested scrollbox had no
   visible scrollbar affordance, so most of both sections just silently
   never rendered on screen unless you happened to scroll inside that exact
   sub-box. One scroll surface only now: the outer .product-form-modal's own
   overflow:auto (max-height:86vh) — every row is reachable by the same,
   single, obvious scroll. */
.deals-picker-section + .deals-picker-section{ margin-top:22px; }
.deals-picker-section-title{
  font-size:12.5px; font-weight:800; color:var(--muted); text-transform:uppercase; letter-spacing:.4px;
  margin:0 0 8px;
}
.deals-picker-list{ display:flex; flex-direction:column; gap:6px; }
.deals-picker-row{
  display:flex; align-items:center; gap:10px; padding:8px 10px; border-radius:7px; border:1px solid transparent;
  cursor:pointer;
}

@media (hover:hover){ .deals-picker-row:hover{ background:var(--line); } }
.deals-picker-row input[type="checkbox"]{ flex:0 0 auto; width:16px; height:16px; accent-color:#ffffff; }
.deals-picker-thumb{ width:32px; height:32px; border-radius:6px; background:var(--line) center/cover no-repeat; flex:0 0 auto; }
.deals-picker-name{ font-size:13px; color:var(--ink); flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.deals-picker-price{ font-size:12px; color:var(--muted); flex:0 0 auto; }
/* Bought price / price / deal discount / resulting profit, one compact
   trading-ticker row per product (wireDealsPickerProfitInputs() in app.js) —
   same tabular-nums + green-up/red-down convention as .profit-readout in
   openProductForm(), just squeezed into inline fields instead of a form row
   since this lives inside the picker's own per-product list. */
.deals-picker-profit{
  display:flex; align-items:center; gap:5px; flex:0 0 auto; font-variant-numeric:tabular-nums;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12px;
}
/* Wide enough for up to 7 integer digits plus cents (e.g. "1234567.89")
   without clipping or scrolling inside the box. */
.dp-field{
  width:82px; background:var(--bg); border:1px solid var(--line-strong); border-radius:4px;
  padding:4px 6px; font:inherit; color:var(--ink); text-align:right;
}
.dp-field:focus{ outline:none; border-color:#ffffff; }
.dp-arrow{ color:var(--muted); }
.dp-delta{ min-width:48px; text-align:right; font-weight:800; }
/* The deal discount is a %, not a $ amount (see deal_discount's own comment
   in db.js) — styled as a small red "deal slip" (solid brand red, white
   text) instead of the plain cost/price boxes next to it, so it visually
   reads as a discount control at a glance rather than just another bland
   number field. */
.dp-discount-slip{
  display:flex; align-items:center; background:var(--brand-red); border-radius:4px;
  padding:0 6px 0 0; flex:0 0 auto;
}
.dp-discount-slip .dp-field{
  width:44px; background:transparent; border:none; color:#fff; font-weight:800; padding:4px 2px 4px 6px;
}
.dp-discount-slip .dp-field::placeholder{ color:rgba(255,255,255,.75); }
.dp-discount-slip .dp-field:focus{ outline:2px solid rgba(255,255,255,.6); outline-offset:-2px; }
.dp-discount-suffix{ color:#fff; font-weight:800; }
.deals-section-title{ font-size:16px; font-weight:800; margin:0 0 4px; }
.deals-section-sub{ font-size:13px; color:var(--muted); margin:0 0 16px; }
.deals-slidebar{ margin-bottom:36px; }
/* This section's own tile strip reuses .promo-tiles/-track/-tile verbatim
   (see the ================= PROMO / DEALS BARS ================= block
   above) — same drifting-treadmill engine (a dedicated createRail()
   instance — see wireDealsSlidebar() in app.js), same edge fade, same tile
   look, just relocated in here. ".promo-bar"'s own margin isn't reused
   (this section supplies its own via .deals-slidebar), so no need for the
   wrapping <div class="promo-bar"> either, just the tiles-wrap/track pair. */
.deal-groups{ display:flex; flex-direction:column; }
/* A ticket, not a plain card — the dashed divider plus the two semicircle
   "notches" cut into the top/bottom edge at that same divider (the ::before/
   ::after pair) are what actually read as a ticket rather than a generic
   list row. Notches are var(--bg) (the true page background) sitting inside
   the card's own outline, not a border trick, so they read as a genuine cut
   whatever's behind the page. */
@media (max-width:700px){
  .deals-page-body{ padding-left:16px; padding-right:calc(16px + var(--rail-w)); }
}

.drawer-head{
  display:flex; justify-content:space-between; align-items:center; padding:18px 20px;
  border-bottom:1px solid var(--line);
}
.drawer-head h3{ margin:0; font-size:17px; font-weight:800; }
/* --line, not --bg-alt — the drawer panel itself is --bg-alt, so matching it
   would make the close button invisible until hovered. */
.drawer-head .close{
  background:var(--line); border:none; width:30px; height:30px; border-radius:50%;
  font-size:17px; cursor:pointer; color:var(--ink);
}

@media (hover:hover){ .drawer-head .close:hover{ background:var(--line-strong); } }
.drawer-body{ flex:1; overflow:auto; padding:16px 20px; }
.drawer-foot{ border-top:1px solid var(--line); padding:16px 20px; }
.drawer-empty{ text-align:center; padding:60px 10px; color:var(--muted); }

.di-row{ display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.di-row:last-child{ border-bottom:none; }
.di-img{ width:64px; height:64px; border-radius:6px; overflow:hidden; background:var(--line); flex:0 0 auto; }
.di-img img{ width:100%; height:100%; object-fit:cover; }
.di-info{ flex:1; min-width:0; }
.di-name{ font-size:13.5px; font-weight:600; margin-bottom:4px; }
.di-price{ font-size:12.5px; color:var(--muted); }
.di-actions{ display:flex; align-items:center; gap:8px; margin-top:8px; }
.di-actions button{
  background:var(--line); border:1px solid var(--line-strong); width:24px; height:24px;
  border-radius:5px; cursor:pointer; font-size:14px; line-height:1; color:var(--ink);
}
.di-remove{
  background:none; border:none; color:var(--muted); font-size:12px; cursor:pointer;
  text-decoration:underline; margin-left:auto;
}
/* ".di-actions button" (above) squares every button in the row to 24x24, which clipped this text link to "Remo" and left a
   24px tap target. The extra class out-ranks it: the link sizes to its text, with room to tap. */
.di-actions .di-remove{
  width:auto; height:auto; min-width:44px; min-height:24px; padding:4px 6px;
  border:none; border-radius:5px; background:none; color:var(--muted); font-size:12px; line-height:1.3; white-space:nowrap;
}
@media (max-width:700px), (pointer:coarse){
  .di-actions .di-remove{ min-height:36px; padding:8px 8px; }
}
.di-actions .di-remove:hover{ background:none; color:#ffffff; }
.dt-row{ display:flex; justify-content:space-between; font-size:14px; margin-bottom:8px; }
.dt-row.total{ font-weight:800; font-size:16px; border-top:1px solid var(--line); padding-top:10px; margin-top:6px; }
/* "Estimated delivery  Free 2-Day: arrives Fri, Oct 16" — one line under the totals; wraps on a narrow drawer. */
.dt-eta{ display:flex; flex-wrap:wrap; justify-content:space-between; align-items:baseline; gap:2px 12px; font-size:13px; margin:2px 0 14px; }
.dt-eta-label{ color:var(--muted); }

/* ================= FILTERS (Costco-style side tab) ================= */
/* Fixed to the left edge, vertical text (writing-mode, not a rotate hack —
   keeps the box's own layout simple), hidden until the grid is well into
   view (see wireFilters()'s checkFiltersTab() in app.js). Clicking it
   slides the panel out from underneath the same edge, exactly the way
   Costco's does — and, unlike Costco's, doubles as the close control too:
   `left` (not `transform`, which is already busy with the show/hide reveal
   below) animates from 0 to the open panel's own measured width, so the tab
   itself slides along and comes to rest docked against the now-visible
   panel's trailing edge instead of getting buried under it — it used to sit
   underneath the panel the whole time it was open (same left:0, but a lower
   z-index than the panel's own opaque background), reachable only via a
   separate ✕ in .filters-head. One control, one consistent gesture: open
   sends it right to the panel's edge, click it again and everything —
   panel and tab together — slides back left. See wireFilters()'s
   openPanel()/closePanel() in app.js for the `left` writes themselves.
   `top` (not `bottom`) — this needs to land its top edge on the bottom
   edge of the first product row, at rest (panelShop scrolled to its own
   top). That row's position is built from fixed-height pieces above it
   (header, tile rail, dept-bar) that don't scale with viewport height, so
   it sits at the same screen height on any screen — a `bottom` offset
   doesn't: it's measured from the viewport's own floor, so it drifted
   further from the row's bottom edge the taller the screen was. Measured
   directly against the live first row, not guessed. */
.filters-tab{
  position:fixed; left:0; top:auto; bottom:24px; z-index:108;
  writing-mode:vertical-rl; text-orientation:mixed;
  background:#000; color:#fff; border:2px solid #fff; border-left:none;
  padding:11px 6px; border-radius:0 8px 8px 0; font-size:11.5px; font-weight:800;
  letter-spacing:1.2px; text-transform:uppercase; cursor:pointer;
  box-shadow:var(--shadow-lg);
  display:flex; align-items:center; justify-content:center; gap:6px; box-sizing:border-box; overflow:hidden;
  /* Explicit closed size (about what the text gave it) so it can animate to the
     smaller open size below. */
  width:31px; height:89px;
  opacity:0; pointer-events:none;
  transform:translateX(-12px);
  transition:opacity .3s ease, transform .3s ease, background .18s ease, left .25s ease, bottom .35s ease,
             width .35s cubic-bezier(.22,1,.36,1), height .35s cubic-bezier(.22,1,.36,1), padding .35s ease, font-size .35s ease, margin-left .35s ease,
             background-size .6s cubic-bezier(.4,0,.2,1);
}
.filters-tab.show{ opacity:1; pointer-events:auto; transform:translateX(0); }
/* The tab (z-index 108) sits above the dialogs' backdrop (.overlay, 100): while a dialog is open it must neither
   draw over it nor open the Filters panel on top of it. */
body:has(.overlay:not([hidden])) .filters-tab.show{ opacity:0; pointer-events:none; }

@media (hover:hover){ .filters-tab:hover{ background:#262626; color:#fff; } }
/* Same dark shade as :hover, but sticky for the whole time the panel is
   open — reads as "this is the active/pressed control", not just something
   the cursor happens to be over. */
/* Kept out of the button's own vertical writing-mode on purpose — nested
   writing-mode:horizontal-tb overrides the inherited vertical-rl just for
   this span, so the glyph itself always reads as a normal upright arrow
   instead of getting laid on its side with the letters. Points right
   (deeper into the page) closed, flips to point left the instant the panel
   opens — literally the direction each click sends the panel next. */
.filters-tab-chevron{
  writing-mode:horizontal-tb; display:inline-block; font-size:10px;
  transition:transform .25s ease;
}
.filters-tab.open .filters-tab-chevron{ transform:rotate(180deg); }
/* Panel open: the tab shrinks to a small arrow-only tab, the same height as the two
   footer buttons it sits level with (46px; see positionFiltersTab() in app.js). The
   label and count are hidden (font-size:0 hides the label text; the chevron has its
   own size) and the arrow points left: "close". */
.filters-tab.open{
  /* The closed tab, just smaller: black, 2px white outline with no left edge, flush
     against the panel's right edge the way the closed tab is flush against the
     screen's — same shape language, not a separate button. */
  width:20px; height:46px; padding:0; font-size:0; letter-spacing:0; gap:0;  /* gap:0 — the hidden label text is still a flex item, and the 6px gap had pushed the arrow 3px off-centre */
  background:#000; border:2px solid #fff; border-left:none; border-radius:0 8px 8px 0; margin-left:0; box-shadow:none;
}
/* Hover, like the + button in the cart stepper: white wipes in from the LEFT and the
   arrow flips to black. The background layers are restated here because the base
   .filters-tab:hover rule's `background` shorthand would otherwise reset them. */
.filters-tab.open{
  background-color:#000; background-image:linear-gradient(#fff, #fff);
  background-repeat:no-repeat; background-position:right center; background-size:0% 100%;
}

@media (hover:hover){ .filters-tab.open:hover{
  background-color:#000; background-image:linear-gradient(#fff, #fff);
  background-repeat:no-repeat; background-position:right center; background-size:100% 100%;
} }
/* The closed tab gets the same wipe on hover: white fills in from the left, and the
   label and arrow turn black as it passes (the count badge flips to a black pill). */
.filters-tab:not(.open){
  background-color:#000; background-image:linear-gradient(#fff, #fff);
  background-repeat:no-repeat; background-position:left center; background-size:0% 100%;
  transition:opacity .3s ease, transform .3s ease, left .25s ease, bottom .35s ease,
             width .35s cubic-bezier(.22,1,.36,1), height .35s cubic-bezier(.22,1,.36,1), padding .35s ease, font-size .35s ease, margin-left .35s ease,
             background-size .6s cubic-bezier(.4,0,.2,1), color .45s ease .1s;
}

@media (hover:hover){ .filters-tab:not(.open):hover{
  background-color:#000; background-image:linear-gradient(#fff, #fff);
  background-repeat:no-repeat; background-position:left center; background-size:100% 100%;
  color:#000;
} }

@media (hover:hover){ .filters-tab:not(.open):hover .filters-tab-count{ background:#000; color:#fff; } }
.filters-tab.open:focus{ outline:none; }
/* The arrow is a real SVG chevron (its drawn box IS its visible shape, so flex centres
   it exactly), not the "❯" glyph (off-centre in its box) or a rotated-border trick
   (whose visible shape sits well off its box centre). It's centred in the tab's inside —
   panel edge to the inner edge of the white right border (360-378px, centre 369) — which
   is what the eye reads as the tab's width; no extra nudge. */
.filters-tab.open .filters-tab-chevron{
  font-size:0; width:7px; height:12px; border:0; border-radius:0;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 12'%3E%3Cpath d='M5.75 1 1.25 6 5.75 11' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 7px 12px no-repeat;
  transform:translateX(-1.5px);   /* replaces the older 180deg flip meant for the typed glyph; the -1.5px nudges the arrow left, as it read as too far right */
  transition:filter .45s ease .1s;
}

@media (hover:hover){ .filters-tab.open:hover .filters-tab-chevron{ filter:invert(1); } }
.filters-tab.open .filters-tab-count{ display:none; }

/* Invisible on purpose — the page itself slides out of the panel's way (see
   .page-shift) instead of the panel floating on top of it, so there's
   nothing left to dim. This stays only as a click-outside-to-close catcher. */
/* pointer-events:none — this used to catch clicks anywhere on the page
   (inset:0 covers the whole viewport, not just the area beyond the 360px
   panel) to close the panel on an outside click. That meant a click on a
   product tile, or literally anything else on the page, hit this
   transparent full-page layer first and closed the filters panel before
   the click ever reached what the user was actually trying to click. The
   panel now only closes via its own close button or Escape (see
   wireFilters() in app.js) — this element no longer needs to intercept
   anything, so it's inert and clicks pass straight through to the page. */
.filters-scrim{ position:fixed; inset:0; background:transparent; z-index:107; pointer-events:none; }
.filters-scrim[hidden]{ display:none; }
/* Rounds the INSIDE corner where the docked department bar's full-width
   bottom edge meets the filters panel's own right edge — a plain
   border-radius on .filters-panel itself can't touch this: that corner
   belongs to the panel's actual box top (0,0), which stays covered by the
   real header/docked bar regardless, so rounding it there is invisible. The
   two DO meet lower down, at (panel width, header+dock height), where the
   panel is exposed for the first time — but that's just a point along the
   panel's straight right edge, not one of its geometric corners, so no
   border-radius setting can curve it. Instead this is a small solid
   --header-black shape (matching the panel/header exactly, so it reads as
   part of the same L) sitting on that point: a square with a quarter disc
   cut out of its far corner, which is what a concave fillet is — dark
   material bulging outward into the page rather than a bite carved out of
   it (which is what border-radius always does, and why it only ever works
   on ordinary convex corners).

   position:absolute, not fixed — and a real DOM child of #header-wrap (moved
   there once by wireFilters() in app.js), not a body-level sibling positioned
   by reading getBoundingClientRect() every animation frame. #header-wrap's
   own tuck transform (see tickTuck()/paintShift() in app.js) is what #side-rail
   already rides for free, for exactly the same reason: a transform creates a
   new containing block for its descendants, so this now moves with the header
   automatically, at the compositor, on every frame of that slide — no JS
   keeping up with it required, and so no window for the two to drift apart
   for even a frame. top:100% is #header-wrap's own constant, untucked flow
   height (tucking is a transform, never a layout change — see that variable's
   own comment) — plus --dept-dock-h, the docked bar's own live height on top
   of it, landing this exactly on the bar's bottom edge regardless of tuck
   state. left is still set by reservePageRoom() (app.js) — the one dimension
   that genuinely depends on a JS value (the panel's own width, clamped by
   max-width:92vw on narrow screens) rather than anything CSS already knows. */
.filters-corner-round{
  /* -1px top: the box is 1px bigger than the 31.5px radius on its top and
     left sides (see the path in index.html; radius 26px) and sits 1px up and left of the
     real junction, so that strip of solid black lies underneath the bar and
     the panel, which are the same colour. Fractional layout values (the
     bar's bottom edge is routinely 92.43px, not 92px) can otherwise leave a
     hairline of page showing between two edges that are meant to touch. */
  /* extra -2px: the dock now starts 2px up inside the header (see .dept-dock), so its
     bottom edge — where this curve sits — is 2px higher than 100% + the bar's height. */
  position:absolute; top:calc(100% + var(--dept-dock-h,0px) - 3px);
  z-index:113; width:27px; height:27px; pointer-events:none;
  /* currentColor is what the SVG path fills with — the one place the corner's
     colour is set, tied to the same variable as the bar and the panel. */
  color:var(--header-black);
  opacity:0; transition:opacity .2s ease;
}
/* A solid vector shape rather than the radial-gradient this used to be: a
   gradient has to cross from transparent to opaque somewhere, and that
   crossing (1-2px wide) is rasterised as a soft band that reads as a halo
   or stair-stepping around the arc, worst on high-DPI screens. A filled SVG
   arc has a single hard edge the browser anti-aliases at the display's real
   resolution — clean at any zoom, no fade to see. */
.filters-corner-round svg{ display:block; }
.filters-corner-round.show{ opacity:1; }
.filters-panel{
  /* --header-black, matching the header/hero/page background, not --bg-alt's
     lighter "elevated surface" shade — the drawer itself should read as part
     of the same page, not a raised card floating on top of it. No box-shadow
     either, for the same reason — a drop-shadow is exactly the "raised card"
     cue this is trying to avoid, and it used to bleed straight through
     .filters-corner-round's transparent hole (same z-stacking gap real page
     content shows through), muddying the curve with a soft dark smudge
     instead of a clean edge. Left over from when this panel was --bg-alt
     and actually needed to read as elevated. */
  position:fixed; top:0; left:0; height:100%; width:360px; max-width:92vw; background:var(--header-black);
  transform:translateX(-100%);
  /* padding-top is written by dockDeptBar()/undockDeptBar() (app.js), eased
     on the same curve/duration as the docked bar's slide in — so the panel's
     content makes room for it in lockstep rather than snapping down — and
     reserves exactly the docked bar's live-measured height, so .filters-head
     sits right below it instead of being covered by it. */
  transition:transform .25s ease, padding-top .58s cubic-bezier(.22,1,.36,1);
  z-index:112; display:flex; flex-direction:column;
}
.filters-panel.open{ transform:translateX(0); }
/* No close button in here anymore — the docked .filters-tab itself is the
   close control now (see its own comment). Kept as a plain header rather
   than removed outright since the bottom border still separates the title
   from the scrollable filter groups below. */
.filters-head{ padding:18px 20px; border-bottom:1px solid var(--line); }
.filters-head h3{ margin:0; font-size:17px; font-weight:800; }
.filters-body{ flex:1; overflow:auto; padding:18px 20px; display:flex; flex-direction:column; gap:24px; }
.filter-group h4{
  margin:0 0 10px; font-size:12px; font-weight:800; letter-spacing:.6px;
  text-transform:uppercase; color:var(--muted);
}
.filter-check{
  display:flex; align-items:center; gap:9px; font-size:13.5px; color:var(--ink);
  padding:6px 0; cursor:pointer;
}
.filter-check input{ accent-color:#ffffff; width:15px; height:15px; cursor:pointer; }
.filter-price-row{ display:flex; align-items:center; gap:8px; }
.filter-price-row input{
  width:0; flex:1; border:1px solid var(--line-strong); border-radius:6px; padding:8px 10px;
  background:var(--line); color:var(--ink); font:inherit; font-size:13px;
}
.filter-price-row input:focus{ outline:2px solid #ffffff; outline-offset:1px; }
.filter-price-row span{ color:var(--muted); }
/* #filterSort — same treatment as .filter-price-row input (border/bg/
   radius) rather than .sort-label select's, since it lives in the dark
   panel body, not on the page proper. */
.filter-select{
  width:100%; border:1px solid var(--line-strong); border-radius:6px; padding:8px 10px;
  background:var(--line); color:var(--ink); font:inherit; font-size:13px; cursor:pointer;
}
.filter-select:focus{ outline:2px solid #ffffff; outline-offset:1px; }
/* ---- live filter system (renderFilterUI() in app.js) ---- */
.filters-head{ display:flex; align-items:baseline; justify-content:space-between; gap:10px; }
.filters-head-count{ font-size:12.5px; font-weight:700; color:var(--muted); }
/* Option counts: how many items picking that option would leave. */
.filter-count{ margin-left:auto; font-size:12px; font-weight:600; color:var(--muted); font-variant-numeric:tabular-nums; }
.filter-check .filter-check-name{ min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.filter-check:hover .filter-check-name{ color:#fff; }
/* An option that would leave nothing — still clickable, just quiet. */
.filter-check.is-zero, .filter-pill.is-zero{ opacity:.4; }
.filter-list{ display:flex; flex-direction:column; }
.filter-hint{ margin:0; font-size:12.5px; color:var(--muted); line-height:1.45; }
.filter-pills{ display:flex; flex-wrap:wrap; gap:7px; }
.filter-pills + .price-slider{ margin-top:16px; }
/* Dual-thumb price slider: two transparent range inputs over one track, with
   only their thumbs taking clicks. */
.price-slider-values{
  display:flex; justify-content:space-between; margin-bottom:10px;
  font-size:13px; font-weight:800; color:var(--ink); font-variant-numeric:tabular-nums;
}
.price-slider-track{ position:relative; height:20px; margin:0 9px; }
.price-slider-track::before{
  content:''; position:absolute; left:-9px; right:-9px; top:8px; height:4px; border-radius:2px; background:var(--line-strong);
}
.price-slider-fill{ position:absolute; top:8px; height:4px; border-radius:2px; background:var(--btn-bg); }
.price-slider-track input[type=range]{
  position:absolute; left:-9px; top:0; width:calc(100% + 18px); height:20px; margin:0;
  background:none; pointer-events:none; -webkit-appearance:none; appearance:none;
}
.price-slider-track input.on-top{ z-index:2; }
.price-slider-track input[type=range]::-webkit-slider-runnable-track{ background:none; border:none; height:20px; }
.price-slider-track input[type=range]::-moz-range-track{ background:none; border:none; }
.price-slider-track input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none; pointer-events:auto; cursor:grab;
  width:18px; height:18px; margin-top:1px; border-radius:50%;
  background:#fff; border:3px solid #ffffff; box-shadow:0 1px 4px rgba(0,0,0,.5);
}
.price-slider-track input[type=range]::-moz-range-thumb{
  pointer-events:auto; cursor:grab; width:12px; height:12px; border-radius:50%;
  background:#fff; border:3px solid #ffffff; box-shadow:0 1px 4px rgba(0,0,0,.5);
}
.price-slider-track input[type=range]:active::-webkit-slider-thumb{ cursor:grabbing; transform:scale(1.1); }
.price-slider-track input[type=range]:focus-visible::-webkit-slider-thumb{ outline:2px solid #fff; outline-offset:2px; }
.filter-pill{
  display:inline-flex; align-items:center; gap:7px;
  background:var(--line); border:1px solid var(--line-strong); color:var(--ink);
  padding:7px 12px; border-radius:18px; font:inherit; font-size:12.5px; font-weight:700; cursor:pointer;
  transition:border-color .15s, background .15s, color .15s;
}
.filter-pill .filter-count{ margin-left:0; font-size:11.5px; }

@media (hover:hover){ .filter-pill:hover{ border-color:#ffffff; background:rgba(255,255,255,0.112); } }
.filter-pill.active{ background:var(--btn-bg); border-color:var(--btn-bg); color:var(--btn-ink); }
.filter-pill.active .filter-count{ color:rgba(0,0,0,.6); }
.filter-pill:focus-visible, .filter-more:focus-visible{ outline:2px solid #ffffff; outline-offset:2px; }
.filter-more{
  margin-top:6px; padding:4px 0; background:none; border:none; color:#ffffff;
  font:inherit; font-size:12.5px; font-weight:700; cursor:pointer;
}

@media (hover:hover){ .filter-more:hover{ text-decoration:underline; } }
.filters-foot{
  border-top:1px solid var(--line); display:flex; gap:10px; align-items:center;
  /* 29px under the buttons: lifts their centre line 52px off the bottom of the screen,
     which is what lets the Filters tab (about 89px tall, pinned to the same bottom edge
     and centred on this row by positionFiltersTab() in app.js) sit level with them. */
  padding:16px 20px 29px;
}
/* Both buttons exactly the same height (they were 45.5px and 53.5px). */
.filters-foot button{ flex:1; height:46px; padding-top:0; padding-bottom:0; box-sizing:border-box; margin:0; }  /* margin:0 — .btn-secondary carries margin-top:8px, which had pushed Clear all 4px low */
.filters-foot button:disabled{ opacity:.45; cursor:default; }

/* Badge on the Filters tab: how many filters are on. Upright, like the chevron. */
.filters-tab-count{
  writing-mode:horizontal-tb; min-width:17px; height:17px; padding:0 4px; border-radius:9px;
  background:#fff; color:#000; font-size:10.5px; font-weight:800; letter-spacing:0;
  display:inline-flex; align-items:center; justify-content:center;
}
.filters-tab-count[hidden]{ display:none; }

/* The row above the grid: item count, then each active filter as a chip
   that removes itself on click. */
.filter-summary{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 16px; }
.filter-summary[hidden]{ display:none; }
.filter-summary-count{ font-size:13px; font-weight:800; color:var(--ink); margin-right:4px; }
.filter-chip{
  display:inline-flex; align-items:center; gap:7px;
  background:rgba(255,255,255,0.112); border:1px solid #ffffff; color:var(--ink);
  padding:6px 10px 6px 12px; border-radius:16px; font:inherit; font-size:12.5px; font-weight:700; cursor:pointer;
}
.filter-chip span{ font-size:10px; color:var(--muted); }

@media (hover:hover){ .filter-chip:hover{ background:var(--btn-bg); color:var(--btn-ink); } }

@media (hover:hover){ .filter-chip:hover span{ color:#fff; } }
.filter-summary-clear{
  background:none; border:none; color:var(--muted); font:inherit; font-size:12.5px; font-weight:700;
  text-decoration:underline; cursor:pointer; padding:6px 4px;
}

@media (hover:hover){ .filter-summary-clear:hover{ color:var(--ink); } }
.empty-clear{ margin-top:14px; }

/* Department chips that would show nothing with the other filters on. */
.dept-chip.dept-chip-empty{ opacity:.38; }

/* ================= SIDE RAIL ================= */
/* A permanent margin, not a floating pill — spans the full viewport height
   like a real layout column (see .page-shift's matching padding-right,
   which reserves exactly this much space so the page never runs under it).
   Same background/typography as the topbar; each item keeps the vertical
   writing-mode treatment shared with .filters-tab, just grouped in the
   middle of the full-height strip rather than stacked top to bottom. */
.side-rail{
  /* A literal DOM child of #headerWrap (see index.html), not a separately-
     positioned element computed to match it.

     position IS ABSOLUTE, not fixed — `position:fixed` here relied on
     header-wrap's transform making it the containing block (correct per
     spec), but still visibly lagged the header's black bar during scroll,
     likely because `fixed` hints browsers to promote it to its own
     compositing layer even under a transformed ancestor, so the two could
     paint on different frames. `absolute`'s containing block is just the
     nearest positioned ancestor (header-wrap's `sticky` qualifies either
     way) with no such hint.

     Containing block being header-wrap's padding box (not the viewport)
     has two consequences, both handled below: header-wrap's right edge IS
     the true viewport edge (its margin-right:-rail-w cancels .page-shift's
     padding-right inset), so a plain `right:0` sits the rail flush with the
     screen edge, in the gutter column .page-shift reserves; and `bottom`
     would resolve against header-wrap's short edge, so height is expressed
     in viewport units instead.

     top is exactly --header-wrap-h (measured live via ResizeObserver, see
     syncHeaderWrapHeight() in wireTopbar()) — no fudge offset, since one
     previously pulled the rail up into the header. */
  position:absolute; right:0; top:var(--header-wrap-h, 110px);
  /* Reaches the real viewport bottom, plus the topbar's height as permanent
     overhang so translating the (now-shared) transform up never tears the
     rail's bottom edge away from the screen's bottom edge — see point 2
     above for why this is height+vh rather than a `bottom` offset. */
  height:calc(100vh - var(--header-wrap-h, 110px) + var(--topbar-h));
  width:var(--rail-w); z-index:90;
  background:var(--header-black); color:#fff;
  display:flex; flex-direction:column; align-items:stretch; justify-content:flex-start;
}
/* REMOVED: a `.side-rail::before` gradient used to sit here, hanging off the
   rail's left edge (right:100%) for its full height to fade "page content"
   into the rail's black. Its actual box, though, was the rail's — spanning
   the full page height regardless of scroll position — so it darkened
   whatever happened to sit in that column, bars or not (confirmed live: a
   plain product-grid card, nowhere near any scrolling strip, was getting
   visibly darkened on its right edge). The fade a bar needs is now each
   bar's own concern instead — see .dept-scroll/.cat-tiles/.promo-tiles'
   own mask-image, all now two-sided (their existing left-edge fade plus a
   matching right one), scoped to that bar's own box and nothing else. */
/* Mirrors .topbar-link/.topbar-a11y exactly — same colorway (header-black
   background, #fff text, .85 opacity resting / 1 + underline on hover) and
   the same 12.5px/600 text — just rotated on its side, so the rail reads as
   the same mini bar turned 90°, not a separate button-styled control. */
.side-rail-item{
  writing-mode:vertical-rl; text-orientation:mixed;
  background:none; border:none; color:#fff; text-decoration:none; font:inherit;
  font-size:12.5px; font-weight:600; opacity:.85; cursor:pointer;
  padding:16px 4px; white-space:nowrap;
  transition:opacity .15s ease;
  /* display:flex + align-items:flex-start, not the default text-align:center
     — .topbar-inner/.sh-inner need a FIXED px value to match wherever this
     text lands, but centred text's position depends on glyph column width
     from text shaping, which isn't stable across reloads (confirmed a few
     px of drift for the same text/font/size). align-items:flex-start pins
     content to the block-start edge instead (the right edge, since
     vertical-rl flows block-right-to-left), which depends only on padding
     plus the glyph's fixed side-bearing metric — empirically stable within
     ~1px, not the 4-8px of centering slack. */
  display:flex; align-items:flex-start; justify-content:center;
}
.side-rail-item:hover{ opacity:1; text-decoration:underline; }
/* Deals and Order Tracking, from the topbar. Hidden while the topbar is on
   screen (they're right there in it), and they appear once it has tucked
   away. */
.side-rail-quick{
  /* Fixed, stacked directly on the settings gear (its box is 14px up and 42px
     tall, so this starts 56px from the bottom), in the same column. Every slot
     in the stack — Deals, package, gear — is the same 42px tall, so the three
     icons sit at an even 42px between centres. */
  position:fixed; right:0; bottom:56px; width:var(--rail-w); z-index:100;
  display:flex; flex-direction:column; align-items:center; gap:0;
  opacity:0; pointer-events:none; transform:translateX(8px);
  /* Going away is quick and has no delay — it should be gone by the time the
     topbar has slid back, not trailing after it. */
  transition:opacity .09s linear, transform .09s linear;
}
body.topbar-hidden:not(.rail-quick-off) .side-rail-quick{
  opacity:1; pointer-events:auto; transform:none;
  transition:opacity .45s ease .12s, transform .55s cubic-bezier(.22,1,.36,1) .12s;
}
.side-rail-icon{
  display:flex; align-items:center; justify-content:center;
  width:100%; height:42px; padding:0; background:none; border:none; cursor:pointer;
  color:#ffffff; opacity:.9; transition:opacity .15s ease;
}
.side-rail-icon:hover{ opacity:1; }
/* (the rail's Deals icon eases to a stop on hover too: iconfx.js) */
/* Marks the Services button red while its page is open (see wireSideRail()
   in app.js, which toggles this class in the same click handler that
   toggles the page itself — one state, read in two places, so they can't
   drift out of sync with each other). */
.side-rail-item.active{ color:#ffffff; opacity:1; }

/* A genuinely independent fixed element now — was the last child of
   .side-rail (margin-top:auto pinning it to the rail's bottom), which
   put it inside the element that gets translateY'd on scroll to tuck the
   topbar, and inside that element's deliberate --topbar-h overhang past
   the viewport bottom (needed so the TRANSLATED, tucked position lands
   flush — see .side-rail's own comment). In the untransformed, expanded
   state that overhang is real and unhidden, pushing anything pinned to
   the rail's bottom edge that same distance below the visible viewport.
   This button is positioned directly off the true viewport instead —
   `bottom` and `right` here have no relationship to .side-rail's box at
   all, so there's no overhang to inherit and no transform to move with;
   it renders in the exact same screen position regardless of scroll or
   header state. `right:0; width:var(--rail-w)` keeps it visually in the
   same column as the rail above it without being structurally tied to it. */
.settings-gear{
  position:fixed; right:0; bottom:14px; width:var(--rail-w);
  /* Level with #headerWrap (100), which holds the rail: at 95 this sat behind
     the rail's black background and never showed. Equal z-index, and it comes
     later in the page than the header, so it paints over the rail — while the
     modal overlays (also 100, later still) keep covering it. */
  z-index:100;
  display:flex; align-items:center; justify-content:center;
  height:42px; padding:0;
  background:none; border:none; color:#ffffff; cursor:pointer;
  opacity:.9; transition:opacity .15s ease;
}
.settings-gear:hover{ opacity:1; }

/* ================= TOAST ================= */
.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--brand-navy); color:#fff; padding:12px 22px; border-radius:8px;
  font-size:13.5px; font-weight:600; z-index:300000; opacity:0; pointer-events:none;
  transition:opacity .2s ease, transform .2s ease; box-shadow:var(--shadow-lg);
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

/* ================= RESPONSIVE ================= */
/* The rail scrolls regardless of viewport width — these just shrink the
   fixed tile size so more of the ticker is visible on narrower screens. */
@media (max-width:860px){
  /* (The location widget no longer hides here — it shrinks to its icon when it
     doesn't fit, see wireLocationFit() in app.js.) */
  /* padding:0 1px 0 16px, not 0 16px — this was overwriting the base
     rule's right-padding fix (see the base .sh-inner rule's comment) below
     860px, reintroducing the gap the base rule fixes. 1px (not the rail
     text's own 5px inset — see the base rule's comment for why this row
     runs 4px under that number, to cancel out .cart-widget's own 4px
     padding around the "Cart" label) keeps the VISIBLE cart text the same
     distance from the true screen edge as the rail's text, down to 520px
     — below that, --rail-w itself shrinks (see the 520px query) and this
     value stops applying, needing its own override there. This query
     doesn't touch `margin` either: the row reaches the true viewport edge
     because .header-wrap itself is full-bleed (its margin-right:-rail-w
     reclaims .page-shift's rail gutter for the whole header). */
  .sh-inner{ gap:14px; flex-wrap:wrap; padding:0 16px; }
  /* No translateY here either — same stale optical-centering correction
     as the base rule (see its comment), just a second copy tuned for this
     breakpoint's smaller font-size/line-height. Measured the same way:
     0 is what actually centers it against .logo-mark now. */
  .logo-word{ font-size:25.5px; line-height:22px; }
  .logo-lockup{ --lh:30px; }
  .footer-inner{ grid-template-columns:1fr 1fr; padding:36px 30px 24px; }
  .footer-brand{ grid-column:1 / -1; }
  .tile{ flex-basis:204px; width:204px; min-height:130px; }
}
@media (max-width:520px){
  /* Same variable the rail's width and the page's margin both read from —
     shrinking it here keeps the two in lockstep on narrow screens instead of
     needing separate overrides for each. */
  :root{ --rail-w:24px; }
  /* .topbar-inner/.sh-inner's right padding (5px/1px above 520px) is sized
     for the 30px rail: --rail-w shrinking to 24px here also shrinks
     .side-rail-item's own padding (12px 3px at this breakpoint — see that
     rule), which moves where its text lands relative to the edge. Measured
     directly (same method as the 30px-rail value, confirmed stable across
     repeated fresh page loads — see .side-rail-item's comment for why
     that stability check matters and what broke without it): 4px.
     Without this override, both rows would use the wider-viewport numbers
     here and sit visibly further from the edge than the rail's text does.
     The two rows still split 4px apart, same as above 520px: .topbar-inner
     gets the full 4px (the phone number has no padding of its own to
     compensate for), .sh-inner gets 4 - 4 = 0px (.cart-widget's own
     padding:4px still applies here even with .cw-label hidden below — the
     cart ICON becomes the last visible child instead of the "Cart" text,
     but it's still inset by that same 4px from .cart-widget's own edge). */
  .topbar-inner{ padding-right:16px; }
  .sh-inner{ padding-right:16px; }
  .cw-label{ display:none; }
  .acct-text{ display:none; }
  .hero{ padding:44px 18px; }
  /* 11px horizontal, not 0 — same edge-alignment fix as the base rule
     (see .cat-tiles-wrap's own comment), recalculated for this
     breakpoint's numbers: .shop's own padding is 16px here (not 24), and
     .cat-tiles-track's gutter is 5px here (not 8), so this needs to
     contribute 16 - 5 = 11px to land a resting tile at the same 16px
     .shop uses. */
  .cat-tiles-wrap{ padding:4px 0 4px 23px; } /* 28px shop gutter - 5px track gutter */
  .cat-tiles-track{ gap:10px; padding:0 5px; }
  /* Same eased curve as the base rule, scaled to the narrower 5px gutter —
     otherwise a wider fade would overshoot it and bleed onto the tile. */
  .cat-tiles{
    -webkit-mask-image:linear-gradient(90deg,
      rgba(0,0,0,0) 0, rgba(0,0,0,.4) 1px, rgba(0,0,0,.78) 2px, rgba(0,0,0,.96) 3px, #000 5px, #000 100%);
    mask-image:linear-gradient(90deg,
      rgba(0,0,0,0) 0, rgba(0,0,0,.4) 1px, rgba(0,0,0,.78) 2px, rgba(0,0,0,.96) 3px, #000 5px, #000 100%);
  }
  .tile{ flex-basis:166px; width:166px; min-height:128px; }
  .cat-tiles .tile-name{ font-size:15px; }
  .shop{ padding:10px 28px 60px 28px; } /* clears the 22px mobile Filters tab by 6px */
  /* 145px minimum: two columns still fit on a 375px phone inside the gutters. */
  .grid{ grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); gap:12px; }
  #grid > .grid + .grid{ margin-top:12px; }
  /* gap:0 — same reasoning as the base rule's .dept-bar: spacing now comes
     entirely from .dept-track's own padding (8px here, matching its 8px
     inter-chip gap at this breakpoint) instead of stacking an extra 12px
     of dept-bar gap on top of it. */
  .dept-bar{ gap:0; }
  /* 18px fade (and matching track padding, so a resting chip never sits in
     the fade): 8px cut the chips off so abruptly right beside the pinned ALL
     chip that they looked like they were sliding under it. */
  .dept-track{ gap:8px; padding:0 18px; }
  .dept-chip{ padding:8px 14px; font-size:11px; }
  .dept-scroll{
    -webkit-mask-image:linear-gradient(90deg,
      rgba(0,0,0,0) 0, rgba(0,0,0,.22) 5px, rgba(0,0,0,.55) 9px, rgba(0,0,0,.85) 14px, #000 18px,
      #000 calc(100% - 18px), rgba(0,0,0,.85) calc(100% - 14px), rgba(0,0,0,.55) calc(100% - 9px),
      rgba(0,0,0,.22) calc(100% - 5px), rgba(0,0,0,0) 100%);
    mask-image:linear-gradient(90deg,
      rgba(0,0,0,0) 0, rgba(0,0,0,.22) 5px, rgba(0,0,0,.55) 9px, rgba(0,0,0,.85) 14px, #000 18px,
      #000 calc(100% - 18px), rgba(0,0,0,.85) calc(100% - 14px), rgba(0,0,0,.55) calc(100% - 9px),
      rgba(0,0,0,.22) calc(100% - 5px), rgba(0,0,0,0) 100%);
  }

  /* Same top-anchored idea as the base rule, recalculated for this
     breakpoint's stack (narrower .cat-tiles-wrap padding, a single-column
     grid, more text wrap in each card — all of it changes where the first
     row's bottom edge actually lands). */
  .filters-tab{ top:auto; bottom:24px; padding:10px 5px; font-size:10px; letter-spacing:1px; }
  .filters-tab.open{ padding:0; font-size:0; }
  .side-rail-item{ padding:12px 3px; }
}

/* The topbar's Order Tracking is the package icon now (a text link before):
   sized and coloured like the Deals icon next to it. */
.topbar-pkg-btn{ padding:1px; } /* 19px glyph + 1px = the same 21px box as the Deals icon (17px + 2px) */
/* Search -> Deals -> package at an even 42px between centres: the search icon
   is a 16px box and the other two are 22px, so equal gaps alone leave it 3px
   tighter. */
.deals-widget{ margin-left:3px; }

/* The red icon set — topbar search / Deals / package, and the sidebar's
   Deals / package / settings gear — all drawn with the same 1.5px line, at
   the same brand red and the same resting opacity. non-scaling-stroke makes
   the line a true 1.5px whatever size each glyph is drawn at (their sizes
   differ, so a shared viewBox stroke-width came out between 1.3px and 1.5px
   and the package, drawn largest, looked heavier than the rest). */
.tsearch-toggle svg :where(path, circle, rect, line),
.deals-spin-btn svg :where(path, circle, rect, line),
.side-rail-icon svg :where(path, circle, rect, line),
.settings-gear svg :where(path, circle, rect, line){
  stroke-width:1.5px; vector-effect:non-scaling-stroke;
}
.tsearch-toggle, .deals-spin-btn, .side-rail-icon, .settings-gear{ color:#ffffff; opacity:.9; }
.tsearch-toggle:hover, .deals-spin-btn:hover, .side-rail-icon:hover, .settings-gear:hover{ opacity:1; }

/* Hovering the search and Deals icons makes their line a little bolder (1.5px -> 2.1px), eased in and out. The package icon does something of its own, below. */
.tsearch-toggle svg :where(path, circle, rect, line),
.header-search-btn svg :where(path, circle, rect, line),
.deals-spin-btn:not(.topbar-pkg-btn) svg :where(path, circle, rect, line),
#railSearchBtn svg :where(path, circle, rect, line),
#railDealsBtn svg :where(path, circle, rect, line){ transition:stroke-width .22s ease; }
.tsearch-toggle:hover svg :where(path, circle, rect, line),
.header-search-btn:hover svg :where(path, circle, rect, line),
.deals-spin-btn:not(.topbar-pkg-btn):hover svg :where(path, circle, rect, line),
#railSearchBtn:hover svg :where(path, circle, rect, line),
#railDealsBtn:hover svg :where(path, circle, rect, line){ stroke-width:2.1px; }

/* The topbar's box icon keeps its shape and is simply coloured in on hover: the whole cube becomes ONE flat cardboard colour (the cart's main box colour; the line takes
   the fill's own colour so there is no outline, and the inner edge lines take it too so there are no creases). The tape stripe on top then FILLS with the cart's packing-tape
   cream by the colour extending through the stripe along its own length: from its upper-right end, along the top, around the corner and down the side. (.pkg-run is the
   stripe's centre line, stroked wide as a mask on .pkg-tape and drawn on with stroke-dashoffset.) Leaving reverses it. */
.topbar-pkg-btn{ --pk-fill:#c99a5b; }
.topbar-pkg-btn svg .pkg-outline{ fill:transparent; stroke:currentColor; transition:fill .3s ease, stroke .3s ease; }
.topbar-pkg-btn svg .pkg-edges{ stroke:currentColor; transition:stroke .3s ease; }
.topbar-pkg-btn svg .pkg-shine{ transition:opacity .15s ease; }
.topbar-pkg-btn svg .pkg-tape{ fill:rgba(255,244,214,.78); stroke:none; }
.topbar-pkg-btn svg .pkg-run{ stroke-width:6px; vector-effect:none; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:1; stroke-dashoffset:1; transition:stroke-dashoffset .3s ease-in; }
.topbar-pkg-btn:hover svg .pkg-outline{ fill:var(--pk-fill); stroke:var(--pk-fill); }
.topbar-pkg-btn:hover svg .pkg-edges{ stroke:var(--pk-fill); }
.topbar-pkg-btn:hover svg .pkg-shine{ opacity:0; }
.topbar-pkg-btn:hover svg .pkg-run{ stroke-dashoffset:0; transition:stroke-dashoffset .7s cubic-bezier(.4,.1,.3,1) .12s; }
@media (prefers-reduced-motion:reduce){ .topbar-pkg-btn svg .pkg-outline, .topbar-pkg-btn svg .pkg-edges, .topbar-pkg-btn svg .pkg-shine, .topbar-pkg-btn svg .pkg-run{ transition:none; } }

/* ===== TEMPORARY — SLIDESHOW TEST COLOURS =====
   Solid flat colours in place of the slide backdrops (and any photo), with the
   readability scrim off so the colours show true. Slide content in the
   database is untouched. DELETE THIS WHOLE BLOCK to restore the normal slides. */
.dc-slide{ background-image:none !important; }
.dc-slide:nth-child(5n+1){ background-color:#e53935 !important; } /* red */
.dc-slide:nth-child(5n+2){ background-color:#1e88e5 !important; } /* blue */
.dc-slide:nth-child(5n+3){ background-color:#43a047 !important; } /* green */
.dc-slide:nth-child(5n+4){ background-color:#fb8c00 !important; } /* orange */
.dc-slide:nth-child(5n+5){ background-color:#8e24aa !important; } /* purple */
.dc-overlay{ background:none !important; }
/* ===== END TEMPORARY ===== */


/* ===== SIDE RAIL REMOVED =====
   No right-hand rail: the rail itself (Services / Back to Top / Contact Us) is
   hidden and its reserved column is zero width, so the page and header run to the
   true right edge. The deals / orders / settings icons that used to sit in it stay
   (they're separate fixed elements) but now float over the page, so they get a
   small dark backing. DELETE THIS WHOLE BLOCK to bring the rail back. */
:root{ --rail-w:0px !important; }
.side-rail{ display:none !important; }
.side-rail-quick, .settings-gear{ width:34px !important; right:6px !important; }
.side-rail-quick{ background:rgba(0,0,0,.55); border-radius:17px; padding:2px 0; }
.settings-gear{ background:rgba(0,0,0,.55); border-radius:50%; }
/* ===== END SIDE RAIL REMOVED ===== */

/* ===== LEFT-TO-RIGHT HOVER SWEEPS =====
   Department chips: the white fill wipes in from the left on hover.
   Link-style buttons (mini-bar links, product names, "show more"): the underline
   draws in from the left instead of appearing all at once. Both are a background
   gradient whose width animates 0 -> 100% anchored at the left edge. */
.dept-chip:not(.active):not(.dept-chip-blank){
  background-color:var(--line);
  background-image:linear-gradient(var(--btn-bg), var(--btn-bg));
  background-repeat:no-repeat; background-position:left center; background-size:0% 100%;
  /* Leaving hover (this state's transition is used going back): quick. */
  transition:background-size .5s ease, color .4s ease, border-color .4s ease;
}

@media (hover:hover){ .dept-chip:not(.active):not(.dept-chip-blank):hover{
  background-size:100% 100%; color:var(--btn-ink); border-color:var(--btn-bg);
  /* Entering hover: the long wipe. */
  transition:background-size 1.1s cubic-bezier(.4,0,.2,1), color .8s ease .15s, border-color .8s ease .15s;
} }

.topbar-a11y, .topbar-link, .filter-more{
  background-image:linear-gradient(currentColor, currentColor);
  background-repeat:no-repeat; background-position:0 calc(100% - 1px); background-size:0% 1px;
  transition:background-size .55s cubic-bezier(.4,0,.2,1), opacity .18s;
}
.topbar-a11y:hover, .topbar-link:hover{
  background-size:100% 1px; text-decoration:none;
}
@media (hover:hover){ .filter-more:hover{
  background-size:100% 1px; text-decoration:none;
} }

/* Add to Cart / Choose Size: inverts on hover — black wipes in from the left over the
   white button while the label turns white. The white ring keeps the button's shape
   against the dark card once its fill is black. */
.add-btn{
  background-color:var(--btn-bg);
  background-image:linear-gradient(#000, #000);
  background-repeat:no-repeat; background-position:left center; background-size:0% 100%;
  box-shadow:inset 0 0 0 1.5px transparent;
  transition:background-size .7s cubic-bezier(.4,0,.2,1), color .5s ease .1s, box-shadow .5s ease .1s;
}

@media (hover:hover){ .add-btn:hover{
  /* image, repeat and position restated: the older .add-btn:hover rule's `background`
     shorthand resets them (repeat:repeat tiled the 0%-wide fill, so it appeared instantly) */
  background-color:var(--btn-bg); background-image:linear-gradient(#000, #000); background-repeat:no-repeat; background-position:left center; background-size:100% 100%; color:#fff;
  box-shadow:inset 0 0 0 1.5px #fff;
} }

/* "N in cart" stepper, restyled to match the outlined Add to Cart: a transparent
   pill with a white ring (inset, so it doesn't change the size), white label, and
   − / + buttons that fill white from the left on hover like the other buttons. */
.qty-row{
  background:transparent; color:#fff; border-radius:6px; padding:3px 4px;
  box-shadow:inset 0 0 0 1.5px #fff;
}
.qty-row span{ font-weight:700; font-size:12.5px; letter-spacing:.2px; }
.qty-row button{
  width:26px; height:26px; border-radius:4px; font-size:15px; font-weight:700; color:#fff;
  background-color:transparent;
  background-image:linear-gradient(var(--btn-bg), var(--btn-bg));
  background-repeat:no-repeat; background-position:left center; background-size:0% 100%;
  transition:background-size .5s cubic-bezier(.4,0,.2,1), color .4s ease .05s;
}

@media (hover:hover){ .qty-row button:hover{
  background-color:transparent; background-image:linear-gradient(var(--btn-bg), var(--btn-bg));
  background-repeat:no-repeat; background-position:left center; background-size:100% 100%;
  color:var(--btn-ink);
} }
/* ===== END HOVER SWEEPS ===== */

/* ===== LOCATION WIDGET: COMPACT (ICON ONLY) =====
   Set by wireLocationFit() in app.js when the full widget doesn't fit. */
.loc-widget.loc-compact .loc-text{ display:none; }
.loc-widget.loc-compact{ gap:0; }
/* ===== END LOCATION COMPACT ===== */

/* Minus button: its fill wipes in from the RIGHT (the + button wipes from the left). */
.qty-row button[data-step="-1"]{ background-position:right center; }

@media (hover:hover){ .qty-row button[data-step="-1"]:hover{ background-position:right center; } }

/* Docked department bar (Filters open): the chips themselves are scaled down so the
   bar is 3px shorter — slightly smaller type and tighter padding, not just less
   space around them. */
.dept-bar-docked .dept-chip{ font-size:11.5px; padding:7.5px 15.5px; letter-spacing:.38px; }
.dept-bar-docked .dept-chip-all{ padding:7.5px 15.5px; }

/* ===== LIQUID-GLASS SEARCH BAR (header open only) =====
   While the header is fully open (the main page, mini bar showing — body is NOT
   .topbar-hidden) the search bar is Apple-style liquid glass:
   - REFRACTION: backdrop-filter runs the page behind it through the SVG lens
     #kmLiquidGlass (index.html) — a displacement map that bends what's behind the
     bar hardest at its rim, like a convex lens, with a little per-channel
     (chromatic) fringing — then a touch of blur and a saturation/brightness lift.
   - SPECULAR: a bright rim, a hot top-left edge highlight, a softer bottom-right
     one, and a gloss sheen across the upper half (::before).
   - Pill-shaped, with a soft drop shadow so it floats.
   Chromium supports url() in backdrop-filter; browsers that don't (Safari, Firefox)
   drop the second declaration and keep the plain frosted blur from the first.
   Once the header tucks the bar goes back to its normal solid look. */
body:not(.topbar-hidden) .searchbar{
  border-radius:15px;
  background-color:rgba(255,255,255,.07);
  background-image:linear-gradient(135deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.03) 36%, rgba(255,255,255,0) 60%, rgba(255,255,255,.10) 100%);
  -webkit-backdrop-filter:blur(16px) saturate(1.8) brightness(1.1);
          backdrop-filter:blur(16px) saturate(1.8) brightness(1.1);
  -webkit-backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12);
          backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12);
  border:1px solid rgba(255,255,255,.30);
  box-shadow:
    inset 2px 2px 3px -1px rgba(255,255,255,.85),
    inset -2px -2px 3px -1px rgba(255,255,255,.45),
    inset 0 0 0 1px rgba(255,255,255,.10),
    inset 0 0 22px rgba(255,255,255,.10),
    0 1px 2px rgba(0,0,0,.18),
    0 6px 16px rgba(0,0,0,.28);
}
/* Gloss sheen over the upper half. */
body:not(.topbar-hidden) .searchbar::before{
  content:""; position:absolute; left:6px; right:6px; top:1px; height:46%;
  border-radius:14px 14px 40% 40% / 14px 14px 10px 10px;
  background:linear-gradient(180deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.08) 70%, rgba(255,255,255,0) 100%);
  pointer-events:none;
}
body:not(.topbar-hidden) .searchbar .tsearch-input{ color:#fff; padding-left:18px; position:relative; }
body:not(.topbar-hidden) .searchbar .tsearch-input::placeholder{ color:rgba(255,255,255,.78); }
/* ===== END LIQUID GLASS ===== */
/* Close (X) while search is open on the main page: it lives just outside the bar's
   right edge (the same .sb-close the tucked header already uses), and the copy in
   the mini bar up in the corner stays hidden. Fades in with the bar's own search
   icon once the bar has finished opening. */
body.search-open:not(.topbar-hidden) .tsearch-close{ opacity:0; pointer-events:none; }
body.search-open:not(.topbar-hidden) .sb-close{ opacity:.9; pointer-events:auto; transition:opacity .25s ease; transition-delay:1.8s; }
body.search-open:not(.topbar-hidden) .sb-close:hover{ filter:drop-shadow(0 0 3px rgba(255,255,255,.75)); }


/* Filters panel open: the product grid flows as ONE grid, exactly 4 per row.
   Normally the shop is a stack of separate .grid chunks with ad rows and banners
   between them, and each chunk ends on its own partly filled row. With those bands
   hidden (rule below) the chunks would just leave a gap at the end of every chunk,
   so here the chunks stop being boxes (display:contents) and their cards flow
   straight through #grid, which packs every row full. Four per row needs screens
   wide enough for four cards beside the panel; narrower ones keep auto-fill. */
.page-shift.filters-open #grid{
  display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:20px; align-items:start;
}
.page-shift.filters-open #grid > .grid{ display:contents; }
.page-shift.filters-open #grid > :not(.grid){ grid-column:1/-1; }
@media (min-width:1000px){
  .page-shift.filters-open #grid{ grid-template-columns:repeat(4, minmax(0,1fr)); gap:16px; }
}
@media (max-width:640px){
  .page-shift.filters-open #grid{ grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); gap:12px; }
}


/* Filters panel open: the advertising / deals bands between the product rows — the
   appliance promo rows (.promo-bar / .ad-row) and the gift-card offer banners
   (.gift-promos) — are hidden, so what's left is just the filtered products. They
   come straight back when the panel closes. */
.page-shift.filters-open .promo-bar,

/* Filters open: every card in a row stretches to the row's height, so the bottoms
   (and the Add to Cart buttons) line up even when one card has an extra line. */
.page-shift.filters-open #grid{ align-items:stretch; }
.page-shift.filters-open #grid .card{ align-self:stretch; height:auto; }

/* Listing tiles now live inside .shop, right under the department bar. They stay full-bleed
   (cancelling .shop's side padding, as the strip had when it was a sibling above it). */
.shop > .cat-tiles-wrap{ margin:0 -40px 16px; }

/* HEADER + DEPT BAR MOVE AS ONE.
   The sticky dept bar parks at the products panel's padding-top. That padding used to flip
   in one step the moment the mini bar was tucked (body.topbar-hidden), while the header itself
   eased up over ~280ms — so the dept bar jumped ahead of the header it hangs from. The padding
   now follows --tuck (0 open … 1 tucked), the same value that drives the header's slide, frame
   for frame, so the two glide together. */
/* --tuck-p is --tuck for the products panel only: registered as NOT inherited, so writing it every frame of the header's slide
   touches this one element, not every product card under it (and --tuck itself is written on the header, not on <html>). */
/* The swipe writes these every frame; registered as NOT inherited so that touches one element, not everything under it. */
@property --dive{ syntax:'<number>'; inherits:false; initial-value:0; }
@property --hp{ syntax:'<number>'; inherits:false; initial-value:0; }
@property --tuck-p{ syntax:'<number>'; inherits:false; initial-value:0; }
@property --fade-h{ syntax:'<length>'; inherits:false; initial-value:0px; }
.panel-shop,
body.topbar-hidden .panel-shop{
  padding-top:calc(var(--header-wrap-h,90px) - var(--tuck-p, 0) * var(--tuck-dist, 19px) + var(--dept-dock-h,0px));
}

/* The department bar is the first thing in the products panel now, so at the shop snap point it
   must sit flush under the header — no strip of .shop's 12px top padding above it. */
.shop{ padding-top:0; }

/* ===== DIVE: products rush up out of the distance as the intro is passed through =====
   Only while .diving is on #panelShop (set by wireDeck's paint() for the length of the swipe;
   gone at both resting points). --dive is the eased swipe progress 0..1; each element's own
   --k staggers it — the tile rail and dept bar lead (row 0), then card rows 1, 2, 3 …, each a
   little later — so the page assembles from the front backward. Individual transform
   properties (scale / translate), so card hover lifts still work. */
.panel-shop.diving .cat-tiles-wrap,
.panel-shop.diving .dept-bar:not(.dept-bar-docked),
.panel-shop.diving #grid .card{
  /* No expanding or rising: the items are simply there as the page comes up (the fade above the department bar does the arriving). */
  opacity:1; scale:1; translate:none;
}
/* ===== END DIVE ===== */

/* Settings gear: a true circle (it was 34 wide by the rail icon's 42 tall, so 50% radius made an oval). */
.settings-gear{ width:34px !important; height:34px !important; border-radius:50%; }

/* ===== SLIDESHOW ARROWS LINE UP WITH THE FLOATING ICON COLUMN =====
   The Deals / package / settings icons float in a 34px column 6px from the right edge, so their
   centres are 23px in. The next arrow's centre now sits on that same line (and the previous arrow
   mirrors it on the left), and the arrows keep clear of the icon stack's height: on wide screens
   they ride the slideshow's middle unless it's so short the stack would reach them, on narrow
   ones (where the arrows used to drop to the bottom corners, straight under the icons) they sit
   at the top corners instead. */
.dc-arrow{ top:min(50%, calc(100% - 210px)); }
.dc-prev{ left:4px; }
.dc-next{ right:4px; }
@media (max-width:700px){
  .dc-arrow{ top:14px; bottom:auto; }
  .dc-prev{ left:7px; }
  .dc-next{ right:7px; }
}
/* ===== END SLIDESHOW ARROWS ===== */

/* ===== FLOATING ICONS CENTRED IN THE RIGHT MARGIN =====
   The Deals / package / settings icons sit in the strip between the products' right edge and the
   window edge. That strip is the shop's side padding (--page-edge: 40px, 28px on phones), so the
   icon column is centred in it: its centre is half the strip in from the window edge. The
   slideshow arrows ride the same line. */
:root{ --page-edge:40px; }
@media (max-width:520px){ :root{ --page-edge:28px; } }
.side-rail-quick, .settings-gear{ right:calc(var(--page-edge) / 2 - 17px) !important; }
.dc-next{ right:calc(var(--page-edge) / 2 - 19px); }
.dc-prev{ left:calc(var(--page-edge) / 2 - 19px); }
@media (max-width:700px){
  .dc-next{ right:calc(var(--page-edge) / 2 - 16px); }
  .dc-prev{ left:calc(var(--page-edge) / 2 - 16px); }
}
/* ===== END FLOATING ICONS ===== */

/* The settings gear belongs to the floating icon column, so it appears and leaves with the Deals /
   package icons (only once the page has scrolled past the main screen) instead of sitting alone
   over the slideshow. Same slide + fade as the column above it. */
.settings-gear{
  opacity:0; pointer-events:none; transform:translateX(8px);
  transition:opacity .09s linear, transform .09s linear;   /* leaving: quick, like the column above */
}
body.topbar-hidden:not(.rail-quick-off) .settings-gear{
  opacity:.9; pointer-events:auto; transform:none;
  transition:opacity .45s ease .12s, transform .55s cubic-bezier(.22,1,.36,1) .12s;
}
body.topbar-hidden:not(.rail-quick-off) .settings-gear:hover{ opacity:1; }

/* Remove button on each multi-size listing tile (admin only): sits just left of the pencil. */
.tile-del-btn{
  display:none; position:absolute; z-index:2; top:8px; right:42px;
  align-items:center; justify-content:center; width:28px; height:28px; border-radius:50%;
  background:rgba(0,0,0,.62); border:1px solid rgba(255,255,255,.25); color:#fff;
  cursor:pointer; padding:0; transition:background .15s, transform .15s;
}
.tile-del-btn:hover{ background:var(--btn-bg); transform:scale(1.08); color:var(--btn-ink); }
body.is-admin .tile-del-btn{ display:flex; }

/* ===== MULTI-LISTING TILES: CENTRED LABEL, CLEAN SANS =====
   The name sits in the middle of the tile (it used to hug the bottom edge), set in Playfair
   Display — the store's display serif — with a soft dark pool behind it so it reads on any photo. */
.cat-tiles .tile:not(.tile-blank){ align-items:center; justify-content:center; }
/* No scrim over the tile photos — the label's own shadow keeps it readable. */
.cat-tiles .tile.has-image::before{ background:none; }
.cat-tiles .tile .tile-text{ display:flex; align-items:center; justify-content:center; }
.cat-tiles .tile .tile-name{
  font-family:'Manrope','Inter',-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  font-weight:800; font-size:17px; line-height:1.25; letter-spacing:-.005em; text-align:center;
  -webkit-text-stroke:.3px currentColor;
  text-wrap:balance; text-shadow:0 1px 2px rgba(0,0,0,.85), 0 0 10px rgba(0,0,0,.75), 0 0 22px rgba(0,0,0,.5);
}
@media (max-width:520px){ .cat-tiles .tile .tile-name{ font-size:15.5px; } }
/* ===== END MULTI-LISTING TILES ===== */

/* ===== ADMIN ACTION ROW =====
   New Multi-Size Listing, Tagged products and Add Product share one row under the department
   bar, left-aligned (Add Product last whatever order the buttons were mounted in). */
.shop > .admin-toolbar:not([hidden]){ display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:10px; margin:0 0 14px; }
.admin-toolbar #addGroupBtn{ order:1; }
.admin-toolbar .mk-manage{ order:2; }
.admin-toolbar #addProductBtn{ order:3; }
.admin-toolbar #photoStudioBtn{ order:4; }
.admin-toolbar .btn-admin-add{ margin:0; min-height:36px; }
/* ===== END ADMIN ACTION ROW ===== */

/* ===== FLOATING ICON COLUMN = SAME LOOK AS THE FILTERS TAB =====
   Deals + package (one box) and the settings gear: black with a 2px white border, rounded corners and
   the tab's shadow; on hover the fill sweeps in left to right (white, icons turning black). White mode
   restyles it in theme-light.css (white, gold border, gold sweep). */
.side-rail-quick, .settings-gear{
  background-color:#000 !important;
  background-image:linear-gradient(#fff, #fff);
  background-repeat:no-repeat; background-position:left center; background-size:0% 100%;
  border:2px solid #fff; border-radius:8px !important; box-shadow:var(--shadow-lg);
  padding:0; color:#fff;
  transition:background-size .5s cubic-bezier(.4,0,.2,1), color .3s ease, opacity .15s ease, transform .15s ease;
}
.side-rail-quick{ padding:0; box-sizing:border-box; }
.settings-gear{ box-sizing:border-box; width:34px !important; height:34px !important; }
.side-rail-quick:hover, .settings-gear:hover{ background-size:100% 100%; }
.side-rail-quick:hover .side-rail-icon, .settings-gear:hover{ color:#000; }
.side-rail-quick .side-rail-icon{ color:inherit; }
/* Dept bar's sticky strip runs to the right edge too (it used to stop at the shop's right padding). */
.dept-bar:not(.dept-bar-docked)::before{ right:-40px; }
/* ===== END FLOATING ICON COLUMN ===== */

/* ===== ICON COLUMN: THREE ROUND BUTTONS =====
   Deals, package and settings are each their own circle (the first two used to share one box). Same
   black / white-border / left-to-right sweep treatment as above, per circle. */
.side-rail-quick{
  background:none !important; background-image:none !important; border:0 !important; box-shadow:none !important;
  gap:8px; padding:0; border-radius:0 !important; width:34px !important;
}
.side-rail-quick .side-rail-icon, .settings-gear{
  width:34px !important; height:34px !important; box-sizing:border-box; border-radius:50% !important;
  background-color:#000 !important;
  background-image:linear-gradient(#fff, #fff);
  background-repeat:no-repeat; background-position:left center; background-size:0% 100%;
  border:2px solid #fff; box-shadow:var(--shadow-lg); color:#fff; opacity:1;
  transition:background-size .5s cubic-bezier(.4,0,.2,1), color .3s ease, transform .15s ease;
}
.side-rail-quick .side-rail-icon:hover, .settings-gear:hover{ background-size:100% 100%; color:#000; opacity:1; }
.side-rail-quick:hover .side-rail-icon:not(:hover){ background-size:0% 100%; color:#fff; }
.side-rail-quick .side-rail-icon svg, .settings-gear svg{ transform:scale(.8); }
/* ===== END ICON COLUMN ===== */

/* The strip joining the dept bar to the header appears (and goes) almost at once — it used to ease in over .2s, which read as lag after a swipe. */
.dept-bar:not(.dept-bar-docked)::before{ transition:opacity .05s linear; }

/* ===== ICON COLUMN, DARK MODE: BLACK, NO OUTLINE =====
   In dark mode the Deals / package / settings circles are solid black with white icons and no outline.
   Hover sweeps a white fill in (icons turn black). White mode keeps its own gold-outlined style
   (theme-light.css). */
html:not([data-theme="light"]) .side-rail-quick .side-rail-icon,
html:not([data-theme="light"]) .settings-gear{
  background-color:#000 !important;
  background-image:linear-gradient(#fff, #fff);
  border:0 !important; color:#fff;
  box-shadow:0 2px 10px rgba(0,0,0,.55);
}
html:not([data-theme="light"]) .side-rail-quick .side-rail-icon:hover,
html:not([data-theme="light"]) .settings-gear:hover{ color:#000; }
html:not([data-theme="light"]) .side-rail-quick:hover .side-rail-icon:not(:hover){ color:#fff; }
/* ===== END ICON COLUMN, DARK MODE ===== */

/* The settings gear belongs to the same column as the Deals / package circles: hidden (and parked 8px
   out, like them) on the main screen, shown only once the page has scrolled past it. The round-button
   rule above sets opacity:1 on it, which had put it back on the main page, 8px off the column's line. */
body:not(.topbar-hidden) .settings-gear,
body.rail-quick-off .settings-gear{ opacity:0 !important; pointer-events:none !important; transform:translateX(8px); }
body.topbar-hidden:not(.rail-quick-off) .settings-gear{ opacity:1 !important; pointer-events:auto; transform:none; }

/* ===== ICON COLUMN: BARE ICONS =====
   Deals, package and settings are plain icons — no circle, fill, outline, shadow box or hover effect.
   (They stay clickable; a soft halo keeps them legible over photos.) Last word, so it beats the
   button treatments above in every mode. */
.side-rail-quick, .side-rail-quick .side-rail-icon, .settings-gear,
.side-rail-quick:hover .side-rail-icon, .side-rail-quick .side-rail-icon:hover, .settings-gear:hover,
html[data-theme="light"] .side-rail-quick .side-rail-icon, html[data-theme="light"] .settings-gear,
html[data-theme="light"] .side-rail-quick .side-rail-icon:hover, html[data-theme="light"] .settings-gear:hover,
html:not([data-theme="light"]) .side-rail-quick .side-rail-icon, html:not([data-theme="light"]) .settings-gear,
html:not([data-theme="light"]) .side-rail-quick .side-rail-icon:hover, html:not([data-theme="light"]) .settings-gear:hover{
  background:none !important; background-image:none !important; border:0 !important; box-shadow:none !important;
  border-radius:0 !important; color:#fff;
}
.side-rail-quick .side-rail-icon svg, .settings-gear svg{ transform:none; filter:drop-shadow(0 0 3px rgba(0,0,0,.85)) drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
html[data-theme="light"] .side-rail-quick .side-rail-icon,
html[data-theme="light"] .settings-gear,
html[data-theme="light"] .side-rail-quick .side-rail-icon:hover,
html[data-theme="light"] .settings-gear:hover{ color:var(--gold-deep); }
html[data-theme="light"] .side-rail-quick .side-rail-icon svg, html[data-theme="light"] .settings-gear svg{
  filter:drop-shadow(0 0 3px rgba(255,255,255,.95)) drop-shadow(0 1px 2px rgba(255,255,255,.8));
}
/* the gear's show/hide (see above) is separate and stays */
body:not(.topbar-hidden) .settings-gear, body.rail-quick-off .settings-gear{ opacity:0 !important; pointer-events:none !important; }
body.topbar-hidden:not(.rail-quick-off) .settings-gear{ opacity:1 !important; }
/* ===== END BARE ICONS ===== */

/* ===== PRODUCT CARDS: TEXT-AREA WIPE, BOTTOM TO TOP =====
   Same bottom-to-top wipe as the gift-card banners, but only on the card's text area (the part under the
   photo): ONE soft gradient glides up from the bottom behind the name, price and button (deepest grey at the
   bottom, fading lighter toward the top) and slides back down when the pointer leaves. There is no hard edge:
   the front of the wipe is feathered into the card and the top fades out completely. The image is 2 box-heights
   tall: its bottom 45% is the visible gradient (--wipe-lo, then --wipe-hi, then clear), the rest is empty.
   At rest it is parked (position 8%) so the gradient's front edge sits just below the box, and on hover it
   slides to 100%: the very first frame already shows the fade rising (no dead travel through empty image,
   and an ease-OUT curve so it starts at full speed; an earlier 3x-tall image with a slow-start curve "triggered
   very late"). Keep the parked position and the 45% stop in step: the gradient's front must start just below the box.
   It is the area's own background, so the text, button and photo are never covered or tinted. */
.card-body{
  --wipe-lo:#202024; --wipe-hi:#0f0f11;                           /* bottom / top of the gradient (dark mode) */
  background-image:linear-gradient(to top, var(--wipe-lo) 0%, var(--wipe-hi) 25%, transparent 45%);
  background-repeat:no-repeat; background-position:center 8%; background-size:100% 200%;
  transition:background-position .45s ease;                       /* leaving: slides back down */
}

@media (hover:hover){ .card:hover .card-body{
  background-position:center 100%;
  transition:background-position .6s cubic-bezier(.2,.8,.2,1);   /* entering: starts at full speed, eases to a stop */
} }
/* ===== END CARD WIPE ===== */

/* The nutrition label sits under BOTH columns of the product popup (it used to be tucked under the photo, half the width). */
.pm-body > .pm-nutrition{ grid-column:1 / -1; }

/* ===== NUTRITION FACTS: HORIZONTAL LABEL =====
   The "linear" layout: title / servings / serving size / calories on the left, the nutrients in two columns
   across the middle, the % Daily Value note on the right — white text and rules on black, in a white outline.
   Below 760px wide it stacks into one column. */
.nutrition-label.nl-h{
  display:grid; grid-template-columns:minmax(150px,.9fr) minmax(0,1.5fr) minmax(0,1.5fr) minmax(130px,.9fr);
  gap:0 18px; align-items:start; padding:12px 14px;
  background:#08090a; color:#f2f3f5; border:2px solid #fff; border-radius:3px;
  font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; box-shadow:none;
}
.nl-id h4{ margin:0; font-size:26px; line-height:.95; font-weight:900; letter-spacing:-.02em; border:0; padding:0; }
.nl-servings{ margin-top:6px; font-size:10.5px; font-weight:500; }
.nl-size{ display:flex; justify-content:space-between; gap:8px; margin-top:3px; padding:3px 0; border-top:1px solid #f2f3f5; border-bottom:5px solid #f2f3f5; font-size:12px; }
.nl-size strong{ font-weight:800; }
.nl-cal{ display:flex; justify-content:space-between; align-items:flex-end; padding-top:3px; font-weight:900; font-size:19px; line-height:1; }
.nl-cal span{ display:flex; flex-direction:column; }
.nl-cal small{ font-size:10px; font-weight:600; margin-top:2px; }
.nl-cal b{ font-size:40px; line-height:.85; font-weight:900; }
.nl-col{ min-width:0; }
.nl-head{ display:flex; justify-content:space-between; padding:0 0 2px; border-bottom:2px solid #f2f3f5; font-size:9px; font-weight:700; }
.nl-row{ display:flex; justify-content:space-between; gap:8px; padding:3px 0; border-bottom:1px solid #6a6e76; font-size:11.5px; line-height:1.2; }
.nl-row:last-child{ border-bottom:0; }
.nl-row b{ font-weight:800; white-space:nowrap; }
.nl-bold strong{ font-weight:800; }
.nl-indent{ padding-left:14px; }
.nl-sub{ padding-left:28px; }
.nl-note{ margin:0; font-size:9.5px; line-height:1.3; color:#d6d8dc; }
@media (max-width:760px){
  .nutrition-label.nl-h{ grid-template-columns:1fr; gap:10px 0; }
  .nl-id{ border-bottom:1px solid #f2f3f5; padding-bottom:8px; }
}
/* ===== END NUTRITION FACTS: HORIZONTAL ===== */
/* ---- label copied from the package: second column ("with milk"), vitamin block, ingredients, allergens, notes ---- */
.nl-row{ align-items:baseline; }
.nl-row .nl-n{ min-width:0; }
.nl-row .nl-v{ display:flex; gap:10px; flex:none; justify-content:flex-end; }
.nl-row .nl-v b{ min-width:30px; text-align:right; font-weight:800; }
.nl-row .nl-v i{ min-width:58px; text-align:right; font-style:normal; font-weight:500; }
.nl-micro{ font-weight:400; }
.nl-micro-first{ border-top:5px solid #f2f3f5; margin-top:3px; }
.nl-micro .nl-n{ font-weight:400; }
.nl-head .nl-v{ display:flex; gap:10px; text-align:right; }
.nl-head .nl-v b{ min-width:30px; text-align:right; font-weight:700; }
.nl-head .nl-v i{ min-width:58px; max-width:58px; white-space:normal; font-size:8px; line-height:1.1; text-align:right; font-style:normal; font-weight:700; }
.nl-colnames, .nl-cal2{ display:grid; grid-template-columns:1fr auto auto; gap:0 10px; align-items:end; }
.nl-colnames{ padding-top:3px; font-size:9px; font-weight:800; line-height:1.1; text-align:right; }
.nl-colnames b{ min-width:62px; }
.nl-cal2 b{ font-size:28px; line-height:.9; min-width:62px; text-align:right; }
.nl-cal2 span{ font-size:19px; font-weight:900; }
.nutrition-label.nl-h.nl-dual{ grid-template-columns:minmax(215px,1.1fr) minmax(0,1.5fr) minmax(0,1.5fr) minmax(130px,.9fr); }
.nutrition-label.nl-h.nl-wide{ grid-template-columns:minmax(225px,.9fr) minmax(0,2.6fr) minmax(130px,.9fr); }
.nl-notes{ min-width:0; }
.nl-notes .nl-note{ margin:0 0 7px; }
.nl-more{ grid-column:1 / -1; margin-top:10px; padding-top:8px; border-top:1px solid #6a6e76; font-size:11px; line-height:1.4; color:#e6e8ec; }
.nl-p{ margin:0 0 5px; }
.nl-p strong{ font-weight:800; }
.nl-allergen{ font-weight:800; }
.nl-tags{ display:flex; flex-wrap:wrap; gap:6px; list-style:none; margin:8px 0 0; padding:0; }
.nl-tags li{ border:1px solid #6a6e76; border-radius:999px; padding:2px 9px; font-size:10.5px; line-height:1.4; }
.nl-certs{ grid-column:1 / -1; display:flex; flex-wrap:wrap; justify-content:flex-end; align-items:flex-start; gap:12px 16px; margin-top:14px; }
.nl-cert{ display:inline-flex; flex-direction:column; align-items:center; gap:5px; max-width:112px; text-align:center; color:#d6d8dc; }
.nl-cert-stack{ display:inline-flex; flex-direction:column; align-items:center; gap:8px; }
.nl-cert-stack .nl-cert-vis{ height:auto; }
.nl-cert-vis{ display:flex; align-items:center; justify-content:center; height:52px; }
.nl-cert img{ display:block; height:52px; width:auto; max-width:104px; object-fit:contain; }
.nl-cert img.sq{ border-radius:4px; }
.nl-cert small{ font-size:9px; line-height:1.2; opacity:.85; min-height:11px; }
.nl-cert small:empty{ display:none; }
.nl-cert-pill{ display:inline-block; border:1px solid #8b9099; border-radius:999px; padding:5px 12px; font-size:10.5px; line-height:1.3; color:#f2f3f5; white-space:nowrap; }
.pm-nutrition-none{ padding:14px 18px; }
.pm-nutrition-none p{ margin:0; font-size:13.5px; opacity:.7; }
.pf-nutri-text{ width:100%; min-height:240px; box-sizing:border-box; padding:10px 12px; font:12.5px/1.5 ui-monospace,Menlo,Consolas,monospace; resize:vertical; border-radius:8px; }
@media (max-width:760px){
  .nutrition-label.nl-h.nl-wide{ grid-template-columns:1fr; }
  .nl-more{ grid-column:auto; }
  }


/* Even rhythm: header → chips and chips → tile rail are the same ~12px. */
.dept-bar{ margin-bottom:8px; }
.dept-bar-spacer{ margin-bottom:8px; }
.shop > .cat-tiles-wrap{ margin-bottom:12px; }
.dept-bar:not(.dept-bar-docked)::before{ top:-6px; bottom:-6px; }
/* Match the header-text → chips gap (11.5px) all the way down. */
.dept-bar, .dept-bar-spacer{ margin-bottom:7.5px; }
.shop > .cat-tiles-wrap{ margin-bottom:7.5px; }
.dept-bar:not(.dept-bar-docked){ margin-bottom:12.5px; }   /* 7.5 + the 2px the chips moved up (see --tuck-dist) + 3px more under the bar (asked for; the panel-open gap got the same 3px in app.js) */

/* Category buttons for the selected department (renderCatButtons() in app.js): they take the place of the multi-size listing bar
   while a department is picked. The buttons ARE .dept-chip, so they look and size exactly like the department bar's; this only
   lays them out — starting at the same left edge as the bar's first chip (it uses the same pull-out as .dept-bar, below),
   with the same gap between them. */
.cat-btns{ margin:0 0 7.5px -16px; }
.cat-btns[hidden]{ display:none; }
.cat-btns-row{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; }
@media (max-width:860px){ .cat-btns{ margin-left:-24px; } }
@media (max-width:520px){ .cat-btns{ margin-left:-12px; } .cat-btns-row{ gap:8px; } }
/* The filter row under the bars (search word, brands, price, shipping): its chips are the department bar's own selected pills (white, with an x), and the row
   sits on the same left edge as the department bar / category buttons (same pull-out as .cat-btns), so everything lines up with All. */
#filterSummary{ margin-left:-16px; gap:10px; }
@media (max-width:860px){ #filterSummary{ margin-left:-24px; } }
@media (max-width:520px){ #filterSummary{ margin-left:-12px; gap:8px; } }

/* The multi-size listing bar steps out of the way while any filter is on (syncTileBar() in app.js): collapsed to nothing, but
   still laid out at full width so its rail keeps its measurements. visibility also takes it out of the tab order. */
.cat-tiles-wrap.is-filtered-away,
.shop > .cat-tiles-wrap.is-filtered-away{
  height:0 !important; min-height:0 !important; margin-top:0 !important; margin-bottom:0 !important;
  padding-top:0 !important; padding-bottom:0 !important; overflow:hidden; visibility:hidden; pointer-events:none;
}

/* ===== Layered slide art (parallax on scroll) — see slideStageHTML() in app.js ===== */
.dc-stage{
  position:absolute; z-index:1; right:max(88px, 7vw); bottom:0; height:calc(100% - var(--header-wrap-h, 90px) - 24px); max-width:42vw;
  pointer-events:none; contain:layout; margin-bottom:3%;
}
.dc-layer{
  position:absolute; display:block; max-width:none; user-select:none; -webkit-user-drag:none; transform-origin:50% 55%; will-change:transform;
  transform:translate3d(calc(var(--hp, 0) * var(--dx, 0)), calc(var(--hp, 0) * var(--dy, 0)), 0)
            scale(calc(1 + var(--hp, 0) * var(--ds, 0))) rotate(calc(var(--hp, 0) * var(--dr, 0)));
  filter:drop-shadow(0 18px 24px rgba(0,0,0,.32));
}
.dc-slide .dc-overlay{ z-index:2; }
@media (max-width:760px){ .dc-stage{ right:-6vw; max-width:78vw; opacity:.55; height:78%; } }
@media (prefers-reduced-motion:reduce){ .dc-layer{ transform:none; } }

/* Full-bleed layered art (art.mode "cover"): the stage behaves like background-size:cover, sitting under the text. */
.dc-stage.is-cover{ right:auto; left:0; bottom:auto; top:calc(-1 * var(--header-wrap-h, 90px)); margin:0; width:max(118%, calc(100dvh * 1.13)); height:auto; max-width:none; opacity:1; }
.dc-slide.has-art{ overflow:hidden; }
.dc-slide.has-art .dc-overlay{ background:linear-gradient(90deg,rgba(0,0,0,.78) 0%,rgba(0,0,0,.5) 42%,rgba(0,0,0,.08) 80%,rgba(0,0,0,0) 100%) !important; }
.dc-stage.is-cover .dc-layer{ filter:none; }
.dc-stage.is-cover .dc-layer.is-front{ filter:drop-shadow(0 22px 30px rgba(0,0,0,.35)); }
@media (max-width:760px){ .dc-stage.is-cover{ width:max(190%, calc(100dvh * 1.13)); left:-34%; } }
.dc-stage.is-cover{ left:5%; transform:translateY(-15%); }
@media (max-width:760px){ .dc-stage.is-cover{ left:-34%; } }
.dc-stage.is-cover{ left:0; width:max(112%, calc(100dvh * 1.13)); }
@media (max-width:760px){ .dc-stage.is-cover{ left:-34%; width:max(190%, calc(100dvh * 1.13)); } }

/* Layers must track the scroll in lockstep: the hero is only visible for the few frames the page takes to snap to the shop,
   so any real lag (the first version had a ~1s glide) means a layer hasn't moved yet by the time the shop covers it. This is
   only a few-ms smoothing between scroll events (see --tr in slideStageHTML). */
.dc-layer{ transition:none !important; }   /* tracks the scroll position exactly, frame by frame */
@media (prefers-reduced-motion:reduce){ .dc-layer{ transition:none; } }

/* stretch gradient: layers are anchored at the bottom and stretched upward (transform set in paint(), app.js) */
.dc-layer{ transform-origin:50% 100%; }

/* Layered art whose layers don't move (all motion 0): nothing to animate per layer, so none of them is promoted to its own GPU layer
   and none is rewritten each frame of the swipe — the slide is drawn once and the compositor just moves / stretches / fades it. */
.dc-stage.is-flat .dc-layer{ will-change:auto; transform:none !important; }

/* Mid-swipe (hero <-> shop): no backdrop blurs, no layer shadows — see paint() in app.js. */
/* Only the elements that actually have a backdrop blur are listed (every selector that sets backdrop-filter in the stylesheets). A
   blanket `body.is-swiping *` made the browser re-check all ~2000 elements each time the class toggled — a ~10ms hitch on the first
   and last frame of every swipe. Add new blurred components here.
   NOT in the list on purpose: .searchbar — its liquid-glass lens (the refraction of the colours behind it) has to keep working through the whole
   swipe, right up until the bar turns solid black (see "SEARCH GLASS HOLDS" at the end of the file). It only costs anything while search is open. */
body.is-swiping :is(.adm-btn, .kmadm-btn, .kmadm-iconbtn, .btn-admin-add, .dc-manage-btn, .ie-btn, .card-admin button, .tile-edit-btn, .tile-del-btn,
  .dept-chip-edit, .pf-tool, .pf-gallery-thumb [data-act], .adm-actions, .gc-close, .gc-count, .ie-root, .ie-out, .ie-cropnote, .ie-tag, .ie-nav,
  .mk-pill, .overlay, #drawerScrim, .kml-overlay, .kmadm-gate, .adm-ask, .mk-scrim, .tsearch-suggest, .dc-arrow, .dc-dots, .ph-glass){
  -webkit-backdrop-filter:none !important; backdrop-filter:none !important;
}
body.is-swiping .dc-layer{ filter:none !important; }

/* Layered art, scaled up ~15%: the stage is wider than the slide and sits a little lower/further right so the food stays framed. */
.dc-stage.is-cover{ width:max(130%, calc(100dvh * 1.3)); transform:translateY(-19%); }
@media (max-width:760px){ .dc-stage.is-cover{ width:max(215%, calc(100dvh * 1.3)); left:-48%; } }

/* Layered art, 16:9 original ("wok2"): the stage is the whole photo, a bit larger than the slide, left-aligned so the food sits
   right of the headline. */
.dc-stage.is-cover{ width:max(122%, calc(100dvh * 1.9)); transform:translateY(-8%); }
@media (max-width:760px){ .dc-stage.is-cover{ width:max(260%, calc(100dvh * 1.9)); left:-72%; } }

/* make sure the 16:9 stage always covers the slide, even in short windows, with room for the layers to travel */
.dc-stage.is-cover{ width:max(122%, calc((100dvh + 200px) * 1.78)); }
/* Layered photo art: no drop shadows — at rest the layers must recombine into the exact photo, and a shadow under the food
   would also cost a repaint every frame of the swipe. */
.dc-stage.is-cover .dc-layer, .dc-stage.is-cover .dc-layer.is-front{ filter:none !important; }

/* The wok slide's readability scrim was a heavy black fade over the whole left half of the screen (the "random fade on the
   left"). The photo is dark behind the headline already, so a light, short scrim plus a soft text shadow is enough. */
.dc-slide.has-art .dc-overlay{ background:linear-gradient(90deg,rgba(0,0,0,.34) 0%,rgba(0,0,0,.14) 34%,rgba(0,0,0,0) 56%) !important; }
.dc-slide.has-art .dc-text h1, .dc-slide.has-art .dc-text p{ text-shadow:0 2px 14px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.45); }
/* ...and the thin dark strip on the slideshow's left edge (.dc-edge-fade) reads as a smudge on a photo, so it is off while
   a photo slide is showing. */
.dc-edge-fade{ transition:opacity .3s ease; }
#dealsSlideshow:has(.dc-slide.active.has-art) .dc-edge-fade{ opacity:0; }

/* Admin ✎ / ✕ over an opened listing's photo (see pmAdminHTML() in app.js). Same glass pair as the grid
   cards, a touch larger to sit level with the close X; top-left because the X and the gallery arrows own the
   other spots. Above the gallery (z 3) so a click never lands on a photo. */
.pm-card-admin{ top:14px; left:14px; right:auto; z-index:4; gap:8px; }
.pm-card-admin button{ width:32px; height:32px; font-size:14px; line-height:1; padding:0; }

/* The department chips and the admin buttons start at the same left edge as the logo (the shop keeps its wider gutter for everything
   else, so the product grid below is untouched): header gutter 24px / 16px, shop gutter 40px / 28px. */
.dept-bar:not(.dept-bar-docked), .shop > .admin-toolbar:not([hidden]){ margin-left:-16px; }
.dept-bar:not(.dept-bar-docked){ margin-right:-16px; }   /* the bar grows on the right by the same amount it moved on the left */
@media (max-width:860px){ .dept-bar:not(.dept-bar-docked), .shop > .admin-toolbar:not([hidden]){ margin-left:-24px; } .dept-bar:not(.dept-bar-docked){ margin-right:-24px; } }
@media (max-width:520px){ .dept-bar:not(.dept-bar-docked), .shop > .admin-toolbar:not([hidden]){ margin-left:-12px; } .dept-bar:not(.dept-bar-docked){ margin-right:-12px; } }

/* The product page starts at the department bar: from the bar down it is solid black, and the empty strip above the bar (the header's
   clearance) is not a black block any more but a fade — black at the bar, clear at the top, so the slideshow shows through above it.
   Once the page has arrived that strip is under the header, so nothing of it shows on the main page or while browsing. */
.panel-shop{
  --fade-h:calc(var(--header-wrap-h,90px) - var(--tuck-p, 0) * var(--tuck-dist, 19px) + var(--dept-dock-h,0px));
  box-shadow:none;   /* the old dark shadow above this box stopped at its top edge, leaving a hard line and a lighter band right where the strip begins */
  background:linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,.1) calc(var(--fade-h) * .25), rgba(0,0,0,.35) calc(var(--fade-h) * .5), rgba(0,0,0,.7) calc(var(--fade-h) * .75), #000 var(--fade-h));
}

/* Docking the department bar for the Filters panel: the products' top padding grows by the bar's height while the placeholder spacer
   shrinks by the same amount. Easing the two separately (they never stayed in step) made the whole grid dip and bounce, so the pair
   changes in one step — the grid stays put — and only the bar itself slides. */
html.dept-docking .panel-shop{ transition:none !important; }
html.dept-docking .dept-bar-spacer{ transition:none !important; }

/* Department bar: brighter, slightly bolder chip text and a firmer outline (the idle chips were grey on near-black at 70% opacity). */
.dept-chip:not(.active):not(.dept-chip-blank){ color:#f2f3f5; font-weight:800; opacity:1; border-color:rgba(255,255,255,.34); }

@media (hover:hover){ .dept-chip:not(.active):not(.dept-chip-blank):hover{ color:var(--btn-ink); } }
.dept-chip.dept-chip-empty{ opacity:.6; }
.dept-chip.active{ font-weight:800; }

/* "Show results" in the Filters panel: a plain solid button, no liquid glass. */
.btn-solid-plain{
  appearance:none; border:1px solid var(--btn-bg); background:var(--btn-bg); color:var(--btn-ink); border-radius:999px;
  padding:10px 20px; font:inherit; font-size:14px; font-weight:800; cursor:pointer; transition:background .18s;
}
.btn-solid-plain:hover{ background:var(--btn-bg-hover); border-color:var(--btn-bg-hover); }

/* The Filters panel's footer is just "Clear all" now (the "Show N items" button is gone — the count is in the panel's header, and the tab beside
   it closes the panel). It fills the whole row and wears the theme of that open Filters tab: black, a 2px white outline, and on hover white
   wipes in from the left while the label turns black. Dimmed and inert while no filter is on. */
.filters-foot #filtersReset{
  background-color:#000; background-image:linear-gradient(#fff, #fff);
  background-repeat:no-repeat; background-position:left center; background-size:0% 100%;
  color:#fff; border:2px solid #fff; border-radius:8px;
  font-size:12.5px; font-weight:800; letter-spacing:1.2px; text-transform:uppercase;
  transition:background-size .6s cubic-bezier(.4,0,.2,1), color .45s ease .1s, opacity .2s ease;
}
.filters-foot #filtersReset:not(:disabled):hover{ background-size:100% 100%; color:#000; }
.filters-foot #filtersReset:focus-visible{ outline:2px solid #fff; outline-offset:2px; }

/* The Filters panel's own scroll never hands leftover wheel/touch movement to the page behind it (which used to swipe the page back to the intro). */
.filters-body{ overscroll-behavior:contain; }
.filters-panel{ overscroll-behavior:contain; }

/* The Filters tab has a fixed height sized for its label; with the count badge showing it needs the badge's room too, or the label is squeezed and the badge hangs off the edge. */
.filters-tab:not(.open):has(.filters-tab-count:not([hidden])){ height:118px; padding-bottom:9px; }
@media (max-width:520px){ .filters-tab:not(.open):has(.filters-tab-count:not([hidden])){ height:108px; } }

/* Filters panel: a custom scroll bar that is always on screen (the system one hides itself until you scroll). */
.filters-body{ overflow-y:scroll; }
@supports not selector(::-webkit-scrollbar){ .filters-body{ scrollbar-width:auto; scrollbar-color:#9a9a9a #161616; } }
.filters-body::-webkit-scrollbar{ width:12px; background:#161616; }
.filters-body::-webkit-scrollbar-track{ background:#161616; border-left:1px solid #2a2a2a; }
.filters-body::-webkit-scrollbar-thumb{ background:#8c8c8c; border-radius:8px; border:3px solid #161616; min-height:48px; }
.filters-body::-webkit-scrollbar-thumb:hover{ background:#d4d4d4; }
.filters-body::-webkit-scrollbar-thumb:active{ background:#ffffff; }

/* Active filter chip on hover: it turns white, so its ✕ must turn dark too (it was forced white = invisible). */

@media (hover:hover){ .filter-chip:hover span{ color:var(--btn-ink); } }

/* Switching what the grid shows: quick fade out, swap, softer fade in (loadProducts in app.js). */
#grid{ transition:opacity .24s ease; }
#grid.is-switching{ opacity:0; transition-duration:.12s; }



/* Filters header: the "N items + selected chips" row replaces the "Filters" title when something is selected; the copy above the grid
   steps aside (and gives its space back) while the panel is open. */
.filters-head{ padding:12px 20px; }
.filters-head.has-summary h3, .filters-head.has-summary .filters-head-count{ display:none; }
.filters-head .filter-summary{ margin:0; gap:6px; }
.filters-head .filter-summary[hidden]{ display:none; }
#pageShift.filters-open #filterSummary{ display:none; }

/* Sort By: themed dropdown replacing the native select's OS popup (wireSortMenu, app.js). */
.filter-select.sort-native{ display:none; }
.sort-menu{ position:relative; }
.sort-menu-btn{ width:100%; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 12px; border-radius:10px;
  border:1px solid var(--line-strong); background:var(--line); color:var(--ink); font:inherit; font-size:13.5px; font-weight:600; cursor:pointer;
  transition:background .15s, border-color .15s; }
.sort-menu-btn:hover{ background:rgba(255,255,255,.1); border-color:#6a6a6a; }
.sort-menu-btn:focus-visible{ outline:2px solid #fff; outline-offset:1px; }
.sort-menu-btn svg{ flex:none; color:var(--muted); transition:transform .18s; }
.sort-menu-btn[aria-expanded="true"] svg{ transform:rotate(180deg); }
.sort-menu-list{ position:absolute; left:0; right:0; top:calc(100% + 6px); z-index:6; margin:0; padding:5px; list-style:none;
  background:#0c0c0c; border:1px solid var(--line-strong); border-radius:12px; box-shadow:0 14px 30px rgba(0,0,0,.6); }
.sort-menu-list[hidden]{ display:none; }
.sort-menu-list li{ padding:8px 10px; border-radius:8px; font-size:13.5px; font-weight:600; color:var(--muted); cursor:pointer; }
.sort-menu-list li:hover{ background:rgba(255,255,255,.1); color:var(--ink); }
.sort-menu-list li[aria-selected="true"]{ background:#fff; color:#000; }

/* Filters panel: tighter vertical rhythm (less air between the header, the sections and their labels). */
.filters-head{ padding:6px 20px 8px; }
.filters-body{ padding-top:12px; padding-bottom:12px; gap:14px; }
.filter-group h4{ margin-bottom:6px; }
.filter-check{ padding:4px 0; }
.filter-hint{ line-height:1.3; }
.price-slider-values{ margin-bottom:6px; }

/* Dept rail at a true end of its scroll: no blank padding / fade there, chips sit flush against ALL (class set by buildDeptBar in app.js). */
.dept-scroll.at-start{ -webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 40px),rgba(0,0,0,.85) calc(100% - 30px),rgba(0,0,0,.55) calc(100% - 20px),rgba(0,0,0,.22) calc(100% - 10px),rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 40px),rgba(0,0,0,.85) calc(100% - 30px),rgba(0,0,0,.55) calc(100% - 20px),rgba(0,0,0,.22) calc(100% - 10px),rgba(0,0,0,0) 100%); }
.dept-scroll.at-end{ -webkit-mask-image:linear-gradient(90deg,rgba(0,0,0,0) 0,rgba(0,0,0,.22) 10px,rgba(0,0,0,.55) 20px,rgba(0,0,0,.85) 30px,#000 40px,#000 100%);
  mask-image:linear-gradient(90deg,rgba(0,0,0,0) 0,rgba(0,0,0,.22) 10px,rgba(0,0,0,.55) 20px,rgba(0,0,0,.85) 30px,#000 40px,#000 100%); }
.dept-scroll.at-start.at-end{ -webkit-mask-image:none; mask-image:none; }
.dept-scroll .dept-track{ padding-left:10px; padding-right:0; }   /* 10px = the chips' own gap, so the first chip sits exactly one gap from ALL */   /* the fade is off at the ends, so no resting padding is needed (and toggling it would jump the chips) */

/* Docked bar: the left fade is short (it sits right beside ALL, so a 40px ramp read as an empty gap there). Placed after .at-start/.at-end so it wins. */
.dept-bar-docked .dept-scroll, .dept-bar-docked .dept-scroll.at-end{
  -webkit-mask-image:linear-gradient(90deg,rgba(0,0,0,0) 0,rgba(0,0,0,.5) 5px,#000 12px,#000 calc(100% - 40px),rgba(0,0,0,.85) calc(100% - 30px),rgba(0,0,0,.55) calc(100% - 20px),rgba(0,0,0,.22) calc(100% - 10px),rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(90deg,rgba(0,0,0,0) 0,rgba(0,0,0,.5) 5px,#000 12px,#000 calc(100% - 40px),rgba(0,0,0,.85) calc(100% - 30px),rgba(0,0,0,.55) calc(100% - 20px),rgba(0,0,0,.22) calc(100% - 10px),rgba(0,0,0,0) 100%); }
.dept-bar-docked .dept-scroll.at-start{ -webkit-mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 40px),rgba(0,0,0,.85) calc(100% - 30px),rgba(0,0,0,.55) calc(100% - 20px),rgba(0,0,0,.22) calc(100% - 10px),rgba(0,0,0,0) 100%);
  mask-image:linear-gradient(90deg,#000 0,#000 calc(100% - 40px),rgba(0,0,0,.85) calc(100% - 30px),rgba(0,0,0,.55) calc(100% - 20px),rgba(0,0,0,.22) calc(100% - 10px),rgba(0,0,0,0) 100%); }
.dept-bar-docked .dept-scroll.at-start.at-end{ -webkit-mask-image:none; mask-image:none; }

/* Normal shop view: with the gift-card banners hidden, the product chunks (8 cards each) used to end on a part-filled row. Same one-flow
   layout as the filters-open view, so cards pack every row; any appliance ad rows still span the full width between them. */
#grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:20px; align-items:stretch; }   /* stretch: cards in a row share one height, as inside the old chunks */
#grid > .grid{ display:contents; }
#grid > :not(.grid){ grid-column:1/-1; }
@media (max-width:640px){ #grid{ grid-template-columns:repeat(auto-fill,minmax(145px,1fr)); gap:12px; } }

/* Search open + scrolling back up to the main page: the bar eases into liquid glass instead of snapping, and the topbar's own X (which
   used to linger for its 1.7s open-delay while the bar's X was already showing) goes at once, so there is never a second X. */
.searchbar{ transition:width .8s cubic-bezier(.22,1,.36,1) .1s, opacity .45s ease .1s, background-color .6s ease, border-color .6s ease, box-shadow .6s ease; }
body.search-open .searchbar{ transition:width .85s cubic-bezier(.22,1,.36,1) .75s, opacity .45s ease .75s, background-color .6s ease, border-color .6s ease, box-shadow .6s ease; }
.searchbar::before{ content:""; position:absolute; left:6px; right:6px; top:1px; height:46%; border-radius:14px 14px 40% 40% / 14px 14px 10px 10px;
  background:linear-gradient(180deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.08) 70%, rgba(255,255,255,0) 100%); pointer-events:none; opacity:0; transition:opacity .6s ease; }
body:not(.topbar-hidden) .searchbar::before{ opacity:1; }
.searchbar .tsearch-input{ transition:color .5s ease; }
body.search-open:not(.topbar-hidden) .tsearch-close{ opacity:0; pointer-events:none; transition-delay:0s; transition-duration:.12s; }

/* Search bar glass is now driven by the same scroll value as the header's see-through→solid fade (--hdr-solid, wireHeaderSolid in app.js),
   so the bar turns glass / black in lock-step with the page instead of on a timer. --g = how glass it is (1 at the top, 0 once solid). */
body .searchbar.searchbar{
  --k:calc(var(--hdr-solid, 1) * var(--hdr-solid, 1) * var(--hdr-solid, 1));   /* cubed: stays glass through the middle of the fade, only turns solid as it finishes */
  --g:calc(1 - var(--k));
  background-color:color-mix(in srgb, var(--bg-alt) calc(var(--k) * 100%), rgba(255,255,255,.07));
  background-image:linear-gradient(135deg, rgba(255,255,255,calc(.22 * var(--g))) 0%, rgba(255,255,255,calc(.03 * var(--g))) 36%, rgba(255,255,255,0) 60%, rgba(255,255,255,calc(.10 * var(--g))) 100%);
  -webkit-backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12);
          backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12);
  border-color:color-mix(in srgb, var(--line-strong) calc(var(--k) * 100%), rgba(255,255,255,.30));
  box-shadow:
    var(--shadow-lg),
    inset 2px 2px 3px -1px rgba(255,255,255,calc(.85 * var(--g))),
    inset -2px -2px 3px -1px rgba(255,255,255,calc(.45 * var(--g))),
    inset 0 0 0 1px rgba(255,255,255,calc(.10 * var(--g))),
    inset 0 0 22px rgba(255,255,255,calc(.10 * var(--g)));
  transition:width .8s cubic-bezier(.22,1,.36,1) .1s, opacity .45s ease .1s;
}
body.search-open .searchbar.searchbar{ transition:width .85s cubic-bezier(.22,1,.36,1) .75s, opacity .45s ease .75s; }
body .searchbar::before, body:not(.topbar-hidden) .searchbar::before{ opacity:calc(1 - var(--hdr-solid, 1) * var(--hdr-solid, 1) * var(--hdr-solid, 1)); transition:none; }
.searchbar .tsearch-input{ transition:none; }

/* Filters open: the page behaves as if the main page didn't exist above the products. The products scroller keeps its scroll to itself
   (no chaining up to the page, so a topped-out swipe just stops: no bounce, no stored momentum). */
.page-shift.filters-open .panel-shop{ overscroll-behavior-y:contain; }

/* Search suggestions: (1) once the page is down in the products, the department bar sits under the header, so the list opens BELOW it instead
   of covering it (bar bottom = search bar bottom + ~46px, plus the usual 8px gap); (2) on the main page it is liquid glass like the bar, driven
   by the same scroll value (--hdr-solid) so it turns solid in step with the page. A flat frosted version of the lens: the SVG lens filter's
   edge band is sized for a short pill and would smear on a tall list. */
body.topbar-hidden .tsearch-suggest{ top:calc(100% + 54px); }
body .tsearch-suggest{
  --k:calc(var(--hdr-solid, 1) * var(--hdr-solid, 1) * var(--hdr-solid, 1));
  --g:calc(1 - var(--k));
  background-color:color-mix(in srgb, var(--bg-alt) calc(var(--k) * 100%), rgba(255,255,255,.07));
  background-image:linear-gradient(rgba(0,0,0,calc(.30 * var(--g))), rgba(0,0,0,calc(.30 * var(--g)))),
    linear-gradient(135deg, rgba(255,255,255,calc(.18 * var(--g))) 0%, rgba(255,255,255,calc(.03 * var(--g))) 36%, rgba(255,255,255,0) 60%, rgba(255,255,255,calc(.08 * var(--g))) 100%);
  -webkit-backdrop-filter:blur(22px) saturate(1.8) brightness(1.1);
          backdrop-filter:blur(22px) saturate(1.8) brightness(1.1);
  border-color:color-mix(in srgb, var(--line-strong) calc(var(--k) * 100%), rgba(255,255,255,.30));
  box-shadow:
    var(--shadow-lg),
    inset 2px 2px 3px -1px rgba(255,255,255,calc(.85 * var(--g))),
    inset -2px -2px 3px -1px rgba(255,255,255,calc(.45 * var(--g))),
    inset 0 0 0 1px rgba(255,255,255,calc(.10 * var(--g))),
    inset 0 0 22px rgba(255,255,255,calc(.08 * var(--g)));
}

/* Suggestions: the real lens (a copy of #kmLiquidGlass with rim bands sized for a roughly square panel) + the same glass recipe as the bar,
   and the list slides between its two resting places (right under the bar on main / under the dept bar in the shop) instead of jumping. */
body .tsearch-suggest{
  background-image:linear-gradient(rgba(0,0,0,calc(.16 * var(--g))), rgba(0,0,0,calc(.16 * var(--g)))),
    linear-gradient(135deg, rgba(255,255,255,calc(.22 * var(--g))) 0%, rgba(255,255,255,calc(.03 * var(--g))) 36%, rgba(255,255,255,0) 60%, rgba(255,255,255,calc(.10 * var(--g))) 100%);
  -webkit-backdrop-filter:url(#kmLiquidGlassPanel) blur(1.5px) saturate(1.9) brightness(1.12);
          backdrop-filter:url(#kmLiquidGlassPanel) blur(1.5px) saturate(1.9) brightness(1.12);
  transition:max-height .5s cubic-bezier(.22,1,.36,1), opacity .4s ease, top .6s cubic-bezier(.22,1,.36,1);
}

/* Search suggestions: a "View" label at the right of each row; hovering it shows the item's picture enlarged beside the list (.sg-peek, app.js). */
.sg-view{ flex:0 0 auto; margin-left:6px; padding:3px 9px; border-radius:11px; font-size:12px; font-weight:700; color:var(--muted); letter-spacing:.2px;
  border:1px solid transparent; transition:color .15s, border-color .15s, background .15s; }
.sg-item:hover .sg-view{ color:var(--ink); }
.sg-view:hover{ color:#000; background:#fff; }
.sg-peek{ position:fixed; z-index:400; width:280px; height:280px; border-radius:18px; overflow:hidden; pointer-events:none;
  background:#0c0c0c; border:1px solid rgba(255,255,255,.28); box-shadow:0 18px 44px rgba(0,0,0,.6), inset 0 0 0 1px rgba(255,255,255,.06);
  opacity:0; transform:scale(.92); transform-origin:left center; transition:opacity .16s ease, transform .22s cubic-bezier(.22,1,.36,1); }
.sg-peek.show{ opacity:1; transform:none; }
.sg-peek img{ width:100%; height:100%; object-fit:contain; display:block; background:#fff; }

/* Suggestions: edges line up with the search bar's outer edges (the list sat 3px inside it on each side), a quicker slide between the two
   resting places, and the View preview fills its frame and grows out of the View label. */
.tsearch-suggest{ left:-1px; width:calc(100% + 2px); }
body .tsearch-suggest{ transition:max-height .5s cubic-bezier(.22,1,.36,1), opacity .4s ease, top .3s cubic-bezier(.3,.7,.2,1); }
.sg-peek{ transform:scale(.4); transition:opacity .14s ease, transform .26s cubic-bezier(.22,1,.36,1); }
.sg-peek.show{ transform:none; }
.sg-peek img{ object-fit:cover; background:#0c0c0c; }

/* Suggestions position follows the page fade: it rests 10px under the bar on main and slides, in step with --hdr-solid (the same value that
   fades the header and the glass), to 58px under it in the shop, where its top edge is level with the tile row below the department bar.
   No timer: it moves exactly as far as the page has. */
body.topbar-hidden .tsearch-suggest, .tsearch-suggest{ top:calc(100% + 10px + var(--hdr-solid, 1) * 49px); }
body .tsearch-suggest{ transition:max-height .5s cubic-bezier(.22,1,.36,1), opacity .4s ease; }

/* The panel that comes up first (trending + common searches) opens exactly as tall as its content: no inner scrollbar. app.js measures it
   and writes --sg-h (showTrending/fitTrending). The cap below is only for a window too short to hold it, where it scrolls as a last resort.
   The list of typed-search results (no .is-trending) keeps its 360px cap and scrolls. Phones keep their own keyboard-aware cap (mobile.css). */
body.search-open .tsearch-suggest.has-results.is-trending{ max-height:min(var(--sg-h, 520px), calc(100dvh - 150px)); }

/* Cart: a popup in the middle of the screen (was a side drawer). Same markup / JS (#drawer, openDrawer/closeDrawer). */
#drawerScrim{ background:rgba(0,0,0,.6); }
#drawer{
  top:50%; left:50%; right:auto; height:auto; width:560px; max-width:94vw; max-height:84vh;
  border-radius:16px; border:1px solid var(--line-strong); box-shadow:0 30px 80px rgba(0,0,0,.7);
  transform:translate(-50%,-46%) scale(.96); opacity:0; visibility:hidden; pointer-events:none;
  transition:transform .3s cubic-bezier(.22,1,.36,1), opacity .22s ease, visibility 0s linear .3s;
}
#drawer.open{ transform:translate(-50%,-50%) scale(1); opacity:1; visibility:visible; pointer-events:auto; transition-delay:0s; }
#drawer .drawer-head{ border-radius:16px 16px 0 0; }
#drawer .drawer-body{ min-height:120px; }

/* Cart popup, bigger: wider and taller, with larger photos and type. */
#drawer{ width:820px; max-height:90vh; }
#drawer .drawer-head{ padding:20px 28px; }
#drawer .drawer-head h3{ font-size:21px; }
#drawer .drawer-body{ padding:8px 28px; }
#drawer .drawer-foot{ padding:20px 28px 24px; }
#drawer .di-row{ gap:20px; padding:18px 0; }
#drawer .di-img{ width:112px; height:112px; border-radius:10px; }
#drawer .di-name{ font-size:16px; margin-bottom:6px; }
#drawer .di-price{ font-size:14px; }
#drawer .di-actions{ margin-top:12px; gap:12px; }
#drawer .di-actions button{ width:32px; height:32px; font-size:17px; }
#drawer .di-actions span{ font-size:16px; min-width:22px; text-align:center; }
#drawer .dt-row{ font-size:16px; margin-bottom:10px; }
#drawer .dt-row.total{ font-size:20px; padding-top:14px; }
#drawer .dt-later{ color:var(--muted); font-size:14px; }
#drawer .btn-primary{ padding:15px; font-size:16px; }
#drawer .di-actions .di-remove{ width:auto; height:auto; font-size:14px; }

/* Popups: the page behind can't scroll (html.km-modal-open is set by wireModalScrollLock in app.js), and every popup backdrop has the
   same faint blur. */
/* html only: with overflow:hidden on BOTH html and body the body becomes its own scroller and the sticky header scrolls away with the page. */
html.km-modal-open{ overflow:hidden !important; overscroll-behavior:none; }
html.km-modal-open #panelShop{ overflow:hidden !important; }
.overlay:not([hidden]), #drawerScrim, .kml-overlay, .kmadm-gate, .adm-ask, .mk-scrim.on, .ie-root{
  -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
}

/* The mini bar is dead while it is tucked away (its buttons used to catch clicks aimed at the cart corner). */
body.topbar-hidden .topbar, body.topbar-hidden .topbar *{ pointer-events:none !important; }

/* Lighter header: while search is closed its pieces are invisible, so they should cost nothing. The glass lens / blur, the big shadow and the
   gloss layer are only switched on while the bar is open (or still closing), and the suggestion list's blur only while it has results. */
body:not(.search-open):not(.search-closing) .searchbar.searchbar{
  -webkit-backdrop-filter:none; backdrop-filter:none; box-shadow:none; background-image:none; visibility:hidden;
}
body:not(.search-open):not(.search-closing) .searchbar::before{ display:none; }
body .tsearch-suggest:not(.has-results){ -webkit-backdrop-filter:none; backdrop-filter:none; box-shadow:none; background-image:none; }

/* Layered art, mode "fit": the stage is exactly the slide, and each layer is a photo covering it (object-position keeps the subject in
   view on narrow screens). The scroll motion is the same as any other layered slide: paint() in app.js moves/stretches the layers. */
.dc-stage.is-fit{ position:absolute; inset:0; width:100%; height:100%; max-width:none; margin:0; transform:none; opacity:1; contain:none; }
.dc-stage.is-fit .dc-layer{ object-fit:cover; object-position:76% 50%; filter:none; }
@media (max-width:760px){ .dc-stage.is-fit{ right:0; left:0; max-width:none; opacity:1; height:100%; } .dc-stage.is-fit .dc-layer{ object-position:82% 50%; } }
/* A bright photo (snow) under white text: a soft shade behind the words (left) and under the header (top) keeps both readable. */
.dc-slide:is(:has(.dc-stage.is-fit), :has(.dc-stage.is-stack)) .dc-overlay{
  background:linear-gradient(90deg, rgba(8,10,18,.62) 0%, rgba(8,10,18,.38) 36%, rgba(8,10,18,0) 66%),
             linear-gradient(180deg, rgba(8,10,18,.5) 0%, rgba(8,10,18,0) 24%) !important;
}

/* Layered art, mode "stack": several pieces (the whole photo, then the subject, then its core) drawn on a 16:9 stage that always covers the
   slide, so the pieces stay lined up on every screen shape. Each moves by its own amount (see paint() in app.js), which gives the depth. */
.dc-stage.is-stack{ position:absolute; left:50%; top:50%; right:auto; bottom:auto; transform:translate(-50%,-50%); width:max(100%, calc(100dvh * 1.7778)); height:auto;
  aspect-ratio:16 / 9; max-width:none; margin:0; opacity:1; contain:none; }
.dc-stage.is-stack .dc-layer, .dc-stage.is-stack .dc-layer.is-front{ object-fit:fill; filter:none !important; }
@media (max-width:760px){ .dc-stage.is-stack{ right:auto; max-width:none; opacity:1; height:auto; } }

/* ===== CORNER GAP: SLIDESHOW ARROWS + LOGO =====
   One distance, --corner-gap (22px: 2px closer than the phone number's 24px from the right edge), used for the arrows:
   - the previous / next arrows sit in the bottom-left / bottom-right corners of the slideshow, --corner-gap in from the side, and 3px less than that up from the bottom;
   - (the logo's left gap used to follow this too; it now matches the ALL chip instead — see the rule below)
   The dots row is centred on the arrows' vertical centre. Last in the file on purpose: it overrides the mid-height / top-corner arrow rules above at every width.
   Narrow screens (520px and under) use 14px, the same 2px-closer step from the phone number's 16px there; the logo keeps its own padding
   below 861px. */
:root{ --corner-gap:22px; }
@media (max-width:520px){ :root{ --corner-gap:14px; } }
.dc-arrow{ top:auto; bottom:calc(var(--corner-gap) - 3px); transform:none; width:32px; height:32px; }   /* 3px lower than the side gap */
.dc-prev{ left:var(--corner-gap); }
.dc-next{ right:var(--corner-gap); }
/* The slide dots sit in a glass capsule (below), centred on the page and 2px lower than the arrows' vertical centre: the arrows' centre is
   their bottom + 16px (half of 32px) = corner-gap + 13px up; the capsule is 26px tall, so its centre (bottom + 13px) lands at corner-gap + 11px. */
.dc-dots{ left:50%; right:auto; width:max-content; transform:translateX(-50%); bottom:calc(var(--corner-gap) - 2px);
  height:26px; box-sizing:border-box; align-items:center; padding:0 13px; border-radius:13px; }
/* The logo (the cat's visible left edge) sits the same distance from the left border as the department bar's ALL chip: 24px (the shop's 40px
   page edge minus the bar's 16px pull-out). .sh-inner's left padding is that 24px plus 5.13px, the amount the cat is pulled out to the left
   of the padding (--cat-left, the lockup's 1.2x open-header scale, and the blank margin inside the cat's artwork) — measured with the header
   open at the top of the page. The logo keeps its own padding below 861px, where the bar's pull-out changes too. */
@media (min-width:861px){ .sh-inner{ padding-left:29.13px; } }

/* Liquid glass on the arrows and the dots capsule — the SAME recipe as the search bar (body:not(.topbar-hidden) .searchbar) and the lens on the phone
   number (.ph-glass): the page behind bent through the #kmLiquidGlass lens with a touch of blur and a saturation/brightness lift, a faint white tint
   with the 135deg sheen, a bright rim, hot top-left / softer bottom-right edge highlights, a gloss sheen over the upper half (::before) and a soft
   drop shadow. Listed in the is-swiping rule above, so the blur is off mid-swipe like every other blurred part. */
.dc-arrow, .dc-dots{
  background-color:rgba(255,255,255,.07);
  background-image:linear-gradient(135deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.03) 36%, rgba(255,255,255,0) 60%, rgba(255,255,255,.10) 100%);
  -webkit-backdrop-filter:blur(16px) saturate(1.8) brightness(1.1);
          backdrop-filter:blur(16px) saturate(1.8) brightness(1.1);
  -webkit-backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12);
          backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12);
  border:1px solid rgba(255,255,255,.30);
  box-shadow:
    inset 2px 2px 3px -1px rgba(255,255,255,.85),
    inset -2px -2px 3px -1px rgba(255,255,255,.45),
    inset 0 0 0 1px rgba(255,255,255,.10),
    inset 0 0 22px rgba(255,255,255,.10),
    0 1px 2px rgba(0,0,0,.18),
    0 6px 16px rgba(0,0,0,.28);
}
/* The old hover swapped the whole `background` (which would wipe the sheen): brighten the tint and the rim instead. */

@media (hover:hover){ .dc-arrow:hover{
  background-color:rgba(255,255,255,.16);
  background-image:linear-gradient(135deg, rgba(255,255,255,.22) 0%, rgba(255,255,255,.03) 36%, rgba(255,255,255,0) 60%, rgba(255,255,255,.10) 100%);
  border-color:rgba(255,255,255,.55);
} }
.dc-arrow::before, .dc-dots::before{
  content:""; position:absolute; left:5px; right:5px; top:1px; height:46%; pointer-events:none;
  border-radius:14px 14px 40% 40% / 14px 14px 10px 10px;
  background:linear-gradient(180deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,.08) 70%, rgba(255,255,255,0) 100%);
}
.dc-dots::before{ left:9px; right:9px; }
/* The dots capsule is the one piece that read as too glary, so it gets a calmer version of the same glass: the same lens and blur, but a fainter
   tint and rim, softer edge highlights and about a third of the gloss sheen. (The arrows keep the full recipe.) */
.dc-dots{
  background-image:linear-gradient(135deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.015) 36%, rgba(255,255,255,0) 60%, rgba(255,255,255,.05) 100%);
  border-color:rgba(255,255,255,.20);
  box-shadow:
    inset 2px 2px 3px -1px rgba(255,255,255,.34),
    inset -2px -2px 3px -1px rgba(255,255,255,.20),
    inset 0 0 0 1px rgba(255,255,255,.05),
    inset 0 0 14px rgba(255,255,255,.04),
    0 1px 2px rgba(0,0,0,.18),
    0 6px 16px rgba(0,0,0,.28);
}
.dc-dots::before{ opacity:.32; }
/* Still too much bend and glare over a bright picture (the dots vanished into it): the capsule now uses the gentle copy of the lens
   (#kmLiquidGlassSoft, about a fifth of the displacement), no brightness lift, and a faint smoky tint so the white dots always have something
   darker behind them; the dots get a hairline shadow of their own. */
.dc-dots{
  background-color:rgba(18,18,18,.22);
  -webkit-backdrop-filter:blur(8px) saturate(1.2);
          backdrop-filter:blur(8px) saturate(1.2);
  -webkit-backdrop-filter:url(#kmLiquidGlassSoft) blur(2.5px) saturate(1.25) brightness(.97);
          backdrop-filter:url(#kmLiquidGlassSoft) blur(2.5px) saturate(1.25) brightness(.97);
}
.dc-dots .dc-dot{ background:rgba(255,255,255,.62); box-shadow:0 0 0 .5px rgba(0,0,0,.22), 0 1px 2px rgba(0,0,0,.38); }
.dc-dots .dc-dot.active{ background:#fff; }
.dc-arrow svg, .dc-dot{ position:relative; }   /* painted above the gloss sheen */
/* Page change: the dots flow instead of snapping. The old pill shrinks back to a dot while the new one stretches out to a pill over the same
   ~.6s on one soft deceleration curve, so the capsule's total width never changes (its two widths always sum to the same) and nothing around it
   jumps; the fill fades along with it. Every dot has the transition (not just the active one), so it runs both ways, and a click mid-flow just
   re-aims it from wherever it is. */
.dc-dots .dc-dot{
  transition:width .6s cubic-bezier(.22,1,.36,1), border-radius .6s cubic-bezier(.22,1,.36,1), background-color .45s ease, transform .3s cubic-bezier(.22,1,.36,1);
  will-change:width;
}
.dc-dots .dc-dot.active{ border-radius:4px; }
@media (hover:hover){ .dc-dots .dc-dot:not(.active):hover{ background:rgba(255,255,255,.9); transform:scale(1.18); } }
.dc-dots .dc-dot:active{ transform:scale(.88); }
@media (prefers-reduced-motion:reduce){ .dc-dots .dc-dot{ transition:background-color .2s ease; } }
/* ===== END CORNER GAP =====

/* ===== SEARCH GLASS HOLDS UNTIL THE VERY END OF THE FADE =====
   Scrolling down from the main page turns the header from see-through to solid (--hdr-solid, 0 -> 1 over about 320px of scroll), and the search bar
   used to go flat and grey long before that: its glass amount (--k) rose as the CUBE of that value, so it was already a third of the way to solid
   by 70%, and its text dropped to the dull solid-state colours the moment the header started to tuck. Now --k stays at 0 (full liquid glass:
   the refracting lens, bright rim and gloss sheen, white text) until --hdr-solid reaches .72, then eases (smoothstep) to solid over the last
   28%, so the glass is still glass right up to where it turns to the solid dark bar. The suggestions list follows the same curve so the two
   turn solid together. */
body .searchbar.searchbar, body .tsearch-suggest{
  --c:clamp(0, calc((var(--hdr-solid, 1) - .72) / .28), 1);
  --k:calc(var(--c) * var(--c) * (3 - 2 * var(--c)));
}
body .searchbar::before, body:not(.topbar-hidden) .searchbar::before{ opacity:calc(1 - var(--k)); }
/* The text keeps its light glass colours through the fade and only then moves to the solid bar's. */
body .searchbar .tsearch-input{ color:color-mix(in srgb, var(--ink) calc(var(--k) * 100%), #fff); }
body .searchbar .tsearch-input::placeholder{ color:color-mix(in srgb, var(--muted) calc(var(--k) * 100%), rgba(255,255,255,.78)); }
/* ===== END SEARCH GLASS FADE ===== */

/* Blank department slots: shoppers read "Coming soon" in them; the admin keeps the "+" that opens the new-department form. */
.dept-chip-blank .dcb-soon{ display:none; }
body:not(.is-admin) .dept-chip-blank .dcb-plus{ display:none; }
body:not(.is-admin) .dept-chip-blank .dcb-soon{ display:inline; }
.dept-chip-blank{ white-space:nowrap; }

/* ===== PAGE BAR UNDER THE PRODUCT GRID =====
   The grid shows at most 40 products at a time; this is the way to the rest (see pagerHTML() in app.js). Black pills like the rest of the shop,
   the current page white. It spans the whole grid width (#grid > :not(.grid) above). */
.pager{ display:flex; flex-direction:column; align-items:center; gap:10px; padding:28px 0 12px; }
.pager-bar{ display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:8px; }
.pager-btn{
  min-width:44px; height:44px; padding:0 14px; border-radius:999px; cursor:pointer;
  background:#0d0d0d; color:#fff; border:1px solid rgba(255,255,255,.22);
  font:600 15px/1 inherit; font-family:inherit; font-variant-numeric:tabular-nums;
  display:inline-flex; align-items:center; justify-content:center;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.pager-btn:hover:not(:disabled):not(.is-current){ background:#1c1c1c; border-color:rgba(255,255,255,.5); }
.pager-btn.is-current{ background:#fff; color:#000; border-color:#fff; cursor:default; }
.pager-btn:disabled{ opacity:.35; cursor:default; }
.pager-step{ font-size:20px; padding:0 16px; }
.pager-gap{ color:rgba(255,255,255,.55); padding:0 2px; user-select:none; }
.pager-note{ font-size:13px; color:rgba(255,255,255,.6); }
html[data-theme="light"] .pager-btn{ background:#fff; color:#111; border-color:rgba(0,0,0,.2); }
html[data-theme="light"] .pager-btn.is-current{ background:#111; color:#fff; border-color:#111; }
html[data-theme="light"] .pager-note, html[data-theme="light"] .pager-gap{ color:rgba(0,0,0,.55); }
/* ===== END PAGE BAR ===== */

/* The selected department, lifted out of the rotating rail to sit right beside "All". */
.dept-chip-pinned{ flex:none; }
.dept-chip-all.is-away{ display:none; }   /* All steps aside while a department is selected; it is that department's place */

/* the picked department sits where All was, with an x to un-pick it */
.dept-chip-x{ margin-left:4px; font-size:9px; font-weight:800; opacity:.8; line-height:1; display:inline-flex; align-items:center; justify-content:center; height:8px; width:8px; }
.dept-chip-pinned:hover .dept-chip-x, .dept-chip-pinned:is(:active, .is-tapped) .dept-chip-x{ opacity:1; }

.cat-count{ align-self:center; font-size:13px; font-weight:800; color:var(--ink); margin-left:4px; white-space:nowrap; }
.dept-chip.dept-chip-pinned, .dept-chip.cat-chip.active{ padding-left:12px; padding-right:11px; }
.dept-chip.dept-chip-pinned, .dept-chip.cat-chip.active{ display:inline-flex; align-items:center; }
/* 'Clear all' beside the item count */
.cat-clear{ align-self:center; background:none; border:none; color:var(--muted); font:inherit; font-size:12.5px; font-weight:700; text-decoration:underline; cursor:pointer; padding:6px 4px; white-space:nowrap; }
@media (hover:hover){ .cat-clear:hover{ color:var(--ink); } }

/* Settings gear, hover: the gear fills in solid (its outline, minus the hub hole, eases from empty to the icon's colour) while it turns one full turn
   clockwise (iconfx.js wireGearSpin spins .gear-spin). The fill is its own path so the hub stays a real hole whatever is behind it. */
.settings-gear .gear-spin{ transform-origin:12px 12px; }
.settings-gear svg .gear-fill{ fill:currentColor; fill-opacity:0; stroke:none !important; transition:fill-opacity .4s ease; }
.settings-gear:hover svg .gear-fill{ fill-opacity:1; }
/* ...and the hub is INVERTED as the gear turns solid: before, a ring in the gear's colour round an empty centre; now the ring goes clear (showing whatever is behind the
   gear: the phone's black pill, the desktop's white sweep) and the centre fills in with the gear's colour. */
.settings-gear svg circle{ transition:stroke .4s ease; }
.settings-gear:hover svg circle{ stroke:transparent; }
.settings-gear svg .gear-dot{ fill:currentColor; fill-opacity:0; stroke:none !important; transition:fill-opacity .4s ease; }
.settings-gear:hover svg .gear-dot{ fill-opacity:1; }

/* The logo is inline SVG (index.html), not CSS masks: a mask is rasterised once at the box's size and then stretched when the header scales the logo up (1.2x when the
   header is open) or the screen is high-density, which made the edges jagged. An inline svg is redrawn from its curves at the size it is actually shown at. */
.logo-cat, .logo-name{ background:none; -webkit-mask-image:none; mask-image:none; overflow:visible; shape-rendering:geometricPrecision; }
.logo-cat{ position:static; }
/* Hovering the sphinx makes it smile: the plain cat is swapped for a copy with its eyes shut into happy ^ ^ arches (the mouth is unchanged). Swapped in one
   instant (a crossfade left both half see-through and the whole cat blinked). */
.logo-cat .lc-happy{ display:none; }
.logo-cat:hover .lc-plain{ display:none; }
.logo-cat:hover .lc-happy{ display:inline; }

/* Top bar: "‹ Services" sits just left of Customer Support. Its arrow points left; clicking slides the extra services out to the LEFT of the button
   inside the bar (no page), and the arrow turns round to point back in. */
.topbar-svc{ display:flex; align-items:center; }
.topbar-services{ display:inline-flex; align-items:center; gap:5px; }
.topbar-services .tsv-arrow{ transition:transform .3s cubic-bezier(.22,1,.36,1); }
.topbar-svc.open .topbar-services{ opacity:1; }
.topbar-svc.open .topbar-services .tsv-arrow{ transform:rotate(180deg); }
.tsv-items{ display:grid; grid-template-columns:0fr; opacity:0; transition:grid-template-columns .34s cubic-bezier(.22,1,.36,1), opacity .25s ease, margin .34s cubic-bezier(.22,1,.36,1); margin-right:0; }
.tsv-inner{ overflow:hidden; display:flex; align-items:center; gap:20px; white-space:nowrap; min-width:0; }
.topbar-svc.open .tsv-items{ grid-template-columns:1fr; opacity:1; margin-right:20px; }
.tsv-item{ flex:none; }
@media (max-width:700px){ .topbar-svc{ display:none; } }

/* Hidden listings: shoppers never get them; the admin sees them dimmed with a badge and an eye button to show them again. */
.card.is-hidden-listing .card-img img, .card.is-hidden-listing .card-body{ opacity:.5; }
.badge-hidden{ position:absolute; left:8px; top:8px; z-index:3; background:#111; color:#fff; font-size:10.5px; font-weight:800; letter-spacing:.3px; padding:3px 8px; border-radius:999px; border:1px solid rgba(255,255,255,.5); }
.card-hide:hover{ background:#fff; color:var(--brand-navy, #123); }
body:not(.is-admin) .badge-hidden{ display:none; }

/* ===== BOTTOM-RIGHT BUTTONS COME AND GO WITH THE FILTERS TAB (desktop, 2026-11-24) =====
   Deals, package and settings used to follow the header's tuck (body.topbar-hidden: the first 8px of scroll), so they appeared long before the
   Filters tab and left after it. They now follow the tab exactly, the way the phone layout already does (mobile.css): shown while the products
   are in view (app.js sets body.shop-in-view in the same call that shows the tab), gone when the tab goes (back at the top, a popup open, the
   Filters panel open), with the tab's own timing (.3s ease), mirrored: it fades out to the left, they fade out to the right. */
@media (min-width:601px){
  .side-rail-quick, #settingsRailBtn.settings-gear{
    opacity:0 !important; pointer-events:none !important; transform:translateX(12px) !important;
    transition:opacity .3s ease, transform .3s ease, background-color .25s ease, color .25s ease !important;
  }
  body.shop-in-view:not(.rail-quick-off):not(:has(.overlay:not([hidden]))):not(:has(.page-shift.filters-open)) .side-rail-quick,
  body.shop-in-view:not(.rail-quick-off):not(:has(.overlay:not([hidden]))):not(:has(.page-shift.filters-open)) #settingsRailBtn.settings-gear{
    opacity:1 !important; pointer-events:auto !important; transform:none !important;
  }
}
/* ===== END BOTTOM-RIGHT BUTTONS ===== */

/* ===== NO PULL-DOWN BOUNCE ON THE MAIN PAGE ONLY (2026-11-24) =====
   Swiping up on the main page stretched the whole page down and exposed a band above the slideshow. The document's elastic bounce is switched off
   WHILE THE MAIN PAGE IS SHOWING (body.at-shop is the products). At the products nothing changes: their bump stop at the top is the browser's
   normal bounce, which is why this must NOT be set on html/body unconditionally (tried: it killed that bump stop). */
html:has(body:not(.at-shop)){ overscroll-behavior-y:none; }
/* ===== END NO PULL-DOWN BOUNCE ===== */

/* ===== DARK MODE: THE HEADER'S FILL IS IN STEP WITH THE SLIDESHOW'S FADE (2026-11-24) =====
   Swiping from the main page to the products, the slideshow fades out over black (opacity 1 - 1.25p, paint() in app.js, which also writes
   --hdr-w = min(1, 1.25p) on the header). The slideshow BEHIND the header is faded too, so the header's own black fill (alpha --hdr-solid) went
   on top of an already-darkened strip: the header band came out darker than the hero below it and a line showed along its bottom edge. The fill
   now only comes in once the slideshow is gone (--hdr-w from .85 to 1), at the --hdr-solid level, so the two always meet seamlessly.
   (White mode does the same in theme-light.css.) */
html:not([data-theme="light"]) .header-wrap{
  background:rgba(0,0,0,calc(var(--hdr-solid, 1) * clamp(0, calc((var(--hdr-w, 1) - .85) / .15), 1)));
}
/* ===== END DARK HEADER IN STEP ===== */

/* ===== THE SLIDESHOW'S NEXT ARROW STEPS ASIDE FOR THE BOTTOM-RIGHT BUTTONS (2026-11-24) =====
   The slideshow's glass "next" arrow (bottom right, 32px) sits in the same corner as the Deals / orders / settings column, and overlaps its
   left padding by ~18px. While the swipe to the products runs, the slideshow is still half visible when the column fades in, so the arrow's
   glass circle showed through as a faint square point in the column's padding. The arrow fades out the moment the column is
   wanted (body.shop-in-view) and comes back with the slideshow. */
@media (min-width:601px){
  .dc-next{ transition:opacity .25s ease, background-color .2s ease, border-color .2s ease; }
  body.shop-in-view .dc-next{ opacity:0 !important; pointer-events:none; }
}

/* ===== MODALS OPEN IN THE MIDDLE OF WHAT THE FILTERS PANEL LEAVES FREE (2026-11-24) =====
   With the Filters panel open (desktop), the product popup (and the other modals) were centred on the WHOLE screen, so its left edge slid under the panel.
   The dimmed overlay now starts where the panel ends (--filters-w, set on <html> by app.js), so the popup is centred in the visible part of the page. */
@media (min-width:601px){
  html:has(.page-shift.filters-open) .overlay{ left:var(--filters-w, 0px); }
}

/* ===== THE OPEN SEARCH BAR STAYS ABOVE THE DOCKED DEPARTMENT BAR (2026-11-24) =====
   With the Filters panel open the department bar is docked right under the header, and its white strip starts about 2px above the search bar's bottom edge
   (the open bar is 30px tall at the top of the header). The bar's own z-index (30) is trapped inside the header row, which has a transform, so the dock (z-index 1)
   painted over the bottom 2px of the search bar and cut its outline. While the search is open the header is lifted above the dock. */
body.search-open .site-header{ z-index:2; }

/* ===== DARK MODE: CLEAR ALL AND THE CLOSE TAB ARE ONE BAR TOO (2026-11-24) =====
   Same as white mode (theme-light.css): Clear all runs to the panel's right edge where the close tab starts, its right edge/corners are open, and its outline runs into the tab's.
   - Nothing filtered: the outline is dim (white at 30%) and turns bright white only over its last stretch, next to the tab; label dim.
   - A filter on: the outline is plain white all the way and the label white, faded in over .4s (the dim is done with colours, not opacity, so the white end stays white).
   --cr-a is the outline's start colour (a registered colour, so it can transition; a gradient can't). The hover wipe (white from the left, label turns black) is kept as its own layer. */
@property --cr-d{ syntax:'<color>'; inherits:false; initial-value:rgba(255,255,255,.3); }
html:not([data-theme="light"]) .filters-foot{ padding-right:0; }
html:not([data-theme="light"]) .filters-foot #filtersReset{
  --cr-d:#ffffff;
  border:2px solid transparent; border-right-width:0; border-radius:8px 0 0 8px;
  background-color:transparent;
  background-image:
    linear-gradient(#ffffff, #ffffff),            /* hover wipe: plain white, as it always was (fades were tried and removed) */
    linear-gradient(#000000, #000000),            /* the black fill */
    linear-gradient(90deg,                        /* the outline */
      var(--cr-d) 0, var(--cr-d) calc(100% - 48px),
      color-mix(in srgb, #ffffff 15%, var(--cr-d)) calc(100% - 38px),
      color-mix(in srgb, #ffffff 50%, var(--cr-d)) calc(100% - 26px),
      color-mix(in srgb, #ffffff 85%, var(--cr-d)) calc(100% - 14px),
      #ffffff calc(100% - 4px));
  background-origin:padding-box, padding-box, border-box;
  background-clip:padding-box, padding-box, border-box;
  background-repeat:no-repeat; background-position:left center, 0 0, 0 0;
  background-size:0% 100%, 100% 100%, 100% 100%;
  opacity:1;
  transition:--cr-d .4s ease, background-size .6s cubic-bezier(.4,0,.2,1), color .4s ease;
}
html:not([data-theme="light"]) .filters-foot #filtersReset:not(:disabled):hover{ background-size:100% 100%, 100% 100%, 100% 100%; }
html:not([data-theme="light"]) .filters-foot #filtersReset:disabled{ --cr-d:rgba(255,255,255,.3); color:rgba(255,255,255,.4); }

/* ===== THEME SWITCH CROSSFADE (2026-11-24) =====
   theme.js fades the old look into the new one when Appearance changes. With the View Transitions API (class km-theme-vt while it runs) the
   page's snapshot dissolves over .8s; without it (km-theme-fade) every colour just transitions. No sun, no moon: white to black, black to white. */
html.km-theme-vt::view-transition-old(root),
html.km-theme-vt::view-transition-new(root){ animation-duration:.8s; animation-timing-function:cubic-bezier(.4,0,.2,1); }
html.km-theme-fade, html.km-theme-fade *, html.km-theme-fade *::before, html.km-theme-fade *::after{
  transition:background-color .8s ease, color .8s ease, border-color .8s ease, fill .8s ease, stroke .8s ease, box-shadow .8s ease !important;
}
/* ===== END THEME SWITCH CROSSFADE ===== */

/* ===== SIDEWAYS SWIPING (2026-11-24) =====
   The page itself never swipes sideways: no browser back/forward gesture, no rubber-band to the side. (Rails and carousels that scroll
   sideways keep their own overscroll-behavior-x:contain.) Product photos swipe instead: on the card (a strip of that product's photos,
   app.js wireCardSwipe) and in the popup (wireSwipe). */
html, body{ overscroll-behavior-x:none; }
.card-img{ touch-action:pan-y; -webkit-user-select:none; user-select:none; }
.card-swipe{ position:absolute; inset:0; overflow:hidden; pointer-events:none; }
.card-swipe-track{ display:flex; width:100%; height:100%; transition:transform .38s cubic-bezier(.22,1,.36,1); will-change:transform; }
.card-swipe-track > img{ flex:0 0 100%; width:100%; height:100%; object-fit:cover; }
/* ===== END SIDEWAYS SWIPING ===== */

/* ===== ADMIN: SELECT SEVERAL PRODUCTS + ✦ PHOTOSHOP (2026-11-25) ===== */
.card-sel{ display:none; position:absolute; left:8px; bottom:8px; z-index:4; width:26px; height:26px; padding:0; border-radius:50%; align-items:center; justify-content:center;
  border:2px solid rgba(255,255,255,.85); background:rgba(0,0,0,.45); color:transparent; cursor:pointer; transition:background .15s, color .15s, border-color .15s, transform .15s; }
body.is-admin .card-sel{ display:inline-flex; opacity:0; }
body.is-admin .card:hover .card-sel, body.is-admin .card-sel:focus-visible, body.is-admin.has-sel .card-sel{ opacity:1; }
.card-sel:hover{ transform:scale(1.08); }
.card.is-sel .card-sel{ opacity:1; background:#fcc419; border-color:#fcc419; color:#1b1405; }
.card.is-sel{ outline:2px solid #fcc419; outline-offset:-2px; }
.card-ps{ font-size:14px; }
#selBar{ position:fixed; z-index:140; bottom:18px; left:calc(50% + var(--filters-w, 0px) / 2); transform:translateX(-50%); display:flex; align-items:center; gap:6px; padding:8px 10px;
  border-radius:999px; background:rgba(18,18,20,.92); color:#fff; border:1px solid rgba(255,255,255,.16); box-shadow:0 10px 30px rgba(0,0,0,.45); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); max-width:calc(100vw - 24px); flex-wrap:wrap; justify-content:center; }
#selBar .sel-count{ font:700 13px/1 Inter, sans-serif; padding:0 8px 0 6px; white-space:nowrap; }
#selBar button{ font:600 13px/1 Inter, sans-serif; padding:8px 13px; border-radius:999px; border:1px solid rgba(255,255,255,.22); background:transparent; color:#fff; cursor:pointer; }
#selBar button:hover{ background:rgba(255,255,255,.14); }
#selBar button[data-sel-act="ps"]{ background:#fcc419; border-color:#fcc419; color:#1b1405; }
#selBar button[data-sel-act="ps"]:hover{ background:#f0aa00; }
#selBar button.is-danger{ border-color:rgba(255,120,120,.55); color:#ff9a9a; }
#selBar button.is-danger:hover{ background:rgba(255,90,90,.18); }
.ps-run .ps-run-box.psr-box{ width:min(1180px, calc(100vw - 24px)); max-height:calc(100vh - 24px); }
.psr-list{ width:100%; overflow:auto; display:flex; flex-direction:column; gap:12px; text-align:left; max-height:calc(100vh - 210px); }
.psr-row{ display:grid; grid-template-columns:auto 1fr auto; gap:8px 12px; align-items:center; padding:10px; border-radius:12px; background:rgba(255,255,255,.05); cursor:pointer; }
.psr-redo{ padding:7px 14px; border-radius:999px; border:1px solid rgba(255,255,255,.3); background:transparent; color:inherit; font:700 13px/1 Inter, sans-serif; cursor:pointer; }
.psr-redo:hover:not(:disabled){ background:rgba(255,255,255,.14); }
.psr-redo:disabled{ opacity:.5; cursor:progress; }
.psr-row.is-redoing .psr-new{ opacity:.35; }
.psr-big{ position:fixed; inset:0; z-index:100000; display:flex; align-items:center; justify-content:center; flex-direction:column; gap:10px; background:rgba(0,0,0,.88); cursor:zoom-out; }
.psr-big img{ max-width:94vw; max-height:90vh; object-fit:contain; border-radius:6px; background:#000; }
.psr-big.psr-w img{ background:#fff; }
.psr-big span{ color:#c9ccd3; font:500 12px/1 Inter, sans-serif; }
.psr-name{ font:600 13px/1.3 Inter, sans-serif; }
.psr-pics{ grid-column:1 / -1; display:flex; gap:12px; }
.psr-pics figure{ margin:0; flex:1 1 0; min-width:0; text-align:center; display:flex; flex-direction:column; gap:3px; justify-content:flex-end; }
.psr-pics img{ width:100%; aspect-ratio:1; max-height:min(560px, calc(100vh - 330px)); object-fit:contain; border-radius:8px; background:#000; cursor:zoom-in; }
.psr-pics .psr-w img{ background:#fff; }
.psr-pics figcaption{ font:600 12px/1.2 Inter, sans-serif; color:#aeb2ba; }
.psr-warn{ font:600 11.5px/1.3 Inter, sans-serif; font-style:normal; color:#ffb454; }
.psr-row.is-warn{ outline:1px solid rgba(255,180,84,.55); }
.psr-btns{ display:flex; gap:10px; margin-top:6px; }
.ps-run-ok{ padding:9px 20px; border-radius:999px; border:0; background:#fcc419; color:#1b1405; font:700 13px/1 Inter, sans-serif; cursor:pointer; }
.ps-run-ok:hover{ background:#f0aa00; }
@media (max-width:600px){ #selBar{ bottom:10px; border-radius:18px; } }
/* ===== END ADMIN SELECT ===== */

/* ===== ADMIN MODE SCROLLED SLOWLY (2026-11-25) =====
   Every admin button on a card (edit, hide, ✦, delete, flag, select: ~5 per card, ~400 on the page) carried the "liquid glass" lens
   (backdrop-filter with the SVG displacement filter) plus layered inset shadows and transitions. Measured on the live site: ~27 ms a frame
   while scrolling in admin mode against ~17 ms for a shopper; with the lens, the layered shadow and the transition off on these small buttons it is
   ~19 ms. The lens comes back on the one button the mouse is over. */
body.is-admin :is(.card-admin button, .card-sel, .tile-edit-btn, .tile-del-btn, .dept-chip-edit, .promo-tile-edit, .ad-edit, .deal-row-edit, .mk-flag){
  -webkit-backdrop-filter:none !important; backdrop-filter:none !important;
  box-shadow:0 1px 3px rgba(0,0,0,.4) !important; transition:none !important;
}
body.is-admin :is(.card-admin button, .card-sel, .tile-edit-btn, .tile-del-btn, .dept-chip-edit, .promo-tile-edit, .ad-edit, .deal-row-edit, .mk-flag):hover{
  -webkit-backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12) !important;
          backdrop-filter:url(#kmLiquidGlass) blur(1.5px) saturate(1.9) brightness(1.12) !important;
}
/* ===== END ADMIN MODE SCROLL SPEED ===== */
