/* ════════════════════════════════════════════════════════════════════════
   storefront.css — Vitrina pública base (MF8; antes MF3 3b)

   Concepto: el mesón de repuestos de un taller serio. Señalética de taller
   (títulos y precios en condensada), N° de parte en monoespaciada como en
   la etiqueta de bodega, fotos sobre blanco como en un catálogo técnico.
   Lo memorable es la portada: banda oscura con un titular grande y el
   «buscador por auto» como una ficha clara con el filete del color del
   taller. Todo lo demás es sobrio: bordes finos, poco color, mucho aire.

   Colores: llegan de /tema.css (--sf-bg, --sf-ink, --sf-primary,
   --sf-on-primary, --sf-accent, --sf-on-accent, --sf-dark, --sf-light,
   --sf-surface opcional). Aquí solo se derivan tonos con color-mix: sirve
   igual para un tema claro o uno oscuro. Sin hex (ux:lint), sin style=
   en las vistas, sin Tailwind.

   Plantillas (Storefront::Templates): su hoja se carga DESPUÉS de esta y
   puede redefinir tokens en `.sf-tpl-<key>` o reglas puntuales.
   ════════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/barlow-condensed-600-53e6a671.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/barlow-condensed-700-909728d4.woff2") format("woff2");
}

@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/dm-mono-500-e06c27ef.woff2") format("woff2");
}

/* ── Tokens ──────────────────────────────────────────────────────────── */

.sf {
  --bg: var(--sf-bg, rgb(255 255 255));
  --ink: var(--sf-ink, rgb(17 24 39));
  --brand: var(--sf-primary, rgb(27 109 240));
  --on-brand: var(--sf-on-primary, rgb(255 255 255));
  --accent: var(--sf-accent, var(--brand));
  --on-accent: var(--sf-on-accent, var(--on-brand));
  --dark: var(--sf-dark, rgb(17 24 39));
  --light: var(--sf-light, rgb(255 255 255));

  --surface: var(--sf-surface, color-mix(in srgb, var(--ink) 4%, var(--bg)));
  --surface-2: color-mix(in srgb, var(--ink) 8%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 13%, var(--bg));
  --line-strong: color-mix(in srgb, var(--ink) 26%, var(--bg));
  --muted: color-mix(in srgb, var(--ink) 66%, var(--bg));
  --link: color-mix(in srgb, var(--brand) 78%, var(--ink));
  --brand-soft: color-mix(in srgb, var(--brand) 10%, var(--bg));
  --brand-line: color-mix(in srgb, var(--brand) 45%, var(--bg));
  --ok: color-mix(in srgb, rgb(22 163 74) 80%, var(--ink));
  --ok-soft: color-mix(in srgb, rgb(22 163 74) 12%, var(--bg));
  --warn: color-mix(in srgb, rgb(217 119 6) 85%, var(--ink));
  --warn-soft: color-mix(in srgb, rgb(217 119 6) 12%, var(--bg));
  /* Oferta (P3): «–X %» y precio de oferta. */
  --sale: color-mix(in srgb, rgb(220 38 38) 88%, var(--ink));
  --on-sale: rgb(255 255 255);
  --on-dark-muted: color-mix(in srgb, var(--light) 72%, var(--dark));
  --on-dark-line: color-mix(in srgb, var(--light) 18%, var(--dark));
  --photo-bg: rgb(255 255 255);

  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --display-weight: 700;
  --display-tracking: 0;
  --display-scale: 1;
  --font-part: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 14px;
  --gutter: 1rem;
  --sticky-top: 8.75rem;
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent);
}

/* Tipografía de títulos según el tema (`font_preset`). */
.sf-font-moderno {
  --font-display: var(--font-body);
  --display-weight: 800;
  --display-tracking: -0.025em;
  --display-scale: .84;
}

.sf-font-clasico {
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --display-weight: 700;
  --display-tracking: -0.01em;
  --display-scale: .86;
}

/* ── Base ────────────────────────────────────────────────────────────── */

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

