/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1a2130;
  --text-muted: #5c6577;
  --border: #e2e5ea;
  --accent: #2f6feb;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fe;
  --good: #1f9d55;
  --warn: #b45309;
  --sample: #b45309;
  --radius: 12px;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --display: "Manrope", var(--sans);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --max-w: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10141c;
    --surface: #171d29;
    --text: #eef1f6;
    --text-muted: #99a2b4;
    --border: #262e3d;
    --accent: #5b8dff;
    --accent-ink: #0b0f16;
    --accent-soft: #1b2740;
  }
}
:root[data-theme="dark"] {
  --bg: #10141c;
  --surface: #171d29;
  --text: #eef1f6;
  --text-muted: #99a2b4;
  --border: #262e3d;
  --accent: #5b8dff;
  --accent-ink: #0b0f16;
  --accent-soft: #1b2740;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; overflow-x: clip; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; letter-spacing: -0.01em; font-family: var(--display); }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--surface); color: var(--text);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.container { max-width: var(--max-w); margin-inline: auto; padding-inline: 1.25rem; }
.grid { display: grid; gap: 1.25rem; }
.product-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* =============================================================
   4. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .8rem 1.5rem; border-radius: 999px; font-weight: 700;
  transition: transform .2s var(--ease-out), background .2s var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; position: relative; }
.card-link { display: block; }
.card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.card-noimg {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .95rem; text-align: center; padding: 1rem;
}
.card-body { padding: 1rem 1.1rem 1.25rem; }
.card-brand { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.card-title { font-size: 1.05rem; margin-block: .2rem .5rem; }
.card-protocol { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.chip { display: inline-block; padding: .25rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 600; }
.chip-hub { background: var(--border); color: var(--text-muted); }
.card-price { font-weight: 800; font-size: 1.1rem; }
.badge { position: absolute; top: .6rem; right: .6rem; z-index: 1; padding: .25rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-sample { background: var(--sample); color: #fff; }

.sample-notice { background: var(--accent-soft); color: var(--sample); border: 1px solid var(--sample); border-radius: var(--radius); padding: .8rem 1.1rem; margin-block: 1rem; font-weight: 600; }

/* =============================================================
   5. Sections
   ============================================================= */
.site-nav { border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 50; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; gap: 1rem; flex-wrap: wrap; }
.nav-logo { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.nav-links { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.nav-links a { font-weight: 600; color: var(--text-muted); transition: color .2s var(--ease-out); }
.nav-links a:hover, .nav-links a.is-active { color: var(--text); }
.nav-links a.nav-cta, .nav-links a.nav-cta:hover {
  background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; border-radius: 999px;
}

.hero { padding-block: 3.5rem 2.5rem; text-align: center; max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); margin-bottom: 1rem; }
.hero-lead { color: var(--text-muted); font-size: 1.1rem; margin-bottom: 1.75rem; }
.hero-cta { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

.trust { padding-block: 1rem 2.5rem; }
.trust h2 { margin-bottom: .6rem; }
.trust p { color: var(--text-muted); max-width: 70ch; }

.categories { padding-block: 2.5rem; }
.category-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; transition: transform .2s var(--ease-out); }
.category-card:hover { transform: translateY(-3px); }
.category-card p { color: var(--text-muted); margin-top: .3rem; }

.page-hero { padding-block: 2.5rem 1.5rem; max-width: 70ch; }
.page-hero h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); margin-bottom: .6rem; }
.page-hero p { color: var(--text-muted); }

section.container { padding-block: 1.5rem; }

.aviso-afiliados { color: var(--text-muted); font-size: .85rem; padding-block: 1.5rem; border-top: 1px solid var(--border); margin-top: 2rem; }

.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; background: var(--surface); }
.footer-inner { padding-block: 1.5rem 2rem; }
.footer-links { display: flex; gap: 1.2rem; margin-block: .8rem; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); font-weight: 600; }
.footer-links a:hover { color: var(--text); }
.footer-copy { color: var(--text-muted); font-size: .82rem; }

/* Ficha */
.ficha { padding-block: 2rem 3rem; display: grid; gap: 2rem; grid-template-columns: 1fr; }
.ficha-noimg {
  border-radius: var(--radius); aspect-ratio: 4/3; width: 100%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.5rem;
}
.ficha-marca { color: var(--text-muted); text-transform: uppercase; font-size: .8rem; letter-spacing: .04em; }
.ficha-nombre { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-block: .3rem .5rem; }
.ficha-rating { color: var(--warn); font-weight: 700; margin-bottom: .8rem; }
.ficha-precio { margin-bottom: 1.2rem; }
.precio-actual { font-size: 1.8rem; font-weight: 800; margin-right: .6rem; }
.precio-antes { text-decoration: line-through; color: var(--text-muted); }
.precio-nota { display: block; color: var(--text-muted); font-size: .82rem; margin-top: .3rem; }
.btn-comprar { margin-top: .5rem; margin-bottom: 1rem; }

.ficha-radar, .ficha-specs, .ficha-editorial, .ficha-resenas, .ficha-comparar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem;
}
.ficha-radar h2, .ficha-specs h2, .ficha-editorial h2, .ficha-resenas h2 { margin-bottom: .8rem; font-size: 1.2rem; }
.radar-chart { width: 100%; max-width: 340px; margin-inline: auto; aspect-ratio: 1; }
.nota { color: var(--text-muted); font-size: .82rem; margin-top: .6rem; text-align: center; }

