/* ============================================================================
   Voltis demo store — design system (calm neutral)
   Light + dark themes, Nudge --site-* variable contract.
   Selectors are aligned 1:1 with the classes rendered by web/assets/js.
   ============================================================================ */

/* --- Fonts: Manrope variable, latin / latin-ext / cyrillic subsets ----------
   `optional` keeps the type stable: the preloaded latin subsets win the race
   before first paint, and if they ever lose, the page stays on the fallback
   instead of reflowing every text box (a font swap is the largest CLS source
   on this site). */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url('../fonts/manrope-latin-ext.woff2') format('woff2');
  /* Latvian diacritics (ā č ē ģ ī ķ ļ ņ š ū) live in latin-ext. */
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 400 800;
  font-display: optional;
  src: url('../fonts/manrope-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* --- Tokens ------------------------------------------------------------------ */
:root {
  /* Native controls (checkboxes, selects, scrollbars, date pickers) follow the
     theme instead of staying light in the dark palette. */
  color-scheme: light;
  /* Nudge appearance contract */
  --site-bg: #f8f8f7;
  --site-fg: #24272c;
  --site-accent: #3f6b7d;
  --site-on-accent: #ffffff;
  --site-surface: #ffffff;
  --site-muted: #5b6270;
  --site-border: #e4e3df;
  --site-font: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Nudge radius / spacing / typography / motion contract */
  --site-radius: 14px;
  --site-space: 1;
  --site-type: 1;
  --site-motion: 1;

  /* Derived tokens. --fg-soft, --ok and --warn are picked so that every muted
     text role clears 4.5:1 on all five light surfaces (page, card, elevated,
     accent-soft, warn-soft); axe reports 0 color-contrast violations with them. */
  --bg-elevated: #f1f0ec;
  --fg-soft: #5c6370;
  --accent-soft: #e9f1f4;
  --accent-hover: #35596a;
  --accent-strong: #35606f;
  --on-accent-soft: #2c5462;
  --danger: #b0483f;
  --danger-soft: #f9eceb;
  --ok: #256d4d;
  --ok-soft: #e9f3ee;
  --warn: #7d5a15;
  --warn-soft: #f8f0e0;
  --star: #c08327;
  --ring: 0 0 0 1px var(--site-border);
  --ring-strong: 0 0 0 1.5px var(--site-accent);
  --field-ring: 0 0 0 3px color-mix(in srgb, var(--site-accent) 16%, transparent);
  /* One shadow family, one ink. Everything raised uses --shadow-pop, sticky
     chrome uses --shadow-bar and the modal scrim uses --scrim. */
  --ink: 36, 39, 44;
  --shadow-soft: 0 1px 2px rgba(var(--ink), 0.04);
  --shadow-card: 0 1px 2px rgba(var(--ink), 0.04), 0 10px 26px rgba(var(--ink), 0.07);
  --shadow-float: 0 4px 14px rgba(var(--ink), 0.18);
  --shadow-pop: 0 14px 40px rgba(var(--ink), 0.18);
  --shadow-bar: 0 -6px 24px rgba(var(--ink), 0.1);
  --shadow-drawer: -12px 0 40px rgba(var(--ink), 0.14);
  --scrim: rgba(var(--ink), 0.4);
  --radius-card: calc(var(--site-radius) + 2px);
  --radius-sm: calc(var(--site-radius) - 4px);
  --radius-control: calc(var(--site-radius) - 2px);
  --radius-media: calc(var(--site-radius) + 8px);
  --gap: calc(24px * var(--site-space, 1));
  --gap-s: calc(14px * var(--site-space, 1));
  --gap-xs: calc(9px * var(--site-space, 1));
  --gap-l: calc(44px * var(--site-space, 1));
  --motion: calc(160ms * var(--site-motion, 1));
  --type-display: calc(34px * var(--site-type, 1));
  --type-h2: calc(23px * var(--site-type, 1));
  --type-h3: calc(18px * var(--site-type, 1));
  --container: 1280px;
  /* Vertical rhythm: one token decides the space between the header and the
     first content block, instead of each page inventing its own margin-top. */
  --page-top: var(--gap-s);
  /* Chrome above the body, split so the pieces compose: dismissing the banner
     (M6) removes its share without touching the header, and the single-row phone
     header below 820px changes its share without touching the banner. */
  --banner-h: 40px;
  --header-h: 66px;
  --shell-h: calc(var(--banner-h) + var(--header-h));
  /* The select chevron is one asset, tinted per theme. A CSS variable cannot be
     interpolated into a url() fragment, so the whole data URI is the token. */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.75 6 6.75 11 1.75' fill='none' stroke='%235c6370' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

html[data-theme='dark'] {
  color-scheme: dark;
  --site-bg: #15171b;
  --site-fg: #e4e7ea;
  --site-surface: #1c1f24;
  --site-muted: #a4acb8;
  --site-border: #2c3138;
  --site-accent: #7fb0c6;
  --site-on-accent: #10232c;
  --bg-elevated: #21252b;
  /* Was #8d959f: 4.48:1 on the selected-edition surface, under AA. */
  --fg-soft: #a4acb8;
  --accent-soft: #223038;
  --accent-hover: #93c2d8;
  --accent-strong: #92c0d4;
  --on-accent-soft: #c3dde9;
  --danger: #e08a82;
  --danger-soft: #342322;
  --ok: #86c9a5;
  --ok-soft: #1e2f27;
  --warn: #d9b276;
  --warn-soft: #322a1c;
  --star: #d8a94f;
  --shadow-soft: none;
  --shadow-card: none;
  --shadow-float: none;
  --shadow-pop: none;
  --shadow-bar: none;
  --shadow-drawer: none;
  --scrim: rgba(0, 0, 0, 0.6);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.75 6 6.75 11 1.75' fill='none' stroke='%23a4acb8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Demo product photography is shot on a light studio backdrop. On the dark
   canvas that backdrop would glow, so the photos are dimmed slightly and read
   as intentional photo tiles rather than unstyled light boxes. */
html[data-theme='dark'] .pc-media img,
html[data-theme='dark'] .cat-media img,
html[data-theme='dark'] .hero-media img,
html[data-theme='dark'] .p-main-img,
html[data-theme='dark'] .p-thumb img,
html[data-theme='dark'] .cart-item img,
html[data-theme='dark'] .si-item img,
html[data-theme='dark'] .order-items img {
  filter: brightness(0.86) saturate(0.9);
}

/* --- Base ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
/* Attribute hiding must beat component display rules: checkout swaps its
   delivery field groups with `hidden`, and `.delivery-fields { display:grid }`
   would otherwise keep the inactive group visible and focusable. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
body {
  margin: 0;
  background: var(--site-bg);
  color: var(--site-fg);
  font-family: var(--site-font);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  font-feature-settings: 'calt';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
/* Calm hierarchy: one family, weights capped at 600, no display-black. */
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -0.015em; }
h1 { font-size: var(--type-display); line-height: 1.15; }
h2 { font-size: var(--type-h2); }
h3 { font-size: var(--type-h3); font-weight: 600; line-height: 1.3; }
strong { font-weight: 600; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
/* Headings and containers that the router focuses programmatically (page title,
   skip-link target) are not interactive: they must not draw a box around the
   text, but assistive tech still lands there. */
[tabindex='-1']:focus, [tabindex='-1']:focus-visible { outline: none; }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: absolute; left: 16px; top: -52px;
  background: var(--site-accent); color: var(--site-on-accent);
  padding: 10px 18px; border-radius: var(--radius-control); z-index: 200;
  transition: top var(--motion);
  font-weight: 600; font-size: 15px;
}
.skip-link:focus { top: 12px; }

/* --- Layout --------------------------------------------------------------------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gap); }
main { padding-bottom: var(--gap-l); }
/* The banner + header have a known height and the footer is static markup, so
   the body can be reserved before any route mounts. Without this the footer
   sits at ~0px, and mounting a route pushes it down — a guaranteed layout shift
   on every cold navigation. */
main#app { min-height: calc(100vh - var(--shell-h)); }
/* The dismissal is remembered (voltis.demoBanner), so the reserved row is
   removed for the whole visit instead of leaving a gap above the header. */
html.banner-off { --banner-h: 0px; }
.muted { color: var(--site-muted); }
.low { color: var(--warn); font-weight: 500; }
.ok { color: var(--ok); font-weight: 500; }
.out { color: var(--danger); font-weight: 500; }

/* --- Demo banner ----------------------------------------------------------------- */
.demo-banner {
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  font-size: 13.5px;
  line-height: 1.45;
  padding: 10px 0;
  border-bottom: 1px solid var(--site-border);
}
.demo-banner .container { display: flex; align-items: baseline; gap: 10px; }
.demo-banner-text { margin: 0; min-width: 0; }
/* Small screens keep the collapsed disclosure compact (~45px) with the key
   "nothing is charged" phrase visible; expanding switches to multi-line. */
@media (max-width: 600px) {
  :root {
    --banner-h: 34px;
  }
  .demo-banner {
    font-size: 12.5px;
    line-height: 1.3;
    padding: 6px 0;
  }
  .demo-banner .container { align-items: center; flex-wrap: nowrap; gap: 6px; }
  .demo-banner-text { flex: 1 1 0; min-width: 0; }
  .demo-toggle { font-size: 12.5px; }
  .demo-dismiss { margin-left: 0; }
  .demo-banner[data-expanded='true'] {
    font-size: 13.5px;
    line-height: 1.45;
    padding: 10px 0;
  }
  .demo-banner[data-expanded='true'] .container { flex-wrap: wrap; row-gap: 6px; gap: 10px; }
  .demo-banner[data-expanded='true'] .demo-banner-text { flex: 1 1 100%; }
  .demo-banner[data-expanded='true'] .demo-toggle { order: 3; font-size: 13px; }
  .demo-banner[data-expanded='true'] .demo-dismiss { order: 2; margin-left: auto; }
  /* Keep the simulation short line (including RU) at two compact lines on 390px
     so cold-load locale hydration never grows the banner or shifts the header. */
  html[data-demo-mode='sim'] .demo-banner:not([data-expanded='true']) { font-size: 12px; }
  html[data-demo-mode='sim'] .demo-banner:not([data-expanded='true']) .container { padding: 0 16px; }
  html[data-demo-mode='sim'] .demo-banner:not([data-expanded='true']) .demo-banner-text { min-height: 2.6em; display: flex; align-items: center; }
  html[data-demo-mode='sim'] .demo-banner:not([data-expanded='true']) .demo-toggle { font-size: 12px; }
}
html[data-demo-mode='sim'] .demo-dismiss { display: none; }
.demo-toggle {
  border: 0; background: transparent; padding: 2px 4px;
  min-height: 24px; min-width: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px; color: inherit; cursor: pointer;
  white-space: nowrap; flex: none;
}
.demo-dismiss {
  border: 0; background: transparent; color: inherit;
  width: 28px; height: 28px; flex: none;
  margin: -4px -6px -4px 0; padding: 0;
  border-radius: 50%; cursor: pointer;
  font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--motion);
}
.demo-dismiss:hover { background: color-mix(in srgb, var(--site-fg) 10%, transparent); }
.demo-badge {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  background: var(--site-surface);
  color: var(--accent-strong);
  box-shadow: var(--ring);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 9999px;
  white-space: nowrap;
}
/* As an inline marker next to a section heading it should sit on the text
   centre rather than dropping to the baseline. */
.section-head .demo-badge { vertical-align: 0.22em; }

/* --- Header ------------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--site-bg) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--site-border);
}
.site-header .container {
  display: flex; align-items: center; gap: 10px;
  min-height: 64px;
  /* The wordmark is nowrap and the action cluster has a fixed minimum, so the
     tablet band is allowed to wrap rather than widen the document. Below 820px
     the controls the row cannot carry move into the menu instead, which is what
     keeps that band a single line (P9). */
  flex-wrap: wrap;
  row-gap: 8px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.header-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: none;
}
.header-demo-btn {
  border: 0;
  min-height: 24px;
  line-height: 1.25;
  padding: 2px 7px;
  cursor: pointer;
  transition: background var(--motion), color var(--motion);
}
.header-demo-btn:hover { background: var(--accent-soft); color: var(--on-accent-soft); }
.logo {
  display: flex; align-items: baseline; gap: 8px;
  min-width: 0;
  text-decoration: none;
  font-weight: 600; font-size: 19px; letter-spacing: 0.07em;
  white-space: nowrap;
}
.main-nav { display: flex; gap: 2px; min-width: 0; }
.main-nav a {
  text-decoration: none; font-weight: 500; font-size: 14px;
  padding: 8px 8px; border-radius: var(--radius-control);
  white-space: nowrap;
  transition: background var(--motion), color var(--motion);
}
.main-nav a:hover { background: var(--bg-elevated); }
.main-nav a[aria-current='page'] { background: var(--accent-soft); color: var(--on-accent-soft); font-weight: 600; }
.main-nav a.nav-back { color: var(--site-muted); }
.main-nav a.nav-back:hover { color: var(--site-fg); }
.header-actions { display: flex; align-items: center; gap: var(--gap-xs); margin-left: auto; min-width: 0; }
.header-search { position: relative; }
.header-search input {
  /* Inline up to the 1120px breakpoint, where the field swaps for the search
     icon button; some locales already wrap the header to a second row at the
     narrow end. The 200px lower bound is an outer width: the longest localized
     placeholder measures 147px of text, and the box adds 36px left padding,
     14px right padding and 2px of borders on top, so nothing under 199px can
     fit and 200px is the safe floor. */
  width: clamp(200px, 14vw, 224px); height: 40px;
  padding: 0 14px 0 36px;
  border-radius: var(--radius-control);
  border: 1px solid var(--site-border);
  background: var(--site-surface);
  transition: border-color var(--motion), box-shadow var(--motion);
}
.header-search input::placeholder { color: var(--fg-soft); }
.header-search input:focus:not(:focus-visible) {
  outline: none;
  border-color: var(--site-accent);
  box-shadow: var(--field-ring);
}
.header-search input:focus-visible {
  border-color: var(--site-accent);
  box-shadow: var(--field-ring);
}
.header-search .search-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--fg-soft); pointer-events: none;
}
.lang-switch {
  display: flex; overflow: hidden;
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface);
}
/* Purely a mount point: the switcher moves between this slot and the mobile menu
   (M6), and `display: contents` keeps it a direct flex item of the header. */
