@charset "utf-8";
/*! ==========================================================================
 * Carrier Wireless — app.css
 * Hand-written design system. No build step, no CDN, no Tailwind runtime.
 *
 * WHY hand-written: the deployment target forbids a CDN <script> (CSP) and the
 * host has no Node toolchain, so the stylesheet has to be shippable as-is.
 * Everything below is one file so WhiteNoise fingerprints a single asset and
 * the storefront paints without a second round trip.
 *
 * Layer order (single file, plain cascade — read top to bottom):
 *   1. Tokens          — design tokens from INTERFACE-CONTRACT.md §5
 *   2. Dark tokens     — the ONLY thing dark mode redefines
 *   3. Reset + base    — element defaults, typography scale
 *   4. Layout          — container, section, stack, grids
 *   5. Components      — header, nav, cards, buttons, forms, tables, panels
 *   6. Page modules    — home, catalog, cart, checkout, delivery, dashboard
 *   7. Utilities       — spacing/visibility helpers used sparingly in markup
 *   8. Media           — reduced motion, forced colors, print
 *
 * Markup contract expected by app.js / cart.js (see static/js/*.js):
 *   header:   <header class="site-header" data-header>
 *               <button class="menu-toggle" data-menu-toggle
 *                       aria-expanded="false" aria-controls="site-menu">
 *               <nav id="site-menu" class="site-nav" data-menu>
 *               <a class="cart-link"><span class="cart-badge"
 *                       data-cart-count data-count="0">
 *   accordion:<div class="accordion" data-accordion>
 *               <h3><button class="accordion-trigger" aria-expanded="false"
 *                       aria-controls="p1" data-accordion-trigger></button></h3>
 *               <div id="p1" class="accordion-panel" hidden>
 *   copy:     <button class="copy-btn" data-copy data-copy-target="#lpa">
 *   cart:     <form data-cart-form method="post" action="{% url 'cart:add' %}">
 * ========================================================================== */

/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
  color-scheme: light;

  /* --- Palette (INTERFACE-CONTRACT.md §5) ------------------------------- */
  --brand-900: #0b1220;
  --brand-700: #12203a;
  --brand-500: #1e3a8a;
  --accent-500: #06b6d4;
  --accent-400: #22d3ee;
  --ink-900: #0f172a;
  --ink-600: #475569;
  --ink-400: #94a3b8;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --line: #e2e8f0;
  --ok: #059669;
  --warn: #d97706;
  --danger: #dc2626;

  /* --- Derived surfaces -------------------------------------------------
     Components only ever reference the tokens in this block, which is why the
     dark-mode override at the bottom of section 2 can be tokens-only. */
  --page-bg: var(--surface-alt);
  --card-bg: var(--surface);
  --card-line: var(--line);
  --raised-bg: var(--surface);
  --sunken-bg: #f1f5f9;
  --header-bg: rgba(255, 255, 255, 0.9);
  --header-line: var(--line);
  --footer-bg: var(--brand-900);
  --footer-ink: #cbd5e1;
  --overlay: rgba(11, 18, 32, 0.55);
  --code-bg: #f1f5f9;

  /* --- Foreground ------------------------------------------------------- */
  --fg: var(--ink-900);
  --fg-muted: var(--ink-600);
  --fg-subtle: var(--ink-400);
  --fg-on-brand: #f8fafc;
  --fg-on-accent: #062a33;
  --link: #1d4ed8;
  --link-hover: var(--brand-500);

  /* --- Status tints (soft background / readable ink) --------------------- */
  --ok-soft: #ecfdf5;
  --ok-ink: #065f46;
  --ok-line: #a7f3d0;
  --warn-soft: #fffbeb;
  --warn-ink: #92400e;
  --warn-line: #fde68a;
  --danger-soft: #fef2f2;
  --danger-ink: #991b1b;
  --danger-line: #fecaca;
  --info-soft: #ecfeff;
  --info-ink: #155e75;
  --info-line: #a5f3fc;

  /* --- Focus ring -------------------------------------------------------
     Cyan-700 rather than --accent-500: the accent fails 3:1 against white. */
  --focus: #0e7490;
  --focus-ring: 0 0 0 4px rgba(6, 182, 212, 0.28);

  /* --- Elevation --------------------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-brand: 0 10px 24px rgba(30, 58, 138, 0.22);

  /* --- Radii ------------------------------------------------------------- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  /* --- Spacing scale ----------------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5.5rem;

  /* --- Type -------------------------------------------------------------- */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", "Cascadia Mono",
    Menlo, Consolas, "Liberation Mono", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);
  --text-md: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.06rem + 0.3vw, 1.25rem);
  --text-xl: clamp(1.3rem, 1.2rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.32rem + 0.9vw, 2rem);
  --text-3xl: clamp(1.85rem, 1.5rem + 1.7vw, 2.75rem);
  --text-4xl: clamp(2.15rem, 1.6rem + 2.6vw, 3.5rem);

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.65;
  --tracking-tight: -0.02em;
  --tracking-wide: 0.08em;

  /* --- Layout ------------------------------------------------------------ */
  --container: 1180px;
  --container-wide: 1400px;
  --container-narrow: 46rem;
  --gutter: clamp(1rem, 4vw, 2.25rem);
  --header-h: 60px;
  --measure: 68ch;

  /* --- Motion ------------------------------------------------------------ */
  --ease: cubic-bezier(0.2, 0.65, 0.25, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 320ms;

  /* --- Stacking ---------------------------------------------------------- */
  --z-base: 1;
  --z-sticky: 50;
  --z-header: 100;
  --z-menu: 120;
  --z-overlay: 200;
  --z-toast: 300;
}

@media (min-width: 60em) {
  :root {
    --header-h: 72px;
  }
}

/* ==========================================================================
   2. Dark mode — tokens only
   ========================================================================== */

