/* ==========================================================================
   PCscan — hoja de estilos
   1. Tokens (claro / oscuro)   5. Explorar (buscador, filtros, tarjetas)
   2. Base                       6. Detalle de producto
   3. Componentes comunes        7. Tiendas
   4. Cabecera y pie             8. Avisos, estados y utilidades
   9. Adaptación a pantallas pequeñas
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-2: #f0f4f2;
  --surface-3: #e6ece9;
  --ink: #14201c;
  --ink-soft: #33413c;
  --muted: #5d6a65;
  --line: #e1e7e4;
  --line-strong: #cdd6d2;

  --brand: #1a7a57;
  --brand-strong: #125d42;
  --brand-soft: #e3f2ec;
  --on-brand: #ffffff;

  --good: #177245;   --good-soft: #e2f4ea;
  --warn: #9a5b00;   --warn-soft: #fcf1dc;
  --bad: #b42318;    --bad-soft: #fde8e6;
  --info: #1d5fbf;   --info-soft: #e5eefc;
  --accent: #8a4b00; --accent-soft: #fff0d6;

  --series-0: #1a7a57; --series-1: #2f6fd6; --series-2: #c2410c; --series-3: #7c3aed;
  --series-4: #a16207; --series-5: #be185d; --series-6: #008300; --series-7: #dc2626;
  /* Color de cada tienda en las gráficas: cercano a su logo y separado de los demás. */
  --store-pcc: #ff6923; --store-mediamarkt: #d84291; --store-alternate: #881c25; --store-redcomputer: #d70c10;
  --store-coolmod: #914d00; --store-neobyte: #fa9700; --store-pcbox: #b57509; --store-caseking: #c5af00;
  --store-ibertronica: #7da100; --store-vsgamers: #288a2a; --store-ldlc: #2c8cc8; --store-lifeinformatica: #3156b3;

  --radius-s: 8px;
  --radius: 12px;
  --radius-l: 18px;
  --shadow-s: 0 1px 2px rgb(16 24 22 / 0.06);
  --shadow: 0 4px 16px rgb(16 24 22 / 0.07), 0 1px 3px rgb(16 24 22 / 0.05);
  --shadow-l: 0 24px 60px rgb(16 24 22 / 0.18);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --content: 1680px;  /* ancho útil máximo: 4-5 tarjetas por fila, sin filas interminables en 2560 px */
  --topbar-h: 80px;  /* barra superior en escritorio; lo fijo de debajo se coloca con ella */
  --gutter: clamp(16px, 3vw, 32px);
  /* Escala tipográfica: pocos tamaños y siempre los mismos (como idealo o Google Shopping).
     2xs etiquetas mínimas · xs insignias · sm datos secundarios · base interfaz · md texto
     · lg destacados · xl subtítulos · 2xl títulos de sección · 3xl precio · 4xl precio de la ficha
     · title el título de cada página (catálogo, ofertas, tiendas…). */
  --text-2xs: 11px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  --text-4xl: 32px;
  --text-title: clamp(24px, 1.2vw + 12px, 32px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1412; --surface: #151d1a; --surface-2: #1b2521; --surface-3: #232f2a;
    --ink: #e7eeeb; --ink-soft: #c7d2cd; --muted: #97a59f; --line: #25302c; --line-strong: #33413b;
    --brand: #3cc48f; --brand-strong: #6adcae; --brand-soft: #16342a; --on-brand: #06120d;
    --good: #5fd39c; --good-soft: #143325; --warn: #f2b454; --warn-soft: #3a2a0e;
    --bad: #ff8a80; --bad-soft: #3d1a17; --info: #7fb0ff; --info-soft: #162a4a;
    --accent: #f5b25e; --accent-soft: #3a2810;
    --series-0: #199e70; --series-1: #3987e5; --series-2: #d95926; --series-3: #9085e9;
    --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #e66767;
    --store-pcc: #ff7c3f; --store-mediamarkt: #f961ad; --store-alternate: #ba4953; --store-redcomputer: #fa353d;
    --store-coolmod: #b76d00; --store-neobyte: #ffb659; --store-pcbox: #c99b16; --store-caseking: #ffe942;
    --store-ibertronica: #a1d447; --store-vsgamers: #4eac4d; --store-ldlc: #5babeb; --store-lifeinformatica: #6e75e2;
    --shadow-s: 0 1px 2px rgb(0 0 0 / 0.4); --shadow: 0 6px 20px rgb(0 0 0 / 0.35); --shadow-l: 0 24px 60px rgb(0 0 0 / 0.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1412; --surface: #151d1a; --surface-2: #1b2521; --surface-3: #232f2a;
  --ink: #e7eeeb; --ink-soft: #c7d2cd; --muted: #97a59f; --line: #25302c; --line-strong: #33413b;
  --brand: #3cc48f; --brand-strong: #6adcae; --brand-soft: #16342a; --on-brand: #06120d;
  --good: #5fd39c; --good-soft: #143325; --warn: #f2b454; --warn-soft: #3a2a0e;
  --bad: #ff8a80; --bad-soft: #3d1a17; --info: #7fb0ff; --info-soft: #162a4a;
  --accent: #f5b25e; --accent-soft: #3a2810;
  --series-0: #199e70; --series-1: #3987e5; --series-2: #d95926; --series-3: #9085e9;
  --series-4: #c98500; --series-5: #d55181; --series-6: #008300; --series-7: #e66767;
  --store-pcc: #ff7c3f; --store-mediamarkt: #f961ad; --store-alternate: #ba4953; --store-redcomputer: #fa353d;
  --store-coolmod: #b76d00; --store-neobyte: #ffb659; --store-pcbox: #c99b16; --store-caseking: #ffe942;
  --store-ibertronica: #a1d447; --store-vsgamers: #4eac4d; --store-ldlc: #5babeb; --store-lifeinformatica: #6e75e2;
  --shadow-s: 0 1px 2px rgb(0 0 0 / 0.4); --shadow: 0 6px 20px rgb(0 0 0 / 0.35); --shadow-l: 0 24px 60px rgb(0 0 0 / 0.55);
}

/* 2. Base ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font: var(--text-md)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter) 64px; }
main:focus, main:focus-visible { outline: none; }
h1, h2, h3, p, dl, dd, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
h1 { font-size: var(--text-title); line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; }
h2 { font-size: var(--text-2xl); line-height: 1.3; letter-spacing: -0.015em; font-weight: 700; }
h3 { font-size: var(--text-md); line-height: 1.35; font-weight: 600; }
a { color: var(--brand-strong); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
img { max-width: 100%; }
[hidden]:not([hidden="until-found"]) { display: none !important; }  /* until-found: lo oculta el navegador y Ctrl+F lo encuentra */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-soft); }