.lang-slot { display: contents; }
.lang-switch button {
  border: 0; background: transparent; padding: 9px 11px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--site-muted);
  transition: background var(--motion), color var(--motion);
}
/* The segmented pill hides overflow for its rounded ends, so the outside
   focus ring would be clipped by the pill's border; inset it instead. */
.lang-switch button:focus-visible { outline-offset: -3px; }
.lang-switch button + button { border-left: 1px solid var(--site-border); }
.lang-switch button:hover { background: var(--bg-elevated); color: var(--site-fg); }
.lang-switch button[aria-pressed='true'] { background: var(--accent-soft); color: var(--on-accent-soft); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface);
  position: relative;
  transition: background var(--motion), border-color var(--motion);
}
.icon-btn:hover { background: var(--bg-elevated); }
.icon-btn svg { width: 18px; height: 18px; }
.bag-count {
  position: absolute; top: -6px; right: -6px;
  background: var(--site-accent); color: var(--site-on-accent);
  font-size: 11px; font-weight: 600;
  min-width: 19px; height: 19px; line-height: 19px;
  border-radius: 9999px; text-align: center; padding: 0 5px;
}
.mobile-nav-btn { display: none; }
/* Replaced by the inline search field on wide screens (see the 1080px block). */
.header-search-btn { display: none; }

/* Mobile nav panel. `.open` is gated on the hamburger breakpoint below, so a
   menu left open when the window grows past it cannot stay on screen. */
.mobile-nav {
  border-top: 1px solid var(--site-border);
  background: var(--site-bg);
  padding: var(--gap-s) var(--gap) var(--gap);
  display: none;
}
.mobile-nav a {
  display: block; padding: 13px 4px; text-decoration: none;
  font-weight: 500; font-size: 16px;
  border-bottom: 1px solid var(--site-border);
}
.mobile-nav a:last-child { border-bottom: 0; }
/* The controls the phone header row cannot carry are relocated here (P9): the
   language switch below 820px and, below 560px, the wishlist icon too. The row
   wraps so the longest locale never pushes the panel past the viewport. */
.mobile-nav-extra {
  display: flex; align-items: center; gap: var(--gap-xs);
  flex-wrap: wrap;
  padding-top: var(--gap-s);
}
.mobile-nav-extra:empty { display: none; }
.mobile-nav-extra .lang-switch { flex: 1 1 140px; min-width: 0; }
.mobile-nav-extra .lang-switch button {
  flex: 1; min-height: 44px; padding: 10px 8px; font-size: 14px;
}
.mobile-nav-extra .lang-label { font-size: 13.5px; color: var(--site-muted); }

