/* FNF — Mobile brand tokens
   White background, navy ink, electric-blue accent (matched to the fnf MOBILE logo)
*/

:root {
  --bg: #FFFFFF;
  --surface: #F5F8FC;
  --surface-2: #FFFFFF;
  --surface-sunk: #E9F1FB;
  --ink: #0B1E40;
  --ink-2: #33446A;
  --muted: #5A6B88;
  --muted-2: #93A1BA;
  --line: #E2E8F2;
  --line-soft: #EEF3F9;
  /* --clay* = primary brand blue (token names kept; values rebranded) */
  --clay: #0A66C2;
  --clay-deep: #074C95;
  --clay-soft: #BBD8F7;
  --clay-tint: #E7F1FC;
  /* electric/azure highlight from the logo's centre glow */
  --azure: #00A6E6;
  --navy: #0A1F5C;
  /* --sage* = success / secondary (e.g. free-delivery banner) */
  --sage: #1F9D78;
  --sage-soft: #A8DEC9;
  --sage-tint: #E2F5EE;
  --gold: #E0A52E;
  --rose: #D86A6A;
  --ok: #1F9D78;
  --shadow-sm: 0 1px 2px rgba(10,31,92,0.05), 0 2px 6px rgba(10,31,92,0.05);
  --shadow-md: 0 4px 14px rgba(10,31,92,0.08), 0 12px 32px rgba(10,31,92,0.07);
  --shadow-lg: 0 12px 28px rgba(10,31,92,0.12), 0 30px 60px rgba(10,31,92,0.12);
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;
}