.sf {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Reinicios sin especificidad (:where) para que cualquier clase los pise. */
:where(.sf) :where(img) { max-width: 100%; height: auto; display: block; }
:where(.sf) :where(a) { color: inherit; }
:where(.sf) :where(button, input, select, textarea) { font: inherit; color: inherit; }
:where(.sf) :where(h1, h2, h3, p, ul, ol, dl, figure) { margin: 0; }
:where(.sf) :where(ul, ol) { padding: 0; list-style: none; }
.sf :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.sf-main { flex: 1 0 auto; }

.sf-wrap {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 48rem) {
  .sf { --gutter: 1.5rem; }
}

.sf-visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.sf-skip {
  position: absolute; left: .5rem; top: -4rem; z-index: 60;
  background: var(--brand); color: var(--on-brand);
  padding: .6rem 1rem; border-radius: var(--r-md); font-weight: 700; text-decoration: none;
}
.sf-skip:focus { top: .5rem; }

.sf-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sf-pre { white-space: pre-line; }
.sf-muted { color: var(--muted); }
.sf-hint { color: var(--muted); font-size: .875rem; line-height: 1.5; }

.sf-icon { flex: none; }

.sf-link {
  color: var(--link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}
.sf-link:hover { text-decoration-thickness: 2px; }

.sf-partno {
  font-family: var(--font-part);
  font-weight: 500;
  font-size: .8125rem;
  letter-spacing: .02em;
  color: var(--muted);
}

/* ── Títulos ─────────────────────────────────────────────────────────── */

.sf-h1, .sf-h2, .sf-h3, .sf-hero-title, .sf-buy-title, .sf-price, .sf-buy-price,
.sf-model-name, .sf-footer-name, .sf-code, .sf-total-row strong {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
}

.sf-h1 { font-size: calc(2rem * var(--display-scale) + .25rem); line-height: 1.05; text-wrap: balance; }
.sf-h2 { font-size: calc(1.625rem * var(--display-scale) + .2rem); line-height: 1.1; text-wrap: balance; }
.sf-h3 { font-size: calc(1.25rem * var(--display-scale) + .15rem); line-height: 1.15; }

@media (min-width: 64rem) {
  .sf-h1 { font-size: calc(2.75rem * var(--display-scale) + .25rem); }
  .sf-h2 { font-size: calc(2rem * var(--display-scale) + .2rem); }
}

/* ── Botones y campos ────────────────────────────────────────────────── */

.sf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.75rem;
  padding: .55rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-weight: 650;
  font-size: .9375rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.sf-btn-lg { min-height: 3.125rem; padding-inline: 1.5rem; font-size: 1rem; }
.sf-btn-wide { width: 100%; }

.sf-btn-primary { background: var(--brand); color: var(--on-brand); }
.sf-btn-primary:hover { background: color-mix(in srgb, var(--brand) 86%, var(--ink)); }

.sf-btn-ghost { background: var(--bg); color: var(--ink); border-color: var(--line-strong); }
.sf-btn-ghost:hover { border-color: var(--ink); }

.sf-btn-soft { background: var(--brand-soft); color: var(--link); }
.sf-btn-soft:hover { background: var(--brand); color: var(--on-brand); }

.sf-btn-ondark { background: transparent; color: var(--light); border-color: var(--on-dark-line); }
.sf-btn-ondark:hover { border-color: var(--light); }

.sf-linkbtn {
  background: none; border: 0; padding: .25rem 0; cursor: pointer;
  color: var(--muted); font-size: .875rem; text-decoration: underline; text-underline-offset: .2em;
}
.sf-linkbtn:hover { color: var(--ink); }

.sf-iconbtn {
  display: inline-grid; place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: var(--r-md);
  cursor: pointer;
}

.sf-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.sf-field label { font-size: .875rem; font-weight: 600; }
.sf-field small { color: var(--muted); font-size: .8125rem; }

:where(.sf) :where(input[type="text"], input[type="email"], input[type="tel"], input[type="search"],
input[type="number"], input[type="url"], select, textarea) {
  width: 100%;
  min-height: 2.875rem;
  padding: .6rem .8rem;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-size: 1rem;
}
:where(.sf) :where(textarea) { min-height: 5rem; resize: vertical; }
:where(.sf) :where(input, select, textarea):focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }

.sf-inline-field { display: flex; gap: .5rem; }
.sf-inline-field input { flex: 1; min-width: 0; }

/* ── Barra superior, cabecera y menú ─────────────────────────────────── */

.sf-topbar {
  background: var(--dark);
  color: var(--on-dark-muted);
  font-size: .8125rem;
}
.sf-topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 2.25rem;
}
.sf-topbar-msg { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.sf-topbar-msg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sf-topbar-msg strong { color: var(--light); font-weight: 600; }
.sf-topbar-links { display: none; gap: 1.25rem; }
.sf-topbar-links li, .sf-topbar-links a { display: flex; align-items: center; gap: .4rem; }
.sf-topbar-links a { text-decoration: none; color: var(--light); }
.sf-topbar-links a:hover { text-decoration: underline; }

@media (min-width: 56rem) {
  .sf-topbar-links { display: flex; }
}

.sf-header {
  position: relative;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.sf-header-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "menu brand actions" "search search search";
  align-items: center;
  gap: .5rem .75rem;
  padding-block: .625rem .75rem;
}

.sf-menu { grid-area: menu; }
.sf-menu > summary { list-style: none; margin-left: -.5rem; }
.sf-menu > summary::-webkit-details-marker { display: none; }
.sf-menu[open] > summary { background: var(--surface); }
.sf-menu-panel {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 32px -18px color-mix(in srgb, var(--ink) 35%, transparent);
  padding: .5rem var(--gutter) 1.25rem;
  max-height: 75vh; overflow-y: auto;
}
.sf-menu-title { font-size: .8125rem; color: var(--muted); padding: .75rem 0 .25rem; }
.sf-menu-list a {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .75rem 0; border-bottom: 1px solid var(--line);
  text-decoration: none; font-weight: 600;
}
.sf-menu-count { color: var(--muted); font-weight: 400; font-size: .875rem; }
.sf-menu-extra a { justify-content: flex-start; font-weight: 500; }

.sf-brand {
  grid-area: brand;
  display: flex; align-items: center; gap: .65rem;
  min-width: 0;
  text-decoration: none;
}
.sf-logo { height: 2.25rem; width: auto; max-width: 9rem; object-fit: contain; }
.sf-brand-text { display: flex; flex-direction: column; min-width: 0; }
.sf-brand-name {
  font-family: var(--font-display);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
  font-size: calc(1.375rem * var(--display-scale) + .1rem);
  line-height: 1.05;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sf-brand-tagline { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sf-search {
  grid-area: search;
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--bg);
  overflow: hidden;
}
.sf-search:focus-within { border-color: var(--brand); box-shadow: var(--focus); }
.sf .sf-search input {
  flex: 1; min-width: 0; border: 0; border-radius: 0; box-shadow: none;
  padding-inline: .9rem; min-height: 2.875rem; background: transparent;
}
.sf-search-go {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 0; padding: 0 1rem; cursor: pointer;
  background: var(--brand); color: var(--on-brand); font-weight: 650;
}
.sf-search-label { display: none; }

.sf-header-actions { grid-area: actions; display: flex; align-items: center; gap: .25rem; }
.sf-header-help { display: none; }

.sf-cart-link {
  position: relative;
  display: inline-flex; align-items: center; gap: .45rem;
  min-height: 2.75rem; padding: 0 .5rem;
  border-radius: var(--r-md);
  text-decoration: none; font-weight: 650;
}
.sf-cart-link:hover { background: var(--surface); }
.sf-cart-text { display: none; }
.sf-cart-count {
  position: absolute; top: .2rem; left: 1.55rem;
  min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font-size: .75rem; font-weight: 700; line-height: 1;
}

.sf-catnav { display: none; }

@media (min-width: 64rem) {
  .sf-header { position: sticky; top: 0; }
  .sf-header-inner {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "brand search actions";
    gap: 2rem;
    padding-block: .9rem;
  }
  .sf-menu { display: none; }
  .sf-logo { height: 2.75rem; }
  .sf-brand-name { font-size: calc(1.625rem * var(--display-scale) + .1rem); }
  .sf-search { max-width: 44rem; width: 100%; justify-self: center; }
  .sf-search-label { display: inline; }
  .sf-header-actions { gap: 1.25rem; }
  .sf-header-help {
    display: flex; align-items: center; gap: .55rem;
    text-decoration: none; font-weight: 650; font-size: .9375rem; line-height: 1.15;
  }
  .sf-header-help span { display: flex; flex-direction: column; }
  .sf-header-help small { font-weight: 400; font-size: .75rem; color: var(--muted); }
  .sf-header-help .sf-icon { color: var(--ok); }
  .sf-cart-link { gap: .9rem; }
  .sf-cart-text { display: inline; }
  .sf-cart-count { left: 1.45rem; top: .15rem; }

  .sf-catnav { display: block; border-top: 1px solid var(--line); }
  .sf-catnav-list { display: flex; gap: 1.75rem; overflow-x: auto; scrollbar-width: none; }
  .sf-catnav-list a {
    display: block; padding: .7rem 0 .6rem;
    border-bottom: 2px solid transparent;
    text-decoration: none; font-size: .9375rem; font-weight: 550; white-space: nowrap;
    color: color-mix(in srgb, var(--ink) 82%, var(--bg));
  }
  .sf-catnav-list a:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
  .sf-catnav-list a[aria-current] { color: var(--ink); border-bottom-color: var(--brand); }
}

/* ── Avisos ──────────────────────────────────────────────────────────── */

.sf-flash { background: var(--brand-soft); border-bottom: 1px solid var(--brand-line); }
.sf-flash p { padding-block: .75rem; font-weight: 600; font-size: .9375rem; }
.sf-flash-alert { background: var(--warn-soft); border-bottom-color: color-mix(in srgb, var(--warn) 40%, var(--bg)); }

.sf-notice {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .9rem 1rem; margin-block: 1rem;
  border: 1px solid var(--brand-line); border-radius: var(--r-md);
  background: var(--brand-soft);
}
.sf-notice > .sf-icon { margin-top: .1rem; color: var(--link); }
.sf-notice-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, var(--bg)); }
.sf-notice-warn > .sf-icon { color: var(--warn); }
.sf-notice ul { list-style: disc; padding-left: 1.1rem; margin-top: .35rem; }
.sf-notice .sf-btn { margin-top: .6rem; }

/* ── Portada: banda principal ────────────────────────────────────────── */