/* --- Buttons ------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 12px 22px;
  min-height: 44px;
  font-weight: 600; font-size: 15.5px; line-height: 1.1;
  text-align: center;
  text-decoration: none;
  transition: background var(--motion), border-color var(--motion),
              color var(--motion), box-shadow var(--motion), transform var(--motion);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--site-accent); color: var(--site-on-accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: var(--shadow-soft); }
.btn-secondary { background: var(--bg-elevated); color: var(--site-fg); }
.btn-secondary:hover { background: color-mix(in srgb, var(--bg-elevated) 78%, var(--site-fg)); }
.btn-outline {
  background: var(--site-surface); color: var(--site-fg);
  border-color: var(--site-border);
}
.btn-outline:hover { background: var(--accent-soft); border-color: var(--site-accent); color: var(--on-accent-soft); }
.btn-quiet { background: transparent; color: var(--site-muted); padding: 10px 14px; min-height: 40px; }
.btn-quiet:hover { background: var(--bg-elevated); color: var(--site-fg); }
.btn-lg { padding: 14px 28px; font-size: 16.5px; min-height: 52px; }
.btn-sm { padding: 9px 15px; font-size: 14px; min-height: 38px; }
.btn[disabled], .btn[aria-disabled='true'] {
  background: var(--bg-elevated); color: var(--fg-soft);
  border-color: var(--site-border);
  cursor: not-allowed; transform: none; box-shadow: none;
}

/* --- Wishlist buttons (card heart + product page) ------------------------------------- */
.wish-btn {
  border: 1px solid var(--site-border);
  background: var(--site-surface);
  border-radius: var(--radius-control);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--motion), color var(--motion), border-color var(--motion);
}
.wish-btn:hover { background: var(--bg-elevated); }
.wish-btn[aria-pressed='true'] {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 26%, transparent);
  color: var(--danger);
}

/* --- Product grid / cards --------------------------------------------------------------- */
.product-grid {
  display: grid;
  /* auto-fill keeps rows full at every width (1 / 2 / 3 / 4 columns) instead of
     leaving an orphan card under a fixed 3-column grid. */
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--gap);
}
.product-card {
  display: flex; flex-direction: column;
  text-decoration: none;
  background: var(--site-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--ring);
  overflow: hidden;
  transition: transform var(--motion), box-shadow var(--motion);
  position: relative;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--ring), var(--shadow-card); }
.product-card .pc-media { aspect-ratio: 1; background: var(--bg-elevated); }
.product-card .pc-media img { width: 100%; height: 100%; object-fit: cover; }
.pc-badges {
  position: absolute; top: 12px; left: 12px;
  display: flex; gap: 8px; z-index: 2; flex-wrap: wrap;
}
.badge-sale {
  background: var(--danger-soft); color: var(--danger);
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 9999px;
}
.badge-new {
  background: var(--site-surface); color: var(--site-muted); box-shadow: var(--ring);
  font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 9999px;
}
/* Surface insets leave headroom above the first text line. Equal top and side
   padding reads as tight because the ascender, not the line box, meets the
   border; a 2px optical bias keeps titles from hugging the top edge. */
.product-card .pc-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc-type { font-size: 12.5px; color: var(--fg-soft); font-weight: 500; letter-spacing: 0.02em; }
.pc-name { font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.pc-rating { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--site-muted); }
.pc-rating .muted { font-size: 13px; }
.pc-prices { display: flex; align-items: baseline; gap: 10px; margin-top: auto; padding-top: 4px; }
.pc-price { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pc-compare { font-size: 14px; color: var(--fg-soft); text-decoration: line-through; }
.pc-stock { font-size: 13px; color: var(--fg-soft); min-height: 1.2em; }
.pc-stock.out { color: var(--danger); font-weight: 500; }
.pc-stock:not(.out):not(:empty) { color: var(--warn); font-weight: 500; }
/* Card overlay link covers the whole card; floating actions sit above it. */
.pc-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
/* The card clips its corners, so an outside focus ring would lose 4 px on
   every edge; draw the shared ring just inside the card instead. */
.pc-link:focus-visible { outline-offset: -4px; }
/* The two floating actions are wrapped for markup convenience only: as a
   `display: contents` box it contributes no flex item, otherwise the card's
   6px column gap would add dead space under the stock line. Its absolutely
   positioned children still anchor to the card. */
.pc-actions { display: contents; }
.pc-heart {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 40px; height: 40px;
  background: color-mix(in srgb, var(--site-surface) 92%, transparent);
  backdrop-filter: blur(4px);
  box-shadow: var(--ring);
  border-color: transparent;
}
.pc-heart svg { width: 18px; height: 18px; }
.pc-quick {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: var(--site-accent); color: var(--site-on-accent);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-float);
  transition: opacity var(--motion), transform var(--motion), background var(--motion);
}
.pc-quick svg { width: 20px; height: 20px; }
.pc-quick:hover { background: var(--accent-hover); }
.pc-quick[disabled] { display: none; }
@media (hover: hover) {
  .pc-quick { opacity: 0; transform: translateY(6px); }
  .product-card:hover .pc-quick,
  .product-card:focus-within .pc-quick,
  .pc-quick:focus-visible { opacity: 1; transform: none; }
}

/* Rating stars (text-glyph rows with inline opacity) */
.stars { display: inline-flex; gap: 2px; color: var(--star); }
.stars svg { width: 15px; height: 15px; }
.rating-stars { display: inline-flex; gap: 1px; color: var(--star); font-size: 14px; letter-spacing: 1px; }

/* --- Category / collection page ----------------------------------------------------------- */
.category-head { margin-top: var(--page-top); }
.breadcrumb { display: flex; gap: 8px; font-size: 13.5px; color: var(--fg-soft); padding: var(--gap) 0 0; flex-wrap: wrap; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.crumb-sep { color: var(--fg-soft); }
.crumb-current { color: var(--site-fg); font-weight: 500; }
.category-head h1 { margin-top: 6px; }
.browse { display: flex; flex-direction: column; }
.category-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--gap); align-items: start; margin-top: var(--gap); }
.category-results { min-width: 0; }
/* Programmatic focus target for filter changes; it is not an interactive
   control, so it gets no visible ring (screen readers still land here). */
.category-results:focus { outline: none; }
aside.filters {
  position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: var(--gap-s);
  background: var(--site-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--ring);
  padding: 24px;
}
.filters-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.filter-fields { display: flex; flex-direction: column; gap: var(--gap-s); }
/* Filter groups are semantic fieldsets; reset the browser chrome and style
   the legend as the group heading. */
fieldset.filter-group, fieldset.opt-group { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.filter-group legend {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--fg-soft); padding: 0 0 8px;
}
.filter-group label {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; margin: 0 -8px; border-radius: var(--radius-sm);
  font-size: 14.5px; cursor: pointer;
  transition: background var(--motion);
}
.filter-group label:hover { background: var(--bg-elevated); }
.filter-group input[type='checkbox'] { width: 18px; height: 18px; flex: none; accent-color: var(--site-accent); }
.filter-option {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; margin: 0 -8px; border-radius: var(--radius-sm);
  font-size: 14.5px; cursor: pointer;
  transition: background var(--motion);
}
.filter-option:hover { background: var(--bg-elevated); }
.filter-option input[type='checkbox'] { width: 18px; height: 18px; flex: none; accent-color: var(--site-accent); }
.price-inputs { display: flex; gap: 8px; align-items: center; }
.price-dash { color: var(--fg-soft); }
.price-inputs input {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface); font: inherit; font-size: 15px;
  transition: border-color var(--motion), box-shadow var(--motion);
}
.price-inputs input:focus-visible { border-color: var(--site-accent); box-shadow: var(--field-ring); }
.browse-toolbar { display: flex; align-items: center; gap: var(--gap-s); flex-wrap: wrap; margin-bottom: var(--gap-s); }
.browse-count { font-weight: 500; font-size: 14.5px; color: var(--site-muted); }
/* A select sizes itself to its longest option, and a flex item refuses to shrink
   below its min-content: in Russian the sort row measured 308px inside a 272px
   column at 320px. min-width:0 plus a wrapping line lets the field take the width
   it is given instead of widening the document. */
.browse-sort { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.browse-sort select { min-width: 0; max-width: 100%; }
.sort-label { font-size: 14px; font-weight: 500; color: var(--site-muted); }
/* One select treatment everywhere: native arrows differ per OS and sit badly
   next to our own inputs, so the chevron is drawn from a data URI instead.
   --chevron carries the theme tint, so no dark override is needed here. */
.browse-sort select,
.checkout-card select,
.simple-form select,
.admin-panel select {
  appearance: none; -webkit-appearance: none;
  min-height: 42px;
  padding: 10px 38px 10px 14px;
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background-color: var(--site-surface);
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  font: inherit; font-size: 15px;
  cursor: pointer;
  transition: border-color var(--motion), box-shadow var(--motion);
}
select:focus-visible { border-color: var(--site-accent); box-shadow: var(--field-ring); }
.filters-toggle { display: none; }
.ft-icon { display: inline-flex; }
.ft-icon svg { width: 16px; height: 16px; }
.ft-count {
  background: var(--site-accent); color: var(--site-on-accent);
  font-size: 12px; font-weight: 600;
  min-width: 19px; height: 19px; line-height: 19px;
  border-radius: 9999px; text-align: center; padding: 0 5px;
}
.sheet-count { font-size: 14px; font-weight: 500; color: var(--site-muted); }
.drawer-foot .btn-primary { width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: var(--gap-s); }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft); color: var(--on-accent-soft);
  border-radius: 9999px; padding: 7px 13px;
  font-size: 13.5px; font-weight: 500; border: 0; cursor: pointer;
  transition: background var(--motion), color var(--motion);
}
/* Hover deepens the tint but keeps the ink colour: the previous white-on-mix
   label measured 1.6:1 in the light theme. 5.1:1 light / 6.0:1 dark here. */