/* WHY duplicated: the media query serves the OS preference while the
   [data-theme] selectors let a template-level toggle win in both directions.
   Neither block touches a component rule. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --brand-900: #060b14;
    --brand-700: #0e1a2e;
    --brand-500: #3b5bd9;
    --accent-500: #22d3ee;
    --accent-400: #67e8f9;
    --ink-900: #e2e8f0;
    --ink-600: #a8b6c9;
    --ink-400: #6b7d94;
    --surface: #0f1725;
    --surface-alt: #0a111d;
    --line: #22304a;
    --ok: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;

    --page-bg: var(--surface-alt);
    --card-bg: var(--surface);
    --card-line: var(--line);
    --raised-bg: #162134;
    --sunken-bg: #0c1524;
    --header-bg: rgba(10, 17, 29, 0.9);
    --header-line: var(--line);
    --footer-bg: #060b14;
    --footer-ink: #94a3b8;
    --overlay: rgba(2, 6, 14, 0.72);
    --code-bg: #0c1524;

    --fg: var(--ink-900);
    --fg-muted: var(--ink-600);
    --fg-subtle: var(--ink-400);
    --fg-on-brand: #f8fafc;
    --fg-on-accent: #04222b;
    --link: #7dd3fc;
    --link-hover: var(--accent-400);

    --ok-soft: rgba(52, 211, 153, 0.12);
    --ok-ink: #6ee7b7;
    --ok-line: rgba(52, 211, 153, 0.38);
    --warn-soft: rgba(251, 191, 36, 0.12);
    --warn-ink: #fcd34d;
    --warn-line: rgba(251, 191, 36, 0.38);
    --danger-soft: rgba(248, 113, 113, 0.13);
    --danger-ink: #fca5a5;
    --danger-line: rgba(248, 113, 113, 0.4);
    --info-soft: rgba(34, 211, 238, 0.12);
    --info-ink: #a5f3fc;
    --info-line: rgba(34, 211, 238, 0.38);

    --focus: #67e8f9;
    --focus-ring: 0 0 0 4px rgba(34, 211, 238, 0.3);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6), 0 6px 14px rgba(0, 0, 0, 0.45);
    --shadow-brand: 0 12px 28px rgba(3, 8, 18, 0.7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --brand-900: #060b14;
  --brand-700: #0e1a2e;
  --brand-500: #3b5bd9;
  --accent-500: #22d3ee;
  --accent-400: #67e8f9;
  --ink-900: #e2e8f0;
  --ink-600: #a8b6c9;
  --ink-400: #6b7d94;
  --surface: #0f1725;
  --surface-alt: #0a111d;
  --line: #22304a;
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;

  --page-bg: var(--surface-alt);
  --card-bg: var(--surface);
  --card-line: var(--line);
  --raised-bg: #162134;
  --sunken-bg: #0c1524;
  --header-bg: rgba(10, 17, 29, 0.9);
  --header-line: var(--line);
  --footer-bg: #060b14;
  --footer-ink: #94a3b8;
  --overlay: rgba(2, 6, 14, 0.72);
  --code-bg: #0c1524;

  --fg: var(--ink-900);
  --fg-muted: var(--ink-600);
  --fg-subtle: var(--ink-400);
  --fg-on-brand: #f8fafc;
  --fg-on-accent: #04222b;
  --link: #7dd3fc;
  --link-hover: var(--accent-400);

  --ok-soft: rgba(52, 211, 153, 0.12);
  --ok-ink: #6ee7b7;
  --ok-line: rgba(52, 211, 153, 0.38);
  --warn-soft: rgba(251, 191, 36, 0.12);
  --warn-ink: #fcd34d;
  --warn-line: rgba(251, 191, 36, 0.38);
  --danger-soft: rgba(248, 113, 113, 0.13);
  --danger-ink: #fca5a5;
  --danger-line: rgba(248, 113, 113, 0.4);
  --info-soft: rgba(34, 211, 238, 0.12);
  --info-ink: #a5f3fc;
  --info-line: rgba(34, 211, 238, 0.38);

  --focus: #67e8f9;
  --focus-ring: 0 0 0 4px rgba(34, 211, 238, 0.3);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.55), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6), 0 6px 14px rgba(0, 0, 0, 0.45);
  --shadow-brand: 0 12px 28px rgba(3, 8, 18, 0.7);
}

/* ==========================================================================
   3. Reset + base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--space-4));
  tab-size: 4;
}

body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

/* WHY: the mobile menu is a fixed panel; locking the document stops iOS
   rubber-banding the page behind it. */
html.menu-open,
html.menu-open body {
  overflow: hidden;
  touch-action: none;
}