.icon { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 14px; border-radius: var(--radius-s); background: var(--brand); color: var(--on-brand); }
.skip-link:focus { top: 12px; }
.eyebrow { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.lead { margin-top: 10px; font-size: var(--text-lg); color: var(--muted); max-width: 62ch; }
.section-title { margin: 32px 0 14px; font-size: var(--text-xl); }

/* 3. Componentes comunes ---------------------------------------------------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: var(--text-base); text-decoration: none; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.button:hover:not(:disabled) { border-color: var(--brand); background: var(--surface-2); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.button-primary:hover:not(:disabled) { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--on-brand); }
.button-small { min-height: 34px; padding: 5px 12px; font-size: var(--text-sm); }

.icon-button {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid transparent; border-radius: var(--radius-s); background: transparent; color: var(--muted);
}
:root[data-theme="dark"] .theme-icon-light, :root:not([data-theme="dark"]) .theme-icon-dark { display: none; }
.theme-toggle > span { display: contents; }
.icon-button:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }

.link-button {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 0;
  border: 0; background: none; color: var(--brand-strong); font-weight: 600; font-size: var(--text-base); text-decoration: none; text-align: left;
}
.link-button:hover:not(:disabled) { text-decoration: underline; }

.field { display: grid; gap: 6px; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }
input[type="text"], input[type="search"], input[type="number"], input[type="password"], select {
  width: 100%; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  background: var(--surface); color: var(--ink); font-weight: 400; font-size: var(--text-base);
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input::placeholder { color: var(--muted); opacity: 0.8; }
.check { display: flex; align-items: center; gap: 10px; font-size: var(--text-base); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
/* Características de la categoría: una lista de casillas por característica */
.spec-filters { display: grid; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.spec-facet { display: grid; gap: 7px; min-width: 0; margin: 0; padding: 0; border: 0; }
/* Un separador entre grupos (precio, cada característica, marca, tienda…), como en las tiendas.
   El «float» del legend lo saca de su dibujo especial, que corta el borde superior del fieldset:
   así la línea va entera por encima del título (en la rejilla del grupo, el float no mueve nada). */
.spec-facet + .spec-facet { padding-top: 18px; border-top: 1px solid var(--line); }
.price-filter { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.spec-facet legend { float: left; width: 100%; margin-bottom: 4px; padding: 0; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }
.spec-option { font-size: var(--text-base); }
.spec-options { display: grid; gap: 7px; }
.spec-option span { flex: 1; min-width: 0; }
.spec-option small { color: var(--muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
.spec-option.is-empty { color: var(--muted); }
/* «Ver más / Ver menos»: botón pequeño, alineado con las casillas, con la flecha detrás. */
.spec-more { justify-self: start; gap: 4px; min-height: 30px; margin-top: 2px; padding: 3px 8px 3px 10px; color: var(--brand-strong); font-size: var(--text-sm); }
.spec-more .icon { width: 14px; height: 14px; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-soft); font-size: var(--text-base); font-weight: 600; white-space: nowrap;
  text-decoration: none;  /* las categorías son enlaces reales */
}
.chip small { font-weight: 600; color: var(--muted); font-size: var(--text-xs); }
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.chip.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.chip.is-active small { color: var(--brand-strong); }
.chip-removable { min-height: 30px; padding: 3px 8px 3px 12px; background: var(--surface-2); font-size: var(--text-sm); }
.chip-removable .icon { width: 14px; height: 14px; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: var(--text-xs); font-weight: 600; line-height: 1.6; white-space: nowrap;
}
.badge .icon { width: 13px; height: 13px; }
.badge-neutral { background: var(--surface-2); color: var(--ink-soft); }
.badge-good { background: var(--good-soft); color: var(--good); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-demo { background: var(--info-soft); color: var(--info); font-size: var(--text-2xs); }

.stock { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: 600; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock-in { color: var(--good); }
.stock-out { color: var(--bad); }
.stock-unknown { color: var(--warn); }
.stock-gone { color: var(--muted); }
.stock-market { color: var(--info); }
.stock-market::before { background: transparent; border: 1.5px solid currentColor; }
.stock-dated { color: var(--good); }
.stock-dated::before { background: transparent; border: 1.5px solid currentColor; }
.stock-backorder { color: var(--accent); }
.stock-backorder::before { background: transparent; border: 1.5px dashed currentColor; }

.panel { display: grid; gap: 16px; align-content: start; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow-s); }

.spinner { width: 14px; height: 14px; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 4. Cabecera y pie --------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
.topbar-inner { display: flex; align-items: center; gap: 28px; max-width: var(--content); height: var(--topbar-h); margin: 0 auto; padding: 0 var(--gutter); }
/* La letra del logo (Plus Jakarta Sans 800, licencia OFL en fonts/OFL.txt): solo para el nombre. */
@font-face { font-family: "PCscan Display"; src: url("/fonts/plus-jakarta-sans-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap; }
/* La marca: el radar en verde, sin caja, y «PCscan» con su propia letra. */
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; color: var(--brand); }
.brand-mark .icon { width: 40px; height: 40px; stroke-width: 2; }
/* Centrado óptico con el radar: «scan» (minúsculas, 4 de 6 letras) hace que el nombre se vea
   bajo aunque «PC» esté centrado; se sube lo que baja su centro óptico (≈2 px a 30 px). */
.brand-name { position: relative; top: -0.065em; font-family: "PCscan Display", var(--font); font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; }
.brand-name b { color: var(--brand); font-weight: 800; }
.main-nav { display: flex; gap: 4px; margin-right: auto; }
/* En escritorio el logo ya lleva al catálogo: el hueco es para el buscador. */
.main-nav .nav-home { display: none; }
.main-nav a { position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-s); color: var(--muted); font-weight: 600; font-size: var(--text-md); text-decoration: none; }
.main-nav a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a.is-active { background: var(--brand-soft); color: var(--brand-strong); }
/* «Ofertas», a la vista: el color de las etiquetas de descuento, con fondo suave. */
.main-nav a.nav-deals, .main-nav a.nav-deals:hover, .main-nav a.nav-deals.is-active { background: var(--bad-soft); color: var(--bad); }
.main-nav a.nav-deals:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bad) 45%, transparent); }
.main-nav a.nav-deals.is-active { box-shadow: inset 0 0 0 1.5px var(--bad); }
.topbar-actions { display: flex; gap: 4px; }
.legal-owner { padding: 12px 16px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--radius) var(--radius) 0; }
.legal-updated { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer p { max-width: var(--content); margin: 0 auto; padding: 20px var(--gutter); font-size: var(--text-sm); color: var(--muted); }
.footer b { color: var(--brand); }

/* 5. Explorar --------------------------------------------------------------- */
/* Buscador en la barra superior */
.search-box { position: relative; flex: 1; max-width: 720px; }
.search { display: flex; align-items: center; gap: 10px; padding: 4px 4px 4px 16px; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.search-icon { color: var(--muted); display: flex; }
.search-icon .icon { width: 20px; height: 20px; }
.search input { flex: 1; min-width: 0; min-height: 44px; border: 0; background: transparent; padding: 0 2px; font-size: var(--text-lg); box-shadow: none; }
.search input:focus { box-shadow: none; }
/* La X para borrar, la misma en todos los navegadores (sin la que añade Chrome a type="search"). */
.search input::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.search-clear { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.search-clear:hover { background: var(--surface-2); color: var(--ink); }
.search-clear[hidden] { display: none; }
.search-clear .icon { width: 18px; height: 18px; }
/* Misma altura que el campo: el mismo hueco arriba, abajo y a la derecha; radio concéntrico con la caja. */
.search .button { min-height: 44px; padding: 0 20px; border-radius: 7px; font-size: var(--text-md); }
/* Presentación en una línea: qué es y lo fresco que está. */
.intro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 22px 0 14px; }
/* El eslogan, grande y fijo (no es un encabezado). El título de cada página para buscadores
   es el de la lista («Tarjetas gráficas»), con el tamaño de un título de sección. */
.slogan { font-size: var(--text-title); line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; }
#results-heading { font-size: var(--text-2xl); line-height: 1.3; letter-spacing: -0.015em; font-weight: 700; }
.intro-meta { display: flex; flex-wrap: wrap; gap: 0 6px; color: var(--muted); font-size: var(--text-base); }
.suggestions { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); padding: 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-l); max-height: min(460px, 70vh); overflow-y: auto; }
.suggestions li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-s); cursor: pointer; font-size: var(--text-base); }
.suggestions li .icon { width: 15px; color: var(--muted); }
.suggestions li[role="option"]:hover, .suggestions li.is-active { background: var(--surface-2); }
.suggestions small { flex-shrink: 0; margin-left: auto; font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.suggestions em { font-style: normal; color: var(--muted); }
.suggestions .suggestions-heading { margin-top: 4px; padding: 8px 12px 4px; border-top: 1px solid var(--line); font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); cursor: default; }
.suggestion-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggestions .suggestion-image { flex-shrink: 0; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; overflow: hidden; }
.suggestions .suggestion-image img { padding: 3px; }
.suggestion-product { display: grid; flex: 1; min-width: 0; gap: 2px; }
.suggestion-product small { margin-left: 0; }
.suggestion-product .suggestion-text { display: -webkit-box; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.3; }
.suggestion-price { flex-shrink: 0; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.suggestion-price.is-missing { color: var(--muted); }

/* El relleno lateral deja ver el anillo de foco; el margen negativo lo compensa: «Todo» en el margen. */
.category-strip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; margin: 0 -2px 16px; }
.category-strip .icon { width: 16px; height: 16px; }