.chip:hover { background: color-mix(in srgb, var(--accent-soft) 75%, var(--site-accent)); color: var(--on-accent-soft); }
.chip-clear {
  border: 0; background: transparent; text-decoration: underline; text-underline-offset: 2px;
  color: var(--site-muted); font-size: 13.5px; padding: 7px 8px; cursor: pointer;
}
.chip-clear:hover { color: var(--site-fg); }

/* --- Product detail --------------------------------------------------------------------------- */
.product-page { padding-bottom: var(--gap-s); }
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: var(--gap-l);
  margin-top: var(--page-top);
  align-items: start;
}
.p-media { min-width: 0; }
/* height:auto lets the aspect-ratio (and therefore the width/height attributes
   on the element) decide the box height. A presentational height attribute would
   otherwise fight the ratio and stretch the photo. */
.p-main-img {
  width: 100%; height: auto; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius-card);
  background: var(--bg-elevated);
}
.p-thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.p-thumb {
  width: 68px; height: 68px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0; border: 0;
  background: var(--bg-elevated);
  box-shadow: var(--ring);
  opacity: 0.75;
  transition: opacity var(--motion), box-shadow var(--motion);
}
.p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.p-thumb:hover { opacity: 1; }
.p-thumb.active, .p-thumb[aria-current='true'] { opacity: 1; box-shadow: var(--ring-strong); }
.p-info { display: flex; flex-direction: column; gap: var(--gap-s); min-width: 0; }
.p-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--gap-s); }
.p-name { font-size: calc(28px * var(--site-type, 1)); line-height: 1.2; }
.p-wish { width: 46px; height: 46px; flex: none; margin-top: 2px; }
.p-wish svg { width: 20px; height: 20px; }
.p-rating { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.p-rating a { text-decoration: none; }
.p-rating a:hover { text-decoration: underline; }
.p-price-block { display: flex; flex-direction: column; gap: 4px; }
.p-price-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.p-price { font-size: 27px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.p-compare { font-size: 15px; color: var(--fg-soft); text-decoration: line-through; }
.p-save {
  background: var(--accent-soft); color: var(--on-accent-soft);
  font-size: 13px; font-weight: 600; padding: 4px 11px; border-radius: 9999px;
  width: fit-content;
}
.p-range { font-size: 14px; }
.vat-note { font-size: 13px; color: var(--fg-soft); }
.opt-group { display: flex; flex-direction: column; gap: 10px; }
.opt-group legend { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--fg-soft); padding: 0; }
.sel-name { text-transform: none; letter-spacing: -0.01em; font-weight: 600; font-size: 15px; color: var(--site-fg); }
.swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch-btn {
  border: 0; background: none; padding: 4px;
  position: relative; border-radius: 50%;
}
.swatch { width: 34px; height: 34px; border-radius: 50%; box-shadow: var(--ring); display: block; }
.swatch-btn[aria-pressed='true'] .swatch { box-shadow: 0 0 0 2px var(--site-bg), 0 0 0 4px var(--site-accent); }
.swatch-out {
  position: absolute; top: 50%; left: 50%;
  width: 135%; height: 2px;
  background: var(--danger);
  transform: translate(-50%, -50%) rotate(-45deg);
  border-radius: 2px; opacity: 0.85;
  pointer-events: none;
}
.edition-cards { display: flex; flex-direction: column; gap: 10px; }
.edition-card {
  display: grid; grid-template-columns: 1fr auto;
  column-gap: 12px; row-gap: 3px; align-items: baseline;
  text-align: left;
  background: var(--site-surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--ring);
  padding: 16px;
  transition: box-shadow var(--motion), background var(--motion);
}
.edition-card:hover { background: var(--bg-elevated); }
.edition-card[aria-pressed='true'] { background: var(--accent-soft); box-shadow: var(--ring-strong); }
.ed-name { font-weight: 600; font-size: 15.5px; }
.ed-price { font-weight: 600; font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ed-desc { grid-column: 1; font-size: 13px; color: var(--fg-soft); }
.ed-out { grid-column: 2; color: var(--danger); font-size: 13px; font-weight: 600; }
.p-buy { display: flex; gap: var(--gap-s); align-items: stretch; margin-top: 6px; flex-wrap: wrap; }
.p-buy .btn-primary { flex: 1; min-width: 220px; }
.stock-line { font-size: 14px; font-weight: 500; }
.stock-line.ok { color: var(--ok); }
.stock-line.low { color: var(--warn); }
.stock-line.out { color: var(--danger); }
.p-perks { display: grid; gap: 10px; margin-top: 4px; }
.perk {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--site-surface); border-radius: var(--radius-sm);
  box-shadow: var(--ring); padding: 16px 18px;
}
.perk-icon { color: var(--accent-strong); flex: none; margin-top: 1px; }
.perk-icon svg { width: 20px; height: 20px; display: block; }
.perk strong { display: block; font-size: 14.5px; font-weight: 600; }
.perk span { font-size: 13px; color: var(--site-muted); }
/* Delivery and returns perks open their full info pages; the whole tile is the
   target, with the heading as the hover affordance. */
.perk-link { color: inherit; text-decoration: none; }
.perk-link:hover strong, .perk-link:focus-visible strong { color: var(--accent-strong); text-decoration: underline; }
/* Sticky mobile buy bar — revealed by IntersectionObserver when the inline
   buy row scrolls out of view; desktop hides it (inline CTA stays visible). */
.buy-bar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  background: color-mix(in srgb, var(--site-surface) 94%, transparent);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--site-border);
  box-shadow: var(--shadow-bar);
  padding: 12px var(--gap) calc(12px + env(safe-area-inset-bottom, 0px));
  align-items: center; gap: var(--gap-s);
}
.bb-price { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bb-add { flex: 1; }
/* Detail sections */
.p-details { margin-top: var(--gap-l); display: flex; flex-direction: column; gap: var(--gap-l); }
.p-details h2 { font-size: calc(20px * var(--site-type, 1)); margin-bottom: var(--gap-s); }
.p-desc { color: var(--site-muted); font-size: 15.5px; line-height: 1.65; max-width: 68ch; }
.hl-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; color: var(--site-muted); }
.p-reviews { display: flex; flex-direction: column; gap: var(--gap-s); }
.p-reviews h2 { margin-bottom: 0; }
.review { background: var(--site-surface); border-radius: var(--radius-sm); box-shadow: var(--ring); padding: 18px; }
.review-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14.5px; font-weight: 600; }
.review-head time { font-size: 13px; color: var(--fg-soft); margin-left: auto; font-weight: 400; }
.review p { margin-top: 6px; color: var(--site-muted); font-size: 15px; }
.related-title { font-size: calc(20px * var(--site-type, 1)); margin-bottom: var(--gap-s); }

/* --- Free-delivery progress ------------------------------------------------------------------------ */
.ship-progress { margin: 6px 0 2px; display: flex; flex-direction: column; gap: 6px; }
.ship-track {
  height: 6px; border-radius: 9999px;
  /* Must stay readable on both the white summary card and the drawer canvas,
     so the empty part of the track is a translucent ink tint, not a fill. */
  background: color-mix(in srgb, var(--site-fg) 9%, transparent);
  overflow: hidden;
}
.ship-fill {
  height: 100%; width: 0;
  background: var(--site-accent);
  border-radius: inherit;
  transition: width calc(var(--motion) * 2);
}
.ship-progress.done .ship-fill { background: var(--ok); }
.ship-label { font-size: 13px; color: var(--site-muted); display: flex; align-items: center; gap: 6px; }
.ship-done-label { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-weight: 600; font-size: 13px; }
.ship-done-label svg { width: 14px; height: 14px; }

/* --- Cart / drawer ------------------------------------------------------------------------------ */
.drawer-underlay { position: fixed; inset: 0; background: var(--scrim); z-index: 140; border: 0; padding: 0; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--site-bg);
  z-index: 150;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-drawer);
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--gap); border-bottom: 1px solid var(--site-border); }
.drawer-head h2 { font-size: 18px; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap-s); }
.sheet-body { flex: 1; min-height: 0; }
.drawer-foot { border-top: 1px solid var(--site-border); padding: 16px var(--gap) var(--gap); display: flex; flex-direction: column; gap: var(--gap-s); }
.cart-item {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: var(--gap-s);
  background: var(--site-surface); border-radius: var(--radius-card);
  box-shadow: var(--ring); padding: 16px;
  align-items: center;
}
.cart-item.over { box-shadow: var(--ring-strong), 0 0 0 1.5px var(--danger); }
.cart-item img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-elevated); }
.cart-item > div { min-width: 0; }
.ci-info { min-width: 0; }
.ci-name { display: block; font-weight: 600; font-size: 15.5px; line-height: 1.3; color: var(--site-fg); text-decoration: none; overflow-wrap: anywhere; }
.ci-name:hover { color: var(--site-accent); }
.ci-meta { font-size: 13px; color: var(--fg-soft); margin-top: 3px; }
/* Wraps instead of squeezing: a long localized "remove" label drops below the
   stepper rather than borrowing width from it. */