main {
  flex: 1 0 auto;
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

svg {
  fill: currentColor;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

button[disabled],
.btn[disabled],
.btn.is-disabled,
[aria-disabled="true"] {
  cursor: not-allowed;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
}
h2 {
  font-size: var(--text-2xl);
}
h3 {
  font-size: var(--text-xl);
}
h4 {
  font-size: var(--text-lg);
}
h5,
h6 {
  font-size: var(--text-md);
}

p,
li,
dd,
dt,
figcaption {
  text-wrap: pretty;
}

p {
  max-width: var(--measure);
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: from-font;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--link-hover);
}

/* Focus rings are never suppressed anywhere in this file — keyboard users must
   always be able to see where they are. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin-block: var(--space-6);
}

small {
  font-size: var(--text-sm);
}

strong,
b {
  font-weight: 700;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

code {
  background: var(--code-bg);
  border-radius: var(--radius-xs);
  padding: 0.12em 0.35em;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-4);
  overflow-x: auto;
}

kbd {
  background: var(--sunken-bg);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  padding: 0.1em 0.4em;
}

ul,
ol {
  padding-inline-start: 1.25em;
}

blockquote {
  border-inline-start: 3px solid var(--accent-500);
  padding-inline-start: var(--space-4);
  color: var(--fg-muted);
  font-style: italic;
}

table {
  border-collapse: collapse;
  width: 100%;
}

figure {
  margin: 0;
}

::selection {
  background: var(--accent-400);
  color: var(--fg-on-accent);
}

/* Progressive enhancement switches. `.js` is set by app.js on <html>. */
html:not(.js) .js-only {
  display: none !important;
}
html.js .no-js-only {
  display: none !important;
}

/* ==========================================================================
   4. Layout
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container-wide {
  max-width: var(--container-wide);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-8);
}

.section-lg {
  padding-block: var(--space-9);
}

.section-alt {
  background: var(--surface-alt);
  border-block: 1px solid var(--line);
}

.section-brand {
  background:
    radial-gradient(
      120% 140% at 15% 0%,
      rgba(6, 182, 212, 0.28) 0%,
      rgba(6, 182, 212, 0) 55%
    ),
    linear-gradient(160deg, var(--brand-700) 0%, var(--brand-900) 100%);
  color: var(--fg-on-brand);
}

.section-brand h1,
.section-brand h2,
.section-brand h3,
.section-brand p,
.section-brand li {
  color: inherit;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.section-head p {
  color: var(--fg-muted);
  margin-top: var(--space-2);
}

.page-head {
  padding-block: var(--space-6) var(--space-5);
}

.page-head .lede {
  font-size: var(--text-md);
  color: var(--fg-muted);
  margin-top: var(--space-3);
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--accent-500);
}

.lede {
  font-size: var(--text-md);
  color: var(--fg-muted);
}

/* Vertical rhythm without touching every child. */
.stack > * + * {
  margin-top: var(--space-4);
}
.stack-sm > * + * {
  margin-top: var(--space-2);
}
.stack-lg > * + * {
  margin-top: var(--space-6);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.cluster-between {
  justify-content: space-between;
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose h2 {
  margin-top: var(--space-7);
}

.prose h3 {
  margin-top: var(--space-6);
}

.prose ul,
.prose ol {
  max-width: var(--measure);
}

.prose li + li {
  margin-top: var(--space-2);
}

.prose img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* --- Grids ---------------------------------------------------------------
   Mobile-first: one column at 360px, columns appear only when they fit. */
.grid {
  display: grid;
  gap: var(--space-5);
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

.grid-products {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}

.grid-sidebar {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  align-items: start;
}

@media (min-width: 40em) {
  .grid-2,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 52em) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grid-sidebar {
    grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  }

  .grid-sidebar-end {
    grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  }
}

.sticky-aside {
  position: sticky;
  top: calc(var(--header-h) + var(--space-4));
}

/* ==========================================================================
   5. Components
   ========================================================================== */

/* --- Skip link ----------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: var(--space-3);
  z-index: var(--z-toast);
  transform: translateY(-200%);
  background: var(--brand-900);
  color: var(--fg-on-brand);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
  color: var(--fg-on-brand);
}

/* --- Header -------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  transition:
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header {
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
  }
}

.site-header.is-stuck {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  text-decoration: none;
  margin-inline-end: auto;
}

.brand:hover {
  color: var(--fg);
}

.brand img,
.brand svg {
  height: 30px;
  width: auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-500), var(--accent-500));
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 800;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --- Primary nav / mobile menu ------------------------------------------ */
.site-nav {
  display: none;
}

.site-nav.is-open {
  display: block;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: var(--z-menu);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: var(--space-5) var(--gutter) var(--space-8);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: menu-in var(--dur) var(--ease);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--fg);
  text-decoration: none;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.nav-link:hover {
  background: var(--surface-alt);
  color: var(--fg);
}

.nav-link[aria-current="page"],
.nav-link.is-active {
  color: var(--brand-500);
  background: var(--info-soft);
}

.nav-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.nav-meta {
  margin-top: var(--space-5);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.menu-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--fg);
}

.menu-toggle:hover {
  background: var(--surface-alt);
}

.burger,
.burger::before,
.burger::after {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition:
    transform var(--dur) var(--ease),
    opacity var(--dur-fast) var(--ease);
}

.burger {
  position: relative;
}

.burger::before,
.burger::after {
  content: "";
  position: absolute;
  left: 0;
}

.burger::before {
  top: -6px;
}

.burger::after {
  top: 6px;
}

.menu-toggle[aria-expanded="true"] .burger {
  background: transparent;
}

.menu-toggle[aria-expanded="true"] .burger::before {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .burger::after {
  transform: translateY(-6px) rotate(-45deg);
}

/* --- Cart link + badge --------------------------------------------------- */
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card-bg);
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}

.cart-link:hover {
  background: var(--surface-alt);
  color: var(--fg);
}

.cart-link svg {
  width: 20px;
  height: 20px;
}

.cart-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: 0.35em;
  border-radius: var(--radius-pill);
  background: var(--accent-500);
  color: var(--fg-on-accent);
  font-size: var(--text-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.cart-badge[data-count="0"] {
  display: none;
}

.cart-badge.is-bumped {
  animation: badge-bump var(--dur-slow) var(--ease);
}

@keyframes badge-bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.32);
  }
  100% {
    transform: scale(1);
  }
}

/* Without JavaScript the toggle can never open the panel, so below the desktop
   breakpoint the nav falls back to an inline block under the logo row. */
@media (max-width: 59.99em) {
  html:not(.js) .header-inner {
    flex-wrap: wrap;
    padding-bottom: var(--space-2);
  }

  html:not(.js) .site-nav {
    display: block;
    order: 3;
    width: 100%;
    padding-top: var(--space-3);
    border-top: 1px solid var(--line);
  }

  html:not(.js) .menu-toggle {
    display: none;
  }
}

@media (min-width: 60em) {
  .site-nav,
  .site-nav.is-open {
    display: block;
    position: static;
    inset: auto;
    padding: 0;
    background: none;
    border: 0;
    overflow: visible;
    animation: none;
    margin-inline-end: var(--space-4);
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-1);
  }

  .nav-link {
    padding: var(--space-2) var(--space-3);
  }

  .nav-actions {
    display: none;
  }

  .nav-meta {
    display: none;
  }

  .menu-toggle {
    display: none;
  }
}

/* --- Footer -------------------------------------------------------------- */
.site-footer {
  margin-top: var(--space-9);
  background: var(--footer-bg);
  color: var(--footer-ink);
  padding-block: var(--space-8) var(--space-6);
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.site-footer a {
  color: var(--footer-ink);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent-400);
  text-decoration: underline;
}

.footer-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

@media (min-width: 40em) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 64em) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  }
}

.footer-links {
  list-style: none;
  margin: var(--space-3) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.footer-bottom {
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid rgba(226, 232, 240, 0.16);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}

.payment-marks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.payment-marks img {
  height: 24px;
  width: auto;
  border-radius: var(--radius-xs);
  background: #fff;
  padding: 2px 4px;
}

/* --- Breadcrumbs --------------------------------------------------------- */
.breadcrumbs {
  padding-block: var(--space-4) 0;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.breadcrumbs li + li::before {
  content: "/";
  color: var(--fg-subtle);
}

.breadcrumbs a {
  color: var(--fg-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
  color: var(--fg);
  font-weight: 600;
}

/* --- Buttons ------------------------------------------------------------- */
.btn {
  --btn-bg: var(--card-bg);
  --btn-fg: var(--fg);
  --btn-line: var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--btn-line);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.btn:hover {
  color: var(--btn-fg);
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.btn-primary {
  --btn-bg: var(--brand-500);
  --btn-fg: #fff;
  --btn-line: var(--brand-500);
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  --btn-bg: var(--brand-700);
  --btn-line: var(--brand-700);
}

.btn-accent {
  --btn-bg: var(--accent-500);
  --btn-fg: var(--fg-on-accent);
  --btn-line: var(--accent-500);
}

.btn-accent:hover {
  --btn-bg: var(--accent-400);
  --btn-line: var(--accent-400);
}

.btn-secondary {
  --btn-bg: transparent;
  --btn-fg: var(--brand-500);
  --btn-line: var(--brand-500);
}

.btn-secondary:hover {
  --btn-bg: var(--info-soft);
}

.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--fg-muted);
  --btn-line: transparent;
}

.btn-ghost:hover {
  --btn-bg: var(--surface-alt);
  --btn-fg: var(--fg);
}

.btn-danger {
  --btn-bg: var(--danger);
  --btn-fg: #fff;
  --btn-line: var(--danger);
}

.btn-danger-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--danger);
  --btn-line: transparent;
}