[data-theme="dark"] {
  --bg: #0A1124;
  --surface: #111A33;
  --surface-2: #18233F;
  --surface-sunk: #0A1024;
  --ink: #EAF1FB;
  --ink-2: #BFCDE3;
  --muted: #8A9AB8;
  --muted-2: #5C6B86;
  --line: #21304F;
  --line-soft: #1A2740;
  --clay: #3D9BEA;
  --clay-deep: #0A66C2;
  --clay-soft: #15315A;
  --clay-tint: #122544;
  --azure: #2FC0F5;
  --navy: #0A1F5C;
  --sage: #44C79E;
  --sage-soft: #1B3F33;
  --sage-tint: #122C24;
  --gold: #E8BE5E;
  --rose: #E08A8A;
  --ok: #44C79E;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.40), 0 2px 6px rgba(0,0,0,0.30);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.45), 0 12px 32px rgba(0,0,0,0.30);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.50), 0 30px 60px rgba(0,0,0,0.40);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  font-family: 'Manrope', -apple-system, system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

/* Mobile iOS-frame preview gets its own dark surround */
.page-wrap {
  background:
    radial-gradient(ellipse at top, #0A2A66 0%, #0A1F5C 55%, #060F2E 100%) !important;
}

/* Desktop wrap — full bleed, just shows the app */
.desktop-wrap {
  background: var(--bg);
  overflow-x: clip;
  max-width: 100vw;
}

/* ───────────────────────────────────────────────────────────
   Responsive — desktop layout collapses for small viewports
   The desktop app gets a mobile-app-style bottom tab bar
   ─────────────────────────────────────────────────────────── */
.show-md-up { display: flex; }
.show-md-down { display: none; }

/* Hide-only utilities — don't force display, just toggle visibility */
.desktop-only { /* default: inherit display */ }
.mobile-only { display: none !important; }

@media (max-width: 900px) {
  .show-md-up { display: none !important; }
  .show-md-down { display: flex !important; }
  .desktop-only { display: none !important; }
  .mobile-only { display: revert !important; }

  /* Push content above the bottom nav */
  .desktop-wrap { padding-bottom: 80px; }

  /* Container paddings shrink */
  .dt-pad-x { padding-left: 16px !important; padding-right: 16px !important; }

  /* Generic grid collapse — used by hero/listings/etc */
  .dt-grid-2 { grid-template-columns: 1fr !important; }
  .dt-grid-3 { grid-template-columns: 1fr 1fr !important; }
  .dt-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .dt-grid-7 { grid-template-columns: repeat(3, 1fr) !important; }

  /* Hero / display type scale-down */
  .display-xxl { font-size: 38px !important; }
  .display-xl { font-size: 32px !important; }
  .display-lg { font-size: 26px !important; }
}

@media (max-width: 560px) {
  .dt-grid-3 { grid-template-columns: 1fr !important; }
  .dt-grid-4 { grid-template-columns: 1fr 1fr !important; }
  .dt-grid-7 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Brand row → swipeable horizontal scroller on mobile.
     display:flex needs !important to beat the inline display:grid. */
  .brand-scroll {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .brand-scroll::-webkit-scrollbar { display: none; }
  .brand-scroll > button {
    flex: 0 0 auto;
    width: 46%;
    scroll-snap-align: start;
  }
}

/* Bottom nav (responsive desktop) */
.rt-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-top: 1px solid var(--line);
}

/* Responsive type scale */
@media (max-width: 720px) {
  /* Reduce display-class headings */
  .display { font-size: 90%; }
  /* Reduce padding-x on common section paddings — selectors match the rendered DOM (no apostrophes around values) */
  .desktop-wrap [style*="padding: 32px 32px"] { padding-left: 16px !important; padding-right: 16px !important; }
  .desktop-wrap [style*="padding: 64px 32px"] { padding-left: 16px !important; padding-right: 16px !important; padding-top: 40px !important; }
  .desktop-wrap [style*="padding: 60px 32px"] { padding-left: 16px !important; padding-right: 16px !important; padding-top: 40px !important; }
  .desktop-wrap [style*="padding: 24px 32px"] { padding-left: 16px !important; padding-right: 16px !important; }
  .desktop-wrap [style*="padding: 0px 32px"],
  .desktop-wrap [style*="padding: 0 32px"] { padding-left: 16px !important; padding-right: 16px !important; }
  .desktop-wrap [style*="padding: 40px 32px"] { padding-left: 16px !important; padding-right: 16px !important; }

  /* Reduce announcement bar / hero giants */
  h1.display { font-size: clamp(28px, 8vw, 44px) !important; }
  h2.display { font-size: clamp(22px, 6vw, 32px) !important; }

  /* Hero stats row — let it wrap so things don't get cropped */
  .dt-hero-stats { gap: 16px 20px !important; margin-top: 24px !important; }
  .dt-hero-stats > div { white-space: nowrap; }

  /* Hero card collapses padding at narrow widths */
  .dt-hero { padding: 28px 20px !important; min-height: auto !important; }

  /* Account order row — collapse the 5-col grid to a 2x2 with chevron at top-right */
  .dt-order-row {
    grid-template-columns: 1fr auto !important;
    grid-template-areas:
      "id     chev"
      "items  items"
      "status total" !important;
    gap: 10px !important;
  }
  .dt-order-row > *:nth-child(1) { grid-area: id; min-width: 0; }
  .dt-order-row > *:nth-child(2) { grid-area: items; min-width: 0; flex-wrap: wrap; }
  .dt-order-row > *:nth-child(3) { grid-area: status; min-width: 0; }
  .dt-order-row > *:nth-child(4) { grid-area: total; min-width: 0; }
  .dt-order-row > *:nth-child(5) { grid-area: chev; }

  /* Cart row — collapse the 5-col grid: product + trash on top, price/qty/total below */
  .dt-cart-head { display: none !important; }
  .dt-cart-row {
    grid-template-columns: 1fr auto 1fr !important;
    grid-template-areas:
      "prod  prod del"
      "price qty  total" !important;
    gap: 14px 12px !important;
    padding: 16px !important;
    align-items: center !important;
  }
  .dt-cart-row > *:nth-child(1) { grid-area: prod; min-width: 0; }
  .dt-cart-row > *:nth-child(2) { grid-area: price; text-align: left !important; }
  .dt-cart-row > *:nth-child(3) { grid-area: qty; justify-self: center; }
  .dt-cart-row > *:nth-child(4) { grid-area: total; }
  .dt-cart-row > *:nth-child(5) { grid-area: del; justify-self: end; }
  /* Label the two prices so unit price vs line total isn't ambiguous on mobile */
  .dt-cart-row > *:nth-child(2)::before,
  .dt-cart-row > *:nth-child(4)::before {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 4px;
  }
  .dt-cart-row > *:nth-child(2)::before { content: "Price"; }
  .dt-cart-row > *:nth-child(4)::before { content: "Total"; }
}

/* Page chrome */
.page-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px 80px;
  background:
    radial-gradient(ellipse at top, #0A2A66 0%, #0A1F5C 55%, #060F2E 100%);
  background-attachment: fixed;
}

/* App-internal layout — fills inside iOS frame children area */
.app-root {
  position: absolute;
  inset: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Manrope', -apple-system, system-ui, sans-serif;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.screen-scroll::-webkit-scrollbar { display: none; }

/* Type */
.display {
  font-family: 'Manrope', -apple-system, system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.serif { font-family: 'Manrope', -apple-system, system-ui, sans-serif; font-weight: 700; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.tabular { font-variant-numeric: tabular-nums; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, box-shadow 200ms ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: #000; }
[data-theme="dark"] .btn-primary { background: var(--ink); color: var(--surface-sunk); }

.btn-clay {
  background: var(--clay);
  color: #fff;
  box-shadow: 0 6px 14px -4px rgba(10,102,194,0.45);
}
.btn-clay:hover { background: var(--clay-deep); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--line-soft); }

.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* Cards */
.card {
  background: var(--surface);
  color: var(--ink);                 /* own its text colour so it stays legible on any (e.g. dark) parent */
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* Segmented toggle (theme Light/Dark, etc.). Active option inverts to --ink so it's clearly
   the selected one in both light and dark themes. JS sets aria-pressed. */
.seg-toggle {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-sunk);
  padding: 4px;
  border-radius: 999px;
}
.seg-opt {
  padding: 8px 18px;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  background: transparent;
  color: var(--muted);
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
.seg-opt:hover { color: var(--ink); }
.seg-opt[aria-pressed="true"] {
  background: var(--ink);
  color: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* Flash-deal banner: copy + countdown on the left, a horizontal product scroller on the right.
   The scroller (.hslider) holds any number of deal products; .deal-slide fixes each card's width. */
.deal-banner { display: grid; grid-template-columns: 1fr 2.2fr; gap: 28px; align-items: center; }
.deal-slide { flex: 0 0 248px; scroll-snap-align: start; }
@media (max-width: 900px) { .deal-banner { grid-template-columns: 1fr; gap: 22px; } }
@media (max-width: 560px) { .deal-slide { flex: 0 0 80%; } }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 120ms ease;
  white-space: nowrap;
}
.chip:hover { border-color: var(--ink); }
.chip-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.chip-clay-active {
  background: var(--clay);
  color: #fff;
  border-color: var(--clay);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge-clay { background: var(--clay); color: #fff; }
.badge-sage { background: var(--sage); color: #fff; }
.badge-ink  { background: var(--ink); color: var(--bg); }
.badge-soft { background: var(--clay-tint); color: var(--clay-deep); }
.badge-outline { border: 1px solid var(--line); color: var(--ink-2); background: transparent; }

/* Inputs */
.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color 120ms ease, background 120ms ease;
  outline: none;
}
[data-theme="dark"] .input { background: var(--surface-2); }
.input::placeholder { color: var(--muted); }
.input:focus { border-color: var(--ink); }

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Product silhouette gradient — universal placeholder */
.prod-bg {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  isolation: isolate;
}
.prod-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255,255,255,0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 90%, rgba(0,0,0,0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* Hairlines */
.hr {
  height: 1px;
  background: var(--line);
  border: none;
  margin: 0;
}

/* Skeleton shimmer */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--line-soft) 0%, var(--surface) 50%, var(--line-soft) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: 8px;
}

/* Toasts */
@keyframes toast-in {
  from { transform: translate(-50%, 12px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.toast {
  animation: toast-in 240ms cubic-bezier(.2,.9,.3,1.2);
}

/* Page transitions — transform-only so a stalled animation
   never hides content (verifier-safe + screenshot-safe) */
@keyframes fade-up {
  from { transform: translateY(8px); }
  to   { transform: translateY(0); }
}
.fade-up { animation: fade-up 320ms cubic-bezier(.2,.7,.3,1) both; }

/* Value-prop / feature cards — white card, interactive hover */
.feature-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), box-shadow 240ms ease, border-color 240ms ease;
}
.feature-item:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--clay-soft); }
.feature-ic {
  transition: transform 300ms cubic-bezier(.2,.8,.2,1), background 220ms ease, color 220ms ease;
}
.feature-item:hover .feature-ic {
  background: var(--clay);
  color: #fff;
  transform: scale(1.1);
}

/* Popular categories — bento grid */
.cat-bento {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  grid-template-rows: 248px 248px;
  grid-template-areas: "a b b" "a c d";
  gap: 16px;
}
.cat-tile {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: 22px;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 260ms cubic-bezier(.2,.8,.2,1), box-shadow 260ms ease;
}
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.cat-tile-ic {
  position: absolute;
  right: -8px; bottom: -18px;
  color: rgba(255,255,255,0.14);
  transition: transform 420ms cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.cat-tile:hover .cat-tile-ic { transform: scale(1.14) translate(-8px, -8px); }
@media (max-width: 720px) {
  .cat-bento {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 220px 200px 200px;
    grid-template-areas: "a a" "b b" "c d";
  }
}
@media (max-width: 480px) {
  .cat-bento {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 170px);
    grid-template-areas: "a" "b" "c" "d";
  }
}

/* Brand-logo marquee — JS-driven (assets/js/main.js): renders ONE set from the data, then clones
   enough copies to cover the screen and animates at a constant speed, so it scales to any number of
   brands added in the CMS with no end-gap. Pauses on hover/focus. Falls back to a static row if JS is off. */
.brand-marquee {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}
.brand-marquee-track {
  display: flex;
  align-items: center;
  width: max-content;
  padding: 14px 0;
  will-change: transform;
}
/* No card chrome — just the logo. Fixed slot + right margin gives even spacing. */
.brand-logo {
  flex: 0 0 auto;
  width: 172px;
  height: 64px;
  margin-right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  transition: transform 200ms ease;
}
.brand-logo:hover { transform: scale(1.06); }
.brand-logo img { max-height: 34px; max-width: 124px; width: auto; height: auto; object-fit: contain; display: block; }
.brand-logo span { font-weight: 800; font-size: 16px; letter-spacing: -0.03em; white-space: nowrap; } /* fallback when a brand has no logo */
@media (max-width: 560px) {
  .brand-logo { width: 138px; height: 56px; margin-right: 14px; padding: 0 12px; }
  .brand-logo img { max-height: 28px; max-width: 100px; }
}

/* Testimonials — auto-scrolling card marquee with faded edges */
.testi-marquee {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent);
}
.testi-track {
  display: flex;
  gap: 20px;
  width: max-content;
  padding: 6px 32px;
  animation: testi-marquee 60s linear infinite;
}
.testi-marquee:hover .testi-track { animation-play-state: paused; }
.testi-card {
  flex-shrink: 0;
  width: 360px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
@keyframes testi-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (max-width: 560px) {
  .testi-card { width: 280px; padding: 20px; }
}

/* Manual horizontal slider (drag / arrow controls, snap) */
.hslider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
}
.hslider::-webkit-scrollbar { display: none; }
.hslide {
  flex: 0 0 340px;
  scroll-snap-align: start;
}
.hslider-btn {
  width: 42px; height: 42px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}
.hslider-btn:hover { background: var(--clay); color: #fff; transform: translateY(-1px); }

/* Image cards inside a slider (e.g. About → reasons) */
.reason-card {
  transition: transform 240ms cubic-bezier(.2,.8,.2,1), box-shadow 240ms ease, border-color 240ms ease;
}
.reason-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--clay-soft); }
.reason-card img { transition: transform 400ms cubic-bezier(.2,.8,.2,1); filter: brightness(0.9) saturate(0.95); }
.reason-card:hover img { transform: scale(1.05); }

@media (max-width: 560px) {
  .hslide { flex: 0 0 82%; }
}

@keyframes slide-in-r {
  from { transform: translateX(20px); }
  to   { transform: translateX(0); }
}
.slide-in-r { animation: slide-in-r 280ms cubic-bezier(.2,.7,.3,1) both; }

@keyframes slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.slide-up { animation: slide-up 320ms cubic-bezier(.2,.8,.2,1) both; }

@keyframes sd-slide-r {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
@keyframes sd-slide-l {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

/* Generic phone silhouette */
.phone-silo {
  position: relative;
  z-index: 2;
  width: 38%;
  aspect-ratio: 9 / 19;
  border-radius: 14% / 6.5%;
  background: linear-gradient(160deg, rgba(255,255,255,0.10) 0%, rgba(0,0,0,0.20) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.12),
    inset 0 0 30px rgba(0,0,0,0.25),
    0 20px 40px -10px rgba(0,0,0,0.45);
}
.phone-silo::after {
  content: '';
  position: absolute;
  top: 6%; left: 50%;
  transform: translateX(-50%);
  width: 36%; height: 4%;
  border-radius: 999px;
  background: rgba(0,0,0,0.45);
}

/* Tap highlight */
button, [role="button"] { -webkit-tap-highlight-color: transparent; }

/* ───────────────────────────────────────────────────────────
   Mobile breakpoints — phones up to ~480px and small phones ~380px
   These apply on top of the 900/720/560 breakpoints above.
   ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  /* All horizontal section paddings collapse to 12px */
  .dt-pad-x { padding-left: 12px !important; padding-right: 12px !important; }
  .desktop-wrap [style*="padding: 32px 32px"],
  .desktop-wrap [style*="padding: 64px 32px"],
  .desktop-wrap [style*="padding: 60px 32px"],
  .desktop-wrap [style*="padding: 24px 32px"],
  .desktop-wrap [style*="padding: 40px 32px"],
  .desktop-wrap [style*="padding: 0px 32px"],
  .desktop-wrap [style*="padding: 0 32px"] {
    padding-left: 12px !important; padding-right: 12px !important;
  }

  /* All multi-column grids collapse to 1 col */
  .dt-grid-2,
  .dt-grid-3,
  .dt-grid-4 { grid-template-columns: 1fr !important; }
  .dt-grid-7 { grid-template-columns: repeat(2, 1fr) !important; }

  /* Hero card — even tighter padding, smaller min-height */
  .dt-hero { padding: 20px 16px !important; }
  .dt-hero h1.display { font-size: clamp(24px, 7vw, 36px) !important; }

  /* Display type scale-down */
  .display-xxl { font-size: 30px !important; }
  .display-xl { font-size: 26px !important; }
  .display-lg { font-size: 22px !important; }
  h1.display { font-size: clamp(24px, 7vw, 36px) !important; }
  h2.display { font-size: clamp(20px, 5.5vw, 28px) !important; }

  /* Bottom nav: tighter spacing for 5 items on narrow widths */
  .rt-bottom-nav { padding-left: 6px; padding-right: 6px; }

  /* Buttons keep min tap target of 44px height even when fontSize shrinks */
  .btn { min-height: 44px; }
}

@media (max-width: 380px) {
  /* iPhone SE / small Android — squeeze further */
  .dt-pad-x { padding-left: 10px !important; padding-right: 10px !important; }
  .desktop-wrap [style*="padding"] {
    /* Don't let any inline section padding exceed 10px on x */
    padding-left: 10px !important; padding-right: 10px !important;
  }

  .dt-grid-7 { grid-template-columns: 1fr 1fr !important; }
  .dt-hero { padding: 16px 12px !important; }

  h1.display { font-size: clamp(20px, 7vw, 30px) !important; }
}

/* Prevent any descendant with explicit large min-width from overflowing on mobile */
@media (max-width: 480px) {
  .desktop-wrap img,
  .desktop-wrap svg,
  .desktop-wrap video { max-width: 100%; height: auto; }

  /* Grid/flex children default to min-content min-width which can force parent overflow.
     Allow them to shrink so long text/buttons don't push past the viewport. */
  .desktop-wrap [style*="display: grid"] > *,
  .desktop-wrap [style*="display: flex"] > * { min-width: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   PHP port additions — utilities used by the server-rendered pages.
   (Everything above is the verbatim prototype stylesheet.)
   ═══════════════════════════════════════════════════════════════ */

/* Section horizontal padding (replaces the prototype's inline-string hack) */
.sec-x { padding-left: 32px !important; padding-right: 32px !important; }
@media (max-width: 900px) { .sec-x { padding-left: 24px !important; padding-right: 24px !important; } }
@media (max-width: 720px) { .sec-x { padding-left: 16px !important; padding-right: 16px !important; } }
@media (max-width: 480px) { .sec-x { padding-left: 12px !important; padding-right: 12px !important; } }
@media (max-width: 380px) { .sec-x { padding-left: 10px !important; padding-right: 10px !important; } }

/* Content-aligned bleed slider: first card lines up with the 1180 content column
   (matching .sec-x gutters), cards bleed off the right edge to invite scrolling.
   50% - 558px = (100% - 1180px)/2 + 32px gutter. */
.hslider-bleed { padding-left: max(32px, calc(50% - 558px)); padding-right: 32px; scroll-padding-left: max(32px, calc(50% - 558px)); }
@media (max-width: 900px) { .hslider-bleed { padding-left: 24px; padding-right: 24px; scroll-padding-left: 24px; } }
@media (max-width: 720px) { .hslider-bleed { padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; } }
@media (max-width: 480px) { .hslider-bleed { padding-left: 12px; padding-right: 12px; scroll-padding-left: 12px; } }
@media (max-width: 380px) { .hslider-bleed { padding-left: 10px; padding-right: 10px; scroll-padding-left: 10px; } }

/* Uploadable hero banner slide — wide on desktop, tall on mobile (matches the
   show-md-up / show-md-down 900px breakpoint and the recommended image sizes). */
.hero-banner { position: relative; display: block; height: 100vh; overflow: hidden; background: var(--clay-tint); }
@supports (height: 100dvh) { .hero-banner { height: 100dvh; } }

/* ── Top bar: solid sticky by default; transparent overlay → scroll-to-pill on hero pages ── */
.topbar { position: sticky; top: 0; z-index: 50; }
.topbar-bar {
  display: flex; align-items: center; gap: 28px; padding: 6px 32px; position: relative; z-index: 2;
  transition: background .35s cubic-bezier(.4,0,.2,1), box-shadow .35s ease, border-radius .35s ease,
              top .35s cubic-bezier(.4,0,.2,1), left .35s cubic-bezier(.4,0,.2,1), right .35s cubic-bezier(.4,0,.2,1);
}
.topbar:not(.topbar-hero) .topbar-bar {
  background: linear-gradient(90deg, color-mix(in srgb, var(--clay) 8%, var(--bg)) 0%, color-mix(in srgb, var(--clay) 12%, var(--bg)) 50%, color-mix(in srgb, var(--clay) 18%, var(--bg)) 100%);
  box-shadow: var(--shadow-sm);
}

/* Hero page: nav overlays the banner, transparent with a legibility scrim, white text + logo */
.topbar-hero { position: relative; --nav-fg: #fff; }
.topbar-hero .topbar-bar {
  position: fixed; left: 0; right: 0; top: 0;
  background: transparent;
}
/* Full-width scrim behind the nav. It's independent of the bar so it never shrinks,
   and it crossfades out on scroll, so the docking pill has no moving side/edge lines. */
.topbar-scrim {
  position: fixed; top: 0; left: 0; right: 0; height: 150px;
  background: linear-gradient(to bottom, rgba(8,14,28,0.78) 0%, rgba(8,14,28,0.32) 38%, rgba(8,14,28,0) 100%);
  pointer-events: none; z-index: 0; opacity: 1; transition: opacity .35s ease;
}
.topbar-hero.is-scrolled .topbar-scrim { opacity: 0; }
.topbar-hero .topbar-logo { filter: brightness(0) invert(1); transition: filter .25s ease; }

/* Scrolled: solid, squeezed, rounded floating bar with ink text */
.topbar-hero.is-scrolled { --nav-fg: var(--ink); }
.topbar-hero.is-scrolled .topbar-bar {
  top: 12px;
  left: max(16px, calc((100% - 1180px) / 2));
  right: max(16px, calc((100% - 1180px) / 2));
  background: var(--surface-2); box-shadow: var(--shadow-md); border-radius: 18px;
}
.topbar-hero.is-scrolled .topbar-logo { filter: none; }
@media (max-width: 900px) {
  .topbar-hero.is-scrolled .topbar-bar { top: 8px; left: 10px; right: 10px; border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) { .topbar-bar { transition: none; } }

/* Links / inline text actions */
a { color: inherit; text-decoration: none; }
.link-accent { color: var(--clay); font-weight: 700; cursor: pointer; }
.unstyled-btn { background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }

/* Categories mega menu (JS toggles .open; also opens on hover for pointer devices) */
.mega { display: none; }
.mega.open { display: grid; }
.has-mega:hover .mega { display: grid; }
/* Bridge across the 8px gap so hover survives the trip from button to panel */
.mega::before { content: ''; position: absolute; left: 0; right: 0; top: -10px; height: 12px; }
/* Dropdown links: highlight on hover (no default-active item) */
.mega-link { padding: 8px 10px; margin: 0 -10px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink); display: flex; align-items: center; gap: 8px; transition: background 120ms ease, color 120ms ease; }
.mega-link:hover { background: var(--surface-sunk); color: var(--clay); }

/* Mobile slide-in drawer */
.drawer-overlay { position: fixed; inset: 0; z-index: 200; background: rgba(8,20,48,0.45); animation: fade-up 200ms ease; }
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 201; width: min(82vw, 360px); background: var(--bg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow-y: auto; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.drawer.right { left: auto; right: 0; width: min(86vw, 380px); box-shadow: -12px 0 28px rgba(10,31,92,0.18); }
body.no-scroll { overflow: hidden; }

/* Tabs / switchable panels (product detail, account, checkout) */
.tabpanel { display: none; }
.tabpanel.active { display: block; }
.fnf-tab { padding: 14px 22px; background: none; border: none; cursor: pointer; font: inherit; font-size: 16px; letter-spacing: -0.01em; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.fnf-tab.active { font-weight: 800; color: var(--clay); border-bottom-color: var(--clay); }

/* Product option tiles — colour swatches + storage */
.swatch { width: 52px; height: 52px; border-radius: 999px; padding: 0; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line); transition: transform 100ms ease; }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(0,0,0,0.12); transform: scale(1.06); }
.stor-tile { padding: 18px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; }
.stor-tile.active { border: 2px solid var(--ink); background: var(--surface-2); }
/* Product gallery: sticky beside the info on desktop, normal flow on mobile (no overlap) */
.pd-grid { display: grid; grid-template-columns: minmax(0, 720px) 1fr; gap: 48px; }
.pd-gallery { position: sticky; top: 100px; align-self: flex-start; min-width: 0; }
.pd-gallery-row { display: flex; gap: 14px; align-items: stretch; }
.pd-thumbs-wrap { flex: 0 0 76px; position: relative; }              /* stretches to the main image height */
.pd-thumbs-v { position: absolute; inset: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px; }
.pd-main { flex: 1 1 0; min-width: 0; position: relative; border-radius: 28px; overflow: hidden; }
@media (max-width: 1080px) {
  .pd-grid { grid-template-columns: 1fr; gap: 28px; }
  .pd-gallery { position: static; top: auto; }
  .pd-gallery-row { flex-direction: column; }
  .pd-thumbs-wrap { order: 2; flex: none; position: static; }
  .pd-thumbs-v { position: static; flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 6px; margin-top: 14px; }
  .pd-main { order: 1; flex: none; }
}
/* Gallery thumbnails (horizontal scroll; click switches the main image) */
.pd-thumb { flex: 0 0 auto; width: 72px; height: 72px; border-radius: 14px; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line); padding: 0; cursor: pointer; background-color: var(--surface); transition: border-color 120ms ease, box-shadow 120ms ease; }
.pd-thumb:hover { box-shadow: 0 0 0 1px var(--clay-soft); }
.pd-thumb.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(0,0,0,0.12); }
/* Gallery prev/next arrows (overlay the main image, like the hero) */
.pd-gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 999px; background: rgba(255,255,255,0.9); color: var(--ink); border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); z-index: 2; transition: background 120ms ease; }
.pd-gal-nav:hover { background: #fff; }

/* Checkbox styled to match the prototype */
.fnf-check { display: flex; align-items: center; gap: 10px; padding: 4px 0; cursor: pointer; font-size: 13px; color: var(--ink); }
.fnf-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.fnf-check .box { width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0; background: var(--surface-2); border: 1.5px solid var(--line); display: inline-flex; align-items: center; justify-content: center; transition: all 100ms ease; color: var(--bg); }
.fnf-check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.fnf-check input:not(:checked) + .box > svg { display: none; }

/* Native select that matches the prototype's pill look */
.fnf-select { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }

/* Scroll reveal — progressive enhancement (visible by default; hidden only when JS is on) */
html.js .reveal { opacity: 0; transform: translateY(20px); }
.reveal { transition: opacity 600ms ease, transform 600ms cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1 !important; transform: none !important; }

/* FAQ / details */
details > summary { list-style: none; cursor: pointer; outline: none; }
details > summary::-webkit-details-marker { display: none; }
/* Keyboard focus only (no ring on mouse click); inset so the card's overflow:hidden doesn't clip it */
details > summary:focus-visible { outline: 2px solid var(--clay); outline-offset: -2px; }

/* Forms */
textarea.input { height: auto; padding: 14px 16px; line-height: 1.5; resize: vertical; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.req { color: var(--clay); }

/* Hide scrollbars on horizontal sliders consistently */
.no-bar { scrollbar-width: none; }
.no-bar::-webkit-scrollbar { display: none; }

/* Product card — hover lift + reveal quick-add (grid variant) */
.product-card { transition: transform 200ms ease, box-shadow 200ms ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.product-card .quick-add { opacity: 0; transition: opacity 200ms ease; pointer-events: none; }
.product-card:hover .quick-add { opacity: 1; pointer-events: auto; }
@media (hover: none) { .product-card .quick-add { opacity: 1; pointer-events: auto; } }

/* Nav link hover (top bar) */
.dt-nav-link { padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--nav-fg, var(--ink)); display: inline-flex; align-items: center; gap: 6px; transition: background 120ms ease; }
.dt-nav-link:hover { background: color-mix(in srgb, var(--nav-fg, var(--ink)) 12%, transparent); }
.dt-icon-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px; height: 40px; border-radius: 10px; background: transparent; border: none; cursor: pointer; color: var(--nav-fg, var(--ink)); position: relative; transition: background 120ms ease; }
.dt-icon-btn:hover { background: color-mix(in srgb, var(--nav-fg, var(--ink)) 12%, transparent); }

/* Footer link hover */
.footer-link { color: var(--muted); transition: color 160ms ease; cursor: pointer; }
.footer-link:hover { color: var(--ink); }
/* Dark footer: light links + placeholder */
.site-footer .footer-link { color: rgba(255,255,255,0.66); }
.site-footer .footer-link:hover { color: #fff; }
.site-footer input::placeholder { color: rgba(255,255,255,0.5); }

/* FAQ accordion icon — plus rotates into an × and turns accent when open */
.faq-ic { transition: background 200ms ease, color 200ms ease, transform 200ms ease; }
details[open] > summary .faq-ic { background: var(--clay); color: #fff; transform: rotate(45deg); }