.ci-qty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; row-gap: 6px; margin-top: 10px; }
.ci-right { text-align: right; }
.ci-price { font-weight: 600; font-size: 15.5px; text-align: right; font-variant-numeric: tabular-nums; }
.ci-remove {
  border: 0; background: transparent; color: var(--fg-soft);
  font-size: 13px; text-decoration: underline; padding: 6px 2px; margin-top: 2px;
  min-height: 24px; /* WCAG 2.2 target size: the text link is a real control */
  /* One line: a wrapped two-line "remove" link under the price reads as a
     stray paragraph on narrow screens. */
  white-space: nowrap;
}
.ci-remove:hover { color: var(--danger); }
.qty-stepper {
  display: inline-flex; align-items: center;
  /* Never shrinks: it is a scroll container, so its automatic minimum size is 0
     and a squeezed row would clip the plus button onto whatever sits beside it. */
  flex: none;
  border-radius: var(--radius-control); box-shadow: var(--ring);
  overflow: hidden; background: var(--site-surface);
}
.qty-stepper:focus-within {
  outline: 2px solid var(--site-accent);
  outline-offset: 2px;
}
.qty-stepper button:focus-visible,
.qty-stepper input:focus-visible {
  outline: 2px solid var(--site-accent);
  outline-offset: -3px;
  border-radius: var(--radius-sm);
}
.qty-stepper button {
  width: 38px; height: 44px; border: 0; background: transparent; color: var(--site-fg);
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0; box-sizing: border-box;
  transition: background var(--motion);
}
.qty-stepper button:hover { background: var(--bg-elevated); }
.qty-stepper button svg { width: 14px; height: 14px; }
.qty-stepper input, .qty-stepper .qty-value {
  width: 40px; text-align: center; border: 0; background: transparent;
  font-weight: 600; font-size: 15px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0; box-sizing: border-box;
}
.qty-stepper.sm button { height: 36px; width: 34px; }
.qty-stepper.sm input, .qty-stepper.sm .qty-value { width: 34px; font-size: 14px; height: 36px; }
.sum-row { display: flex; justify-content: space-between; font-size: 15px; padding: 3px 0; }
.sum-row.total { font-size: 18px; font-weight: 600; padding-top: 8px; }
.sum-row.discount { color: var(--ok); font-weight: 600; }
.sum-note { font-size: 13px; color: var(--fg-soft); }
.field-error { color: var(--danger); font-size: 13px; margin-top: 4px; font-weight: 600; }

/* --- Cart page ----------------------------------------------------------------------------------- */
.cart-page { margin-top: var(--page-top); }
.cart-page > h1 { margin-bottom: var(--gap); }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--gap); align-items: start; }
.cart-list { display: flex; flex-direction: column; gap: var(--gap-s); }
.cart-summary {
  position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: var(--gap-s);
  background: var(--site-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--ring);
  padding: 24px;
}
.sum-rows { display: flex; flex-direction: column; }
.discount-block { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.discount-row { display: flex; gap: 8px; }
.discount-row input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface);
}
.discount-row input:focus-visible { border-color: var(--site-accent); box-shadow: var(--field-ring); }
.promo-hint { margin: 6px 0 0; font-size: 13px; color: var(--site-muted); }
.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-xs); padding-top: 4px; align-items: start; }
/* The summary card is narrow: three side-by-side labels each fold to three
   lines, so the trust row is stacked there instead. */
.cart-summary .trust-row { grid-template-columns: 1fr; gap: 8px; }
.trust-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--site-muted); }
.trust-icon { color: var(--accent-strong); flex: none; display: inline-flex; margin-top: 2px; }
.trust-icon svg { width: 16px; height: 16px; }
.empty-state { text-align: center; padding: var(--gap-l) var(--gap); display: flex; flex-direction: column; gap: var(--gap-s); align-items: center; }
.empty-state svg { width: 56px; height: 56px; color: var(--fg-soft); }
.empty-icon { color: var(--fg-soft); }
.empty-icon svg { width: 56px; height: 56px; display: block; }
/* `align-items: center` above makes the suggestions section shrink-to-fit, and an
   auto-fill 1fr grid sizes from its images, so that width only settled once they
   decoded — the whole section re-laid out (CLS ~0.076 on an empty checkout).
   Stretching it takes the column width on the first layout pass instead. */
.empty-state > .home-section { align-self: stretch; width: 100%; min-width: 0; }
/* Empty browse result: left-aligned copy plus real suggestions, so the page
   reads as "nothing matched", not "nothing exists". */
.empty-browse { display: flex; flex-direction: column; gap: var(--gap-s); padding: var(--gap) 0 var(--gap-l); }
.empty-browse > .btn { align-self: flex-start; }
.browse-empty .cat-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* --- Checkout ------------------------------------------------------------------------------------ */
.checkout-page { margin-top: var(--page-top); }
.checkout-page > h1 { margin-bottom: var(--gap); }
/* Plain-language demo notice: the purchase is simulated end to end. Kept on a
   soft accent surface so it reads as guidance, not an error, and wraps beside
   its shortcut at narrow widths instead of squeezing the copy. */