.btn-danger-ghost:hover {
  --btn-bg: var(--danger-soft);
}

.btn-lg {
  min-height: 52px;
  padding: 0.85rem 1.75rem;
  font-size: var(--text-md);
  border-radius: var(--radius);
}

.btn-sm {
  min-height: 36px;
  padding: 0.3rem 0.75rem;
  font-size: var(--text-sm);
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn[disabled],
.btn.is-disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

/* Busy state driven by cart.js while a fetch is in flight. */
.btn[aria-busy="true"],
.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn[aria-busy="true"]::after,
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--btn-fg) transparent var(--btn-fg) transparent;
  animation: spin 720ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* --- Cards --------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition:
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  flex: 1 1 auto;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--card-line);
  background: var(--surface-alt);
}

.card-head h2,
.card-head h3 {
  font-size: var(--text-lg);
}

.card-foot {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--card-line);
  background: var(--surface-alt);
}

.card-flush .card-body {
  padding: 0;
}

.card-hover:hover,
.card-link:hover {
  border-color: var(--accent-500);
  box-shadow: var(--shadow-lg);
}

/* Whole-card click target that keeps the real link keyboard-reachable. */
.card-link .stretched::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card:has(.stretched:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.card-media {
  aspect-ratio: 16 / 10;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--card-line);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Product card -------------------------------------------------------- */
.product-card .card-body {
  gap: var(--space-2);
}

.product-card .product-title {
  font-size: var(--text-md);
  font-weight: 700;
  line-height: var(--leading-snug);
}

.product-card .product-title a {
  color: var(--fg);
  text-decoration: none;
}

.product-card .product-title a:hover {
  color: var(--brand-500);
}

.product-summary {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin: 0;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--fg-muted);
  list-style: none;
  margin: 0;
  padding: 0;
}

.product-meta li {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.6rem;
}

.product-card .card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
}

.price {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.price-old {
  margin-inline-start: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--fg-subtle);
  text-decoration: line-through;
}

.price-note {
  display: block;
  font-size: var(--text-xs);
  color: var(--fg-muted);
  font-weight: 500;
}

.price-lg {
  font-size: var(--text-3xl);
}

.stock-line {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-size: var(--text-sm);
  font-weight: 600;
}

.stock-line::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: currentColor;
}

.stock-in {
  color: var(--ok);
}
.stock-low {
  color: var(--warn);
}
.stock-out {
  color: var(--danger);
}

/* --- Badges -------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-alt);
  color: var(--fg-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.5;
  white-space: nowrap;
}

.badge-ok {
  background: var(--ok-soft);
  border-color: var(--ok-line);
  color: var(--ok-ink);
}

.badge-warn {
  background: var(--warn-soft);
  border-color: var(--warn-line);
  color: var(--warn-ink);
}

.badge-danger {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  color: var(--danger-ink);
}

.badge-info {
  background: var(--info-soft);
  border-color: var(--info-line);
  color: var(--info-ink);
}

.badge-brand {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

.badge-sale {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.badge-corner {
  position: absolute;
  top: var(--space-3);
  inset-inline-start: var(--space-3);
  z-index: var(--z-base);
  box-shadow: var(--shadow-sm);
}

/* --- Alerts / messages --------------------------------------------------- */
.messages {
  display: grid;
  gap: var(--space-3);
  padding-block: var(--space-4) 0;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-inline-start-width: 4px;
  border-radius: var(--radius);
  background: var(--surface-alt);
  color: var(--fg);
  font-size: var(--text-base);
}

.alert p {
  margin: 0;
  max-width: none;
}

.alert-title {
  font-weight: 700;
  display: block;
}

.alert-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
}

.alert-close {
  margin-inline-start: auto;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-xs);
  color: inherit;
  opacity: 0.7;
  line-height: 1;
}

.alert-close:hover {
  opacity: 1;
  background: rgba(15, 23, 42, 0.06);
}

.alert-success,
.alert.success {
  background: var(--ok-soft);
  border-color: var(--ok-line);
  border-inline-start-color: var(--ok);
  color: var(--ok-ink);
}

.alert-warning,
.alert.warning {
  background: var(--warn-soft);
  border-color: var(--warn-line);
  border-inline-start-color: var(--warn);
  color: var(--warn-ink);
}

.alert-error,
.alert.error {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  border-inline-start-color: var(--danger);
  color: var(--danger-ink);
}

.alert-info,
.alert.info,
.alert.debug {
  background: var(--info-soft);
  border-color: var(--info-line);
  border-inline-start-color: var(--accent-500);
  color: var(--info-ink);
}

.alert a {
  color: inherit;
  font-weight: 700;
}

/* --- Forms --------------------------------------------------------------- */
.form {
  display: grid;
  gap: var(--space-5);
}

.fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: var(--space-4);
}

.fieldset > legend {
  padding: 0;
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-2);
}

.field {
  display: grid;
  gap: var(--space-2);
}

.field-row {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 40em) {
  .field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .field-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.label,
.field > label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--fg);
}

.label .req,
.field > label .req {
  color: var(--danger);
  margin-inline-start: 0.15em;
}

.label .optional {
  font-weight: 500;
  color: var(--fg-subtle);
  margin-inline-start: 0.35em;
}

.input,
.select,
.textarea,
input[type="text"].input,
input[type="email"].input {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--fg);
  font-size: var(--text-base);
  line-height: 1.4;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--fg-subtle);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--ink-400);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent-500);
  box-shadow: var(--focus-ring);
}

.textarea {
  min-height: 8rem;
  resize: vertical;
}