.sf-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--dark);
  color: var(--light);
}
.sf-hero-bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
.sf-hero-image::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, color-mix(in srgb, var(--dark) 92%, transparent) 0%,
                                     color-mix(in srgb, var(--dark) 78%, transparent) 55%,
                                     color-mix(in srgb, var(--dark) 45%, transparent) 100%);
}
/* Sin foto: retícula de taller muy tenue hacia la derecha. */
.sf-hero:not(.sf-hero-image)::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--on-dark-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--on-dark-line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .45;
  mask-image: linear-gradient(100deg, transparent 30%, black 100%);
}
.sf-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--brand);
}

.sf-hero-inner {
  display: grid;
  gap: 2rem;
  padding-block: 2.25rem 2.75rem;
}
.sf-hero-tagline {
  display: inline-flex; align-items: center; gap: .6rem;
  font-size: .9375rem; font-weight: 600; color: var(--on-dark-muted);
  margin-bottom: 1rem;
}
.sf-hero-tagline::before { content: ""; width: 1.75rem; height: 3px; background: var(--brand); }
.sf-hero-title {
  font-size: calc(2.5rem * var(--display-scale) + .3rem);
  line-height: .98;
  max-width: 17ch;
  text-wrap: balance;
}
.sf-hero-sub {
  margin-top: 1.1rem;
  max-width: 34rem;
  font-size: 1.0625rem;
  color: var(--on-dark-muted);
}
.sf-hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }

/* Ficha «Busca por tu auto»: tarjeta clara sobre la banda oscura. */
.sf-finder {
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: 0 24px 48px -24px color-mix(in srgb, black 60%, transparent);
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
}
.sf-finder-part {
  margin-top: 1.1rem; padding-top: 1.1rem;
  border-top: 1px dashed var(--line-strong);
  display: flex; flex-direction: column; gap: .4rem;
}
.sf-finder-part label { font-size: .875rem; font-weight: 600; }
.sf-finder-part input { font-family: var(--font-part); letter-spacing: .02em; }

@media (min-width: 64rem) {
  .sf-hero-inner {
    grid-template-columns: minmax(0, 1.25fr) minmax(22rem, 26rem);
    align-items: center;
    gap: 4rem;
    padding-block: 4.5rem 5rem;
  }
  .sf-hero-title { font-size: calc(4.25rem * var(--display-scale) + .3rem); }
  .sf-hero-sub { font-size: 1.1875rem; }
  .sf-finder { padding: 1.75rem; }
}

/* Buscador por vehículo (portada y filtros). */
.sf-picker-title {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
  font-size: calc(1.375rem * var(--display-scale) + .15rem); line-height: 1.1;
  margin-bottom: 1rem;
}
.sf-picker-title .sf-icon { color: var(--brand); }
.sf-picker-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.sf-picker-fields .sf-field:first-child { grid-column: 1 / -1; }
.sf-picker .sf-hint { margin-top: .6rem; }
.sf-picker-compact .sf-picker-title { font-size: 1.125rem; margin-bottom: .75rem; }
.sf-picker-compact .sf-picker-fields { grid-template-columns: 1fr; gap: .6rem; }

/* ── Franja de confianza ─────────────────────────────────────────────── */

.sf-trust { background: var(--surface); border-bottom: 1px solid var(--line); }
.sf-trust-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 1rem;
  padding-block: 1.5rem;
}
.sf-trust-item { display: flex; gap: .75rem; align-items: flex-start; font-size: .875rem; line-height: 1.4; }
.sf-trust-item strong { display: block; font-size: .9375rem; margin-bottom: .1rem; }
.sf-trust-item span span { color: var(--muted); }
.sf-trust-icon {
  display: inline-grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--bg); color: var(--brand);
  border: 1px solid var(--line);
}

@media (min-width: 64rem) {
  .sf-trust-list { grid-template-columns: repeat(4, 1fr); gap: 2rem; padding-block: 1.75rem; }
}

/* ── Secciones de la portada ─────────────────────────────────────────── */

.sf-section { padding-block: 2.75rem; }
.sf-section-alt { background: var(--surface); }
.sf-section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem;
}

@media (min-width: 64rem) {
  .sf-section { padding-block: 4rem; }
  .sf-section-head { margin-bottom: 1.75rem; }
}

/* Compra por categoría */
.sf-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.sf-tile {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg);
  text-decoration: none;
  overflow: hidden;
  transition: border-color .15s ease;
}
.sf-tile:hover { border-color: var(--ink); }
.sf-tile-photo {
  display: grid; place-items: center;
  aspect-ratio: 4 / 3;
  background: var(--photo-bg);
  border-bottom: 1px solid var(--line);
  padding: .75rem;
}
.sf-tile-photo img { width: 100%; height: 100%; object-fit: contain; }
.sf-tile-name { padding: .8rem .9rem 0; font-weight: 700; font-size: 1rem; line-height: 1.25; }
.sf-tile-count { padding: .15rem .9rem .9rem; color: var(--muted); font-size: .8125rem; }

@media (min-width: 48rem) {
  .sf-tiles { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (min-width: 64rem) {
  .sf-tiles { grid-template-columns: repeat(6, 1fr); }
  .sf-tile-photo { aspect-ratio: 1; }
}

/* Compra por modelo */
.sf-models { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.sf-model {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 6.5rem; height: 100%;
  padding: 1rem;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg);
  text-decoration: none;
  overflow: hidden;
}
.sf-model::after {
  content: ""; position: absolute; top: 1.1rem; right: 1.1rem;
  width: .5rem; height: .5rem;
  border-top: 2px solid var(--muted); border-right: 2px solid var(--muted);
  transform: rotate(45deg);
}
.sf-model:hover { border-color: var(--ink); }
.sf-model:hover::after { border-color: var(--brand); }
.sf-model-brand { font-size: .8125rem; color: var(--muted); }
.sf-model-name { font-size: calc(1.75rem * var(--display-scale) + .1rem); line-height: 1; }
.sf-model-photo { padding: 0; }
.sf-model-photo img { aspect-ratio: 16 / 10; width: 100%; object-fit: cover; }
.sf-model-photo .sf-model-brand { padding: .75rem 1rem 0; }
.sf-model-photo .sf-model-name { padding: 0 1rem 1rem; }

@media (min-width: 48rem) {
  .sf-models { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 1rem; }
  .sf-model { min-height: 8rem; padding: 1.25rem; }
}

.sf-more { margin-top: 2rem; text-align: center; }

/* Preguntas frecuentes */
.sf-faq { display: grid; gap: 1.5rem; }
.sf-faq-intro p { color: var(--muted); margin-top: .75rem; max-width: 30rem; }
.sf-faq-intro .sf-btn { margin-top: .5rem; }
.sf-faq-list { border-top: 1px solid var(--line-strong); }
.sf-qa { border-bottom: 1px solid var(--line-strong); }
.sf-qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 0;
  font-weight: 650; font-size: 1.0625rem; line-height: 1.35;
  cursor: pointer; list-style: none;
}
.sf-qa summary::-webkit-details-marker { display: none; }
.sf-qa-icon { color: var(--muted); transition: transform .2s ease; }
.sf-qa[open] .sf-qa-icon { transform: rotate(45deg); color: var(--brand); }
.sf-qa p { padding: 0 2.5rem 1.25rem 0; color: color-mix(in srgb, var(--ink) 82%, var(--bg)); max-width: 44rem; }

@media (min-width: 64rem) {
  .sf-faq { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 4rem; }
}

/* ── Tarjeta de producto ─────────────────────────────────────────────── */

.sf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }

@media (min-width: 48rem) {
  .sf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
}

@media (min-width: 64rem) {
  .sf-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
  .sf-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.sf-card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg);
  overflow: hidden;
  transition: border-color .15s ease;
}
.sf-card:hover { border-color: var(--line-strong); }
/* La caja manda, no la foto: la fila de la grilla parte en 0 y overflow quita el
   mínimo automático de aspect-ratio, así una foto vertical no estira la tarjeta. */
.sf-card-photo {
  display: grid; place-items: center;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--photo-bg);
  padding: 8%;
}
.sf-card-photo img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.sf-card-body { display: flex; flex-direction: column; flex: 1; gap: .3rem; padding: .8rem .85rem .85rem; border-top: 1px solid var(--line); }
.sf-card-brand { font-size: .75rem; color: var(--muted); font-weight: 600; }
.sf-card-title {
  font-size: .9375rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em;
}
.sf-card-link { text-decoration: none; }
.sf-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.sf-card-link:hover { text-decoration: underline; text-underline-offset: .18em; }
.sf-card-foot { margin-top: auto; padding-top: .35rem; display: flex; flex-direction: column; gap: .15rem; }
.sf-price { font-size: calc(1.5rem * var(--display-scale) + .1rem); line-height: 1.05; display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem; }
.sf-vat { font-family: var(--font-body); font-weight: 400; font-size: .75rem; color: var(--muted); letter-spacing: 0; }
/* Oferta (P3 «Precios y ofertas»): normal tachado + «–X %», sin fecha. */
.sf-was { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .875rem; line-height: 1.2; color: var(--muted); }
.sf-was s { text-decoration-thickness: 1px; }
.sf-was .sf-off,
.sf-line-price .sf-was .sf-off,
.sf-mini-info .sf-was .sf-off {
  display: inline-block; padding: .1rem .4rem; border-radius: .25rem;
  background: var(--sale); color: var(--on-sale); font-weight: 700; font-size: .75rem; letter-spacing: .02em;
}
.sf-was-lg { margin-top: 1.25rem; font-size: 1rem; }
.sf-was-lg + .sf-buy-price { margin-top: .35rem; }
.sf-price-sale { color: var(--sale); }
.sf-line-price .sf-was, .sf-mini-info .sf-was { font-size: .8125rem; }
.sf-card-add { position: relative; z-index: 2; margin-top: .6rem; }
.sf-card-add .sf-btn { min-height: 2.5rem; font-size: .875rem; }

@media (min-width: 64rem) {
  .sf-card-body { padding: 1rem 1.1rem 1.1rem; }
  .sf-card-title { font-size: 1rem; }
}

/* Disponibilidad */
.sf-avail {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8125rem; font-weight: 600;
}
.sf-avail::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
.sf-avail-stock { color: var(--ok); }
.sf-avail-stock::before { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.sf-avail-order { color: var(--warn); }
.sf-avail-order::before { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sf-avail-lg { font-size: .9375rem; }

/* ── Destacados (MF11): justo bajo el buscador ──────────────────────────
   1 → protagonista + catálogo · 2–3 → fila con el catálogo al final ·
   4–8 → carrusel (scroll-snap, sin JS) bajo 64rem y grilla de 4 encima. La
   tarjeta del catálogo completa la última fila: nunca queda un hueco. */

.sf-feat-head { align-items: flex-end; }
.sf-feat-lead { margin-top: .45rem; color: var(--muted); font-size: .9375rem; max-width: 36rem; }
.sf-feat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.sf-feat-item { display: flex; min-width: 0; }
.sf-feat-item > * { flex: 1; min-width: 0; }

/* Tarjeta protagonista */
.sf-feat-one .sf-feat-list { grid-template-columns: minmax(0, 1fr); }
.sf-card-lead .sf-card-title { font-size: 1.25rem; line-height: 1.2; -webkit-line-clamp: 3; min-height: 0; }
.sf-card-lead .sf-price { font-size: calc(2.1rem * var(--display-scale) + .1rem); }
.sf-card-lead .sf-card-foot { gap: .45rem; padding-top: .75rem; }
.sf-card-lead .sf-card-add { margin-top: 1rem; }
.sf-card-lead .sf-card-add .sf-btn { min-height: 3rem; font-size: .9375rem; }
.sf-card-note { font-size: .875rem; line-height: 1.5; color: var(--muted); max-width: 30rem; }
@media (min-width: 40rem) {
  .sf-card-lead { flex-direction: row; }
  .sf-card-lead .sf-card-photo { flex: 0 0 50%; aspect-ratio: auto; min-height: 21rem; }
  .sf-card-lead .sf-card-body { justify-content: center; gap: .45rem; padding: 1.5rem; border-top: 0; border-left: 1px solid var(--line); }
  .sf-card-lead .sf-card-foot { margin-top: .5rem; }
  .sf-card-lead .sf-card-add .sf-btn { width: auto; align-self: flex-start; padding-inline: 1.75rem; }
}
@media (min-width: 64rem) {
  .sf-feat-one .sf-feat-list { grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 1.25rem; }
  .sf-feat-solo .sf-feat-list { grid-template-columns: minmax(0, 1fr); }
  .sf-card-lead .sf-card-photo { min-height: 26rem; }
  .sf-card-lead .sf-card-body { padding: 2rem 2.25rem; }
  .sf-card-lead .sf-card-title { font-size: 1.5rem; }
}

/* 2–3: la tarjeta del catálogo cierra la fila */
.sf-feat-n2 .sf-feat-item-all { grid-column: 1 / -1; }
@media (min-width: 48rem) {
  .sf-feat-few .sf-feat-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .sf-feat-n2 .sf-feat-item-all { grid-column: auto; }
  .sf-feat-n3 .sf-feat-item-all { grid-column: 1 / -1; }
}
@media (min-width: 64rem) {
  .sf-feat-few .sf-feat-list { gap: 1.25rem; }
  .sf-feat-n3 .sf-feat-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sf-feat-n3 .sf-feat-item-all { grid-column: auto; }
}

/* 4–8: carrusel en teléfono y tablet, grilla de 4 en escritorio */
@media (max-width: 63.99rem) {
  .sf-feat-many .sf-feat-list {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(10.5rem, 42%);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    margin-inline: calc(-1 * var(--gutter));
    padding: 0 var(--gutter) .75rem;
    scrollbar-width: thin;
  }
  .sf-feat-many .sf-feat-item { scroll-snap-align: start; }
}
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .sf-feat-many .sf-feat-list { grid-auto-columns: 29%; gap: 1rem; }
}
@media (min-width: 64rem) {
  .sf-feat-many .sf-feat-list { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; }
  .sf-feat-span-2 { grid-column: span 2; }
  .sf-feat-span-3 { grid-column: span 3; }
  .sf-feat-full { grid-column: 1 / -1; }
}

/* Tarjeta «Ver todo el catálogo» (o «¿Buscas otro repuesto?» si ya está todo a la vista) */
.sf-feat-all {
  display: flex; flex-direction: column; gap: .35rem;
  min-height: 100%;
  padding: 1.25rem;
  border-radius: var(--r-lg);
  background: var(--dark);
  color: var(--light);
  text-decoration: none;
}
.sf-feat-all-kicker { font-weight: 700; font-size: 1rem; }
.sf-feat-all-num {
  margin-top: auto; padding-top: 1rem;
  font-family: var(--font-display); font-weight: var(--display-weight, 700);
  font-size: calc(3rem * var(--display-scale)); line-height: .95;
  font-variant-numeric: tabular-nums;
}
.sf-feat-all-label { color: var(--on-dark-muted); font-size: .9375rem; }
.sf-feat-all-text { margin-top: auto; color: var(--on-dark-muted); font-size: .9375rem; line-height: 1.5; }
.sf-feat-all-extra {
  margin-top: .5rem; padding-top: .65rem;
  border-top: 1px solid var(--on-dark-line);
  color: var(--on-dark-muted); font-size: .875rem; line-height: 1.45;
}
.sf-feat-all-extra strong { color: var(--light); font-weight: 700; }
.sf-feat-all-go { display: inline-flex; align-items: center; gap: .45rem; margin-top: .9rem; font-weight: 700; font-size: .9375rem; }
.sf-feat-all:hover .sf-feat-all-go > span { text-decoration: underline; text-underline-offset: .2em; }
.sf-feat-all:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.sf-feat-item-all { container-type: inline-size; }
.sf-feat-all-kicker, .sf-feat-all-go { line-height: 1.15; }
.sf-feat-all-go { white-space: nowrap; }
/* Tarjeta angosta (al lado de un producto en el teléfono): todo más compacto. */
@container (max-width: 15rem) {
  .sf-feat-all { padding: 1rem; }
  .sf-feat-all-num { font-size: calc(2.5rem * var(--display-scale)); }
  .sf-feat-all-label, .sf-feat-all-text { font-size: .875rem; }
  .sf-feat-all-extra { font-size: .8125rem; }
  .sf-feat-all-go-more { display: none; }
}

/* Franja de ancho completo (4 u 8 destacados en escritorio): todo en una línea. */
@media (min-width: 64rem) {
  .sf-feat-full .sf-feat-all { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 1rem; padding: 1.25rem 1.75rem; }
  .sf-feat-full .sf-feat-all-num { margin-top: 0; padding-top: 0; font-size: calc(2.25rem * var(--display-scale)); }
  .sf-feat-full .sf-feat-all-extra { margin: 0; padding: 0 0 0 1rem; border-top: 0; border-left: 1px solid var(--on-dark-line); }
  .sf-feat-full .sf-feat-all-go { margin: 0 0 0 auto; }
}

/* Sin destacados pero con catálogo (solo listas «a pedido»): solo la franja. */
.sf-feat-none .sf-feat-list { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) {
  .sf-feat-none .sf-feat-all { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 1rem; padding: 1.25rem 1.75rem; }
  .sf-feat-none .sf-feat-all-num { margin-top: 0; padding-top: 0; font-size: calc(2.25rem * var(--display-scale)); }
  .sf-feat-none .sf-feat-all-extra { margin: 0; padding: 0 0 0 1rem; border-top: 0; border-left: 1px solid var(--on-dark-line); }
  .sf-feat-none .sf-feat-all-go { margin: 0 0 0 auto; }
}

/* ── Listado ─────────────────────────────────────────────────────────── */

.sf-pagehead { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: 1.25rem 1.5rem; }
.sf-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem;
  font-size: .8125rem; color: var(--muted);
  margin-bottom: .6rem;
}
.sf-crumbs a { color: inherit; text-decoration: none; }
.sf-crumbs a:hover { color: var(--ink); text-decoration: underline; }
.sf-crumbs [aria-current] { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.sf-pagehead-meta { margin-top: .5rem; color: var(--muted); font-size: .9375rem; }
.sf-pagehead-meta strong { color: var(--ink); }

.sf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; }
.sf-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 2rem; padding: .25rem .5rem .25rem .8rem;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--bg);
  font-size: .8125rem; font-weight: 600; text-decoration: none;
}
.sf-chip:hover { border-color: var(--ink); }

