/* =============================================================
   PiezaxPieza — hoja de estilos única
   1. Tokens · 2. Reset · 3. Utilidades · 4. Tipografía
   5. Componentes · 6. Secciones · 7. Efectos · 8. Responsive
   9. Reduced motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* Fondos */
  --bg:          #08090c;
  --bg-2:        #0c0e13;
  --surface:     #11141b;
  --surface-2:   #171b25;
  --surface-3:   #1e2330;

  /* Texto */
  --text:        #eceef4;
  --text-2:      #b3b9c9;
  --muted:       #7f8798;
  --faint:       #5b6274;

  /* Líneas */
  --line:        rgba(255, 255, 255, .075);
  --line-2:      rgba(255, 255, 255, .14);

  /* Acento */
  --accent:      #ff6b2c;
  --accent-soft: rgba(255, 107, 44, .14);
  --accent-line: rgba(255, 107, 44, .38);
  --accent-ink:  #0a0b0d;

  /* Datos / series */
  --d1: #ff6b2c;
  --d2: #38bdf8;
  --d3: #a78bfa;
  --d4: #fbbf24;
  --d5: #34d399;

  /* Semánticos */
  --good:   #4ade80;
  --bad:    #fb7185;
  --star:   #fbbf24;

  /* Tipografía */
  --display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --sans:    -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Medidas */
  --gutter: 20px;
  --maxw: 1240px;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  /* Easing */
  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  color-scheme: dark;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  min-height: 100vh;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -.028em; font-family: var(--display); font-weight: 600; }
ul, ol { padding-left: 1.15em; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilidades
   ============================================================= */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* =============================================================
   4. Tipografía
   ============================================================= */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}
.h-xl  { font-size: clamp(2.05rem, 6.2vw, 3.9rem); letter-spacing: -.04em; font-weight: 700; }
.h-lg  { font-size: clamp(1.75rem, 4.2vw, 2.7rem); }
.h-md  { font-size: clamp(1.35rem, 3vw, 1.85rem); }
.h-sm  { font-size: clamp(1.1rem, 2.2vw, 1.3rem); }
.lead  { font-size: clamp(1.02rem, 1.9vw, 1.19rem); color: var(--text-2); line-height: 1.7; }
.small { font-size: .875rem; color: var(--muted); }
.tiny  { font-size: .78rem; color: var(--faint); line-height: 1.6; }

/* =============================================================
   5. Componentes
   ============================================================= */

/* --- Cabecera --------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--line);
  isolation: isolate;
}
/* El desenfoque va en un pseudoelemento, no en el propio header sticky. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.35);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header::before { background: var(--bg); }
}
.site-header .wrap {
  display: flex; align-items: center; gap: 1rem;
  min-height: 64px;
}
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 700; font-size: 1.06rem; letter-spacing: -.02em; flex: none; }
.brand-mark {
  width: 30px; height: 30px; flex: none;
  border-radius: 8px;
  display: block; object-fit: cover;
  /* El logo trae su propio fondo negro, practicamente el mismo que --bg, de
     modo que el recuadro redondeado se funde con la cabecera. */
  background: #000;
}
.brand-name em { font-style: normal; color: var(--accent); }

