/* ==========================================================================
   XDF Moto Tuning - storefront design system
   Tokens, base, components and the shared site shell (header, footer,
   WhatsApp button, toasts). Pages still on the old styles load
   css/legacy.css after this file; the shell only uses its own prefixed
   classes (sh-, sf-, wa-fab, x-toast, xs-) so it looks the same on every page.
   ========================================================================== */

:root {
  /* Type */
  --font-display: "Archivo", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --stretch-display: 112%;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: clamp(1.625rem, 1.3rem + 1.1vw, 2.125rem);
  --text-3xl: clamp(2rem, 1.45rem + 2vw, 2.875rem);
  --text-4xl: clamp(2.25rem, 1.4rem + 3.4vw, 3.75rem);

  /* Spacing (4 px grid) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* Colour: brand */
  --brand: #3da5ee;
  --brand-hover: #5cb5f2;
  --brand-press: #2b95e0;
  --brand-ink: #03111d;       /* text on --brand: 8.3:1 */
  --brand-600: #0f74bd;       /* brand as text on white: 4.9:1 */
  --brand-700: #0b5c97;
  --brand-50: #eef7fe;
  --brand-100: #d8edfc;
  --brand-200: #b6dcf8;

  /* Colour: ink (near-black) */
  --ink-950: #06080b;
  --ink-900: #0b0e13;
  --ink-850: #10141a;
  --ink-800: #161b22;
  --ink-700: #222932;
  --ink-600: #313a45;

  /* Colour: light surfaces and text */
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eef1f4;
  --line: #e4e7ec;
  --line-2: #d3d8df;
  --text: #0e1116;
  --text-2: #3d4652;          /* 9.9:1 on white */
  --text-3: #5b6472;          /* 6.0:1 on white */

  /* Colour: on dark */
  --on-dark: #f2f4f7;
  --on-dark-2: #b3bcc8;       /* 9.6:1 on --ink-900 */
  --on-dark-3: #8691a0;       /* 6.0:1 on --ink-900 */
  --line-dark: rgba(255, 255, 255, 0.09);
  --line-dark-2: rgba(255, 255, 255, 0.16);

  /* Colour: status */
  --success: #13803f;
  --success-bg: #ecfbf2;
  --danger: #c42b2b;
  --danger-bg: #fdf1f1;
  --warning: #a95a06;
  --warning-bg: #fff7eb;
  --whatsapp: #25d366;
  --whatsapp-ink: #062b15;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --r-full: 999px;

  /* Elevation */
  --shadow-xs: 0 1px 2px rgba(11, 14, 19, 0.06);
  --shadow-sm: 0 1px 3px rgba(11, 14, 19, 0.08), 0 1px 2px rgba(11, 14, 19, 0.04);
  --shadow-md: 0 8px 20px -6px rgba(11, 14, 19, 0.14), 0 2px 5px rgba(11, 14, 19, 0.05);
  --shadow-lg: 0 24px 48px -16px rgba(11, 14, 19, 0.3), 0 4px 10px rgba(11, 14, 19, 0.06);
  --shadow-pop: 0 16px 40px -10px rgba(11, 14, 19, 0.3), 0 0 0 1px rgba(11, 14, 19, 0.06);

  /* Focus */
  /* Focus on light surfaces: --brand-600 (4.9:1 on white, WCAG 1.4.11). Dark
     bands, the header and the footer switch back to --brand (7.6:1 there). */
  --focus: 0 0 0 3px rgba(15, 116, 189, 0.35);
  --focus-outline: 2px solid var(--brand-600);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --dur-fast: 120ms;
  --dur: 180ms;
  --dur-slow: 260ms;

  /* Layout */
  --container: 1240px;
  --gutter: 16px;
  --header-h: 64px;
  --bottom-bar-h: 0px;

  /* Layers */
  --z-sticky: 50;
  --z-fab: 80;
  --z-header: 100;
  --z-popover: 200;
  --z-drawer: 300;
  --z-toast: 400;
}