.sf-listing { display: grid; gap: 1.25rem; padding-block: 1.25rem 3rem; }

.sf-filters-box { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
.sf-filters-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1rem; font-weight: 650; cursor: pointer; list-style: none;
}
.sf-filters-toggle::-webkit-details-marker { display: none; }
.sf-filters-chev { transition: transform .2s ease; color: var(--muted); }
.sf-filters-box[open] .sf-filters-chev { transform: rotate(90deg); }
.sf-filters-body { padding: 0 1rem 1rem; display: grid; gap: 1.25rem; }
.sf-filter-title { font-size: .875rem; font-weight: 700; margin-bottom: .4rem; }
.sf-filter-list a {
  display: flex; justify-content: space-between; gap: .5rem;
  padding: .45rem .6rem; margin-inline: -.6rem;
  border-radius: var(--r-sm);
  text-decoration: none; font-size: .9375rem;
}
.sf-filter-list a span { color: var(--muted); font-size: .8125rem; }
.sf-filter-list a:hover { background: var(--surface); }
.sf-filter-list a[aria-current] { background: var(--brand-soft); color: var(--link); font-weight: 650; }
.sf-filter-group + .sf-filter-group { border-top: 1px solid var(--line); padding-top: 1.25rem; }

.sf-pages {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  margin-top: 2rem; font-size: .9375rem;
}
.sf-pages > :last-child { justify-self: end; }

@media (min-width: 64rem) {
  .sf-pagehead { padding-block: 1.75rem 2rem; }
  .sf-listing { grid-template-columns: 16.5rem minmax(0, 1fr); gap: 2rem; padding-block: 2rem 4rem; align-items: start; }
  .sf-filters { position: sticky; top: var(--sticky-top); }
  .sf-filters-box.is-enhanced { border: 0; background: none; }
  .sf-filters-box.is-enhanced .sf-filters-toggle { display: none; }
  .sf-filters-box.is-enhanced .sf-filters-body { padding: 0; }
}

/* ── Vacío y 404 ─────────────────────────────────────────────────────── */

.sf-empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .75rem;
  padding: 3rem 1.25rem;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface);
}
.sf-empty p { max-width: 34rem; color: var(--muted); }
.sf-empty-icon { color: var(--muted); }
.sf-empty-page { margin-block: 2.5rem 4rem; border-style: solid; }
.sf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; margin-top: .75rem; }
.sf-code { font-size: 4.5rem; line-height: 1; color: var(--brand); }

/* ── Ficha de producto ───────────────────────────────────────────────── */

.sf-crumbs-product { padding-top: 1rem; }

.sf-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.sf-gallery { min-width: 0; }
.sf-gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--photo-bg);
}
.sf-gallery-track::-webkit-scrollbar { display: none; }
.sf-shot {
  flex: 0 0 100%;
  scroll-snap-align: start;
  aspect-ratio: 1;
  display: grid; place-items: center;
  padding: 6%;
}
.sf-shot img { width: 100%; height: 100%; object-fit: contain; }
.sf-thumbs { display: flex; gap: .5rem; margin-top: .75rem; overflow-x: auto; }
.sf-thumbs a {
  display: block; width: 4.25rem; height: 4.25rem; padding: .3rem; flex: none;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  background: var(--photo-bg);
}
.sf-thumbs a[aria-current] { border-color: var(--brand); }
.sf-thumbs img { width: 100%; height: 100%; object-fit: contain; }