.nav { margin-left: auto; display: flex; align-items: center; gap: .15rem; }
.nav a {
  padding: .45rem .68rem; border-radius: 8px;
  font-size: .89rem; color: var(--text-2); font-weight: 500;
  transition: color .18s var(--ease-out), background .18s var(--ease-out);
  white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.is-active { color: var(--accent); }
.nav .nav-cta {
  /* Flex y no en línea: el reset pone los svg en bloque y el icono empujaba
     el texto a una segunda línea. */
  display: inline-flex; align-items: center; gap: .42rem;
  background: var(--accent); color: var(--accent-ink); font-weight: 650;
  margin-left: .4rem;
}
.nav .nav-cta svg { width: 16px; height: 16px; flex: none; }
.nav .nav-cta:hover { background: #ff8552; color: var(--accent-ink); }

/* Desplegables «Componentes» y «Guías» (Spec 004) */
.nav-menu { position: relative; }
.nav-menu summary {
  display: flex; align-items: center; gap: .35rem;
  padding: .45rem .68rem; border-radius: 8px;
  font-size: .89rem; color: var(--text-2); font-weight: 500;
  cursor: pointer; list-style: none; white-space: nowrap;
  transition: color .18s var(--ease-out), background .18s var(--ease-out);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after {
  content: ""; width: .38rem; height: .38rem; margin-top: -.2rem;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg); transition: transform .18s var(--ease-out);
}
.nav-menu[open] summary::after { transform: translateY(.2rem) rotate(-135deg); }
.nav-menu summary:hover { color: var(--text); background: var(--surface-2); }
.nav-menu summary.is-active { color: var(--accent); }
.nav-panel {
  position: absolute; top: calc(100% + .5rem); left: 0; z-index: 10;
  display: flex; flex-wrap: wrap; width: max-content; max-width: min(28rem, calc(100vw - 2.4rem)); gap: 1.4rem;
  padding: 1rem 1.1rem; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}
/* Puente invisible sobre el hueco entre el título y el panel: sin él, el
   puntero sale del desplegable al bajar y el panel se cierra (RF-20). */
.nav-panel::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: calc(.5rem + 1px); }
.nav-group { min-width: 9rem; }
.nav-group-title {
  margin: 0 0 .4rem; padding: 0 .68rem;
  font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint);
}
.nav-cat-title { margin: .5rem 0 .1rem; padding: 0 .68rem; font-size: .8rem; font-weight: 600; color: var(--text); }
.nav-group-title + .nav-cat-title { margin-top: 0; }
.nav-panel ul { list-style: none; margin: 0; padding: 0; }
.nav-panel a { display: block; }

.nav-toggle {
  margin-left: auto; display: none;
  width: 40px; height: 40px; border-radius: 9px;
  border: 1px solid var(--line-2);
  place-items: center; color: var(--text);
}
.nav-toggle:hover { background: var(--surface-2); }
.nav-toggle svg { width: 20px; height: 20px; }

/* --- Botones ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .78rem 1.3rem; border-radius: 10px;
  font-weight: 600; font-size: .95rem; letter-spacing: -.01em;
  transition: transform .2s var(--ease-out), background .2s var(--ease-out), border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
  border: 1px solid transparent; cursor: pointer;
  text-align: center;
}
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #ff8a4f);
  color: var(--accent-ink);
  box-shadow: 0 6px 22px rgba(255,107,44,.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,107,44,.35); }
.btn-ghost { border-color: var(--line-2); color: var(--text); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--accent-line); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.02rem; }
.btn-sm { padding: .5rem .85rem; font-size: .84rem; border-radius: 8px; }

/* --- Etiquetas / píldoras ---------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .26rem .62rem; border-radius: 999px;
  font-size: .74rem; font-weight: 600; letter-spacing: .01em;
  border: 1px solid var(--line-2); color: var(--text-2);
  background: var(--surface-2);
}
.pill-accent { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
.pill-good { border-color: rgba(74,222,128,.35); color: var(--good); background: rgba(74,222,128,.1); }
.pill-brand { font-family: var(--mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }

/* --- Tarjeta de producto ----------------------------------- */
.card-grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: 1fr;
}
.pcard {
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .3s var(--ease-out), border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
  position: relative;
}
.pcard:hover { transform: translateY(-4px); border-color: var(--line-2); box-shadow: 0 18px 44px rgba(0,0,0,.5); }
.pcard-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: radial-gradient(120% 100% at 50% 0%, #232838 0%, #10131a 70%);
  border-bottom: 1px solid var(--line);
}
/* Posicionamiento absoluto: los porcentajes de alto no resuelven de forma
   fiable dentro de una caja con aspect-ratio. */