@media (min-width: 768px) {
  :root { --gutter: 24px; }
}
@media (min-width: 1280px) {
  :root { --gutter: 32px; }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: var(--stretch-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: inherit;
}
p { margin: 0; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.band, .sh, .sf, .sh-drawer { --focus-outline: 2px solid var(--brand); }

::selection { background: var(--brand-100); color: var(--text); }

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

.skip-link {
  position: fixed;
  top: 8px; left: 8px;
  z-index: calc(var(--z-toast) + 1);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--brand);
  color: var(--brand-ink);
  font: 600 var(--text-sm)/1.2 var(--font-body);
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus { transform: none; color: var(--brand-ink); }

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }
.icon-lg { width: 24px; height: 24px; flex: none; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--space-16); }
.section-tight { padding-block: var(--space-12); }
.section-white { background: var(--surface); }
@media (max-width: 767px) {
  .section { padding-block: var(--space-12); }
  .section-tight { padding-block: var(--space-10); }
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.section-title { font-size: var(--text-2xl); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font: 600 var(--text-xs)/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-600);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text);
  white-space: nowrap;
  flex: none;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform var(--dur) var(--ease-out); }
.link-arrow:hover { color: var(--brand-600); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--line-2);
  --btn-bg-hover: var(--surface-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: 600 0.9375rem/1.2 var(--font-body);
  letter-spacing: -0.005em;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--btn-bg-hover); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: var(--focus-outline); outline-offset: 2px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary { --btn-bg: var(--brand); --btn-fg: var(--brand-ink); --btn-border: var(--brand); --btn-bg-hover: var(--brand-hover); }
.btn-primary:hover { border-color: var(--brand-hover); }
.btn-primary:active { --btn-bg: var(--brand-press); }
.btn-dark { --btn-bg: var(--ink-900); --btn-fg: #fff; --btn-border: var(--ink-900); --btn-bg-hover: var(--ink-700); }
.btn-dark:hover { border-color: var(--ink-700); }
.btn-secondary { --btn-bg: var(--surface); --btn-fg: var(--text); --btn-border: var(--line-2); --btn-bg-hover: var(--surface-2); }
.btn-secondary:hover { border-color: var(--text-3); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-2); --btn-border: transparent; --btn-bg-hover: var(--surface-3); }
.btn-ghost:hover { color: var(--text); }
.btn-whatsapp { --btn-bg: var(--whatsapp); --btn-fg: var(--whatsapp-ink); --btn-border: var(--whatsapp); --btn-bg-hover: #3ee07b; }
.btn-on-dark { --btn-bg: rgba(255, 255, 255, 0.06); --btn-fg: var(--on-dark); --btn-border: var(--line-dark-2); --btn-bg-hover: rgba(255, 255, 255, 0.12); }

.btn-sm { min-height: 36px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn-lg { min-height: 52px; padding: 0 var(--space-6); font-size: var(--text-base); }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
@media (pointer: coarse) {
  .btn-sm { min-height: 44px; }
  .btn-icon.btn-sm { width: 44px; }
}

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-color: var(--btn-fg) var(--btn-fg) transparent transparent;
  animation: x-spin 0.7s linear infinite;
}
.btn.is-loading svg { visibility: hidden; }

@keyframes x-spin { to { transform: rotate(360deg); } }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.label { font: 600 var(--text-sm)/1.3 var(--font-body); color: var(--text-2); }
.input {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-base);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.input::placeholder { color: #6b7380; }
.input:hover { border-color: var(--text-3); }
.input:focus { outline: none; border-color: var(--brand-600); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.field-error { font-size: var(--text-sm); color: var(--danger); }

.input-icon { position: relative; display: block; }
.input-icon > svg {
  position: absolute;
  left: 14px; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.input-icon > .input { padding-left: 42px; }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-full);
  background: var(--surface);
  color: var(--text-2);
  font: 600 var(--text-sm)/1 var(--font-body);
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.chip:hover { border-color: var(--text-3); color: var(--text); }
.chip[aria-pressed="true"], .chip[aria-current="true"], .chip.is-active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: #fff;
}
.chip .chip-count { font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] .chip-count, .chip.is-active .chip-count { color: rgba(255, 255, 255, 0.72); }
@media (pointer: coarse) { .chip { min-height: 44px; } }

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 4px 0 12px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-700);
  font: 600 var(--text-sm)/1 var(--font-body);
  white-space: nowrap;
}
.filter-chip .filter-chip-key { font-weight: 500; color: var(--text-3); }
.filter-chip button {
  display: grid;
  place-items: center;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--brand-700);
}
.filter-chip button:hover { background: var(--brand-100); }
.filter-chip button svg { width: 14px; height: 14px; }
@media (pointer: coarse) {
  .filter-chip { min-height: 44px; }
  .filter-chip button { width: 40px; height: 40px; }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font: 700 0.6875rem/1 var(--font-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface-3);
  color: var(--text-2);
}
.badge-brand { background: var(--brand); color: var(--brand-ink); }
.badge-dark { background: var(--ink-900); color: #fff; }
.badge-outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text-2); }
.badge-file {
  height: 22px;
  padding: 0 7px;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xs);
}