.checkout-demo {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px 16px;
  margin-bottom: var(--gap);
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: var(--accent-soft);
  color: var(--on-accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--site-accent) 20%, transparent);
}
.checkout-demo p { font-size: 14.5px; line-height: 1.5; max-width: 68ch; }
.checkout-demo strong { font-weight: 600; }
.checkout-demo .btn { flex: none; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--gap); align-items: start; }
.checkout-form { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.checkout-actions { display: flex; flex-direction: column; gap: var(--gap-s); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-s); }
.form-grid .full { grid-column: 1 / -1; }
.form-error {
  background: var(--danger-soft); color: var(--danger);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 14px; font-weight: 600;
}
.form-warning {
  background: var(--warn-soft); color: var(--warn);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 14px; font-weight: 600;
}
.form-success {
  background: var(--accent-soft); color: var(--on-accent-soft);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 14px; font-weight: 600;
}
.delivery-options { display: flex; flex-direction: column; gap: 10px; }
.delivery-option {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: var(--radius-card);
  box-shadow: var(--ring);
  background: var(--site-surface);
  padding: 16px;
  cursor: pointer;
  transition: box-shadow var(--motion), background var(--motion);
}
.delivery-option:hover { background: var(--bg-elevated); }
.delivery-option input { margin-top: 4px; accent-color: var(--site-accent); }
.delivery-option .do-name { font-weight: 600; font-size: 15px; }
.delivery-option .do-price { margin-left: auto; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.checkout-summary { position: sticky; top: 84px; display: flex; flex-direction: column; gap: var(--gap-s); }
.sum-items {
  border: 1px solid var(--site-border);
  border-radius: var(--radius-card);
  background: var(--site-surface);
  overflow: hidden;
}
.sum-items-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px;
  font-weight: 600; cursor: pointer; list-style: none;
}
.sum-items-head::-webkit-details-marker { display: none; }
.sum-items-head::after {
  content: ''; width: 8px; height: 8px;
  border-right: 2px solid var(--site-muted); border-bottom: 2px solid var(--site-muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--motion);
}
.sum-items[open] .sum-items-head::after { transform: rotate(225deg) translateY(-2px); }
.sum-items-inline { font-weight: 600; font-variant-numeric: tabular-nums; }
.si-item {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px;
  padding: 10px 16px; border-top: 1px solid var(--site-border);
  align-items: center;
}
.si-item img { width: 48px; height: 48px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-elevated); }
.si-info { display: flex; flex-direction: column; gap: 2px; font-size: 14px; min-width: 0; }
.si-name { font-weight: 600; }
.si-meta { font-size: 12px; color: var(--fg-soft); }
.si-price { font-weight: 600; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.checkout-summary .trust-row { grid-template-columns: 1fr 1fr; }

/* Checkout uses semantic fieldset/legend groups ("checkout-card"); reset the
   browser chrome and style the legend as a card heading. */
.checkout-page fieldset.checkout-card {
  border: 0; min-width: 0; margin: 0;
  background: var(--site-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--ring);
  /* Top padding matches the sides so the heading does not sit on the border.
     Chromium still uses this value as the gap under the legend when it ignores
     fieldset padding-top for legend placement. */
  padding: 22px;
  /* display:grid turns off the fieldset's special legend positioning and
     renders the legend as a normal first item inside the card. */
  display: grid; grid-template-columns: 1fr; align-content: start; gap: 14px;
}
/* Chromium ignores a fieldset's top padding when positioning its legend, so
   the legend carries its own generous inset instead of relying on the card. */
.checkout-card legend { font-size: 17px; font-weight: 600; padding: 24px 0 0; }
.checkout-card label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.checkout-card input[type='text'], .checkout-card input[type='email'],
.checkout-card input[type='tel'], .checkout-card input[type='search'] {
  height: 44px; padding: 0 14px;
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface); color: var(--site-fg); font: inherit;
  transition: border-color var(--motion), box-shadow var(--motion);
}
.checkout-card input::placeholder { color: var(--fg-soft); }
.checkout-card input:focus-visible, .checkout-card select:focus-visible {
  border-color: var(--site-accent); box-shadow: var(--field-ring);
}
.checkout-card input[aria-invalid='true'] { border-color: var(--danger); }
.checkout-card .hint { font-size: 13px; color: var(--fg-soft); font-weight: 400; }
.checkout-card .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap-s); }
.checkout-card .delivery-fields { display: grid; grid-template-columns: 1fr; gap: var(--gap-s); }
.provider-note { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.provider-note svg { width: 20px; height: 20px; flex: none; }
.demo-note { font-size: 13px; color: var(--fg-soft); }
.checkout-card .do-eta { font-size: 13px; color: var(--fg-soft); }
.checkout-card .delivery-option {
  display: grid; grid-template-columns: auto 1fr auto;
  column-gap: 12px; row-gap: 4px; align-items: center;
}
.checkout-card .delivery-option input,
.checkout-card .delivery-option .do-name,
.checkout-card .delivery-option .do-price { grid-row: 1; }
.checkout-card .delivery-option .do-price { margin-left: 0; }
.checkout-card .delivery-option .do-eta { grid-column: 2 / -1; grid-row: 2; }
/* Free because the shipping threshold is met: show the waived list price too. */
.checkout-card .delivery-option .do-price.unlocked { display: inline-flex; align-items: baseline; gap: 6px; color: var(--ok); }
.checkout-card .delivery-option .do-was { font-weight: 500; font-size: 13px; color: var(--fg-soft); text-decoration: line-through; }
.terms-note { font-size: 13px; color: var(--fg-soft); }
.terms-note a { color: var(--site-fg); font-weight: 600; }

/* --- Pay (mock provider) --------------------------------------------------------------------------- */
.pay-page { max-width: 520px; margin: var(--gap-l) auto 0; }
.pay-card { background: var(--site-surface); border-radius: var(--radius-card); box-shadow: var(--ring); overflow: hidden; }
.pay-head {
  background: var(--bg-elevated); color: var(--site-fg);
  border-bottom: 1px solid var(--site-border);
  padding: 16px var(--gap);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pay-logo svg { width: 24px; height: 24px; display: block; color: var(--site-accent); }
.pay-name { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.pay-title { font-size: 20px; padding: var(--gap) var(--gap) 0; }
.pay-amount {
  padding: var(--gap-s) var(--gap) 0;
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.pay-amount strong { font-size: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pay-merchant { padding: var(--gap-xs) var(--gap) 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.pay-warning {
  margin: var(--gap-s) var(--gap) 0;
  background: var(--warn-soft);
  border-radius: var(--radius-sm);
  padding: 14px 16px; font-size: 13px; font-weight: 500; color: var(--warn);
}
.pay-actions { padding: var(--gap); display: flex; flex-direction: column; gap: 10px; }
.pay-status { padding: 0 var(--gap) var(--gap); }
.processing { color: var(--site-muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.pay-retry { margin-top: var(--gap-s); display: flex; gap: var(--gap-xs); flex-wrap: wrap; }

/* --- Order / status ------------------------------------------------------------------------------ */
.order-page { max-width: 720px; margin: var(--page-top) auto 0; display: flex; flex-direction: column; gap: var(--gap); }
.order-confirmed {
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--gap-s);
  padding: var(--gap) 0 0;
}
.confirmed-icon { color: var(--ok); }
.confirmed-icon svg { width: 56px; height: 56px; display: block; }
.order-card {
  background: var(--site-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--ring);
  padding: var(--gap);
  display: flex; flex-direction: column; gap: var(--gap-s);
}
.order-head { display: flex; justify-content: space-between; gap: var(--gap-s); flex-wrap: wrap; }
.order-head > div { display: flex; flex-direction: column; gap: 2px; }
.order-head strong { font-size: 17px; font-weight: 600; }
.order-lookup { display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin-top: var(--gap-s); }
.order-lookup label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.order-lookup input {
  height: 44px; padding: 0 14px; font: inherit; color: var(--site-fg);
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface);
}
.order-lookup input:focus-visible { border-color: var(--site-accent); box-shadow: var(--field-ring); }
.order-lookup .btn { align-self: flex-start; }
.order-items td { padding: 10px 12px; vertical-align: middle; }
.order-items img { border-radius: var(--radius-sm); background: var(--bg-elevated); }
.order-items td:nth-child(3) { white-space: nowrap; color: var(--site-muted); }
.order-items td:nth-child(4), td.num { text-align: right; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.order-sums { border-top: 1px solid var(--site-border); padding-top: var(--gap-s); display: flex; flex-direction: column; }
.order-meta {
  border-top: 1px solid var(--site-border); padding-top: var(--gap-s);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap);
}
.order-meta h3 { font-size: 16px; margin-bottom: 6px; }
.order-meta p { font-size: 14px; }
.order-actions { display: flex; gap: var(--gap-s); flex-wrap: wrap; }
.save-note { font-size: 13px; color: var(--fg-soft); }
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  border-radius: 9999px; padding: 5px 12px;
  font-size: 13px; font-weight: 600;
  background: var(--bg-elevated); color: var(--site-muted);
}
.status-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--fg-soft); }
.status-pill.paid, .status-pill.delivered { background: var(--ok-soft); color: var(--ok); }
.status-pill.paid::before, .status-pill.delivered::before { background: var(--ok); }
.status-pill.failed, .status-pill.cancelled, .status-pill.expired { background: var(--danger-soft); color: var(--danger); }
.status-pill.failed::before, .status-pill.cancelled::before, .status-pill.expired::before { background: var(--danger); }
.status-pill.pending_payment, .status-pill.processing { background: var(--warn-soft); color: var(--warn); }
.status-pill.pending_payment::before, .status-pill.processing::before { background: var(--warn); }
/* Backorder is a wait, not a failure: same warn ink, hollow dot. */
.status-pill.backorder { background: var(--warn-soft); color: var(--warn); }
.status-pill.backorder::before { background: transparent; box-shadow: inset 0 0 0 2px var(--warn); }
/* A late payment is the same kind of wait — money that has to go back — while the
   executed refund below stays the neutral closed state. */
.status-pill.refund_pending { background: var(--warn-soft); color: var(--warn); }
.status-pill.refund_pending::before { background: transparent; box-shadow: inset 0 0 0 2px var(--warn); }

/* --- Admin ----------------------------------------------------------------------------------------- */
.admin-page { display: flex; flex-direction: column; gap: var(--gap); margin-top: var(--page-top); }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-s); flex-wrap: wrap; }
.admin-head h1 { font-size: var(--type-display); }
.admin-panel {
  background: var(--site-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--ring);
  padding: var(--gap);
  display: flex; flex-direction: column; gap: var(--gap-s);
}
.admin-content { display: flex; flex-direction: column; gap: var(--gap-s); }
.admin-pagination {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--gap-s); flex-wrap: wrap;
}
.admin-page-indicator { font-size: 14px; font-weight: 500; }
.admin-login {
  max-width: 420px; margin: var(--gap-l) auto 0;
  background: var(--site-surface);
  border-radius: var(--radius-card);
  box-shadow: var(--ring);
  padding: var(--gap);
  display: flex; flex-direction: column; gap: var(--gap-s);
}
.admin-login label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.admin-login input {
  height: 44px; padding: 0 14px; font: inherit; color: var(--site-fg);
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface);
}
.admin-login input:focus-visible { border-color: var(--site-accent); box-shadow: var(--field-ring); }
/* The tablist is the navigation itself; logout sits beside it, outside the
   role="tablist", so a screen reader does not announce it as a fourth tab. */
.admin-bar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--gap-s); flex-wrap: wrap;
  border-bottom: 1px solid var(--site-border);
}
.admin-tabs { display: flex; gap: 4px; margin-bottom: -1px; flex-wrap: wrap; }
.admin-logout { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.admin-tabs button {
  border: 0; background: transparent; padding: 10px 16px;
  min-height: 44px;
  font-weight: 500; font-size: 15px; color: var(--site-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: background var(--motion), color var(--motion);
}
.admin-tabs button:hover { background: var(--bg-elevated); color: var(--site-fg); }
.admin-tabs button[aria-selected='true'] { background: var(--accent-soft); color: var(--on-accent-soft); box-shadow: inset 0 -2px 0 var(--site-accent); }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--site-surface); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--ring); }
.data-table th { text-align: left; padding: 12px 16px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-soft); border-bottom: 1px solid var(--site-border); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--site-border); }
.data-table tr:last-child td { border-bottom: 0; }
/* A populated admin table (six columns of order data, a stock row with a number
   field) measures well past a phone and cannot be squeezed further. The region
   around it takes that overflow: the table scrolls, the document does not — a
   sideways page would push the header, the totals and every row's first column
   off screen at the same time. A focused scroll region is an arrow-key scroll
   stop in Chromium, which is what tabindex 0 buys here; the global [tabindex]
   focus ring shows the visitor which box the keys act on. */