.pcard-media img {
  position: absolute; inset: 1.2rem; margin: auto;
  width: auto; height: auto;
  max-width: calc(100% - 2.4rem); max-height: calc(100% - 2.4rem);
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,.5));
}
.pcard-flag {
  position: absolute; top: .75rem; left: .75rem;
  z-index: 2;
}
.pcard-flag .pill {
  background: rgba(8, 9, 12, .86);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-color: var(--accent-line); color: var(--accent);
}
.pcard-body { padding: 1.15rem 1.2rem 1.3rem; display: flex; flex-direction: column; flex: 1; gap: .7rem; }
.pcard-brand { font-family: var(--mono); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.pcard-title { font-size: 1.16rem; line-height: 1.25; }
.pcard-title a:hover { color: var(--accent); }
.pcard-desc { font-size: .89rem; color: var(--muted); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-keys { display: flex; flex-wrap: wrap; gap: .35rem; }
.keychip {
  font-family: var(--mono); font-size: .73rem;
  padding: .22rem .5rem; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2);
}
.pcard-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; padding-top: .5rem; }
.pcard-cta { display: grid; grid-template-columns: 1fr; gap: .5rem; margin-top: .25rem; }
.pcard-cta .btn { width: 100%; }
@media (min-width: 400px) { .pcard-cta { grid-template-columns: 1.25fr 1fr; } }

/* --- Precio ------------------------------------------------ */
.price { display: flex; flex-direction: column; gap: .1rem; }
.price-now { font-family: var(--mono); font-size: 1.32rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.price-was { font-family: var(--mono); font-size: .82rem; color: var(--faint); text-decoration: line-through; }
.price-note { font-size: .7rem; color: var(--faint); }

/* --- Estrellas --------------------------------------------- */
.rating { display: inline-flex; align-items: center; gap: .4rem; font-size: .84rem; color: var(--text-2); }
.stars { display: inline-flex; gap: 1px; }
.stars svg { width: 13px; height: 13px; }
.stars .on { fill: var(--star); }
.stars .off { fill: rgba(255,255,255,.16); }

/* --- Sección genérica --------------------------------------- */
.section { padding-block: clamp(3rem, 8vw, 5.5rem); }
.section-head { margin-bottom: 2rem; display: flex; flex-direction: column; gap: .7rem; max-width: 62ch; }
.section-head .lead { margin-top: .1rem; }
.section-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* --- Panel / caja ------------------------------------------ */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
}
.panel-flush { padding: 0; overflow: hidden; }

/* --- Tabla de especificaciones ------------------------------ */
.spec-group + .spec-group { margin-top: 1.6rem; }
.spec-group h3 {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .15em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .6rem;
  font-weight: 500;
}
.spec-table { font-size: .92rem; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table th {
  text-align: left; font-weight: 500; color: var(--muted);
  padding: .62rem .8rem .62rem 0; vertical-align: top; width: 55%;
  font-family: var(--sans); font-size: .88rem;
}
.spec-table td {
  padding: .62rem 0; text-align: right; color: var(--text);
  font-family: var(--mono); font-size: .89rem; font-variant-numeric: tabular-nums;
  vertical-align: top;
}
.spec-table td.na { color: var(--faint); }

/* --- Radar -------------------------------------------------- */
.radar-wrap { display: flex; flex-direction: column; gap: 1rem; }
.radar { width: 100%; height: auto; overflow: visible; }
.radar .grid-line { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 1; }
.radar .axis-line { stroke: rgba(255,255,255,.09); stroke-width: 1; }
.radar .axis-label { fill: var(--muted); font-size: 11px; font-family: var(--sans); font-weight: 500; }
.radar .axis-val { fill: var(--text); font-size: 11px; font-family: var(--mono); font-weight: 600; }
.radar .poly { stroke-width: 2; stroke-linejoin: round; }
.radar .dot { r: 3.1; }

.legend { display: flex; flex-wrap: wrap; gap: .5rem .95rem; }
.legend-item { display: inline-flex; align-items: center; gap: .42rem; font-size: .82rem; color: var(--text-2); }
.legend-swatch { width: 11px; height: 11px; border-radius: 3px; flex: none; }

/* --- Barras de puntuación ----------------------------------- */
.score-list { display: flex; flex-direction: column; gap: .8rem; }
.score-row { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; align-items: baseline; }
.score-label { font-size: .87rem; color: var(--text-2); }
.score-val { font-family: var(--mono); font-size: .87rem; font-weight: 700; color: var(--text); }
.score-bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
/* `display: block` es imprescindible: es un <span>, y un elemento en línea
   ignora width y height, así que el relleno se quedaba en 0 × 0 por muy bien
   calculado que estuviera el porcentaje. */
.score-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), #ffa06b); }