/* ---------- Skeleton ---------- */
.skeleton {
  display: block;
  border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--surface-3) 0%, #f6f8fa 45%, var(--surface-3) 90%);
  background-size: 250% 100%;
  animation: x-shimmer 1.4s ease-in-out infinite;
}
@keyframes x-shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: var(--space-10);
}
.pagination ol { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.page-btn {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: 600 var(--text-sm)/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
a.page-btn:hover { border-color: var(--text-3); background: var(--surface-2); color: var(--text); }
.page-btn[aria-current="page"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }
.page-btn.page-step { display: inline-flex; gap: 6px; }
.page-btn.page-step svg { width: 16px; height: 16px; }
.page-btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.page-gap { min-width: 24px; text-align: center; color: var(--text-3); }
@media (max-width: 559px) {
  .page-btn.page-step .page-step-label { display: none; }
  .page-btn.page-step { padding: 0; width: 44px; }
  .pagination ol { gap: 4px; }
  .pagination { gap: 4px; flex-wrap: nowrap; }
  .page-btn { padding: 0 8px; }
  .page-gap { min-width: 16px; }
}

/* ---------- Empty and error states ---------- */
.state {
  display: grid;
  justify-items: center;
  gap: var(--space-3);
  padding: var(--space-16) var(--space-6);
  text-align: center;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.state-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--surface-3);
  color: var(--text-2);
}
.state-icon svg { width: 24px; height: 24px; }
.state-title { font: 700 var(--text-lg)/1.3 var(--font-display); font-stretch: var(--stretch-display); letter-spacing: -0.01em; }
.state-text { color: var(--text-3); font-size: var(--text-sm); }
.state .btn { margin-top: var(--space-2); }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }

/* ---------- Toasts ---------- */
.x-toasts {
  position: fixed;
  z-index: var(--z-toast);
  right: 16px;
  bottom: calc(16px + var(--bottom-bar-h) + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 8px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.x-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 8px 12px 14px;
  border-radius: var(--r-md);
  background: var(--ink-900);
  color: var(--on-dark);
  box-shadow: var(--shadow-lg);
  font: 500 var(--text-sm)/1.4 var(--font-body);
  pointer-events: auto;
  animation: x-toast-in var(--dur-slow) var(--ease-out);
}
.x-toast.is-leaving { animation: x-toast-out 160ms var(--ease-in) forwards; }
.x-toast-icon { width: 20px; height: 20px; flex: none; color: var(--brand); }
.x-toast.is-error .x-toast-icon { color: #ff8a8a; }
.x-toast.is-success .x-toast-icon { color: #5fe3a1; }
.x-toast-msg { flex: 1; min-width: 0; }
.x-toast-action {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.x-toast-action:hover { background: rgba(255, 255, 255, 0.08); color: var(--brand-hover); }
.x-toast-close {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--on-dark-2);
}
.x-toast-close:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.x-toast-close svg { width: 16px; height: 16px; }
@keyframes x-toast-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes x-toast-out { to { opacity: 0; transform: translateY(4px); } }
@media (max-width: 559px) {
  .x-toasts { left: 16px; right: 16px; width: auto; }
}

/* ==========================================================================
   Dark bands and page header (every page)
   ========================================================================== */
.band {
  position: relative;
  z-index: 2;
  isolation: isolate;
  background: var(--ink-950);
  color: var(--on-dark);
}
/* Decorations are clipped here, not on .band, so dropdowns can open past the band. */
.band-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 75% 20%, #000 10%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 90% at 75% 20%, #000 10%, transparent 75%);
  pointer-events: none;
}
.band-glow {
  position: absolute;
  top: -30%;
  right: -10%;
  width: 70%;
  height: 130%;
  background: radial-gradient(closest-side, rgba(61, 165, 238, 0.22), rgba(61, 165, 238, 0));
  pointer-events: none;
}
/* The owner's page banner (the page.banner site image). It ships with no
   photo: without one the element paints nothing, and the band keeps the
   gradient it has always had. js/site.js adds the class with the photo. */
.band-photo {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
}
.band-photo.has-photo { opacity: 0.45; }
/* Inside the faded element, so the scrim fades with the photo it darkens.
   The breadcrumb and the title sit on the left, which the first gradient
   keeps dark; the second only settles the bottom edge, and stops short
   because this band is a fraction of the height of the home page's. */
.band-photo.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 8, 11, 0.96) 0%, rgba(6, 8, 11, 0.74) 45%, rgba(6, 8, 11, 0.3) 100%),
    linear-gradient(0deg, rgba(6, 8, 11, 0.85) 0%, rgba(6, 8, 11, 0) 35%);
}