.table-scroll {
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border-radius: var(--radius-card);
  background: var(--site-surface);
  box-shadow: var(--ring);
}
.table-scroll .data-table { box-shadow: none; }
@media (max-width: 560px) {
  .table-scroll th, .table-scroll td { padding-inline: 12px; }
}
.email-preview { white-space: pre-wrap; font-size: 14px; background: var(--bg-elevated); border-radius: var(--radius-card); padding: var(--gap-s) var(--gap); }
.simple-form { display: flex; flex-direction: column; gap: var(--gap-s); max-width: 460px; }
.simple-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.simple-form input, .simple-form textarea {
  font: inherit; color: var(--site-fg);
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface);
}
.simple-form input { height: 44px; padding: 0 14px; }
.simple-form textarea { min-height: 120px; padding: 12px 14px; resize: vertical; }
.simple-form input:focus-visible, .simple-form textarea:focus-visible, .simple-form select:focus-visible {
  border-color: var(--site-accent); box-shadow: var(--field-ring);
}
/* Contact page merchant block: label/value pairs. A field with no value is
   dropped by views/info.js, so every dd here carries real data. */
.contact-info { margin-bottom: var(--gap); }
.merchant-facts {
  display: grid; grid-template-columns: max-content 1fr;
  gap: 6px var(--gap-s); margin: var(--gap-s) 0 0;
  font-size: 15px; max-width: 560px;
}
.merchant-facts dt { color: var(--site-muted); }
.merchant-facts dd { margin: 0; overflow-wrap: anywhere; }
.merchant-facts a { color: var(--site-fg); text-underline-offset: 3px; }
.fulfillment-block { border-top: 1px solid var(--site-border); padding-top: var(--gap-s); display: flex; flex-direction: column; gap: var(--gap-xs); }
.fulfillment-row { display: flex; align-items: center; gap: var(--gap-s); flex-wrap: wrap; font-size: 14px; }

/* --- Home --------------------------------------------------------------------------------------------- */
.home { padding-top: var(--gap-xs); }
.hero {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--gap-l);
  align-items: center;
  padding: var(--gap) 0 var(--gap-s);
}
.eyebrow {
  font-size: 12.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.09em; color: var(--fg-soft);
}
.hero h1 {
  font-size: calc(46px * var(--site-type, 1)); line-height: 1.08;
  letter-spacing: -0.025em; margin-top: 14px; max-width: 15ch;
}
.hero .hero-sub { font-size: 17px; color: var(--site-muted); margin-top: var(--gap-s); max-width: 46ch; line-height: 1.6; }
.hero .hero-cta { margin-top: var(--gap); display: flex; gap: var(--gap-s); align-items: center; flex-wrap: wrap; }
.hero-chips { margin-top: var(--gap-s); display: flex; gap: var(--gap-xs); flex-wrap: wrap; }
.hero-chip {
  font-size: 13px; font-weight: 500; color: var(--site-muted);
  background: var(--site-surface); box-shadow: var(--ring);
  border-radius: 9999px; padding: 6px 13px;
  display: inline-flex; align-items: center; gap: 6px;
}
.hero-media { position: relative; }
.hero-media img {
  width: 100%; height: auto; aspect-ratio: 1.05; object-fit: cover;
  border-radius: var(--radius-media);
  box-shadow: var(--shadow-card);
}
.home-section { margin-top: var(--gap-l); }
.section-head { margin-bottom: var(--gap-s); }
.section-head h2 { font-size: var(--type-h2); }
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap-s); }
/* The 5 → 3 → 2 fold lives with the shared ladder at the end of the file. */
.cat-card {
  position: relative; border-radius: var(--radius-card); overflow: hidden;
  aspect-ratio: 0.85; text-decoration: none;
  box-shadow: var(--ring);
}
.cat-media { position: absolute; inset: 0; }
.cat-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--motion); }
.cat-card:hover .cat-media img { transform: scale(1.04); }
.cat-name {
  position: absolute; left: 12px; bottom: 12px; right: auto;
  max-width: calc(100% - 24px);
  background: color-mix(in srgb, var(--site-bg) 88%, transparent);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-control); padding: 8px 12px;
  font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  color: var(--site-fg);
}
/* minmax(0,…) rather than 1fr: an inflexible 1fr track is at least as wide as its
   min-content, and the longest Russian USP sentence is wider than a quarter of a
   320px viewport, which pushed the whole page into horizontal scroll. */
.usp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-s); }
@media (max-width: 1000px) { .usp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.usp {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--site-surface); border-radius: var(--radius-card);
  box-shadow: var(--ring); padding: 20px;
}
.usp-icon { color: var(--site-accent); }
.usp-icon svg { width: 22px; height: 22px; display: block; }
.usp h3 { font-size: 15.5px; }
.usp p { font-size: 14px; color: var(--site-muted); line-height: 1.55; }
.promo-section { scroll-margin-top: 84px; }
/* In-page anchor targets (#reviews, #withdrawal-form) must clear the sticky
   65px header, otherwise the section the user jumped to starts under it. */
section[id], form[id], .p-reviews { scroll-margin-top: 84px; }

/* --- Search / wishlist / notfound ------------------------------------------------------------------------ */
.search-page, .wishlist-page { margin-top: var(--page-top); }
.search-page h1, .wishlist-page h1 { margin-bottom: var(--gap-xs); }
.search-page .muted { margin-bottom: var(--gap); }
/* The header collapses its input into a button on narrow screens, so the
   /search page carries its own field. */
.search-field { display: flex; gap: 8px; flex-wrap: wrap; max-width: 560px; margin-bottom: var(--gap-s); }
.search-field input {
  flex: 1 1 220px; min-width: 0; height: 44px; padding: 0 14px; font: inherit;
  color: var(--site-fg); border: 1px solid var(--site-border);
  border-radius: var(--radius-control); background: var(--site-surface);
}
.search-field input:focus-visible { border-color: var(--site-accent); box-shadow: var(--field-ring); }
.admin-stock-wrap { display: flex; flex-direction: column; gap: var(--gap-s); }
.admin-stock-readonly input[disabled] { opacity: 0.7; cursor: not-allowed; }
.wishlist-note { margin-bottom: var(--gap-s); }
.notfound { text-align: center; padding: var(--gap-l) var(--gap); display: flex; flex-direction: column; gap: var(--gap-s); align-items: center; }
.notfound-links { display: flex; flex-direction: column; gap: 8px; margin-top: var(--gap); }
.notfound-links h2 { font-size: var(--type-h3); color: var(--site-muted); }
.notfound-links a { color: var(--site-accent); font-weight: 500; }

/* --- Footer ---------------------------------------------------------------------------------------------- */
.site-footer { background: var(--bg-elevated); border-top: 1px solid var(--site-border); margin-top: var(--gap-l); }
.site-footer .footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--gap);
  padding: var(--gap-l) 0 var(--gap);
}
/* Footer column titles are h2 (the page h1 is the only heading above them), so
   the box keeps its small caps look without a skipped heading level. */