.select {
  appearance: none;
  padding-inline-end: 2.5rem;
  /* Inline data URI: keeps the control single-file and CSP-safe. Slate-500 is
     the one chevron colour that clears 3:1 on both the light and dark field. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.1rem;
}

[dir="rtl"] .select {
  background-position: left 0.75rem center;
}

.input[readonly],
.input[disabled],
.select[disabled],
.textarea[disabled] {
  background: var(--sunken-bg);
  color: var(--fg-muted);
}

.input-mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.input-group {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
  flex-wrap: wrap;
}

.input-group .input,
.input-group .select {
  flex: 1 1 12rem;
  min-width: 0;
}

.help,
.field-help {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.field-error {
  display: flex;
  align-items: flex-start;
  gap: 0.4em;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--danger-ink);
}

.field-error::before {
  content: "!";
  flex: none;
  display: grid;
  place-items: center;
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.2em;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 0.75em;
  font-weight: 800;
}

.field-error ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea,
.input.is-invalid,
[aria-invalid="true"].input,
[aria-invalid="true"].select,
[aria-invalid="true"].textarea {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.field.has-error .input:focus,
.input.is-invalid:focus,
[aria-invalid="true"].input:focus {
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.22);
}

/* Checkbox / radio: a real control, resized and re-coloured. */
.checkbox,
.radio {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: var(--space-3);
  font-size: var(--text-base);
  line-height: var(--leading-snug);
  cursor: pointer;
}

.checkbox > input[type="checkbox"],
.radio > input[type="radio"],
input[type="checkbox"].checkbox,
input[type="radio"].radio {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0.1rem 0 0;
  border: 2px solid var(--ink-400);
  border-radius: var(--radius-xs);
  background: var(--card-bg);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition:
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.radio > input[type="radio"],
input[type="radio"].radio {
  border-radius: 50%;
}

.checkbox > input[type="checkbox"]::before,
input[type="checkbox"].checkbox::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  transform: scale(0);
  transform-origin: center;
  clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 16%, 84% 0%, 38% 68%);
  background: #fff;
  transition: transform var(--dur-fast) var(--ease);
}

.radio > input[type="radio"]::before,
input[type="radio"].radio::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #fff;
  transform: scale(0);
  transition: transform var(--dur-fast) var(--ease);
}

.checkbox > input[type="checkbox"]:checked,
.radio > input[type="radio"]:checked,
input[type="checkbox"].checkbox:checked,
input[type="radio"].radio:checked {
  background: var(--brand-500);
  border-color: var(--brand-500);
}

.checkbox > input[type="checkbox"]:checked::before,
.radio > input[type="radio"]:checked::before,
input[type="checkbox"].checkbox:checked::before,
input[type="radio"].radio:checked::before {
  transform: scale(1);
}

.checkbox > input:disabled,
.radio > input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.choice-list {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Quantity stepper (cart + product page) */
.qty {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  overflow: hidden;
}

.qty button {
  width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--fg-muted);
  transition: background-color var(--dur) var(--ease);
}

.qty button:hover {
  background: var(--surface-alt);
  color: var(--fg);
}

.qty button[disabled] {
  opacity: 0.4;
}

.qty input {
  width: 3.25rem;
  min-height: 44px;
  border: 0;
  border-inline: 1px solid var(--line);
  background: transparent;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- Tables -------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  -webkit-overflow-scrolling: touch;
}

.table-wrap > .table {
  border: 0;
  border-radius: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  font-size: var(--text-base);
}

.table caption {
  caption-side: top;
  text-align: start;
  padding: var(--space-3) var(--space-4);
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

.table th,
.table td {
  padding: var(--space-3) var(--space-4);
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.table thead th {
  background: var(--surface-alt);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: var(--surface-alt);
}

.table .num,
.table .money {
  text-align: end;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table .actions {
  text-align: end;
  white-space: nowrap;
}

.table-fixed {
  table-layout: fixed;
}

/* Opt-in only: a sticky head needs a scroll container of its own, otherwise it
   pins to the page and collides with the sticky site header. */
.table-wrap.is-scrollable {
  max-height: 70svh;
  overflow-y: auto;
}

.table-wrap.is-scrollable .table thead th {
  position: sticky;
  top: 0;
  z-index: var(--z-base);
}

.table-zebra tbody tr:nth-child(even) td {
  background: var(--surface-alt);
}

.table-compact th,
.table-compact td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
}

.empty-state {
  display: grid;
  gap: var(--space-4);
  justify-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-4);
  color: var(--fg-muted);
}

.empty-state img,
.empty-state svg {
  width: min(180px, 50%);
  opacity: 0.85;
}

/* --- Spec table ---------------------------------------------------------- */
.spec-table {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  font-size: var(--text-base);
}

.spec-table th,
.spec-table td {
  padding: var(--space-3) var(--space-4);
  text-align: start;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.spec-table th {
  font-weight: 700;
  color: var(--fg-muted);
  background: var(--surface-alt);
  width: 42%;
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: 0;
}

/* Below 30rem a two-column spec table crushes to unreadable widths, so the
   label sits above its value instead. */
@media (max-width: 29.99em) {
  .spec-table,
  .spec-table tbody,
  .spec-table tr,
  .spec-table th,
  .spec-table td {
    display: block;
    width: auto;
  }

  .spec-table tr {
    border-bottom: 1px solid var(--line);
  }

  .spec-table tr:last-child {
    border-bottom: 0;
  }

  .spec-table th {
    border-bottom: 0;
    padding-bottom: 0;
    background: transparent;
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
  }

  .spec-table td {
    border-bottom: 0;
    padding-top: var(--space-1);
    font-weight: 600;
  }
}

/* Definition-list flavour of the same block. */
dl.spec-table {
  display: grid;
  grid-template-columns: 1fr;
  padding: var(--space-2) 0;
}

dl.spec-table dt {
  padding: var(--space-3) var(--space-4) 0;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
}

dl.spec-table dd {
  margin: 0;
  padding: 0 var(--space-4) var(--space-3);
  font-weight: 600;
}

@media (min-width: 40em) {
  dl.spec-table {
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  }

  dl.spec-table dt,
  dl.spec-table dd {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--line);
  }

  dl.spec-table dt {
    font-size: var(--text-sm);
    text-transform: none;
    letter-spacing: 0;
    background: var(--surface-alt);
  }
}

/* --- Feature list -------------------------------------------------------- */
.feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-3);
}

.feature-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
}

.feature-list li::before {
  content: "";
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23059669' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 10.5 4 4 8-9'/%3E%3C/svg%3E")
    center / 0.9rem no-repeat;
  box-shadow: inset 0 0 0 1px var(--ok-line);
}