.sf-buy-brand { font-size: .875rem; font-weight: 650; color: var(--link); margin-bottom: .35rem; }
.sf-buy-title { font-size: calc(1.875rem * var(--display-scale) + .25rem); line-height: 1.05; text-wrap: balance; }
.sf-buy-part { margin-top: .5rem; font-size: .875rem; color: var(--muted); }
.sf-buy-part .sf-partno { color: var(--ink); font-size: .875rem; }
.sf-buy-price {
  display: flex; align-items: baseline; gap: .6rem;
  margin-top: 1.25rem;
  font-size: calc(2.5rem * var(--display-scale) + .2rem); line-height: 1;
}
.sf-buy-price .sf-vat { font-size: .875rem; }
.sf-buybox .sf-avail { margin-top: .9rem; }
.sf-buy-note { margin-top: .35rem; font-size: .875rem; color: var(--muted); }

.sf-add {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end; gap: .75rem;
  margin-top: 1.25rem; padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.sf-qty { display: flex; flex-direction: column; gap: .35rem; }
.sf-qty label { font-size: .8125rem; font-weight: 600; }
.sf-qty-box { display: flex; align-items: stretch; }
.sf .sf-qty input { width: 4.5rem; min-height: 3.125rem; text-align: center; font-weight: 650; }
.sf-qty.is-enhanced .sf-qty-box { border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; }
.sf .sf-qty.is-enhanced input { width: 3rem; border: 0; border-radius: 0; box-shadow: none; -moz-appearance: textfield; appearance: textfield; }
.sf-qty.is-enhanced input::-webkit-inner-spin-button, .sf-qty.is-enhanced input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.sf-qty-btn { width: 2.5rem; border: 0; background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.sf-qty-btn[hidden] { display: none; }
.sf-qty-btn:hover { background: var(--surface-2); }
.sf-buy-incart { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; font-size: .875rem; color: var(--ok); }

.sf-buy-delivery {
  margin-top: 1.5rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.sf-buy-delivery li {
  display: flex; gap: .75rem; align-items: center;
  padding: .75rem .9rem;
  font-size: .875rem; color: var(--muted);
}
.sf-buy-delivery li + li { border-top: 1px solid var(--line); }
.sf-buy-delivery .sf-icon { color: var(--ink); }
.sf-buy-delivery strong { display: block; color: var(--ink); font-weight: 650; }

.sf-buy-ask {
  display: flex; gap: .75rem; align-items: center;
  margin-top: 1rem; padding: .85rem .9rem;
  border-radius: var(--r-md);
  background: var(--ok-soft);
  text-decoration: none; font-size: .875rem; line-height: 1.4;
}
.sf-buy-ask .sf-icon { color: var(--ok); }
.sf-buy-ask strong { display: block; }
.sf-buy-ask:hover strong { text-decoration: underline; }

.sf-product-detail { display: grid; gap: 2rem; min-width: 0; }
.sf-block .sf-h3 { margin-bottom: .9rem; }
.sf-prose { max-width: 46rem; white-space: pre-line; color: color-mix(in srgb, var(--ink) 86%, var(--bg)); }

.sf-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.sf-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.sf-table th, .sf-table td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line); }
.sf-table thead th { background: var(--surface); font-size: .8125rem; font-weight: 650; color: var(--muted); }
.sf-table tbody th { font-weight: 650; }
.sf-table tbody tr:last-child > * { border-bottom: 0; }
.sf-block .sf-hint { margin-top: .75rem; }

.sf-specs { display: grid; border-top: 1px solid var(--line); }
.sf-specs div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.sf-specs dt { color: var(--muted); }
.sf-specs dd { margin: 0; font-weight: 550; }

@media (min-width: 64rem) {
  .sf-product {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    grid-template-areas: "gallery buy" "detail buy";
    column-gap: 3.5rem; row-gap: 3rem;
    align-items: start;
    padding-bottom: 4.5rem;
  }
  .sf-gallery { grid-area: gallery; }
  .sf-buybox { grid-area: buy; position: sticky; top: var(--sticky-top); }
  .sf-buybox-inner { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.75rem; }
  .sf-product-detail { grid-area: detail; }
  .sf-crumbs-product { padding-block: 1.25rem .75rem; }
}

/* ── Compra: pasos, carrito, checkout ────────────────────────────────── */

.sf-flow { padding-block: 1.25rem 3.5rem; }
.sf-flow > .sf-h1 { margin-bottom: 1.25rem; }

.sf-steps {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 1.25rem;
  font-size: .8125rem; color: var(--muted);
  overflow-x: auto;
}
.sf-step { display: flex; align-items: center; gap: .45rem; white-space: nowrap; }
.sf-step + .sf-step::before { content: ""; width: 1.5rem; height: 1px; background: var(--line-strong); margin-right: .1rem; }
.sf-step-n {
  display: inline-grid; place-items: center;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-weight: 700; font-size: .75rem;
}
.sf-step.is-current { color: var(--ink); font-weight: 650; }
.sf-step.is-current .sf-step-n { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.sf-step.is-done .sf-step-n { background: var(--ok-soft); border-color: transparent; color: var(--ok); }

.sf-flow-layout { display: grid; gap: 1.5rem; align-items: start; }

@media (min-width: 64rem) {
  .sf-flow { padding-block: 2rem 5rem; }
  .sf-flow-layout { grid-template-columns: minmax(0, 1fr) 24rem; gap: 2.5rem; }
}

.sf-lines { border-top: 1px solid var(--line); }
.sf-line {
  display: grid;
  grid-template-columns: 4.75rem minmax(0, 1fr);
  grid-template-areas: "photo info" "photo qty" "photo price";
  gap: .5rem 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--line);
}
.sf-line-photo {
  grid-area: photo;
  display: grid; place-items: center;
  width: 4.75rem; height: 4.75rem; padding: .35rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--photo-bg);
}
.sf-line-photo img { width: 100%; height: 100%; object-fit: contain; }
.sf-line-info { grid-area: info; display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; min-width: 0; }
.sf-line-name { font-weight: 650; text-decoration: none; line-height: 1.3; }
.sf-line-name:hover { text-decoration: underline; }
.sf-line-qty { grid-area: qty; display: flex; align-items: center; gap: .75rem; }
.sf-line-qty label { font-size: .8125rem; color: var(--muted); }
.sf .sf-line-qty input { width: 4.5rem; min-height: 2.5rem; text-align: center; }
.sf-line-price { grid-area: price; display: flex; align-items: baseline; gap: .5rem; }
.sf-line-price strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: calc(1.375rem * var(--display-scale) + .1rem); }
.sf-line-price span { color: var(--muted); font-size: .8125rem; }

@media (min-width: 48rem) {
  .sf-line {
    grid-template-columns: 5.5rem minmax(0, 1fr) auto 8rem;
    grid-template-areas: "photo info qty price";
    align-items: center;
  }
  .sf-line-photo { width: 5.5rem; height: 5.5rem; }
  .sf-line-qty { flex-direction: column; align-items: center; gap: .2rem; }
  .sf-line-qty label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .sf-line-price { flex-direction: column; align-items: flex-end; gap: 0; }
}

.sf-cart-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }

.sf-summary {
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
}
@media (min-width: 64rem) {
  .sf-summary { position: sticky; top: var(--sticky-top); padding: 1.5rem; }
}
.sf-totals { display: grid; gap: .5rem; font-size: .9375rem; }
.sf-totals div { display: flex; justify-content: space-between; gap: 1rem; }
.sf-totals dt { color: var(--muted); }
.sf-totals dd { margin: 0; text-align: right; font-weight: 600; }
.sf-totals dd.sf-muted { font-weight: 400; }
.sf-total-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-top: .9rem; border-top: 1px solid var(--line-strong);
  font-weight: 650;
}
.sf-total-row strong { font-size: calc(2rem * var(--display-scale) + .15rem); line-height: 1; }
.sf-summary-perks { display: grid; gap: .5rem; padding-top: .9rem; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
.sf-summary-perks li { display: flex; gap: .5rem; align-items: center; }
.sf-summary-perks .sf-icon { color: var(--ink); }
.sf-clear { align-self: center; }
.sf-summary .sf-linkbtn { align-self: center; }

.sf-mini-lines { display: grid; gap: .9rem; }
.sf-mini-lines li { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) auto; gap: .75rem; align-items: center; font-size: .875rem; }
.sf-mini-photo {
  position: relative;
  display: grid; place-items: center;
  width: 3.25rem; height: 3.25rem; padding: .25rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--photo-bg);
}
.sf-mini-photo img { width: 100%; height: 100%; object-fit: contain; }
.sf-mini-qty {
  position: absolute; top: -.45rem; right: -.45rem;
  min-width: 1.25rem; height: 1.25rem; padding: 0 .3rem;
  display: inline-grid; place-items: center;
  border-radius: 999px; background: var(--ink); color: var(--bg);
  font-size: .6875rem; font-weight: 700;
}
.sf-mini-info { display: flex; flex-direction: column; line-height: 1.3; font-weight: 600; min-width: 0; }
.sf-mini-info span { font-weight: 400; color: var(--muted); font-size: .8125rem; }

.sf-checkout-main { display: grid; gap: 1.25rem; min-width: 0; }
.sf-panel {
  min-width: 0;
  margin: 0;
  padding: 1.1rem 1.1rem 1.25rem;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg);
}
.sf-panel-title {
  float: left; width: 100%;
  padding: 0; margin-bottom: 1rem;
  font-family: var(--font-display); font-weight: var(--display-weight); letter-spacing: var(--display-tracking);
  font-size: calc(1.375rem * var(--display-scale) + .15rem); line-height: 1.1;
}
.sf-panel-title + * { clear: both; }
.sf-form-grid { display: grid; gap: 1rem; clear: both; }
.sf-address-hint { margin-bottom: .75rem; clear: both; }

@media (min-width: 40rem) {
  .sf-form-grid { grid-template-columns: 1fr 1fr; }
  .sf-span-2 { grid-column: 1 / -1; }
}
@media (min-width: 64rem) {
  .sf-panel { padding: 1.5rem; }
}

.sf-choices { display: grid; gap: .6rem; clear: both; }
.sf-choice {
  display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: .85rem;
  padding: .9rem 1rem;
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  cursor: pointer;
}
.sf-choice:hover { border-color: var(--line-strong); }
.sf-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.sf-choice input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--brand); }
.sf-choice-icon { color: var(--muted); display: grid; }
.sf-choice:has(input:checked) .sf-choice-icon { color: var(--link); }
.sf-choice-body { display: flex; flex-direction: column; font-size: .875rem; color: var(--muted); line-height: 1.4; }
.sf-choice-body strong { color: var(--ink); font-size: .9375rem; }
.sf-choice-price { font-weight: 700; font-size: .9375rem; white-space: nowrap; }

@media (max-width: 30rem) {
  .sf-choice { grid-template-columns: auto minmax(0, 1fr) auto; }
  .sf-choice-icon { display: none; }
}

/* La dirección solo se ve si se eligió despacho (sin :has, se ve siempre). */
@supports selector(:has(*)) {
  .sf-checkout:not(:has(input[value="shipping"]:checked)) .sf-address { display: none; }
  .sf-address-hint { display: none; }
}

/* ── Despacho: buscador de dirección, comuna y cotización (MF7) ───────── */

.sf-autocomplete[hidden], .sf-btn[hidden], .sf-combo-pop[hidden] { display: none; }
.sf-combo { position: relative; }
.sf-combo-icon { position: absolute; left: .8rem; top: 1.45rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
:where(.sf) .sf-combo input { padding-left: 2.6rem; }
.sf-combo-pop {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + .35rem);
  background: var(--bg);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--ink) 40%, transparent);
  overflow: hidden;
}
.sf-combo-list { max-height: 18rem; overflow-y: auto; margin: 0; padding: .3rem 0; list-style: none; overscroll-behavior: contain; }
.sf-combo-option {
  display: flex; flex-direction: column; gap: .1rem;
  min-height: 2.75rem; padding: .65rem .9rem;
  cursor: pointer; line-height: 1.3;
}
.sf-combo-option strong { font-size: .9375rem; font-weight: 600; }
.sf-combo-option span { font-size: .8125rem; color: var(--muted); }
.sf-combo-option[aria-selected="true"] { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.sf-combo-attrib {
  display: flex; justify-content: flex-end;
  padding: .4rem .75rem;
  border-top: 1px solid var(--line);
  background: var(--photo-bg); color: rgb(94 94 94); font-size: .75rem;
}
.sf-combo-attrib img { display: block; width: auto; height: 15px; }

.sf-inline-field select { flex: 1; min-width: 0; }

.sf-ship-modes { display: grid; gap: .75rem; margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sf-ship-modes-title { font-size: .875rem; font-weight: 600; }
.sf-ship-mode-list { display: grid; gap: .5rem; }
@media (min-width: 40rem) {
  .sf-ship-mode-list { grid-template-columns: 1fr 1fr; }
}
.sf .sf-choice-compact { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: .75rem .9rem; }
.sf-choice-compact input { margin-top: .15rem; }

/* El courier solo importa en el por pagar (sin :has, se ve siempre). */
@supports selector(:has(*)) {
  .sf-address:has(input[value="prepaid"]:checked):not(.is-collect) .sf-carrier { display: none; }
}

.sf-quote-box { margin-top: 1rem; }
.sf-quote {
  display: flex; gap: .7rem; align-items: flex-start;
  margin: 0; padding: .85rem 1rem;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface);
  font-size: .9375rem; line-height: 1.45;
}
.sf-quote > .sf-icon { flex: none; margin-top: .1rem; color: var(--muted); }
.sf-quote p { display: flex; flex-direction: column; gap: .15rem; margin: 0; min-width: 0; }
.sf-quote-line { font-weight: 650; }
.sf-quote-note { color: var(--muted); font-size: .875rem; }
.sf-quote-ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--bg)); background: var(--ok-soft); }
.sf-quote-ok > .sf-icon { color: var(--ok); }
.sf-quote-warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--bg)); background: var(--warn-soft); }
.sf-quote-warn > .sf-icon { color: var(--warn); }
.sf-quote-idle { color: var(--muted); }
.is-loading .sf-quote-box { opacity: .55; transition: opacity .15s; }
.sf-recalc { margin-top: .75rem; }

/* Total con o sin despacho según la entrega elegida. */
.sf-total-ship { display: none; }
@supports selector(:has(*)) {
  .sf-checkout:has(input[value="shipping"]:checked) .sf-total-ship { display: flex; }
  .sf-checkout:has(input[value="shipping"]:checked) .sf-total-base { display: none; }
  .sf-checkout:not(:has(input[value="shipping"]:checked)) .sf-ship-row,
  .sf-checkout:not(:has(input[value="shipping"]:checked)) .sf-ship-hint { display: none; }
}