.page-band { padding: 28px 0 64px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; font-size: var(--text-sm); color: var(--on-dark-3); }
.breadcrumb a { color: var(--on-dark-2); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; color: rgba(255, 255, 255, 0.25); }
.page-title { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.03em; color: #fff; }

/* ==========================================================================
   Custom dropdown (js/select.js)
   ========================================================================== */
.xs { position: relative; min-width: 0; }
.xs-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font: 500 var(--text-base)/1.2 var(--font-body);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.xs-trigger:hover { border-color: var(--text-3); }
.xs-trigger[aria-invalid="true"] { border-color: var(--danger); }
.xs-trigger:focus-visible, .xs.is-open .xs-trigger { outline: none; border-color: var(--brand-600); box-shadow: var(--focus); }
.xs-trigger[disabled] { cursor: not-allowed; opacity: 0.55; }
.xs-text { display: grid; flex: 1; min-width: 0; gap: 2px; }
.xs-caption { font: 600 0.6875rem/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.xs-value { display: flex; align-items: center; gap: 8px; min-width: 0; }
.xs-value-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xs-value.is-placeholder { color: var(--text-2); }
.xs-chevron { width: 18px; height: 18px; flex: none; color: var(--text-3); transition: transform var(--dur) var(--ease-out); }
.xs.is-open .xs-chevron { transform: rotate(180deg); }
.xs-logo { width: 28px; height: 20px; flex: none; object-fit: contain; }
.xs-trigger.has-caption { min-height: 56px; }

.xs-pop {
  position: absolute;
  z-index: var(--z-popover);
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
  color: var(--text);
  animation: xs-in var(--dur) var(--ease-out);
}
.xs.is-up .xs-pop { top: auto; bottom: calc(100% + 6px); }
.xs.is-right .xs-pop { left: auto; right: 0; }
@keyframes xs-in { from { opacity: 0; transform: translateY(-4px); } }
.xs-sheet-head { display: none; }
.xs-search { padding: 4px 4px 8px; }
.xs-search .input { min-height: 40px; font-size: var(--text-sm); }
.xs-list {
  max-height: min(320px, 50vh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  outline: none;
}
.xs-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
}
@media (pointer: coarse) { .xs-option { min-height: 44px; } }
.xs-option.is-active { background: var(--surface-3); }
.xs-option[aria-selected="true"] { font-weight: 600; }
.xs-option-label { flex: 1; min-width: 0; }
.xs-option-sub { display: block; font-weight: 400; font-size: var(--text-xs); color: var(--text-3); }
.xs-option-count { flex: none; font-variant-numeric: tabular-nums; font-size: var(--text-xs); color: var(--text-3); min-width: 20px; text-align: right; }
.xs-option-check { width: 16px; height: 16px; flex: none; color: var(--brand-600); visibility: hidden; }
.xs-option[aria-selected="true"] .xs-option-check { visibility: visible; }
.xs-option .xs-logo { width: 32px; height: 22px; }
.xs-option-logo-empty { width: 32px; height: 22px; flex: none; }
.xs-empty { padding: 14px 10px; color: var(--text-3); font-size: var(--text-sm); }
.xs-backdrop { display: none; }

@media (max-width: 639px) {
  .xs-pop {
    position: fixed;
    z-index: var(--z-drawer);
    inset: auto 0 0 0;
    top: auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px));
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: xs-sheet-in var(--dur-slow) var(--ease-out);
  }
  .xs.is-up .xs-pop { bottom: 0; }
  .xs-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 4px 8px;
  }
  .xs-sheet-head::before {
    content: "";
    position: absolute;
    top: 6px; left: 50%;
    width: 36px; height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--line-2);
  }
  .xs-sheet-title { font: 700 var(--text-md)/1.2 var(--font-display); font-stretch: var(--stretch-display); }
  .xs-sheet-close {
    display: grid;
    place-items: center;
    width: 44px; height: 44px;
    margin-right: -8px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text-2);
  }
  .xs-sheet-close svg { width: 20px; height: 20px; }
  .xs-list { max-height: min(60vh, 440px); }
  .xs-option { min-height: 48px; font-size: var(--text-base); }
  .xs-search .input { min-height: 44px; font-size: var(--text-base); }
  .xs-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-drawer) - 1);
    background: rgba(6, 8, 11, 0.55);
    animation: x-fade var(--dur) var(--ease-out);
  }
}
@keyframes xs-sheet-in { from { transform: translateY(100%); } }
@keyframes x-fade { from { opacity: 0; } }