.feature-list .detail {
  display: block;
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* --- Steps --------------------------------------------------------------- */
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-5);
}

.steps > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: start;
}

.steps > li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.steps h3 {
  font-size: var(--text-md);
  margin-bottom: var(--space-1);
}

/* --- Accordion (FAQ) ----------------------------------------------------- */
.accordion {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  overflow: hidden;
}

.accordion-item + .accordion-item {
  border-top: 1px solid var(--line);
}

.accordion-item > h2,
.accordion-item > h3,
.accordion-item > h4 {
  margin: 0;
  font-size: inherit;
  letter-spacing: 0;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  text-align: start;
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--fg);
  transition: background-color var(--dur) var(--ease);
}

.accordion-trigger:hover {
  background: var(--surface-alt);
}

.accordion-trigger::after {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  background: currentColor;
  /* Chevron drawn with a mask so it inherits colour in both themes. */
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 13.2 3.8 7 5.2 5.6 10 10.4l4.8-4.8L16.2 7z'/%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 20 20'%3E%3Cpath d='M10 13.2 3.8 7 5.2 5.6 10 10.4l4.8-4.8L16.2 7z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  transition: transform var(--dur) var(--ease);
}

.accordion-trigger[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.accordion-panel {
  padding: 0 var(--space-5) var(--space-5);
  color: var(--fg-muted);
}

.accordion-panel > * + * {
  margin-top: var(--space-3);
}

.accordion-panel[hidden] {
  display: none;
}

/* <details> fallback so FAQs still open with JS disabled. */
details.accordion-item {
  padding: 0;
}

details.accordion-item > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) var(--space-5);
  font-weight: 700;
}

details.accordion-item > summary::-webkit-details-marker {
  display: none;
}

/* --- Pagination ---------------------------------------------------------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-7);
  list-style: none;
  padding: 0;
}

.page-link {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding-inline: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.page-link:hover {
  background: var(--surface-alt);
  border-color: var(--ink-400);
  color: var(--fg);
}

.page-link.is-current,
.page-link[aria-current="page"] {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

.page-link.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.pagination-status {
  width: 100%;
  text-align: center;
  color: var(--fg-muted);
  font-size: var(--text-sm);
}

/* --- Toolbar / filters --------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
}

.toolbar .input,
.toolbar .select {
  min-height: 42px;
  flex: 1 1 10rem;
  min-width: 0;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 34px;
  padding: 0.15rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--card-bg);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.chip:hover {
  border-color: var(--accent-500);
  color: var(--fg);
}

.chip.is-active,
.chip[aria-pressed="true"] {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #fff;
}

/* --- Search -------------------------------------------------------------- */
.search-form {
  display: flex;
  gap: var(--space-2);
  width: 100%;
}

.search-form .input {
  flex: 1 1 auto;
  min-width: 0;
}

/* ==========================================================================
   6. Page modules
   ========================================================================== */

/* --- Hero ---------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(
      90% 120% at 10% 0%,
      rgba(6, 182, 212, 0.35) 0%,
      rgba(6, 182, 212, 0) 60%
    ),
    linear-gradient(155deg, var(--brand-700) 0%, var(--brand-900) 70%);
  color: var(--fg-on-brand);
  padding-block: var(--space-8) var(--space-9);
}

.hero::after {
  /* Signal-grid motif — decorative, so it is drawn rather than downloaded. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 80% at 70% 20%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 80% at 70% 20%, #000 0%, transparent 75%);
}

.hero-inner {
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

.hero h1 {
  font-size: var(--text-4xl);
  color: #fff;
}

.hero p {
  color: #cbd5e1;
  font-size: var(--text-md);
  max-width: 46ch;
}

.hero .eyebrow {
  color: var(--accent-400);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.hero-media img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 64em) {
  .hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: var(--space-8);
  }
}

/* --- Trust bar ----------------------------------------------------------- */
.trust-bar {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  list-style: none;
  margin: 0;
  padding: var(--space-5) 0 0;
}

.trust-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 600;
}

.trust-item img,
.trust-item svg {
  width: 1.75rem;
  height: 1.75rem;
  color: var(--accent-500);
}

.trust-item .detail {
  display: block;
  font-weight: 500;
  color: var(--fg-muted);
}

.hero .trust-item .detail {
  color: #94a3b8;
}

/* --- Category tiles ------------------------------------------------------ */
.category-tile {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  color: var(--fg);
  text-decoration: none;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.category-tile:hover {
  color: var(--fg);
  border-color: var(--accent-500);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-tile .tile-icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius);
  background: var(--info-soft);
  color: var(--info-ink);
}

.category-tile h3 {
  font-size: var(--text-lg);
}

.category-tile p {
  color: var(--fg-muted);
  font-size: var(--text-sm);
  margin: 0;
}

/* --- Product detail ------------------------------------------------------ */
.product-layout {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 64em) {
  .product-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
    gap: var(--space-8);
  }
}

.product-gallery {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card-bg);
}

.product-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.product-thumbs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3);
  overflow-x: auto;
  list-style: none;
  margin: 0;
  border-top: 1px solid var(--line);
}

.product-thumbs img {
  width: 72px;
  height: 56px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  border: 1px solid var(--line);
}

.buy-box {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
}

.buy-box .price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2);
}

.buy-form {
  display: grid;
  gap: var(--space-3);
}

.buy-form .qty-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.buy-note {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.gateway-marks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.gateway-marks img {
  height: 22px;
  width: auto;
}

/* --- Cart ---------------------------------------------------------------- */
.cart-layout {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 64em) {
  .cart-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 23rem);
  }
}

.cart-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--line);
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line.is-removing {
  opacity: 0.45;
}

.cart-line-media img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--line);
}

.cart-line-body {
  display: grid;
  gap: var(--space-3);
}

.cart-line-title {
  font-size: var(--text-md);
  font-weight: 700;
}

.cart-line-title a {
  color: var(--fg);
  text-decoration: none;
}

.cart-line-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.cart-line-total {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.summary {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  font-size: var(--text-base);
  color: var(--fg-muted);
}

.summary-row > :last-child {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--fg);
}

.summary-row.is-discount > :last-child {
  color: var(--ok);
}

.summary-total {
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--fg);
}

.summary-total > :last-child {
  font-size: var(--text-xl);
  font-weight: 800;
}