/* Carrito: «Calcula tu despacho». */
.sf-calc { display: grid; gap: .6rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.sf-calc-title { display: flex; gap: .5rem; align-items: center; font-size: .9375rem; font-weight: 650; }
.sf-calc .sf-quote-box { margin-top: 0; }
.sf-calc .sf-quote-box:empty { display: none; }
.sf-calc .sf-quote { font-size: .875rem; padding: .7rem .8rem; }

.sf-accept { display: grid; gap: .6rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.sf-check { display: flex; gap: .6rem; align-items: flex-start; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.sf-check input { width: 1.15rem; height: 1.15rem; margin: .15rem 0 0; accent-color: var(--brand); flex: none; }
.sf-errors, .sf-problems { font-size: .9375rem; }

/* Términos (pie y checkout) */
.sf-terms summary { cursor: pointer; font-size: .875rem; font-weight: 600; color: var(--link); }
.sf-terms-body { display: grid; gap: .6rem; margin-top: .6rem; font-size: .8125rem; line-height: 1.55; color: var(--muted); }

/* ── Pedido ──────────────────────────────────────────────────────────── */

.sf-order-page { max-width: 44rem; }
.sf-order {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .75rem;
  margin-top: 1rem;
  padding: 2rem 1.25rem;
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.sf-order > p:not(.sf-order-kicker):not(.sf-actions):not(.sf-order-total):not(.sf-order-delivery) { color: var(--muted); max-width: 32rem; }
.sf-order-icon {
  display: inline-grid; place-items: center;
  width: 4rem; height: 4rem; border-radius: 50%;
  background: var(--warn-soft); color: var(--warn);
}
.sf-order-ok .sf-order-icon { background: var(--ok-soft); color: var(--ok); }
.sf-order-off .sf-order-icon { background: var(--surface-2); color: var(--muted); }
.sf-order-kicker { font-size: .875rem; color: var(--muted); }
.sf-order-total { font-size: 1rem; }
.sf-order-total strong { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.5rem; margin-left: .35rem; }
/* Entrega y montos que cobró el taller (MF7, GET /sales/:token). */
.sf-order-delivery {
  display: flex; gap: .6rem; align-items: flex-start; text-align: left;
  padding: .75rem 1rem; border-radius: var(--r-md); background: var(--surface);
  font-size: .9375rem;
}
.sf-order-delivery span { display: flex; flex-direction: column; color: var(--muted); }
.sf-order-delivery strong { color: var(--ink); }
.sf-order-totals { width: 100%; max-width: 22rem; padding-top: .75rem; border-top: 1px solid var(--line); text-align: left; }
.sf-order-totals .sf-order-total { align-items: baseline; padding-top: .5rem; border-top: 1px solid var(--line-strong); }
.sf-order-totals .sf-order-total dt { color: var(--ink); font-weight: 650; }

.sf-timeline {
  display: grid; grid-template-columns: repeat(3, 1fr);
  width: 100%; max-width: 30rem; margin-block: 1rem .5rem;
  font-size: .8125rem; color: var(--muted);
}
.sf-timeline li { position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.sf-timeline li span {
  position: relative; z-index: 1;
  width: .9rem; height: .9rem; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--line-strong);
}
.sf-timeline li + li::before {
  content: ""; position: absolute; top: .4rem; right: 50%; width: 100%; height: 2px; background: var(--line-strong);
}
.sf-timeline li.is-done { color: var(--ink); font-weight: 600; }
.sf-timeline li.is-done span { background: var(--ok); border-color: var(--ok); }
.sf-timeline li.is-done + li.is-done::before { background: var(--ok); }

@media (min-width: 64rem) {
  .sf-order { margin-top: 2rem; padding: 3rem 2.5rem; }
}

/* ── Pie ─────────────────────────────────────────────────────────────── */

.sf-footer {
  margin-top: auto;
  background: var(--dark);
  color: var(--on-dark-muted);
  font-size: .9375rem;
  border-top: 4px solid var(--brand);
}
.sf-footer a { color: var(--light); text-decoration: none; }
.sf-footer a:hover { text-decoration: underline; }
.sf-footer-grid { display: grid; gap: 2rem; padding-block: 2.5rem 2rem; }
.sf-footer-name { color: var(--light); font-size: calc(1.75rem * var(--display-scale) + .1rem); line-height: 1.1; }
.sf-footer-about { margin-top: .6rem; max-width: 26rem; }
.sf-social { display: flex; gap: .5rem; margin-top: 1rem; }
.sf-social a {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--on-dark-line); border-radius: 50%;
}
.sf-social a:hover { border-color: var(--light); }
.sf-footer-title { color: var(--light); font-size: .9375rem; font-weight: 700; margin-bottom: .75rem; }
.sf-footer-col ul { display: grid; gap: .55rem; }
.sf-footer-note { display: block; font-size: .8125rem; }
.sf-footer-contact li { display: flex; gap: .6rem; align-items: flex-start; }
.sf-footer-contact .sf-icon { margin-top: .15rem; }
.sf-footer-legal {
  display: grid; gap: .75rem;
  padding-block: 1.25rem 2rem;
  border-top: 1px solid var(--on-dark-line);
  font-size: .8125rem;
}
.sf-footer .sf-terms summary { color: var(--light); }
.sf-footer .sf-terms-body { color: var(--on-dark-muted); max-width: 52rem; }

@media (min-width: 48rem) {
  .sf-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 64rem) {
  .sf-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 3rem; padding-block: 3.5rem 2.5rem; }
  .sf-footer-legal { grid-template-columns: 1fr auto; align-items: start; }
  .sf-footer-legal .sf-terms { grid-column: 1 / -1; grid-row: 2; }
}

/* ── Tienda no disponible (layout mínimo) ────────────────────────────── */

.sf-bare { justify-content: center; }
.sf-bare-main {
  max-width: 32rem; margin: 0 auto; padding: 3rem 1.25rem; text-align: center;
  display: grid; gap: .75rem;
}
.sf-bare-main .sf-code { font-size: 1rem; color: var(--muted); font-family: var(--font-body); font-weight: 600; }

/* ── Movimiento reducido ─────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .sf *, .sf *::before, .sf *::after { transition: none; scroll-behavior: auto; }
}

/* ── Imagen referencial (MF10: repuestos a pedido sin foto propia) ───── */

.sf-photo-ref { position: relative; }
.sf-ref-pic { display: block; width: 100%; height: 100%; }
.sf-ref-pic img { width: 100%; height: 100%; object-fit: contain; }
.sf-ref-tag {
  position: absolute; left: .5rem; bottom: .5rem; z-index: 1;
  padding: .2rem .5rem;
  font-size: .6875rem; font-weight: 600; line-height: 1.2; letter-spacing: .01em;
  color: rgb(55 61 72);
  background: rgb(255 255 255 / .9);
  border: 1px solid rgb(0 0 0 / .08);
  border-radius: var(--r-sm);
  pointer-events: none;
}
.sf-line-photo.sf-photo-ref .sf-ref-tag,
.sf-mini-photo .sf-ref-tag { left: .2rem; bottom: .2rem; padding: .05rem .25rem; font-size: .5625rem; }
.sf-mini-photo .sf-ref-tag { display: none; }
.sf-ref-note { margin-top: .5rem; }
.sf-hint-order { display: flex; gap: .4rem; align-items: flex-start; margin-bottom: .5rem; }
.sf-hint-order .sf-icon { flex: none; margin-top: .15rem; }