.specs-table { width: 100%; border-collapse: collapse; }
.specs-table tr { border-bottom: 1px solid var(--border); }
.specs-table th, .specs-table td { text-align: left; padding: .6rem .4rem; font-size: .92rem; }
.specs-table th { color: var(--text-muted); font-weight: 600; width: 45%; }

.editorial-cuerpo p { margin-bottom: 1rem; color: var(--text); }
.pros-contras { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-block: 1.2rem; }
.pros-contras h3 { font-size: 1rem; margin-bottom: .5rem; }
.pros-contras ul { padding-left: 1.2rem; }
.pros li { color: var(--good); }
.contras li { color: var(--warn); }
.ideal-para { background: var(--accent-soft); border-radius: 8px; padding: .8rem 1rem; color: var(--accent); }

.similares { margin-top: 1rem; }
.similar-card { display: block; padding: .5rem 0; border-bottom: 1px solid var(--border); font-weight: 600; }

/* Comparador */
.comparador-picker { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem; }
.comparador-picker label { display: block; font-weight: 600; margin-bottom: .5rem; }
.comparador-picker input { width: 100%; padding: .7rem 1rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.comparador-resultados { margin-top: .8rem; display: grid; gap: .4rem; }
.comparador-resultado-item { display: flex; justify-content: space-between; align-items: center; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: 8px; }
.comparador-vacio { color: var(--text-muted); padding: 2rem 0; text-align: center; }
.comparador-tabla { overflow-x: auto; }
.comparador-tabla table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.comparador-tabla th, .comparador-tabla td { padding: .7rem .8rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.comparador-tabla td.best-value { color: var(--good); font-weight: 700; }
.remove-badge { position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 999px; background: var(--warn); color: #fff; font-weight: 700; line-height: 1; }
.comparador-col-header { position: relative; padding-top: 1.4rem !important; }

.guide { padding-block: 2rem 3rem; max-width: 74ch; }
.guide h1 { margin-bottom: 1rem; }
.guide h2 { margin-top: 1.6rem; margin-bottom: .5rem; font-size: 1.2rem; }
.guide p, .guide ul { color: var(--text); margin-bottom: .6rem; }
.guide ul { padding-left: 1.3rem; }

.legal-page { padding-block: 2rem 3rem; max-width: 74ch; }
.legal-page h1 { margin-bottom: 1rem; }
.legal-page p { color: var(--text); }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .ficha { grid-template-columns: 1fr 1.3fr; }
  .ficha-noimg { grid-row: span 6; }
}
@media (min-width: 960px) {
  .hero { padding-block: 5rem 3rem; }
}

/* =============================================================
   9. Reduced motion — only intrusive
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