.catalog { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; }
/* En su sitio, arriba: al bajar se queda atrás como el resto (como en Idealo y
   PcComponentes). «Ver más» despliega la lista entera. */
.filters { display: grid; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.filters-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filters-head .link-button { font-size: var(--text-sm); white-space: nowrap; }
.filters-title { display: flex; align-items: center; gap: 8px; font-size: var(--text-lg); }
.price-range { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.price-range input { -moz-appearance: textfield; }
.price-range input::-webkit-inner-spin-button, .price-range input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
/* Deslizador de dos tiradores: dos «range» superpuestos; solo los tiradores reciben el ratón. */
.range-slider { position: relative; height: 28px; margin: 2px 2px 6px; }
.range-slider.is-disabled { opacity: 0.45; }
.range-track { position: absolute; top: 50%; right: 9px; left: 9px; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--line-strong); }
.range-fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--brand); }
.range-slider input[type="range"] { position: absolute; inset: 0; width: 100%; height: 28px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.range-slider input[type="range"]::-webkit-slider-runnable-track { background: none; }
.range-slider input[type="range"]::-moz-range-track { background: none; }
.range-slider input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; border: 2px solid var(--brand); border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-s); cursor: grab; pointer-events: auto; -webkit-appearance: none; appearance: none; }
.range-slider input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border: 2px solid var(--brand); border-radius: 50%; background: var(--surface); cursor: grab; pointer-events: auto; }
.range-slider input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--brand); outline-offset: 2px; }
.range-slider input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
.results { min-width: 0; }
.results-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.results-tools { display: flex; gap: 8px; }
.sort select { min-width: 210px; }
.filters-toggle { display: none; }
.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.active-filters:empty { display: none; }
.results .product-grid, .results .empty-state { margin-top: 20px; }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.product-card { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--shadow-s); overflow: hidden; transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s; }
.product-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card { cursor: pointer; }
.product-card:hover .product-name a { color: var(--brand-strong); }
.product-media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-bottom: 1px solid var(--line); background: #fff; }
.product-image { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.product-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 14px; background: #fff; }
.image-placeholder { width: 40%; height: 40%; color: #b8c4bf; stroke-width: 1.2; }
.product-body { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; padding: 14px 16px 16px; }  /* min-width: una línea de características larga no ensancha la tarjeta */
.product-brand { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.product-name { margin-top: -6px; }
.product-name a { display: -webkit-box; color: inherit; text-decoration: none; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 0; border: 0; background: none; text-align: left; font-weight: 600; font-size: var(--text-md); line-height: 1.4; min-height: 2.8em; }
.product-name a:hover { color: var(--brand-strong); text-decoration: underline; }
/* Características bajo el nombre (el nombre corto no las repite) */
.product-specs { margin-top: -4px; overflow: hidden; color: var(--muted); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.detail-specs { color: var(--ink-soft); font-size: var(--text-base); }
.product-price { display: grid; gap: 1px; }
.price { font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.price-missing { font-size: var(--text-xl); color: var(--muted); }
.price-where { font-size: var(--text-sm); color: var(--muted); }
.product-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.product-tags:empty { display: none; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: var(--text-sm); }

.skeleton { min-height: 360px; padding: 16px; gap: 12px; }
.skeleton span { display: block; border-radius: var(--radius-s); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.skeleton span:nth-child(1) { height: 170px; }
.skeleton span:nth-child(2) { height: 18px; width: 80%; }
.skeleton span:nth-child(3) { height: 28px; width: 45%; }
@keyframes shimmer { to { background-position: -200% 0; } }
/* Filtros mientras llega la búsqueda: las casillas, barras de carga (como las tarjetas). */
.skeleton-bar, .filters.is-loading :is(.spec-option, .check)::after,
.filters.is-first-load :is(#price-label, .filter-options legend, .price-range input), .filters.is-first-load .range-slider::after { border-radius: var(--radius-s); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.skeleton-facet { display: grid; gap: 10px; }
.skeleton-chip { width: 128px; height: 40px; border-color: transparent; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; pointer-events: none; }
.skeleton-bar { display: block; height: 16px; }
.skeleton-bar.is-title { width: 45%; height: 13px; }
.filters.is-loading :is(.spec-option, .check) { position: relative; pointer-events: none; color: transparent; }
.filters.is-loading .spec-option > *, .filters.is-loading .check input { visibility: hidden; }
.filters.is-loading :is(.spec-option, .check)::after { content: ""; position: absolute; inset: 2px 0; }
/* Primera carga: el precio y los títulos, barras como los grupos de relleno. */
.filters.is-first-load :is(#price-label, .filter-options legend) { display: block; width: 45%; height: 13px; overflow: hidden; color: transparent; }
.filters.is-first-load .range-slider > *, .filters.is-first-load .price-range span { visibility: hidden; }
.filters.is-first-load .range-slider::after { content: ""; position: absolute; inset: 6px 0; }
.filters.is-first-load .price-range input { border-color: transparent; pointer-events: none; }
.filters.is-first-load .price-range input::placeholder { color: transparent; }
.filters.is-loading .price-filter, .filters.is-loading .spec-more { opacity: 0.5; pointer-events: none; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 28px; }
.empty-state { display: grid; justify-items: center; gap: 10px; padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-l); text-align: center; color: var(--muted); }
.empty-state > .icon { width: 32px; height: 32px; color: var(--brand); }
.empty-state h3 { color: var(--ink); font-size: var(--text-xl); }
.empty-note { padding: 18px; border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: var(--text-base); }

/* 6. Detalle de producto ---------------------------------------------------- */
.dialog { width: min(920px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overscroll-behavior: contain; padding: 0; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-l); }
/* Con un modal abierto la página de detrás no se mueve: al llegar al final del
   modal, la rueda seguiría desplazándola. «scrollbar-gutter» evita que salte al
   desaparecer su barra. */
html { scrollbar-gutter: stable; }
html:has(dialog[open]) { overflow: hidden; }
.dialog::backdrop { background: rgb(8 14 12 / 0.55); backdrop-filter: blur(3px); }
.dialog-body { display: grid; gap: 8px; padding: clamp(20px, 3vw, 32px); }
.dialog-close { position: sticky; top: 12px; z-index: 2; display: grid; margin: 12px 12px -50px auto; background: var(--surface); border-color: var(--line); }
.detail-loading { display: grid; justify-items: center; gap: 12px; padding: 48px 0; text-align: center; }
.detail-loading .spinner { width: 28px; height: 28px; color: var(--brand); }
.detail-head { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: center; }  /* datos a la altura de la foto */
/* Cuadrada siempre: con «height: 100%» (de .product-image) tomaría la altura de
   la columna de datos y un nombre largo la estiraría. */
.detail-image { height: auto; aspect-ratio: 1; border: 1px solid var(--line); border-radius: var(--radius-l); background: #fff; overflow: hidden; }
.detail-summary { display: grid; gap: 12px; align-content: start; }
/* Hasta 2 líneas: algunas tiendas dan nombres larguísimos (el completo, al pasar el ratón). */
.detail-summary h2 { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; padding-right: 40px; font-size: clamp(var(--text-xl), 2vw, var(--text-2xl)); line-height: 1.3; }
.detail-summary .product-tags:empty { display: none; }
.detail-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; color: var(--muted); font-size: var(--text-base); }
.detail-price .price { font-size: var(--text-4xl); color: var(--ink); }
.detail-price b { color: var(--ink); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.offer-list { display: grid; gap: 8px; }
.offers-extra > .offer-list { margin-top: 8px; }  /* lo de tras «Ver N tiendas más» */
/* A todo el ancho de la lista y de la altura de «Ir a la tienda»: que se vea que hay más. */
/* «Mostrar más tiendas»: la forma del «Más tiendas» de Google Shopping (píldora con fondo
   suave, sin borde) con el verde de las acciones secundarias de la web. */
.offers-more { display: flex; justify-content: center; gap: 6px; width: 100%; min-height: 44px; margin-top: 10px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--brand-strong); font-size: var(--text-base); font-weight: 600; }
.offers-more:hover:not(:disabled) { border-color: transparent; background: var(--brand-soft); }
.offers-more .icon { width: 18px; height: 18px; }
.offer-divider { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; color: var(--muted); font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; list-style: none; }
.detail-filtered { margin: 2px 0 0; color: var(--muted); font-size: var(--text-sm); }
.offer-divider::before, .offer-divider::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.offer { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.offer.is-best { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); }
.offer.is-out { opacity: 0.65; }
.offer-store { display: grid; gap: 2px; min-width: 0; }
/* «Mejor precio» junto al nombre: la tarjeta mide lo mismo que las demás. */
.offer-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.offer-name .badge { padding-block: 0; }
.offer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: var(--text-sm); }
.offer-meta .muted { white-space: nowrap; }  /* «revisado hace 19 h» no se parte */
.offer-price { display: grid; justify-items: end; gap: 2px; font-size: var(--text-sm); }
.offer-price strong { font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
/* Bajo el precio, el envío: gratis (verde), con importe (texto) o no indicado (gris). */
.shipping { color: var(--ink-soft); font-size: var(--text-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shipping.is-free { color: var(--good); font-weight: 600; }
.shipping.is-unknown { color: var(--muted); }
.offer .button .icon { width: 15px; height: 15px; }
/* Todos los botones de la lista con el mismo ancho: alineados aunque cambie el texto. */
.offer > .button { min-width: 9.75em; }
.store-avatar { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 10px; background: var(--surface-2); color: var(--ink-soft); font-size: var(--text-sm); font-weight: 700; letter-spacing: 0.02em; }
.store-avatar.has-logo { overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
.store-avatar img { display: block; width: 100%; height: 100%; object-fit: contain; }
.store-avatar .icon { width: 20px; height: 20px; }
.store-mark { display: inline-block; width: 16px; height: 16px; margin-right: 5px; border-radius: 4px; background: #fff; object-fit: contain; vertical-align: -3px; }

.price-chart { position: relative; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.price-chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; cursor: crosshair; border-radius: var(--radius-s); }
.price-chart svg:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; }
.chart-cursor { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart-tooltip { position: absolute; top: 12px; z-index: 2; min-width: 190px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); box-shadow: var(--shadow); font-size: var(--text-sm); pointer-events: none; }
.chart-tooltip strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: var(--text-xs); }
.chart-tooltip ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.chart-tooltip li { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); }
.chart-tooltip li i { flex-shrink: 0; width: 10px; height: 10px; border-radius: 2px; background: var(--series); }
.chart-tooltip li span { flex: 1; }
.chart-tooltip li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-tooltip li.is-sold-out b { color: var(--bad); font-weight: 600; }
/* El más barato de ese momento (todos si empatan): fondo suave y en negrita. */
.chart-tooltip li.is-cheapest { margin: 0 -6px; padding: 2px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--ink); font-weight: 700; }
.chart-tooltip li.is-cheapest b { color: var(--brand-strong); font-weight: 800; }
.chart-tooltip li.is-sold-out i { background: transparent; border: 2px solid var(--series); }  /* como su punto hueco */
/* Mismo corte que chartFrame() en price-chart.js: en móvil el tooltip no tapa la gráfica. */
@media (max-width: 560px) {
  .price-chart { padding: 12px; }
  /* Con .price-chart delante: las reglas generales de la gráfica van después en la hoja. */
  .price-chart .chart-label { font-size: var(--text-base); }
  .price-chart .chart-legend { gap: 2px 4px; }
  .price-chart .chart-key { padding: 3px 6px; }
  .chart-tooltip { position: static; margin-top: 10px; box-shadow: none; background: var(--surface-2); }
}
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-label { fill: var(--muted); font-size: var(--text-2xs); font-family: var(--font); }
/* Una línea fina por tienda, en su color, sin ninguna destacada. Resaltada una (leyenda), las demás casi desaparecen. */
.price-chart .store-line { transition: opacity 0.15s; }
.price-chart .store-line path { fill: none; stroke: var(--series); stroke-width: 1.8; stroke-linejoin: round; }
.price-chart .store-line circle.sold-out { fill: var(--surface); stroke: var(--series); stroke-width: 2; }
.price-chart.has-highlight .store-line { opacity: 0.1; }
.price-chart.has-highlight .store-line.is-highlighted { opacity: 1; }
.price-chart .store-line.is-highlighted path { stroke-width: 2.6; }
/* Leyenda de las tiendas, aparte y más discreta. */
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: var(--text-sm); color: var(--ink-soft); }
.chart-key { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border: 1px solid transparent; border-radius: var(--radius-s); background: none; color: inherit; font: inherit; }
button.chart-key { cursor: pointer; }
button.chart-key:hover, button.chart-key.is-highlighted { border-color: var(--line-strong); color: var(--ink); }
button.chart-key[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--ink); }
.chart-key i { width: 10px; height: 10px; border-radius: 3px; background: var(--series); }

.series-0 { --series: var(--series-0); } .series-1 { --series: var(--series-1); }
.series-2 { --series: var(--series-2); } .series-3 { --series: var(--series-3); }
.series-4 { --series: var(--series-4); } .series-5 { --series: var(--series-5); }
.series-6 { --series: var(--series-6); } .series-7 { --series: var(--series-7); }
.series-other { --series: var(--muted); }
.store-pcc { --series: var(--store-pcc); }
.store-mediamarkt { --series: var(--store-mediamarkt); }
.store-alternate { --series: var(--store-alternate); }
.store-redcomputer { --series: var(--store-redcomputer); }
.store-coolmod { --series: var(--store-coolmod); }
.store-neobyte { --series: var(--store-neobyte); }
.store-pcbox { --series: var(--store-pcbox); }
.store-caseking { --series: var(--store-caseking); }
.store-ibertronica { --series: var(--store-ibertronica); }
.store-vsgamers { --series: var(--store-vsgamers); }
.store-ldlc { --series: var(--store-ldlc); }
.store-lifeinformatica { --series: var(--store-lifeinformatica); }
.price-chart .store-line.series-other path { stroke-width: 1.4; stroke-dasharray: 4 3; }

/* 7. Tiendas ------------------------------------------------------------------ */
.page-head { margin: 36px 0 28px; }
.page-head h1 { margin-top: 8px; }

.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.store-card { display: grid; gap: 12px; align-content: start; padding: 18px; border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-s); }
.store-card header { display: flex; gap: 12px; align-items: center; }
.store-card header p { font-size: var(--text-sm); }
.store-card > .muted { font-size: var(--text-sm); }
.store-card .link-button { font-size: var(--text-sm); }
.store-card .link-button .icon { width: 14px; height: 14px; }

/* 8. Avisos y estados ------------------------------------------------------- */
.toasts { position: fixed; right: 16px; top: calc(var(--topbar-h) + 12px); z-index: 60; display: grid; gap: 10px; width: min(400px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 12px 12px 12px 16px; border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-l); font-size: var(--text-base); animation: rise 0.2s ease-out; }
.toast p { flex: 1; }
.toast-success { border-left-color: var(--good); }
.toast-error { border-left-color: var(--bad); }
.toast-close { border: 0; background: none; color: var(--muted); font-size: var(--text-2xl); line-height: 1; padding: 0 4px; }
@keyframes rise { from { opacity: 0; transform: translate(var(--tx, 0), var(--ty, 8px)); } }
.toast { --ty: -8px; }

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

/* 9. Pantallas pequeñas ----------------------------------------------------- */
/* Menú con texto solo si el buscador conserva su protagonismo: por debajo,
   solo iconos (el texto sigue ahí para lectores de pantalla y en el «title»). */
@media (max-width: 1279px) {
  .main-nav a > span:not([data-icon]) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .topbar-inner { gap: 18px; }
}
@media (max-width: 1024px) {
  .catalog { grid-template-columns: 1fr; }
  .filters { display: none; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
  .filters.is-open { display: grid; }
  .filters-head { grid-column: 1 / -1; }
  .price-filter { padding-bottom: 0; border-bottom: 0; }  /* en columnas, el separador quedaría cojo */
  .filters-toggle { display: inline-flex; }
}

@media (max-width: 760px) {
  :root { --text-title: 22px; }
  #view-about section[id] { scroll-margin-top: 136px; }  /* la barra de arriba, con el buscador, mide ~115 px */
  h2, #results-heading { font-size: var(--text-xl); }  /* misma distancia con el eslogan que en escritorio */
  /* backdrop-filter crearía un contexto para position: fixed y la barra
     inferior quedaría dentro de la cabecera. */
  .topbar { backdrop-filter: none; background: var(--surface); transition: top 0.2s ease; }  /* se esconde al bajar (topbar.js) */
  /* Marca y botones arriba; el buscador, a lo ancho en la segunda fila. */
  .topbar-inner { flex-wrap: wrap; height: auto; gap: 8px 12px; padding-top: 8px; padding-bottom: 10px; }
  .search-box { order: 1; flex-basis: 100%; max-width: none; }
  .brand-name { display: inline; font-size: 25px; }
  .brand-mark .icon { width: 34px; height: 34px; }
  .main-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around; gap: 0; margin: 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); }
  .main-nav a { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: var(--text-2xs); flex: 1; text-align: center; }
  .main-nav .nav-home { display: flex; }  /* pestaña de inicio de la barra inferior */
  .main-nav a.nav-deals, .main-nav a.nav-deals:hover { background: none; box-shadow: none; }  /* barra inferior: solo el color */
  .main-nav a > span:not([data-icon]) { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }  /* barra inferior: icono y texto */
  .topbar-actions { margin-left: auto; }
  main { padding-bottom: 96px; }
  .footer { padding-bottom: 72px; }
  .toasts { top: 64px; right: 12px; left: 12px; width: auto; }
  .search { padding-left: 12px; }
  .search input { min-height: 40px; }
  .intro { margin: 16px 0 12px; }
  .intro-meta { font-size: var(--text-sm); }
  .results-head { align-items: stretch; }
  .results-tools { width: 100%; }
  .sort { flex: 1; }
  .sort select { min-width: 0; }

  /* Tarjetas en formato lista: más productos por pantalla. */
  .product-grid { grid-template-columns: 1fr; gap: 10px; }
  .product-card { display: grid; grid-template-columns: 104px 1fr; }
  .product-card:hover { transform: none; }
  .product-media { aspect-ratio: auto; height: 100%; min-height: 120px; border-bottom: 0; border-right: 1px solid var(--line); }
  .product-image img { padding: 8px; }
  .product-body { padding: 12px; gap: 8px; }
  .product-name a { min-height: 0; font-size: var(--text-base); }
  .price { font-size: var(--text-2xl); }
  .skeleton { min-height: 140px; display: grid; grid-template-columns: 104px 1fr; }
  .skeleton span:nth-child(1) { height: 100%; grid-row: span 3; }

  .detail-head { grid-template-columns: 1fr; }
  .detail-image { max-width: 180px; }
  .offer { gap: 10px; padding: 10px 12px; }
  .offer { grid-template-columns: auto 1fr auto; }
  .offer > .button, .offer > .muted:last-child { grid-column: 1 / -1; justify-self: stretch; }
  /* Sin sitio junto al nombre: «Mejor precio» como pestaña sobre el borde, sin altura extra. */
  .offer.is-best { position: relative; margin-top: 10px; }
  .offer.is-best .offer-name .badge-good { position: absolute; top: 0; left: 12px; transform: translateY(-50%); border: 1px solid var(--brand); background: var(--surface); }
  .page-head { margin: 24px 0 20px; }
}

@media (max-width: 420px) {
  .search .button { display: none; }
  .suggestion-from { display: none; }
}

/* ---------------------------------------------------------------------------
   Páginas informativas
   ------------------------------------------------------------------------- */

.footer p { padding-bottom: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; max-width: var(--content); margin: 0 auto; padding: 0 var(--gutter) 20px; }
.footer-links a { color: var(--muted); font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 3px; }
.footer-links a:hover { color: var(--ink); }

.prose { display: grid; gap: 36px; max-width: 760px; }
.prose h2 { margin: 0 0 10px; font-size: var(--text-2xl); }
.prose p { margin: 0 0 12px; color: var(--ink-soft); line-height: 1.6; }
.prose mark.todo { padding: 0 4px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.legend-list { display: grid; gap: 10px; margin: 0 0 12px; }
.legend-list div { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 12px; }
.legend-list dt { font-weight: 700; }
.legend-list dd { margin: 0; color: var(--ink-soft); }
@media (max-width: 560px) {
  .legend-list div { grid-template-columns: 1fr; gap: 2px; }
}

/* Ofertas: descuento sobre la foto, precio habitual tachado y explicación de la página */
/* Reacondicionado: ámbar (aviso), distinto del rojo de las rebajas y del verde de «en stock». */
.refurb-tag { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: var(--text-xs); font-weight: 700; }
.refurb-tag .icon, .badge-refurb .icon { width: 13px; height: 13px; }
.badge-refurb { border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); color: var(--warn); font-weight: 700; }
.refurb-text { color: var(--warn); font-weight: 700; }
.deal-tag { position: absolute; top: 10px; right: 10px; padding: 3px 8px; border-radius: 999px; background: var(--bad); color: #fff; font-size: var(--text-xs); font-weight: 800; }
.price-old { margin-right: 8px; color: var(--muted); font-size: var(--text-base); font-weight: 600; }
.badge-deal { background: var(--bad-soft, var(--surface-2)); color: var(--bad); font-weight: 700; }
.offers-note { max-width: 75ch; margin: -4px 0 12px; color: var(--muted); font-size: var(--text-sm); }
.offers-note b { color: var(--ink-soft); font-weight: 600; }
/* Amazon: como una tienda, pero sin precio y fuera de la lista (borde discontinuo). */
.offer.offer-amazon { grid-template-columns: auto 1fr auto; margin-top: 10px; border-style: dashed; border-color: var(--line-strong); background: transparent; }
.deals-intro { max-width: 70ch; margin-top: 6px; color: var(--muted); font-size: var(--text-base); }

/* Resumen del producto para buscadores (la app lo quita al arrancar) */
.ssr-product ul { padding-left: 20px; }

/* Volver arriba (components/back-to-top.js): aparece al bajar una pantalla */
.back-to-top { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-l); cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(12px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand-strong); }
.back-to-top .icon { width: 22px; height: 22px; }
@media (max-width: 760px) { .back-to-top { right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); width: 44px; height: 44px; } }  /* encima de la barra inferior */

/* Franjas horizontales (components/scroller.js): sin barra, con flechas y bordes difuminados */
.scroller { position: relative; }
.scroller-track { scrollbar-width: none; }
.scroller-track::-webkit-scrollbar { display: none; }
.scroller-track.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.scroller-track.is-sliding { scroll-snap-type: none; }
.scroller.fade-right .scroller-track { mask-image: linear-gradient(to right, #000 calc(100% - 64px), transparent); }
.scroller.fade-left .scroller-track { mask-image: linear-gradient(to left, #000 calc(100% - 64px), transparent); }
.scroller.fade-left.fade-right .scroller-track { mask-image: linear-gradient(to right, transparent, #000 64px, #000 calc(100% - 64px), transparent); }
.scroller-arrow { position: absolute; top: 50%; z-index: 3; display: grid; place-items: center; width: 38px; height: 38px; margin-top: -19px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
.scroller-arrow[hidden] { display: none; }
.scroller-arrow:hover { background: var(--surface-2); }
.scroller-arrow .icon { width: 20px; height: 20px; }
.scroller-left { left: 0; }
.scroller-right { right: 0; }
@media (hover: none) { .scroller-arrow { display: none; } }  /* en táctil se desliza con el dedo */