/* --- Pros y contras ---------------------------------------- */
.proscons { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.pc-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: var(--surface); }
.pc-box h3 { font-size: .95rem; display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.pc-box ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.pc-box li { display: flex; gap: .6rem; font-size: .91rem; color: var(--text-2); line-height: 1.55; }
.pc-box li::before { flex: none; margin-top: .12rem; font-family: var(--mono); font-weight: 700; }
.pc-pros li::before { content: "+"; color: var(--good); }
.pc-cons li::before { content: "−"; color: var(--bad); }
.pc-pros h3 { color: var(--good); }
.pc-cons h3 { color: var(--bad); }

/* --- Galería ------------------------------------------------ */
.gallery { display: flex; flex-direction: column; gap: .7rem; }
.gallery-main {
  position: relative;
  aspect-ratio: 4 / 3;
  background: radial-gradient(120% 100% at 50% 0%, #242a3a 0%, #0f1219 72%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.gallery-main img {
  position: absolute; inset: 1.5rem; margin: auto;
  width: auto; height: auto;
  max-width: calc(100% - 3rem); max-height: calc(100% - 3rem);
  object-fit: contain;
  filter: drop-shadow(0 14px 30px rgba(0,0,0,.55));
}
.gallery-thumbs { display: flex; gap: .55rem; flex-wrap: wrap; }
.gallery-thumb {
  width: 66px; height: 66px; flex: none;
  border-radius: 9px; border: 1px solid var(--line);
  background: var(--surface-2); padding: .35rem;
  overflow: hidden;
  transition: border-color .2s var(--ease-out), transform .2s var(--ease-out);
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumb:hover { border-color: var(--line-2); transform: translateY(-2px); }
.gallery-thumb[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-line); }

/* --- Reseñas ------------------------------------------------ */
.histogram { display: flex; flex-direction: column; gap: .38rem; }
.hist-row { display: grid; grid-template-columns: 5.6em 1fr 2.6em; gap: .6rem; align-items: center; font-size: .8rem; }
.hist-track { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hist-fill { height: 100%; background: var(--star); border-radius: 99px; }
.hist-pct { font-family: var(--mono); color: var(--muted); text-align: right; }
.hist-label { color: var(--muted); white-space: nowrap; }

/* --- Migas de pan ------------------------------------------ */
.crumbs { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .82rem; color: var(--muted); padding-top: 1.6rem; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--faint); }

/* --- Aviso de afiliados ------------------------------------ */
.aff-note {
  display: flex; gap: .7rem; align-items: flex-start;
  font-size: .8rem; color: var(--muted); line-height: 1.55;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
  padding: .8rem .95rem; background: rgba(255,255,255,.015);
}
.aff-note svg { width: 16px; height: 16px; flex: none; margin-top: .15rem; color: var(--accent); }

/* --- Pie ---------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 3rem; }
.footer-grid { display: grid; gap: 2rem; padding-block: 3rem 2rem; grid-template-columns: 1fr; }
.footer-col h4 { font-size: .78rem; font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; font-weight: 500; }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.footer-col a { font-size: .89rem; color: var(--text-2); }
.footer-col a:hover { color: var(--accent); }
.footer-group + .footer-group { margin-top: 1.1rem; }
.footer-group-title { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: .45rem; }
.footer-bottom { border-top: 1px solid var(--line); padding-block: 1.3rem 2.2rem; display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; }

/* =============================================================
   6. Secciones
   ============================================================= */

/* --- Hero --------------------------------------------------- */
.hero { position: relative; padding-block: clamp(3.2rem, 9vw, 6.5rem) clamp(2.5rem, 6vw, 4rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(60% 55% at 22% 8%, rgba(255,107,44,.16), transparent 62%),
    radial-gradient(50% 50% at 84% 22%, rgba(56,189,248,.11), transparent 65%);
  pointer-events: none; z-index: 0;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.024) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(75% 60% at 50% 30%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(75% 60% at 50% 30%, #000 25%, transparent 78%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-inner { max-width: 46rem; display: flex; flex-direction: column; gap: 1.2rem; }
.hero h1 { margin-top: .3rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: .5rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 1.6rem; margin-top: 1.8rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.hero-stat { display: flex; flex-direction: column; gap: .1rem; }
.hero-stat b { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.hero-stat span { font-size: .78rem; color: var(--muted); }

/* --- Rejilla de categorías ---------------------------------- */
.cat-grid { display: grid; gap: .8rem; grid-template-columns: 1fr; }
.cat-card {
  display: flex; align-items: center; gap: .9rem;
  padding: 1rem 1.1rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color .25s var(--ease-out), transform .25s var(--ease-out), background .25s var(--ease-out);
}
.cat-card:hover { border-color: var(--accent-line); transform: translateY(-3px); background: var(--surface-2); }
.cat-card[aria-disabled="true"] { opacity: .5; cursor: default; }
.cat-card[aria-disabled="true"]:hover { transform: none; border-color: var(--line); background: var(--surface); }
.cat-abbr {
  width: 42px; height: 42px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--line);
  font-family: var(--mono); font-size: .72rem; font-weight: 700; color: var(--accent);
  letter-spacing: .02em;
}
.cat-card b { display: block; font-size: .98rem; font-family: var(--display); letter-spacing: -.01em; }
.cat-card small { font-size: .78rem; color: var(--muted); }
.cat-card .arrow { margin-left: auto; color: var(--faint); flex: none; }
.cat-card:hover .arrow { color: var(--accent); }

/* --- Ficha de producto --------------------------------------- */
.ficha-top { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; padding-top: 1.4rem; }
.ficha-head { display: flex; flex-direction: column; gap: .85rem; }
.ficha-head h1 { font-size: clamp(1.7rem, 4.4vw, 2.5rem); }
.buy-panel {
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  padding: 1.2rem; display: flex; flex-direction: column; gap: .9rem;
}
.buy-panel .price-now { font-size: 1.85rem; }
.buy-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.ficha-body { display: grid; gap: 2.2rem; grid-template-columns: 1fr; align-items: start; }
.ficha-main { display: flex; flex-direction: column; gap: 2.4rem; }
.ficha-side { display: flex; flex-direction: column; gap: 1.2rem; }
.block-title { font-size: 1.28rem; margin-bottom: 1rem; display: flex; align-items: center; gap: .6rem; }
.block-title::before {
  content: ""; width: 3px; height: 1.05em; border-radius: 2px;
  background: var(--accent); flex: none;
}
.prose p { color: var(--text-2); font-size: 1rem; line-height: 1.78; }
.prose p + p { margin-top: 1rem; }
.ideal-box {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: .9rem 1.1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .96rem; color: var(--text);
}
.ideal-box b { color: var(--accent); display: block; font-size: .74rem; font-family: var(--mono); letter-spacing: .13em; text-transform: uppercase; margin-bottom: .3rem; font-weight: 500; }

.sources { display: flex; flex-direction: column; gap: .4rem; }
.sources a { font-size: .84rem; color: var(--text-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.sources a:hover { color: var(--accent); }

/* --- Comparador --------------------------------------------- */
/* minmax(0, 1fr), aquí y en los anchos mayores: con 1fr, un nombre largo
   ensanchaba su columna y sacaba de la pantalla el botón de quitar (Spec 022,
   RF-26 y RF-27). */
.cmp-picker { display: grid; gap: .7rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 1.6rem; }
.cmp-slot {
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: .8rem .9rem; display: flex; align-items: center; gap: .8rem;
  background: var(--surface); min-height: 76px;
}
.cmp-slot.is-filled { border-style: solid; }
.cmp-slot img { width: 46px; height: 46px; object-fit: contain; flex: none; }
.cmp-slot-info { flex: 1; min-width: 0; }
/* Hasta dos líneas y, solo si no cabe, puntos suspensivos: con las columnas
   iguales, una sola línea no bastaba para saber qué producto es. */
.cmp-slot-info b { display: -webkit-box; font-size: .9rem; font-family: var(--display); letter-spacing: -.01em;
  -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cmp-slot-info small { font-size: .78rem; color: var(--muted); font-family: var(--mono); }
.cmp-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.cmp-remove { color: var(--faint); padding: .3rem; border-radius: 6px; flex: none; }
.cmp-remove:hover { color: var(--bad); background: var(--surface-2); }
.cmp-add { width: 100%; height: 100%; display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .89rem; }
.cmp-add:hover { color: var(--accent); }

.cmp-chooser { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.8rem; }
.cmp-chip {
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: .42rem .9rem; font-size: .85rem; color: var(--text-2);
  background: var(--surface); transition: all .2s var(--ease-out);
}
.cmp-chip:hover { border-color: var(--accent-line); color: var(--text); }
.cmp-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
/* Componentes de otra categoría mientras hay una comparativa empezada: se ven,
   pero no se pueden pulsar, porque no se pueden enfrentar con lo ya elegido. */
.cmp-chip:disabled { opacity: .35; cursor: not-allowed; }
.cmp-chip:disabled:hover { border-color: var(--line-2); color: var(--text-2); }

.cmp-scroller { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cmp-table { font-size: .89rem; min-width: 620px; }
.cmp-table th, .cmp-table td { padding: .68rem .9rem; text-align: left; border-bottom: 1px solid var(--line); }
.cmp-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); font-family: var(--display); font-size: .92rem;
  border-bottom: 1px solid var(--line-2); vertical-align: bottom;
}
.cmp-table tbody th {
  font-weight: 500; color: var(--muted); font-size: .86rem;
  width: 210px; min-width: 180px;
}
.cmp-table td { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--text-2); }
.cmp-table td.na { color: var(--faint); }
.cmp-table td.is-best { color: var(--good); font-weight: 700; }
.cmp-table td.is-best::after { content: " ★"; font-size: .7em; opacity: .85; }
.cmp-table tr.grouprow th {
  background: var(--bg-2); font-family: var(--mono); font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  padding-top: 1rem; padding-bottom: .5rem;
}
.cmp-table tr.grouprow td { background: var(--bg-2); }
.cmp-head-cell { display: flex; flex-direction: column; gap: .3rem; min-width: 150px; }
.cmp-head-cell .cmp-dot { margin-bottom: .1rem; }
.cmp-empty {
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 2.6rem 1.4rem; text-align: center; color: var(--muted);
  background: var(--surface);
}

/* --- Guía / artículo ---------------------------------------- */
.article { max-width: 46rem; }
.article-head { display: flex; flex-direction: column; gap: .9rem; padding-top: 1.4rem; }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem .9rem; font-size: .8rem; color: var(--muted); }
.article-body { margin-top: 1.6rem; }
.article-body h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin-top: 2.6rem; margin-bottom: .9rem; }
.article-body h3 { font-size: 1.08rem; margin-top: 1.8rem; margin-bottom: .6rem; }
.article-body p { color: var(--text-2); line-height: 1.8; }
.article-body p + p { margin-top: 1rem; }
.pick-card {
  display: flex; gap: 1rem; align-items: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); padding: .9rem 1rem; margin-top: 1.1rem;
  transition: border-color .25s var(--ease-out), transform .25s var(--ease-out);
}
.pick-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.pick-card img { width: 74px; height: 74px; object-fit: contain; flex: none; }
.pick-card .pick-info { flex: 1; min-width: 0; }
.pick-card b { font-family: var(--display); font-size: 1rem; display: block; }
.pick-card small { color: var(--muted); font-size: .82rem; }
.pick-card .price-now { font-size: 1.05rem; }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; list-style: none; padding: 1rem 2rem 1rem 0;
  font-family: var(--display); font-size: 1.02rem; font-weight: 600;
  position: relative; color: var(--text);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: .3rem; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 1.2rem; color: var(--accent); transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::after { content: "−"; }
.faq-item p { padding-bottom: 1.1rem; color: var(--text-2); font-size: .95rem; line-height: 1.75; }

/* --- Página legal ------------------------------------------- */
.legal { max-width: 44rem; padding-top: 1.4rem; }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; margin-bottom: .7rem; }
.legal h3 { font-size: 1rem; margin-top: 1.5rem; margin-bottom: .5rem; color: var(--text); 
  font-family: var(--display); letter-spacing: -.01em; }
.legal h4 { font-size: .95rem; margin-top: 1.4rem; margin-bottom: .35rem; color: var(--text);
  font-family: var(--display); letter-spacing: -.01em; }
.legal p, .legal li { color: var(--text-2); font-size: .95rem; line-height: 1.75; }
.legal p + p { margin-top: .8rem; }
.legal ul + p, .legal ul + h2, .legal ul + h3, .legal ul + h4 { margin-top: 1rem; }
.legal ul { margin-top: .6rem; display: flex; flex-direction: column; gap: .4rem; }

/* --- Estado vacío ------------------------------------------- */
.empty-state {
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  padding: 3rem 1.5rem; text-align: center; color: var(--muted);
  background: var(--surface);
}
.empty-state b { display: block; font-family: var(--display); color: var(--text); font-size: 1.05rem; margin-bottom: .4rem; }

/* --- Filtros / orden ---------------------------------------- */
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1.6rem; }
.toolbar label { font-size: .82rem; color: var(--muted); }
.select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: 8px; padding: .48rem 2rem .48rem .75rem; font-size: .86rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
.select:hover { border-color: var(--accent-line); }

/* =============================================================
   7. Efectos
   ============================================================= */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .65s var(--ease-out), transform .65s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .proscons { grid-template-columns: 1fr 1fr; }
  .cat-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 720px) {
  :root { --gutter: 28px; }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .cmp-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
  .ficha-top { grid-template-columns: 1.05fr 1fr; gap: 2.4rem; }
}

@media (min-width: 960px) {
  .nav { gap: .2rem; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .card-grid-2 { grid-template-columns: repeat(2, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .cmp-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ficha-body { grid-template-columns: minmax(0, 1.72fr) minmax(280px, 1fr); gap: 2.8rem; }
  .ficha-side { position: sticky; top: 88px; }
}

@media (min-width: 1280px) {
  :root { --gutter: 36px; }
}

/* Menú móvil */
@media (max-width: 959px) {
  .nav-toggle { display: grid; }
  .nav {
    position: fixed; inset: 64px 0 auto 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: .7rem var(--gutter) 1.2rem; gap: .1rem;
    margin-left: 0;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .nav.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .nav a, .nav-menu summary { padding: .72rem .6rem; font-size: .96rem; }
  .nav-menu summary { justify-content: space-between; }
  .nav-panel::before { content: none; }
  .nav-panel { position: static; flex-direction: column; flex-wrap: nowrap; width: auto; max-width: none; gap: .6rem; padding: .2rem 0 .6rem .8rem; background: none; border: 0; box-shadow: none; }
  .nav .nav-cta { margin-left: 0; margin-top: .5rem; justify-content: center; }
  .no-js .nav { position: static; transform: none; opacity: 1; pointer-events: auto; flex-direction: row; flex-wrap: wrap; background: none; border: 0; padding: 0 0 .6rem; max-height: none; }
  .no-js .nav-toggle { display: none; }
  /* Sin JavaScript no hay hamburguesa: el menú baja a su propia fila bajo la marca. */
  .no-js .site-header .wrap { flex-wrap: wrap; }
  .no-js .nav { width: 100%; }
}

/* =============================================================
   9. Reduced motion — solo efectos intrusivos
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --- Spec 003: precios que envejecen y productos no disponibles --- */
.price-old { color: var(--d4); }
.price-off { color: var(--muted); }
.pill-off {
  background: rgba(255, 255, 255, .08);
  color: var(--text-2);
  border: 1px solid rgba(255, 255, 255, .14);
}
.pcard.is-off .pcard-media img { opacity: .45; filter: grayscale(.6); }
.btn-off {
  background: var(--surface-2); color: var(--muted);
  cursor: default; display: inline-flex; align-items: center; gap: .4rem;
}
.alt-box {
  display: grid; gap: .35rem; margin-top: .9rem;
  padding: .85rem 1rem; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--accent-line);
  font-size: .92rem; line-height: 1.55;
}
.alt-box b { display: flex; align-items: center; gap: .4rem; }
.alt-box span { color: var(--text-2); }
.alt-box a { color: var(--accent); font-weight: 600; }


/* Spec 022: aviso exclusivo de la demo. */
.demo-banner {
  position: relative;
  z-index: 101;
  width: 100%;
  color: var(--text-2);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  font-size: .84rem;
  line-height: 1.45;
  text-align: center;
}
.demo-banner-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: .55rem var(--gutter);
  overflow-wrap: anywhere;
}
.demo-banner a { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