.coupon-form {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.coupon-form .input {
  flex: 1 1 9rem;
  min-width: 0;
  text-transform: uppercase;
}

.coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px dashed var(--ok-line);
  border-radius: var(--radius-sm);
  background: var(--ok-soft);
  color: var(--ok-ink);
  font-weight: 600;
  font-size: var(--text-sm);
}

/* --- Checkout ------------------------------------------------------------ */
.checkout-layout {
  display: grid;
  gap: var(--space-6);
  align-items: start;
}

@media (min-width: 64em) {
  .checkout-layout {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: var(--space-8);
  }
}

.pay-options {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}

.pay-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  cursor: pointer;
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.pay-option:hover {
  border-color: var(--ink-400);
}

.pay-option:has(input:checked),
.pay-option.is-selected {
  border-color: var(--brand-500);
  background: var(--info-soft);
  box-shadow: var(--focus-ring);
}

.pay-option:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.pay-option .pay-name {
  font-weight: 700;
}

.pay-option .pay-note {
  display: block;
  font-size: var(--text-sm);
  color: var(--fg-muted);
  font-weight: 500;
}

.pay-option img {
  height: 24px;
  width: auto;
}

.order-review {
  display: grid;
  gap: var(--space-3);
}

.order-review-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.order-review-line .qty-note {
  color: var(--fg-muted);
}

.secure-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.secure-note svg {
  width: 1.1rem;
  height: 1.1rem;
  color: var(--ok);
}

/* --- Order status -------------------------------------------------------- */
.status-banner {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
  text-align: center;
  padding: var(--space-8) var(--space-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.status-banner .status-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: var(--text-2xl);
}

.status-banner.is-pending .status-icon {
  background: var(--warn-soft);
  color: var(--warn);
}

.status-banner.is-failed .status-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-banner h1 {
  font-size: var(--text-2xl);
}

.order-meta {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.order-meta dt {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.order-meta dd {
  margin: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 var(--space-5);
  border-inline-start: 2px solid var(--line);
  display: grid;
  gap: var(--space-5);
}

.timeline > li {
  position: relative;
}

.timeline > li::before {
  content: "";
  position: absolute;
  inset-inline-start: calc(-1 * var(--space-5) - 6px);
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink-400);
  box-shadow: 0 0 0 4px var(--page-bg);
}

.timeline > li.is-done::before {
  background: var(--ok);
}

.timeline > li.is-current::before {
  background: var(--accent-500);
}

.timeline time {
  display: block;
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* --- Delivery / QR panel -------------------------------------------------
   Renders decrypted credentials for ONE paid order. Nothing here may ever be
   put in a URL — the QR image comes from the signed `fulfillment:qr` view. */
.delivery-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.delivery-panel + .delivery-panel {
  margin-top: var(--space-5);
}

.delivery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: linear-gradient(120deg, var(--brand-700), var(--brand-900));
  color: var(--fg-on-brand);
}

.delivery-head h2,
.delivery-head h3 {
  color: #fff;
  font-size: var(--text-lg);
}

.delivery-head .badge {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.delivery-grid {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-5);
}

@media (min-width: 48em) {
  .delivery-grid {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    align-items: start;
  }
}

.qr-frame {
  display: grid;
  gap: var(--space-3);
  justify-items: center;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  /* Always literal white: scanners need maximum contrast, in dark mode too. */
  background: #ffffff;
}

.qr-frame img {
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
}

.qr-frame figcaption,
.qr-caption {
  font-size: var(--text-sm);
  color: #475569;
  text-align: center;
}

.secret-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.secret-row {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}

.secret-label {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.secret-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.secret-value {
  flex: 1 1 12rem;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
  color: var(--fg);
  overflow-wrap: anywhere;
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}

.secret-value.is-masked {
  letter-spacing: 0.2em;
  -webkit-user-select: none;
  user-select: none;
}

.copy-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 38px;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-weight: 700;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.copy-btn:hover {
  border-color: var(--accent-500);
  color: var(--fg);
}

.copy-btn .copy-done {
  display: none;
}

.copy-btn[data-copied="true"] {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok-ink);
}

.copy-btn[data-copied="true"] .copy-idle {
  display: none;
}

.copy-btn[data-copied="true"] .copy-done {
  display: inline;
}

.copy-btn[data-copied="error"] {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.delivery-steps {
  margin-top: var(--space-4);
}

.delivery-warning {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  margin: var(--space-4) var(--space-5) var(--space-5);
  padding: var(--space-4);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn-ink);
  font-size: var(--text-sm);
}

/* --- Guides / CMS -------------------------------------------------------- */
.guide-card .card-body {
  gap: var(--space-2);
}

.guide-meta {
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.toc {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.toc h2 {
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: var(--space-2);
}

.toc ol,
.toc ul {
  margin: 0;
  padding-inline-start: 1.1em;
  display: grid;
  gap: var(--space-2);
}

/* --- Account area -------------------------------------------------------- */
.account-layout {
  display: grid;
  gap: var(--space-6);
  align-items: start;
  padding-block: var(--space-6);
}

@media (min-width: 60em) {
  .account-layout {
    grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  }
}

.account-nav {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
}

.account-nav a {
  display: block;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-weight: 600;
  text-decoration: none;
}

.account-nav a:hover {
  background: var(--surface-alt);
}

.account-nav a[aria-current="page"] {
  background: var(--info-soft);
  color: var(--brand-500);
}

.stat-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
}

.stat {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: var(--shadow-xs);
}

.stat-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-muted);
}

.stat-value {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}

.stat-delta {
  font-size: var(--text-sm);
  font-weight: 700;
}

.stat-delta.is-up {
  color: var(--ok);
}

.stat-delta.is-down {
  color: var(--danger);
}

/* --- Auth pages ---------------------------------------------------------- */
.auth-shell {
  display: grid;
  place-items: center;
  padding-block: var(--space-8);
}

.auth-card {
  width: 100%;
  max-width: 27rem;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
}

.auth-card h1 {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-2);
}

.auth-alt {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--fg-muted);
  text-align: center;
}

/* --- Error pages --------------------------------------------------------- */
.error-page {
  display: grid;
  gap: var(--space-4);
  justify-items: center;
  text-align: center;
  padding-block: var(--space-10);
}