/* ==========================================================================
   Site header (js/site.js)
   ========================================================================== */
.sh {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  display: block;
  height: var(--header-h);
  background: rgba(11, 14, 19, 0.94);
  border-bottom: 1px solid var(--line-dark);
  color: var(--on-dark);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.2;
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
}
.sh * { box-sizing: border-box; }
.sh-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 100%;
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.sh-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-right: 12px;
  color: #fff;
  text-decoration: none;
  flex: none;
}
.sh-logo:hover { color: #fff; }
.sh-logo-mark { width: 30px; height: 24px; color: var(--brand); }
.sh-logo-word {
  font-family: var(--font-display);
  font-stretch: 108%;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.sh-logo-word span { color: var(--brand); }

.sh-nav { display: none; align-items: center; gap: 2px; }
.sh-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--on-dark-2);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.sh-nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.sh-nav-link[aria-current="page"], .sh-nav-link.is-current { color: #fff; }
.sh-nav-link[aria-current="page"]::after, .sh-nav-link.is-current::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.sh-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.sh-search { position: relative; display: none; width: 240px; margin-right: 6px; }
.sh-search svg {
  position: absolute;
  left: 12px; top: 50%;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  color: var(--on-dark-3);
  pointer-events: none;
}
.sh-search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--line-dark-2);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: 400 14px/1 var(--font-body);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.sh-search input::placeholder { color: var(--on-dark-3); }
.sh-search input:hover { border-color: rgba(255, 255, 255, 0.28); }
.sh-search input:focus { outline: none; border-color: var(--brand); background: rgba(255, 255, 255, 0.08); box-shadow: 0 0 0 3px rgba(61, 165, 238, 0.35); }

.sh-icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--on-dark);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.sh-icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.sh-icon-btn svg { width: 22px; height: 22px; }
.sh-icon-btn:focus-visible, .sh-btn:focus-visible, .sh-nav-link:focus-visible, .sh-logo:focus-visible,
.sh-account-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sh-search-link { display: none; }

.sh-badge {
  position: absolute;
  top: 4px; right: 2px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand);
  color: var(--brand-ink);
  font: 700 11px/1 var(--font-body);
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--ink-900);
  pointer-events: none;
}

