/* Spire Discounts — the all-in-one deal place (all.html, brands.html).
   Sits on top of style.css: the cards, basket, popup and both themes come from there.
   Everything new is prefixed dh-. Colours use the site's tokens so dark/light both work;
   the hero is always dark, like the store's. */

/* ---------- the browse row that replaced the shop tabs ---------- */
.dh-nav-wrap { position: relative; border-top: 1px solid var(--line); background: var(--bg-elev); }
html.theme-light .dh-nav-wrap { background: #fff; border-top-color: rgba(20,15,30,.07); }
.dh-nav { display: flex; align-items: center; gap: .25rem; padding: .45rem 0; overflow-x: auto; scrollbar-width: none; }
.dh-nav::-webkit-scrollbar { display: none; }
.dh-link {
  flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .48rem .85rem; border-radius: 999px;
  font: 600 .9rem/1 Inter, sans-serif; color: var(--ink); background: none; border: 0; cursor: pointer; white-space: nowrap;
  transition: background .15s ease;
}
@media (hover: hover) and (pointer: fine) { .dh-link:hover { background: var(--accent-soft); } }
.dh-link.on { background: var(--ink); color: var(--bg); }
/* an OPEN dropdown is not the selected view — soft, so only one tab ever reads as "you are here" */
.dh-drop[aria-expanded="true"] { background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.dh-drop.on[aria-expanded="true"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.dh-link, .dh-seg button, .dh-chip, .dh-pitem, .dh-cat, .dh-brand, .dh-tile, .dh-more { -webkit-tap-highlight-color: transparent; }
.dh-link:active, .dh-seg button:active, .dh-chip:active { transform: scale(.96); }
.dh-link:focus-visible, .dh-seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dh-drop span { font-size: .7em; opacity: .7; }
.dh-nav-note { margin-left: auto; flex: none; padding-left: 1rem; font: 500 .8rem Inter, sans-serif; color: var(--muted); white-space: nowrap; }
@media (max-width: 900px) { .dh-nav-note { display: none; } }

.dh-panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 60; background: var(--bg-elev);
  border-top: 1px solid var(--line); box-shadow: 0 24px 50px rgba(0,0,0,.18); animation: dhDrop .18s ease both;
}
html.theme-light .dh-panel { background: #fff; }
@keyframes dhDrop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dh-panel-in { padding: 1rem 0 1.2rem; max-height: min(70vh, 560px); overflow: auto; overscroll-behavior: contain; }
/* the phone sheet's head (tabs + ✕) and its dim — desktop has neither */
.dh-sheet-head, .dh-scrim { display: none; }
.dh-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .35rem; }
.dh-pitem { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 12px; color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .dh-pitem:hover { background: var(--accent-soft); } }
.dh-pitem b { display: block; font: 600 .92rem/1.2 Inter, sans-serif; }
.dh-pitem small { color: var(--muted); font-size: .78rem; }
.dh-pemo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: #fff; flex: none; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(20,15,30,.08); }
.dh-pemo img { width: 100%; height: 100%; object-fit: contain; padding: 8%; }
.dh-pitem .dh-mk { width: 40px; height: 40px; }
html.theme-light .dh-pemo { background: #f3f1f6; }
.dh-pall { border: 1px dashed var(--line); }

/* ---------- brand marks: real logo for the shops we have one for, else a monogram ---------- */
.dh-mk {
  --t: #334155; flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--t); color: #fff; font: 800 .58rem/1 Sora, sans-serif; letter-spacing: .02em;
}
.dh-mk.big { width: 64px; height: 64px; font-size: 1.15rem; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.dh-mk-img { position: relative; background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(20,15,30,.08); }
/* absolute, so the % sizes resolve against the circle whatever style.css says about .shop-ico */
.dh-mk-img .shop-ico { position: absolute; inset: 0; margin: auto !important; height: 62% !important; width: auto !important; vertical-align: 0; }
.dh-mk-img .shop-ico.si-amazon { height: 100% !important; width: 100% !important; border-radius: 0 !important; object-fit: cover; }
.dh-mk-logo { background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(20,15,30,.1); }
.dh-mk-logo img { width: 100%; height: 100%; object-fit: contain; padding: 16%; }
.dh-mk-logo.big { box-shadow: 0 6px 18px rgba(0,0,0,.14), inset 0 0 0 1px rgba(20,15,30,.08); }
.deal-mark.dm-logo .dh-mk-logo img { padding: 8%; }
.dh-mk-photo { background: #fff; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(20,15,30,.1); }
.dh-mk-photo img { width: 100%; height: 100%; object-fit: contain; padding: 12%; }
.dh-mk-photo.big { box-shadow: 0 6px 18px rgba(0,0,0,.14), inset 0 0 0 1px rgba(20,15,30,.08); }
.dh-mk-quad { background: #fff; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1px; box-shadow: inset 0 0 0 1px rgba(20,15,30,.1); }
.dh-mk-quad img { width: 100%; height: 100%; object-fit: contain; padding: 14%; background: #fff; }
.deal-mark.dm-logo .dh-mk { width: 22px; height: 22px; box-shadow: none; }
.deal-mark.dm-logo .dh-mk-img { background: transparent; }

/* ---------- hero ---------- */
.dh-hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(900px 420px at 82% 30%, rgba(255,122,24,.26), transparent 60%),
              radial-gradient(600px 380px at 8% 110%, rgba(232,57,26,.22), transparent 60%), #0b0b0f;
}
body.is-xmas .dh-hero::before {
  /* a light snowfall — dots only, no movement, so it never fights the photos */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 90px 80px, #fff 50%, transparent 51%),
                    radial-gradient(2.5px 2.5px at 150px 40px, rgba(255,255,255,.8) 50%, transparent 51%), radial-gradient(1.5px 1.5px at 60px 140px, #fff 50%, transparent 51%);
  background-size: 180px 170px;
}
.dh-hero-in { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 3rem; align-items: center; padding: 3.2rem 0 3.4rem; }
.dh-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font: 600 .82rem Inter, sans-serif; color: #fff; }
.dh-hero h1 { color: #fff; font: 800 clamp(2.4rem, 5.2vw, 4.1rem)/1.02 Sora, sans-serif; letter-spacing: -.035em; margin: 1rem 0 .9rem; }
.dh-hero h1 span { background: var(--grad-flame); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dh-hero p { color: #c8c6d4; font-size: 1.06rem; max-width: 34rem; }
.dh-cta { display: flex; align-items: center; gap: 1.3rem; margin: 1.6rem 0 1.8rem; flex-wrap: wrap; }
.dh-go { padding: .95rem 1.6rem; border-radius: 999px; }
.dh-ghost { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.dh-stats { display: flex; gap: 2.2rem; list-style: none; }
.dh-stats b { display: block; font: 800 1.7rem/1 Sora, sans-serif; color: #fff; }
.dh-stats span { font-size: .8rem; color: #8a879a; }

.dh-collage { display: grid; grid-template-columns: 1.25fr 1fr 1fr; grid-template-rows: 1fr 1fr; gap: .8rem; height: 430px; }
.dh-tile {
  position: relative; border: 0; padding: 0; cursor: pointer; border-radius: 20px; overflow: hidden; background: #fff;
  box-shadow: 0 18px 40px rgba(0,0,0,.35); transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
@media (hover: hover) and (pointer: fine) { .dh-tile:hover { transform: translateY(-4px) rotate(-.4deg); } }
.dh-tile img { width: 100%; height: 100%; object-fit: contain; padding: 10%; }
.dh-tile.big { grid-row: 1 / 3; }
.dh-tile:nth-child(4) { grid-column: 2 / 4; }
.dh-tile-off { position: absolute; top: 0; left: 0; padding: .32rem .7rem; border-radius: 0 0 14px 0; background: linear-gradient(135deg, #ff4d4d, #d40000); color: #fff; font: 800 .9rem Sora, sans-serif; }
.dh-tile.big .dh-tile-off { font-size: 1.15rem; padding: .45rem .9rem; }
.dh-tile-p { position: absolute; left: .6rem; bottom: .6rem; padding: .32rem .65rem; border-radius: 999px; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.16); color: #18141f; font: 800 .92rem Sora, sans-serif; display: flex; gap: .35rem; align-items: baseline; }
.dh-tile-p s { font: 500 .72rem Inter, sans-serif; color: #8a879a; }
.dh-tile.big .dh-tile-p { font-size: 1.15rem; }
.dh-tile-from { position: absolute; right: .6rem; bottom: .6rem; }
.dh-tile-from .dh-mk { width: 28px; height: 28px; font-size: .66rem; box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.dh-sk { display: block; border-radius: 20px; background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.12), rgba(255,255,255,.06)); background-size: 200% 100%; animation: dhSk 1.3s linear infinite; }
.dh-collage .dh-sk:first-child { grid-row: 1 / 3; }
.dh-collage .dh-sk:nth-child(4) { grid-column: 2 / 4; }
@keyframes dhSk { to { background-position: -200% 0; } }

/* ---------- sections ---------- */
.dh-main { padding-bottom: 3rem; }
.dh-sec { padding-top: 2.4rem; }
.dh-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.dh-sec-head h2, .dh-feed-head h2 { font: 800 clamp(1.35rem, 2.6vw, 1.75rem)/1.15 Sora, sans-serif; letter-spacing: -.02em; }
.dh-more { background: none; border: 0; cursor: pointer; font: 700 .9rem Inter, sans-serif; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* categories: photo tiles, the best-cut deal in each shelf on show */
.dh-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: .8rem; }
.dh-cat { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--bg-elev); border: 1px solid var(--line); transition: transform .2s ease, box-shadow .2s ease; }
html.theme-light .dh-cat { background: #fff; border-color: rgba(20,15,30,.07); }
@media (hover: hover) and (pointer: fine) { .dh-cat:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(20,15,30,.1); } }
.dh-cat.on { outline: 2px solid var(--ink); }
.dh-cat-img { position: relative; aspect-ratio: 4 / 3; background: #fff; display: block; }
.dh-cat-img img { width: 100%; height: 100%; object-fit: contain; padding: 12%; }
.dh-cat-emo { position: absolute; left: .55rem; top: .55rem; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.92); box-shadow: 0 3px 10px rgba(0,0,0,.1); font-size: 1.1rem; }
.dh-cat-txt { padding: .7rem .8rem .8rem; }
.dh-cat-txt b { display: block; font: 700 .95rem/1.25 Sora, sans-serif; color: var(--ink); }
.dh-cat-txt small { color: var(--muted); font-size: .78rem; }
.dh-cat-txt small i, .dh-cat-txt small em { font-style: normal; }
.dh-chip-store { text-decoration: none; background: var(--ink) !important; color: var(--bg) !important; border-color: transparent; }
.dh-sk-cat { height: 190px; background-color: var(--bg-elev-2); border-radius: 18px; }
html.theme-light .dh-sk-cat { background-image: linear-gradient(90deg, #eeecf2, #f7f6fa, #eeecf2); background-size: 200% 100%; }

/* brands row: big round marks, scrolls sideways */
.dh-brands { display: flex; gap: .9rem; overflow-x: auto; padding: .3rem .1rem 1rem; scrollbar-width: thin; scroll-snap-type: x proximity; }
.dh-brand { flex: none; width: 112px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .45rem; scroll-snap-align: start; color: var(--ink); }
.dh-brand b { font: 700 .86rem/1.2 Inter, sans-serif; }
.dh-brand small { color: var(--muted); font-size: .74rem; margin-top: -.3rem; }
.dh-brand .dh-mk.big { transition: transform .2s ease; }
@media (hover: hover) and (pointer: fine) { .dh-brand:hover .dh-mk.big { transform: scale(1.06); } }

/* ---------- the feed ---------- */
.dh-feed { scroll-margin-top: 1rem; }
.dh-feed-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.dh-crumb { font: 500 .82rem Inter, sans-serif; color: var(--muted); margin-bottom: .2rem; }
.dh-crumb a { color: var(--ink); font-weight: 600; }
.dh-count { color: var(--muted); font-size: .88rem; margin-top: .15rem; }
.dh-active { display: flex; gap: .4rem; flex-wrap: wrap; }
.dh-chip { border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink); border-radius: 999px; padding: .4rem .75rem; font: 600 .82rem Inter, sans-serif; cursor: pointer; }
html.theme-light .dh-chip { background: #fff; }
.dh-chip span { opacity: .55; margin-left: .2rem; }
.dh-chip-all { border-style: dashed; }
.dh-tools { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.dh-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-elev-2); gap: 2px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
html.theme-light .dh-seg { background: #ecebf0; }
.dh-seg button { flex: none; border: 0; background: none; padding: .45rem .85rem; border-radius: 999px; font: 600 .84rem Inter, sans-serif; color: var(--muted); cursor: pointer; white-space: nowrap; }
.dh-seg button.on { background: var(--bg-elev); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
html.theme-light .dh-seg button.on { background: #fff; }
.dh-out { text-align: center; text-decoration: none; display: block; box-sizing: border-box; }
.dh-disclose { font-size: .8rem; color: var(--muted); margin-bottom: .6rem; max-width: 52rem; }

/* ---------- brands.html ---------- */
.dh-bhero { padding: 2.4rem 0 1.4rem; }
.dh-bhero h1 { font: 800 clamp(2rem, 4.6vw, 3rem)/1.05 Sora, sans-serif; letter-spacing: -.03em; margin: .3rem 0 .4rem; }
.dh-bsub { color: var(--muted); }
.dh-bsearch { margin: 1.2rem 0 .9rem; max-width: 440px; }
.dh-bsearch input { width: 100%; padding: .85rem 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-elev); color: var(--ink); font: 500 1rem Inter, sans-serif; }
html.theme-light .dh-bsearch input { background: #fff; }
.dh-letters { display: flex; flex-wrap: wrap; gap: .25rem; }
.dh-letters a, .dh-letters span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; font: 700 .8rem Sora, sans-serif; }
.dh-letters a { color: var(--ink); background: var(--bg-elev); border: 1px solid var(--line); }
html.theme-light .dh-letters a { background: #fff; }
@media (hover: hover) and (pointer: fine) { .dh-letters a:hover { background: var(--ink); color: var(--bg); } }
.dh-letters span { color: var(--muted); opacity: .45; }
.dh-bmain { padding-bottom: 3rem; }
.dh-shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.dh-shop { border-radius: 20px; overflow: hidden; background: var(--bg-elev); border: 1px solid var(--line); transition: transform .2s ease, box-shadow .2s ease; }
html.theme-light .dh-shop { background: #fff; border-color: rgba(20,15,30,.07); }
@media (hover: hover) and (pointer: fine) { .dh-shop:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(20,15,30,.12); } }
.dh-shop-img { display: block; aspect-ratio: 16 / 9; background: #fff; }
.dh-shop-img img { width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.dh-shop-row { display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem; }
.dh-shop-row .dh-mk.big { width: 48px; height: 48px; margin-top: -2.2rem; border: 3px solid var(--bg-elev); }
html.theme-light .dh-shop-row .dh-mk.big { border-color: #fff; }
.dh-shop-row b { display: block; font: 700 1.02rem Sora, sans-serif; color: var(--ink); }
.dh-shop-row small { color: var(--muted); font-size: .8rem; }
.dh-shop-row i { margin-left: auto; font-style: normal; font-weight: 700; color: var(--ink); }
.dh-az { padding: 1rem 0 .4rem; scroll-margin-top: 1rem; }
.dh-az h3 { font: 800 1.3rem Sora, sans-serif; padding-bottom: .5rem; margin-bottom: .6rem; border-bottom: 1px solid var(--line); }
.dh-azgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .4rem; }
.dh-azb { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: 12px; color: var(--ink); }
@media (hover: hover) and (pointer: fine) { .dh-azb:hover { background: var(--accent-soft); } }
.dh-azb .dh-mk { width: 42px; height: 42px; }
.dh-azb b { display: block; font: 600 .92rem/1.2 Inter, sans-serif; }
.dh-azb small { color: var(--muted); font-size: .76rem; }

/* ---------- phones ---------- */
@media (max-width: 860px) {
  .dh-hero-in { grid-template-columns: 1fr; gap: 1.6rem; padding: 1.8rem 0 2rem; }
  .dh-collage { height: 300px; }
  .dh-stats { gap: 1.4rem; }
  .dh-stats b { font-size: 1.35rem; }
}
@media (max-width: 560px) {
  .dh-hero h1 { margin-top: .8rem; }
  .dh-hero p { font-size: .96rem; }
  .dh-cta { margin: 1.2rem 0 1.3rem; }
  .dh-collage { height: 250px; gap: .5rem; grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr 1fr; }
  .dh-tile:nth-child(3) { display: none; }
  .dh-tile:nth-child(4), .dh-collage .dh-sk:nth-child(4) { grid-column: auto; }
  .dh-collage .dh-sk:nth-child(3) { display: none; }
  .dh-tile { border-radius: 16px; }
  .dh-sec { padding-top: 1.8rem; }
  .dh-cats { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 42%; grid-template-rows: auto auto; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: .4rem; scrollbar-width: none; }
  .dh-cats::-webkit-scrollbar { display: none; }
  .dh-cat { scroll-snap-align: start; }
  .dh-cat-txt { padding: .55rem .65rem .65rem; }
  .dh-cat-txt b { font-size: .86rem; }
  .dh-cat-txt small { display: block; line-height: 1.35; }
  .dh-cat-txt small i { display: none; }
  .dh-cat-txt small em { display: block; }
  .dh-brand { width: 86px; }
  .dh-brand .dh-mk.big { width: 56px; height: 56px; }
  .dh-tools { flex-wrap: nowrap; flex-direction: column; gap: .45rem; }
  .dh-seg { align-self: flex-start; }
  .dh-pgrid { grid-template-columns: 1fr 1fr; }
  .dh-pitem { padding: .5rem; gap: .5rem; }
  .dh-pemo, .dh-pitem .dh-mk { width: 34px; height: 34px; }
  .dh-shops { grid-template-columns: 1fr; }
  .dh-azgrid { grid-template-columns: 1fr 1fr; }
}

/* ---------- phones: Categories / Brands open as a bottom sheet ----------
   Fixed to the bottom edge over a dimmed page (all.js). Tap the dim, press ✕, swipe the
   sheet down or go Back to close. It fills down into the home-indicator strip itself. */
@media (max-width: 700px) {
  .dh-scrim {
    display: block; position: fixed; inset: 0; z-index: 59; background: rgba(8,6,12,.5);
    opacity: 0; pointer-events: none; transition: opacity .25s ease; touch-action: none;
  }
  .dh-scrim.show { opacity: 1; pointer-events: auto; }
  .dh-panel {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 61;
    display: flex; flex-direction: column; max-height: min(82dvh, 82vh);
    border-top: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -18px 50px rgba(0,0,0,.3);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    animation: dhSheetIn .34s cubic-bezier(.32,.72,0,1);   /* no fill: a drag's inline transform must win */
    will-change: transform;
  }
  .dh-panel.is-closing { transform: translate3d(0,100%,0); transition: transform .22s cubic-bezier(.4,0,1,1); }
  .dh-panel::before {
    content: ""; position: absolute; top: .5rem; left: 50%; width: 40px; height: 4px; margin-left: -20px;
    border-radius: 4px; background: var(--line); opacity: .9;
  }
  html.theme-light .dh-panel::before { background: #d6d3de; }
  .dh-sheet-head { display: flex; align-items: center; gap: .6rem; padding: 1.25rem 1rem .6rem; flex: none; touch-action: none; }
  .dh-sheet-tabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--bg-elev-2); }
  html.theme-light .dh-sheet-tabs { background: #ecebf0; }
  .dh-sheet-tabs button {
    border: 0; background: none; padding: .55rem 1rem; border-radius: 999px; cursor: pointer;
    font: 600 .9rem Inter, sans-serif; color: var(--muted); -webkit-tap-highlight-color: transparent;
  }
  .dh-sheet-tabs button.on { background: var(--bg-elev); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
  html.theme-light .dh-sheet-tabs button.on { background: #fff; }
  .dh-sheet-x {
    margin-left: auto; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--bg-elev-2); color: var(--ink); font-size: 1rem; display: grid; place-items: center;
    -webkit-tap-highlight-color: transparent;
  }
  html.theme-light .dh-sheet-x { background: #ecebf0; }
  .dh-panel > .dh-panel-in {
    width: auto; margin: 0; padding: .2rem 1rem 1.1rem; flex: 1 1 auto; min-height: 0;
    max-height: none; overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .dh-pitem { min-height: 52px; }
  /* the row scrolls sideways: fade its right edge so it reads as "more this way" */
  .dh-nav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); padding-right: 28px; scroll-padding-inline: 16px; }
  .dh-link { padding: .55rem .9rem; }
  .dh-seg { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent); padding-right: 24px; }
}
@keyframes dhSheetIn { from { transform: translate3d(0,100%,0); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .dh-panel, .dh-panel.is-closing { animation: none; transition: none; }
}
/* landscape phones: short screen — the sheet takes more of it */
@media (max-width: 700px) and (max-height: 500px) { .dh-panel { max-height: 92dvh; } }
@media (min-width: 701px) and (max-height: 500px) { .dh-panel-in { max-height: calc(100dvh - 140px); } }

/* phones: the popup sheet must not rubber-band when you pull it down — the pull is the
   dismiss gesture (all.js) */
@media (max-width: 700px) { #productModal .modal-box { overscroll-behavior-y: none; } }

/* =====================================================================
   "All deals" browse view (body.is-browse) — filters + results
   ===================================================================== */
.dh-side, .dh-filterbtn, .dh-side-scrim { display: none; }
.dh-morefilters { align-self: center; font: 700 .86rem Inter, sans-serif; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
body.is-browse .dh-morefilters, body.is-browse .dh-seg-price { display: none; }
body.is-browse .dh-feed { padding-top: 1.4rem; }
.no-results { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.no-results p { margin-bottom: .8rem; }

/* the panel itself — same markup as a column or a sheet */
.dh-side { flex-direction: column; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 20px; }
html.theme-light .dh-side { background: #fff; border-color: rgba(20,15,30,.08); }
.dh-side-head { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.1rem .4rem; }
.dh-side-head b { font: 800 1.05rem Sora, sans-serif; color: var(--ink); margin-right: auto; }
.dh-side-clear { background: none; border: 0; cursor: pointer; font: 600 .82rem Inter, sans-serif; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.dh-side-x, .dh-side-foot { display: none; }
.dh-side-body { padding: .2rem 1.1rem 1.1rem; }
.dh-fsec { padding: .85rem 0; border-top: 1px solid var(--line); }
html.theme-light .dh-fsec { border-top-color: rgba(20,15,30,.07); }
.dh-fsec:first-child { border-top: 0; padding-top: .3rem; }
.dh-fsec h4 { font: 700 .78rem Inter, sans-serif; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .5rem; }
.dh-fsearch { display: flex; align-items: center; gap: .5rem; padding: 0 .85rem; border-radius: 12px; background: var(--bg-elev-2); border: 1px solid transparent; }
html.theme-light .dh-fsearch { background: #f2f1f6; }
.dh-fsearch:focus-within { border-color: var(--ink); }
.dh-fsearch input { flex: 1; min-width: 0; border: 0; background: none; outline: none; padding: .7rem 0; font: 500 16px Inter, sans-serif; color: var(--ink); }  /* 16px: no iPhone zoom */
.dh-fsearch-sm { margin-bottom: .45rem; }
.dh-fsearch-sm input { padding: .55rem 0; }
.dh-fico { width: 16px; height: 16px; flex: none; background: currentColor; color: var(--muted); -webkit-mask: var(--ico-search) center / contain no-repeat; mask: var(--ico-search) center / contain no-repeat; }
.dh-opts { display: flex; flex-direction: column; gap: 1px; }
.dh-opt {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; min-height: 38px;
  padding: .4rem .55rem; border: 0; border-radius: 10px; background: none; cursor: pointer; text-align: left;
  font: 500 .9rem Inter, sans-serif; color: var(--ink); -webkit-tap-highlight-color: transparent;
}
.dh-opt-l { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.dh-opt-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-opt .dh-mk { width: 24px; height: 24px; }
.dh-opt-n { flex: none; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.dh-opt.on { background: var(--ink); color: var(--bg); font-weight: 700; }
.dh-opt.on .dh-opt-n { color: inherit; opacity: .7; }
@media (hover: hover) and (pointer: fine) { .dh-opt:not(.on):hover { background: var(--accent-soft); } }
.dh-optmore { margin-top: .2rem; align-self: flex-start; background: none; border: 0; cursor: pointer; padding: .35rem .55rem; font: 700 .84rem Inter, sans-serif; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.dh-fnone { font-size: .84rem; color: var(--muted); padding: .3rem .55rem; }
.dh-pills { display: flex; flex-wrap: wrap; gap: .4rem; }
.dh-pill { border: 1px solid var(--line); background: none; color: var(--ink); border-radius: 999px; padding: .45rem .8rem; font: 600 .84rem Inter, sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent; }
html.theme-light .dh-pill { border-color: rgba(20,15,30,.12); }
.dh-pill.on { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* desktop: filters down the left, results on the right */
@media (min-width: 960px) {
  body.is-browse .dh-browse { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 1.8rem; align-items: start; }
  body.is-browse .dh-side { display: flex; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: hidden; }
  body.is-browse .dh-side-body { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
  body.is-browse .product-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1240px) { body.is-browse .product-grid { grid-template-columns: repeat(4, 1fr); } }

/* phones + tablets: a Filters button, and the panel is a bottom sheet */
@media (max-width: 959px) {
  body.is-browse .dh-filterbtn {
    display: inline-flex; align-items: center; gap: .45rem; flex: none; padding: .5rem .95rem; border-radius: 999px;
    border: 1px solid var(--ink); background: var(--ink); color: var(--bg); font: 700 .86rem Inter, sans-serif; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .dh-fbico { width: 15px; height: 15px; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 7h16M7 12h10M10 17h4'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M4 7h16M7 12h10M10 17h4'/%3E%3C/svg%3E") center / contain no-repeat; }
  .dh-fbn { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--grad-flame); color: #fff; font: 800 .72rem/20px Inter, sans-serif; text-align: center; }
  body.is-browse .dh-tools { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: .5rem; }
  body.is-browse .dh-tools .dh-seg { flex: 1 1 auto; min-width: 0; }

  .dh-side-scrim { display: block; position: fixed; inset: 0; z-index: 120; background: rgba(8,6,12,.5); opacity: 0; pointer-events: none; transition: opacity .25s ease; touch-action: none; }
  .dh-side-scrim.show { opacity: 1; pointer-events: auto; }
  .dh-side {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 121; max-height: min(88dvh, 88vh);
    border-radius: 22px 22px 0 0; border: 0; box-shadow: 0 -18px 50px rgba(0,0,0,.3);
    transform: translate3d(0,100%,0); visibility: hidden;
    transition: transform .26s cubic-bezier(.4,0,1,1), visibility 0s linear .26s;
  }
  .dh-side.open { transform: none; visibility: visible; transition: transform .34s cubic-bezier(.32,.72,0,1); }
  .dh-side::before { content: ""; position: absolute; top: .5rem; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
  html.theme-light .dh-side::before { background: #d6d3de; }
  .dh-side-head { padding: 1.3rem 1rem .5rem; flex: none; touch-action: none; }
  .dh-side-x { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; background: var(--bg-elev-2); color: var(--ink); font-size: .95rem; -webkit-tap-highlight-color: transparent; }
  html.theme-light .dh-side-x { background: #ecebf0; }
  .dh-side-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 1rem .6rem; }
  .dh-side-foot { display: block; flex: none; padding: .7rem 1rem calc(.8rem + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); }
  html.theme-light .dh-side-foot { border-top-color: rgba(20,15,30,.07); }
  .dh-side-foot .btn-primary { width: 100%; padding: .95rem 1rem; border-radius: 14px; font-size: 1rem; }
  .dh-opt { min-height: 44px; }
  .dh-pill { padding: .55rem .9rem; }
  /* category + shop lists as two columns on the sheet, so it isn't a mile long */
  #fCat, #fShop { display: grid; grid-template-columns: 1fr 1fr; gap: 2px .4rem; }
  #fCat .dh-optmore, #fShop .dh-optmore { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) { .dh-side, .dh-side.open { transition: none; } }