.error-code {
  font-size: clamp(3.5rem, 12vw, 6rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: var(--tracking-tight);
  background: linear-gradient(120deg, var(--brand-500), var(--accent-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Receipt ------------------------------------------------------------- */
.receipt {
  max-width: 46rem;
  margin-inline: auto;
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
}

.receipt-head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: var(--space-5);
  border-bottom: 2px solid var(--line);
}

.receipt-head img {
  height: 34px;
  width: auto;
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-4);
  margin-top: var(--space-4);
  border-top: 2px solid var(--line);
  font-size: var(--text-lg);
  font-weight: 800;
}

.receipt-foot {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

/* --- Dashboard shell -----------------------------------------------------
   Staff-only. Mobile keeps the nav as a horizontally scrollable strip so the
   content column is never squeezed below 360px. */
.dash {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100svh;
  background: var(--page-bg);
}

.dash-sidebar {
  background: var(--brand-900);
  color: #cbd5e1;
  padding: var(--space-4) var(--gutter);
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  margin-bottom: var(--space-3);
}

.dash-brand .badge {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.dash-nav {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  padding-bottom: var(--space-2);
  list-style: none;
  margin: 0;
}

.dash-nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: #cbd5e1;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.dash-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.dash-nav a[aria-current="page"],
.dash-nav a.is-active {
  background: var(--brand-500);
  color: #fff;
}

.dash-nav-group {
  margin-top: var(--space-4);
}

.dash-nav-title {
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: #64748b;
  padding: 0 var(--space-3) var(--space-2);
}

.dash-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dash-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--gutter);
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
}

.dash-topbar h1 {
  font-size: var(--text-xl);
}

.dash-content {
  flex: 1 1 auto;
  padding: var(--space-5) var(--gutter) var(--space-8);
  display: grid;
  gap: var(--space-5);
  align-content: start;
}

@media (min-width: 64em) {
  .dash {
    grid-template-columns: 16rem minmax(0, 1fr);
  }

  .dash-sidebar {
    position: sticky;
    top: 0;
    height: 100svh;
    overflow-y: auto;
    padding: var(--space-5) var(--space-4);
  }

  .dash-nav {
    display: grid;
    gap: var(--space-1);
    overflow: visible;
  }

  .dash-nav a {
    white-space: normal;
  }
}

/* ==========================================================================
   7. Utilities
   ========================================================================== */

.visually-hidden,
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-focusable:not(:focus):not(:focus-within) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hidden,
[hidden] {
  display: none !important;
}

.text-center {
  text-align: center;
}
.text-end {
  text-align: end;
}
.muted {
  color: var(--fg-muted);
}
.subtle {
  color: var(--fg-subtle);
}
.small {
  font-size: var(--text-sm);
}
.strong {
  font-weight: 700;
}
.mono {
  font-family: var(--font-mono);
}
.nums {
  font-variant-numeric: tabular-nums;
}
.nowrap {
  white-space: nowrap;
}
.break-all {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.measure {
  max-width: var(--measure);
}
.full-width {
  width: 100%;
}
.ok {
  color: var(--ok);
}
.warn {
  color: var(--warn);
}
.danger {
  color: var(--danger);
}

.mt-0 {
  margin-top: 0;
}
.mt-2 {
  margin-top: var(--space-2);
}
.mt-3 {
  margin-top: var(--space-3);
}
.mt-4 {
  margin-top: var(--space-4);
}
.mt-5 {
  margin-top: var(--space-5);
}
.mt-6 {
  margin-top: var(--space-6);
}
.mb-0 {
  margin-bottom: 0;
}
.mb-3 {
  margin-bottom: var(--space-3);
}
.mb-4 {
  margin-bottom: var(--space-4);
}
.mb-5 {
  margin-bottom: var(--space-5);
}
.mb-6 {
  margin-bottom: var(--space-6);
}

.flow-tight > * + * {
  margin-top: var(--space-2);
}

/* Lazy-reveal used by app.js; opacity only, never layout shift. */
[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity var(--dur-slow) var(--ease),
    transform var(--dur-slow) var(--ease);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* Placeholder shimmer for images still loading. */
.img-loading {
  background:
    linear-gradient(
      100deg,
      var(--surface-alt) 30%,
      var(--sunken-bg) 50%,
      var(--surface-alt) 70%
    )
    var(--surface-alt);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

.aria-live-region {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ==========================================================================
   8. Media — motion, contrast, print
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .btn:active {
    transform: none;
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: #94a3b8;
    --fg-muted: #334155;
  }

  .card,
  .input,
  .select,
  .textarea,
  .btn {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  .btn,
  .card,
  .input,
  .select,
  .textarea,
  .badge,
  .qty {
    border: 1px solid ButtonBorder;
  }

  .cart-badge,
  .badge-brand,
  .badge-sale {
    forced-color-adjust: none;
  }
}

/* --- Print: receipts and delivery pages -------------------------------- */
@media print {
  :root {
    --page-bg: #fff;
    --card-bg: #fff;
    --surface-alt: #fff;
    --fg: #000;
    --fg-muted: #333;
    --line: #999;
    --shadow-xs: none;
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: none;
    --shadow-brand: none;
  }

  @page {
    margin: 14mm;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  .site-header,
  .site-footer,
  .site-nav,
  .menu-toggle,
  .breadcrumbs,
  .messages,
  .pagination,
  .toolbar,
  .skip-link,
  .dash-sidebar,
  .dash-topbar,
  .btn,
  .copy-btn,
  .qty,
  .no-print,
  form[data-cart-form],
  [data-no-print] {
    display: none !important;
  }

  main,
  .dash-content {
    padding: 0 !important;
  }

  .receipt,
  .card,
  .delivery-panel,
  .summary,
  .table-wrap {
    border: 1px solid #999 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .receipt {
    max-width: none;
    padding: 0;
    border: 0 !important;
  }

  .delivery-head {
    background: #fff !important;
    color: #000 !important;
    border-bottom: 1px solid #999;
  }

  .delivery-head h2,
  .delivery-head h3 {
    color: #000 !important;
  }

  .qr-frame {
    border: 1px solid #999 !important;
    break-inside: avoid;
  }

  .qr-frame img {
    max-width: 46mm;
  }

  .secret-value {
    font-size: 10pt;
    word-break: break-all;
  }

  .table th,
  .table td,
  .spec-table th,
  .spec-table td {
    padding: 4pt 6pt;
  }

  .table thead th {
    position: static;
    background: #f2f2f2 !important;
    color: #000 !important;
  }

  tr,
  img,
  .secret-row {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  a {
    color: #000 !important;
    text-decoration: none;
  }

  /* WHY not on every link: printed receipts are read, not clicked, and the
     order URL is the only one worth carrying over to a screen. */
  .print-url a[href]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444;
  }

  .print-only {
    display: revert !important;
  }
}

.print-only {
  display: none;
}