.sh-auth { display: none; align-items: center; gap: 6px; margin-left: 6px; }
.sh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font: 600 14px/1 var(--font-body);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.sh-btn-ghost { color: var(--on-dark); background: transparent; }
.sh-btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.sh-btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.sh-btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-ink); }
.sh-btn-outline { background: transparent; border-color: var(--line-dark-2); color: var(--on-dark); }
.sh-btn-outline:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.sh-account { position: relative; display: none; margin-left: 4px; }
.sh-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--on-dark);
  font: 600 14px/1 var(--font-body);
}
.sh-account-btn:hover { background: rgba(255, 255, 255, 0.08); }
.sh-account-btn > svg { width: 16px; height: 16px; color: var(--on-dark-3); transition: transform var(--dur) var(--ease-out); }
.sh-account-btn[aria-expanded="true"] > svg { transform: rotate(180deg); }
.sh-account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #4fb3f5, #1f7fcc);
  color: #04121f;
  font: 800 13px/1 var(--font-display);
  letter-spacing: 0.02em;
}
.sh-avatar-dot {
  position: absolute;
  top: -1px; right: -1px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #ff5d5d;
  box-shadow: 0 0 0 2px var(--ink-900);
}
.sh-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-pop);
  animation: xs-in var(--dur) var(--ease-out);
}
.sh-menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sh-menu-name { font: 700 15px/1.3 var(--font-body); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-menu-email { font: 400 13px/1.3 var(--font-body); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-menu-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font: 500 14px/1.2 var(--font-body);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.sh-menu-link:hover, .sh-menu-link:focus-visible { background: var(--surface-3); color: var(--text); }
/* On the white menu the focus ring uses the darker brand blue (4.9:1 on white). */
.sh-menu-link:focus-visible { outline: 2px solid var(--brand-600); outline-offset: -2px; }
.sh-menu-link svg { width: 18px; height: 18px; color: var(--text-3); }
.sh-menu-link .sh-menu-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--brand);
  color: var(--brand-ink);
  font: 700 11px/20px var(--font-body);
  text-align: center;
}
.sh-menu-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.sh-menu-list { margin: 0; padding: 0; list-style: none; }
.sh-menu-link[aria-current="page"] { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.sh-menu-link[aria-current="page"] svg { color: var(--brand-600); }

/* "ECU files": a nav entry opening the catalogue's file types (js/site.js). */
.sh-files { position: relative; }
.sh-files-btn {
  gap: 4px;
  padding-right: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.sh-files-btn.is-current::after { right: 8px; }
.sh-files-btn > svg { width: 16px; height: 16px; color: var(--on-dark-3); transition: transform var(--dur) var(--ease-out), color var(--dur-fast) var(--ease-out); }
.sh-files-btn:hover > svg, .sh-files-btn[aria-expanded="true"] > svg { color: var(--on-dark); }
.sh-files-btn[aria-expanded="true"] { color: #fff; background: rgba(255, 255, 255, 0.06); }
.sh-files-btn[aria-expanded="true"] > svg { transform: rotate(180deg); }
.sh-files-menu { left: 0; right: auto; width: 232px; }
/* The pointer crosses the gap under the button without leaving the menu. */
.sh-files-menu::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 10px; }

.sh-burger { margin-right: -6px; }

/* A session may exist and is being checked: a neutral placeholder instead of
   the sign-in links or the account menu, so the wrong state never shows. */
.sh-account-skel {
  display: none;
  align-items: center;
  gap: 8px;
  height: 44px;
  flex: none;
  margin-left: 4px;
  padding: 0 8px 0 4px;
}
.sh.is-checking .sh-account-skel { display: inline-flex; }
.sh-skel-avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; background: rgba(255, 255, 255, 0.1); }
.sh-skel-name { width: 56px; height: 12px; flex: none; border-radius: 6px; background: rgba(255, 255, 255, 0.1); }
.sh-skel-caret { width: 16px; height: 16px; flex: none; }

@media (min-width: 1024px) {
  .sh-nav { display: flex; }
  .sh-burger { display: none; }
  .sh-auth { display: flex; }
  .sh-search-link { display: inline-grid; }
  .sh.is-signed-in .sh-auth, .sh.is-checking .sh-auth { display: none; }
  .sh.is-signed-in .sh-account { display: block; }
}
@media (min-width: 1200px) {
  .sh-search { display: block; }
  .sh-search-link { display: none; }
}
@media (max-width: 1023px) {
  .sh.is-signed-in .sh-account { display: block; }
  .sh.is-signed-in .sh-account-name, .sh.is-signed-in .sh-account-btn > svg { display: none; }
  .sh.is-signed-in .sh-account-btn { padding: 0 5px; }
  .sh-account-skel { padding: 0 5px; }
  .sh-skel-name, .sh-skel-caret { display: none; }
}
@media (max-width: 379px) {
  .sh-logo-mark { display: none; }
  .sh-logo { margin-right: 4px; }
  .sh-logo-word { font-size: 16px; }
}

/* ---------- Mobile drawer ---------- */
.sh-drawer { position: fixed; inset: 0; z-index: var(--z-drawer); }
.sh-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 11, 0.6);
  animation: x-fade var(--dur) var(--ease-out);
}
.sh-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(360px, 88vw);
  background: var(--ink-900);
  color: var(--on-dark);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-body);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: sh-drawer-in var(--dur-slow) var(--ease-out);
}
.sh-drawer.is-closing .sh-drawer-panel { animation: sh-drawer-out 180ms var(--ease-in) forwards; }
.sh-drawer.is-closing .sh-drawer-backdrop { animation: x-fade-out 180ms var(--ease-in) forwards; }
@keyframes sh-drawer-in { from { transform: translateX(100%); } }
@keyframes sh-drawer-out { to { transform: translateX(100%); } }
@keyframes x-fade-out { to { opacity: 0; } }
.sh-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 10px 0 20px;
  border-bottom: 1px solid var(--line-dark);
  flex: none;
}
.sh-drawer-title { font: 700 16px/1 var(--font-display); font-stretch: var(--stretch-display); color: #fff; }
.sh-drawer-body { display: grid; gap: 20px; padding: 20px; }
.sh-drawer .sh-search { display: block; width: 100%; margin: 0; }
.sh-drawer .sh-search input { height: 48px; font-size: 16px; }
.sh-drawer-nav { display: grid; gap: 2px; }
.sh-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--on-dark);
  font: 600 16px/1.2 var(--font-body);
  text-decoration: none;
}
.sh-drawer-link svg { width: 18px; height: 18px; color: var(--on-dark-3); }
.sh-drawer-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.sh-drawer-link[aria-current="page"] { background: rgba(61, 165, 238, 0.12); color: #fff; box-shadow: inset 3px 0 0 var(--brand); }
.sh-drawer-label { margin-bottom: 8px; font: 600 11px/1 var(--font-body); letter-spacing: 0.12em; text-transform: uppercase; color: var(--on-dark-3); }
/* ECU files: the header menu's links, grouped under their label. */
.sh-drawer-group { margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line-dark); }
.sh-drawer-group .sh-drawer-label { padding: 4px 12px 0; }
.sh-drawer-files { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sh-drawer-file { justify-content: flex-start; gap: 12px; font-size: 15px; font-weight: 500; }
.sh-drawer-file > span { flex: 1; min-width: 0; }
.sh-drawer-file[aria-current="page"] > svg:first-child { color: var(--brand); }
.sh-drawer-foot { display: grid; gap: 10px; margin-top: auto; padding: 20px; border-top: 1px solid var(--line-dark); }
.sh-drawer-foot .sh-btn { min-height: 48px; font-size: 15px; }
.sh-drawer-user { display: flex; align-items: center; gap: 12px; padding: 4px 0 8px; }
.sh-drawer-user > div { min-width: 0; }
.sh-drawer-user .sh-avatar { width: 40px; height: 40px; font-size: 14px; }
.sh-drawer-user-name { font: 700 15px/1.3 var(--font-body); color: #fff; overflow-wrap: anywhere; }
.sh-drawer-user-email { font: 400 13px/1.3 var(--font-body); color: var(--on-dark-3); word-break: break-all; }
.sh-drawer-account { display: grid; gap: 2px; }
.sh-drawer-account .sh-drawer-link { justify-content: flex-start; gap: 12px; font-size: 15px; font-weight: 500; }
.sh-drawer-account .sh-menu-count { margin-left: auto; }
.sh-drawer-signout { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; }

body.x-scroll-lock { overflow: hidden; }

/* ==========================================================================
   Site footer (js/site.js)
   ========================================================================== */
.sf {
  display: block;
  min-height: 320px;
  background: var(--ink-950);
  color: var(--on-dark-2);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  border-top: 1px solid var(--line-dark);
}
.sf * { box-sizing: border-box; }
.sf-inner {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding: 56px var(--gutter) 0;
}
.sf-top {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(3, minmax(120px, 1fr)) minmax(220px, 1.3fr);
  gap: 32px;
  padding-bottom: 40px;
}
/* Two link columns (Shop, Company) when no help page is enabled (js/features.js). */
.sf-top.sf-top-two { grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(120px, 1fr)) minmax(220px, 1.3fr); }
.sf-brand { display: grid; align-content: start; gap: 18px; }
.sf-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; width: max-content; }
.sf-logo:hover { color: #fff; }
.sf-logo .sh-logo-mark { width: 30px; height: 24px; color: var(--brand); }
.sf-logo .sh-logo-word { font-size: 20px; }
.sf-pay { display: flex; align-items: center; gap: 8px; }
.sf-pay svg { width: 46px; height: 30px; border-radius: 5px; }
.sf-social { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-social a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: var(--r-sm);
  color: var(--on-dark-2);
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.sf-social a:hover { color: #fff; border-color: var(--line-dark-2); background: rgba(255, 255, 255, 0.05); }
.sf-social svg { width: 18px; height: 18px; }
@media (pointer: coarse) { .sf-social a { width: 44px; height: 44px; } }

.sf-col-title {
  margin: 0 0 12px;
  font: 600 12px/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark);
}
.sf-links { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.sf-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--on-dark-2);
  font-size: 14px;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
.sf-link:hover { color: #fff; }
.sf-link:focus-visible, .sf-social a:focus-visible, .sf-logo:focus-visible, .sf-wa:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.sf-contact { display: grid; align-content: start; gap: 10px; }
.sf-contact-line { display: flex; align-items: center; gap: 10px; min-height: 32px; color: var(--on-dark-2); text-decoration: none; word-break: break-word; }
a.sf-contact-line:hover { color: #fff; }
.sf-contact-line svg { width: 16px; height: 16px; flex: none; color: var(--on-dark-3); }
.sf-wa {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  padding: 0 16px 0 12px;
  border-radius: var(--r-sm);
  background: rgba(37, 211, 102, 0.1);
  border: 1px solid rgba(37, 211, 102, 0.35);
  color: #d8f8e4;
  font: 600 14px/1.1 var(--font-body);
  text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.sf-wa:hover { background: rgba(37, 211, 102, 0.18); border-color: rgba(37, 211, 102, 0.6); color: #fff; }
.sf-wa svg { width: 20px; height: 20px; color: var(--whatsapp); }
.sf-wa small { display: block; font-weight: 500; font-size: 12px; color: var(--on-dark-2); }

.sf-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px 0 24px;
  border-top: 1px solid var(--line-dark);
  font-size: 12.5px;
  color: var(--on-dark-3);
}
.sf-bottom p { margin: 0; }
.sf-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; }
@media (pointer: coarse) {
  .sf-logo, .sf-contact-line { min-height: 44px; }
  .sf-link { min-height: 44px; min-width: 44px; }
}

@media (max-width: 1099px) {
  .sf-top { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; }
  .sf-top.sf-top-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sf-brand { grid-column: 1 / -1; grid-template-columns: auto 1fr; align-items: center; gap: 16px 24px; }
  .sf-brand .sf-pay { justify-self: end; }
  .sf-contact { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
  .sf-contact .sf-col-title { grid-column: 1 / -1; margin-bottom: 0; }
}
@media (max-width: 639px) {
  .sf-inner { padding-top: 40px; }
  .sf-top {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: "brand brand" "shop help" "shop company" "contact contact";
    gap: 24px 16px;
    padding-bottom: 28px;
  }
  .sf-brand { grid-area: brand; }
  .sf-top > nav:nth-of-type(1) { grid-area: shop; }
  .sf-top > nav:nth-of-type(2) { grid-area: help; }
  .sf-top > nav:nth-of-type(3) { grid-area: company; }
  .sf-contact { grid-area: contact; }
  .sf-top.sf-top-two { grid-template-areas: "brand brand" "shop company" "contact contact"; }
  .sf-top.sf-top-two > nav:nth-of-type(2) { grid-area: company; }
  .sf-brand { grid-template-columns: 1fr; }
  .sf-brand .sf-pay { justify-self: start; }
  .sf-link { min-height: 44px; }
  .sf-contact { grid-template-columns: 1fr; }
  .sf-contact-line { min-height: 44px; }
  .sf-bottom { flex-direction: column; align-items: flex-start; padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- WhatsApp floating button ---------- */
.wa-fab {
  position: fixed;
  z-index: var(--z-fab);
  right: 16px;
  bottom: calc(16px + var(--bottom-bar-h) + env(safe-area-inset-bottom, 0px));
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(6, 43, 21, 0.55), 0 2px 6px rgba(6, 8, 11, 0.18);
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}
.wa-fab:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 14px 28px -8px rgba(6, 43, 21, 0.6), 0 2px 6px rgba(6, 8, 11, 0.2); }
.wa-fab:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.wa-fab svg { width: 28px; height: 28px; }
.wa-fab.is-tucked { opacity: 0; transform: translateY(24px) scale(0.9); pointer-events: none; }
body.x-scroll-lock .wa-fab { opacity: 0; pointer-events: none; }
.x-toasts:not(:empty) ~ .wa-fab { opacity: 0; pointer-events: none; }
@media (min-width: 768px) {
  .wa-fab { right: 24px; bottom: calc(24px + var(--bottom-bar-h)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