.site-footer h2, .site-footer h3 {
  font-size: 12.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.07em; color: var(--fg-soft); margin-bottom: 14px;
  line-height: 1.4;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.site-footer a { text-decoration: none; font-size: 14.5px; color: var(--site-muted); }
.site-footer a:hover { color: var(--site-fg); text-decoration: underline; text-underline-offset: 3px; }
.footer-merchant { font-size: 14px; color: var(--site-muted); display: flex; flex-direction: column; gap: 4px; }
.footer-about-text { color: var(--site-muted); font-size: 15px; max-width: 40ch; line-height: 1.6; }
.footer-merchant span, .site-footer a, .footer-bottom { overflow-wrap: anywhere; }
.footer-bottom {
  border-top: 1px solid var(--site-border);
  padding: var(--gap-s) 0 var(--gap);
  font-size: 13px; color: var(--fg-soft);
  display: flex; flex-direction: column; gap: 6px;
}
.footer-bottom .fb-notes { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.footer-banner-btn {
  border: 0; background: transparent; padding: 0;
  font: inherit; font-size: 13px; color: var(--site-muted);
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer; min-height: 24px;
}
.footer-banner-btn:hover { color: var(--site-fg); }
.footer-lang-switch {
  display: inline-flex; flex-wrap: wrap; align-items: center; align-self: flex-start;
  overflow: hidden;
  border: 1px solid var(--site-border); border-radius: var(--radius-control);
  background: var(--site-surface);
  margin-top: 4px;
}
.footer-lang-btn {
  border: 0; background: transparent;
  padding: 7px 12px; min-height: 36px;
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--site-muted);
  transition: background var(--motion), color var(--motion);
}
.footer-lang-btn:focus-visible { outline-offset: -3px; }
.footer-lang-btn + .footer-lang-btn { border-left: 1px solid var(--site-border); }
.footer-lang-btn:hover { background: var(--bg-elevated); color: var(--site-fg); }
.footer-lang-btn[aria-pressed='true'] { background: var(--accent-soft); color: var(--on-accent-soft); }

/* --- Legal / info pages ------------------------------------------------------------------------------------ */
.legal-wrap {
  max-width: 760px; margin: var(--gap) auto 0; display: flex; flex-direction: column; gap: var(--gap);
  line-height: 1.65; font-size: 16px; color: var(--site-fg);
}
.legal-wrap h2 { font-size: 22px; margin: var(--gap) 0 var(--gap-s); }
.legal-wrap h3 { font-size: 17px; margin: var(--gap) 0 10px; }
.legal-wrap p, .legal-wrap li { color: var(--site-muted); }
.legal-wrap ul, .legal-wrap ol { padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal-wrap a { color: var(--site-fg); }
.legal-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
/* Legal drafts quote the model withdrawal form as preformatted text; without
   wrapping it pushes the whole page wider than a phone screen. */
.legal-wrap pre {
  white-space: pre-wrap; overflow-wrap: anywhere;
  font-family: inherit; font-size: 14.5px; line-height: 1.6;
  background: var(--bg-elevated); border-radius: var(--radius-card);
  padding: var(--gap-s) var(--gap);
}
.legal-wrap th, .legal-wrap td { border: 1px solid var(--site-border); padding: 10px 12px; text-align: left; }
.info-page { max-width: 760px; margin: var(--page-top) auto 0; }

/* --- Status region / misc -------------------------------------------------------------------------------------- */
.status-region { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.skeleton {
  border-radius: var(--radius-card);
  background: linear-gradient(100deg, var(--bg-elevated) 40%, color-mix(in srgb, var(--bg-elevated) 60%, var(--site-surface)) 50%, var(--bg-elevated) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
/* Route skeletons. A single 360px grey box was shorter than every real page, so
   the placeholder still pushed the footer down when the view mounted. Each
   shape mirrors the route it stands in for: card cells use the same grid and the
   aspect ratio of a rendered product card (media square + three text lines). */
.sk { display: flex; flex-direction: column; gap: var(--gap); margin-top: var(--page-top); }
.sk-title { height: 34px; width: min(420px, 65%); }
.sk-text { height: 16px; width: min(620px, 92%); }
.sk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: var(--gap);
}
.sk-cell { aspect-ratio: 0.72; border-radius: var(--radius-card); }
.sk-block { height: 120px; border-radius: var(--radius-card); }
.sk-split { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: var(--gap-l); }
.sk-media { aspect-ratio: 1; border-radius: var(--radius-card); }
.sk-hero { height: 380px; border-radius: var(--radius-card); }
.sk-side { display: flex; flex-direction: column; gap: var(--gap-s); }
.sk-side .sk-text { width: 100%; }
/* The browse routes reserve a 260px filter rail above the grid. */
.sk-browse { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--gap); align-items: start; }
.sk-rail { height: 420px; border-radius: var(--radius-card); }
@media (max-width: 1080px) {
  .sk-split, .sk-browse { grid-template-columns: minmax(0, 1fr); }
  .sk-rail { display: none; }
}
.error-state { text-align: center; padding: var(--gap-l); display: flex; flex-direction: column; gap: var(--gap-s); align-items: center; }

/* --- Responsive ------------------------------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .product-layout { grid-template-columns: minmax(0, 1fr); }
  .category-layout { grid-template-columns: 1fr; }
  aside.filters { display: none; }
  .filters-toggle { display: inline-flex; }
  .cart-layout, .checkout-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-summary, .checkout-summary { position: static; }
  /* Mobile checkout: order review above the form (collapsed items + totals). */
  .checkout-layout { display: flex; flex-direction: column; }
  .checkout-summary { order: -1; }
  .buy-bar.show { display: flex; }
}
/* Category tiles fold 5 → 3 → 2 here, in one ladder instead of two stray
   breakpoint blocks in the component rules. The 1000px step used to jump straight
   to two columns while 820px widened them back to three, so tiles grew narrower
   and then larger as the viewport shrank. */
@media (max-width: 1000px) {
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
}
/* Desktops keep a persistent buy action too: once the inline buy row is out of
   view the same bar becomes a compact floating pill near the bottom edge
   (Apple/Sonos-style). It sits away from the page margins so text stays
   readable underneath, and product.js hides it again when the footer enters
   the viewport so no footer link is ever covered. */
@media (min-width: 1081px) {
  .buy-bar.show {
    display: flex;
    left: 50%; right: auto; bottom: 24px;
    transform: translateX(-50%);
    width: min(620px, calc(100vw - 48px));
    border: 1px solid var(--site-border);
    border-radius: 9999px;
    padding: 10px 12px 10px 24px;
    box-shadow: var(--shadow-pop);
  }
  .buy-bar.show .bb-price { margin-right: auto; }
  .buy-bar.show .bb-add { flex: none; padding-inline: 24px; }
}
/* Header adapts in two steps: the inline search field becomes an icon button
   that opens /search (which has its own field), then the category nav moves
   behind the hamburger. Each step keeps one aligned row for the widest locale
   instead of wrapping the sticky header into two rows. */
@media (min-width: 1025px) and (max-width: 1320px) {
  .site-header .container { padding-inline: 14px; gap: 5px; }
  .header-brand { gap: 5px; }
  .logo { font-size: 17px; }
  .header-demo-btn { padding: 2px 6px; }
  .main-nav { gap: 1px; }
  .main-nav a { padding: 8px 6px; font-size: 13.5px; }
  .header-actions { gap: 5px; }
  .lang-switch button { padding: 8px 8px; }
}
@media (max-width: 1120px) {
  .header-search { display: none; }
  .header-search-btn { display: inline-flex; }
}
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .mobile-nav-btn { display: inline-flex; }
  /* The only width where the panel is worth showing: above it the category nav
     is back in the header and a dropped flag would leave a stray open sheet. */
  .mobile-nav.open { display: block; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: var(--gap-xs); }
  .hero h1 { font-size: calc(36px * var(--site-type, 1)); max-width: 20ch; }
  .hero-media { order: -1; }
  .hero-media img { aspect-ratio: 1.45; }
  .form-grid { grid-template-columns: 1fr; }
  .checkout-card .form-row { grid-template-columns: 1fr; }
  .order-meta { grid-template-columns: 1fr; }
  .site-footer .footer-grid { grid-template-columns: 1fr 1fr; }
  /* P9: one row, never two. Whatever does not fit — language below 820px, the
     wishlist below 560px — is moved out of the row by main.js, so the line can
     be nowrap. 56px of content plus the header's 1px border is the 57px that
     --header-h reserves, and 40px icon buttons still have room to breathe. */
  :root { --header-h: 57px; }
  .site-header .container {
    flex-wrap: nowrap;
    row-gap: 0;
    min-height: 56px;
    gap: var(--gap-xs);
  }
  .site-header .header-actions { margin-left: auto; width: auto; }
}
@media (max-width: 560px) {
  :root { --container: 100%; }
  h1 { font-size: calc(28px * var(--site-type, 1)); }
  .hero h1 { font-size: calc(30px * var(--site-type, 1)); }
  .p-name { font-size: calc(23px * var(--site-type, 1)); }
  .p-price { font-size: 24px; }
  .site-footer .footer-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cart-item { grid-template-columns: 64px minmax(0, 1fr) auto; column-gap: var(--gap-xs); padding: 14px; }
  .cart-item img { width: 64px; height: 64px; }
  .ci-price { font-size: 15px; }
  .trust-row, .checkout-summary .trust-row, .cart-summary .trust-row { grid-template-columns: 1fr; gap: 8px; }
  /* The unstyled spec table sizes to its longest cell, and a Russian value like
     "40 h (ANC)" put 297px of table into a 272px column at 320px. Letting the
     words break is enough: the table then fits the column it is given. */
  .spec-table { width: 100%; }
  .spec-table th, .spec-table td { overflow-wrap: anywhere; }
  .p-buy .btn-primary { min-width: 100%; }
  .order-head { flex-direction: column; gap: var(--gap-xs); }
  .header-brand { gap: 5px; }
  .logo { font-size: 16.5px; letter-spacing: 0.05em; }
  .header-demo-btn { padding: 2px 6px; }
  .btn { padding: 12px 18px; }
  /* Long localized CTA labels ("Noformēt un maksāt 1 867 €") must stay on one
     line at 360 px, so the large button trades a little side padding. */
  .btn-lg { padding-inline: 14px; }
}
