/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f6f8f8;
  --surface: #ffffff;
  --surface-2: #eef2f2;
  --ink: #12181b;
  --ink-soft: #545f61;
  --ink-faint: #8a9294;
  --line: #dfe6e6;
  --accent: #0f6e6e;
  --accent-ink: #ffffff;
  --accent-soft: #d9ecec;
  --amber: #b8790a;
  --amber-soft: #fbe9d0;
  --success: #1f7a45;
  --danger: #c0392b;
  --cream: #f6f8f8;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;
  --gutter: clamp(1.1rem, 4vw, 2.4rem);
  --container: 1180px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161a; --surface: #171f23; --surface-2: #1d2529;
    --ink: #eef2f2; --ink-soft: #aeb8ba; --ink-faint: #7c8688;
    --line: #29343a; --accent-soft: #163333; --amber-soft: #3a2a12;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--sans);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow-x: clip; overscroll-behavior-y: none;
}
img, svg, video, canvas { 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 { font-family: var(--display); text-wrap: balance; line-height: 1.1; letter-spacing: -0.01em; }
::selection { background: var(--accent); color: var(--accent-ink); }
input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  /* Visually-hidden-until-focus: clipped to 1x1px rather than pushed off-screen
     with a negative offset, so mobile browsers changing viewport height when
     their chrome (URL bar) hides/shows can never make it visible by accident —
     only :focus can. */
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  background: var(--ink); color: var(--cream); z-index: 9999; border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus {
  position: fixed; top: 1rem; left: 1rem; width: auto; height: auto;
  padding: .6rem 1rem; margin: 0; overflow: visible; clip: auto; white-space: normal;
}
.container { max-width: var(--container); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: .6rem; }
.section { padding-block: clamp(2rem, 5vw, 3.6rem); }
.section-head { max-width: 640px; margin-bottom: clamp(1.2rem, 3vw, 2rem); }
.lede { font-size: clamp(1rem, 1.6vw, 1.2rem); color: var(--ink-soft); max-width: 62ch; }
.no-js .mobile-nav, .no-js .nav-toggle { display: none; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
h3 { font-size: 1.1rem; }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.3rem; border-radius: var(--radius-m); font-weight: 600; font-size: .95rem;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 18px -8px rgba(15,110,110,.55); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -8px rgba(15,110,110,.65); }
.btn-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--line); }
.btn-sm { padding: .55rem .9rem; font-size: .85rem; }
.btn-lg { padding: 1rem 1.6rem; font-size: 1.02rem; }
.btn-block { width: 100%; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }

.chip {
  display: inline-flex; align-items: center; font-size: .76rem; font-weight: 600;
  padding: .3rem .65rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
}

.notice-banner {
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--line));
  color: var(--ink); border-radius: var(--radius-m); padding: 1rem 1.2rem; font-size: .92rem; margin-top: 1rem;
}
.price-note, .limits-note { font-size: .82rem; color: var(--ink-faint); }

/* --- header / nav --- */
.site-header {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  padding: .9rem var(--gutter); background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 700; font-size: 1.1rem; }
.logo-mark { color: var(--accent); font-size: 1.3rem; }
.main-nav { display: none; align-items: center; gap: 1.5rem; font-size: .92rem; font-weight: 500; color: var(--ink-soft); }
.main-nav a:hover, .main-nav a.active { color: var(--ink); }
.nav-toggle { font-size: 1.3rem; background: none; border: 1px solid var(--line); border-radius: 8px; padding: .3rem .6rem; }
.mobile-nav {
  display: none; flex-direction: column; position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px);
  background: var(--surface); z-index: 50; padding: 5rem 1.5rem 2rem; gap: .3rem; box-shadow: -20px 0 40px -20px rgba(0,0,0,.3);
  transform: translateX(100%); transition: transform .3s var(--ease-out);
}
.mobile-nav.is-open { display: flex; transform: translateX(0); }
.mobile-nav a { padding: .8rem .2rem; border-bottom: 1px solid var(--line); font-weight: 600; }
@media (min-width: 960px) { .main-nav { display: flex; } .nav-toggle { display: none; } }

/* --- hero --- */
.hero { padding-block: clamp(2.4rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem); }
.hero-copy { max-width: 780px; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.4rem; }
.page-hero { padding-block: clamp(1.8rem, 4vw, 3rem) 0; max-width: 900px; }

/* --- product cards / grids --- */
.products-grid { display: grid; gap: 1.3rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.product-card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
  overflow: hidden; display: flex; flex-direction: column;
}
.card-badge {
  position: absolute; top: .8rem; left: .8rem; z-index: 2; background: var(--amber); color: #fff;
  font-size: .72rem; font-weight: 700; padding: .3rem .6rem; border-radius: 999px;
}
.card-media { display: block; background: var(--surface-2); aspect-ratio: 4/3; }
.card-photo { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.placeholder-art {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .3rem; text-align: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-2));
  color: var(--accent); font-family: var(--display); font-weight: 700; font-size: .98rem; padding: 1rem;
}
.placeholder-icon { width: 40px; height: 40px; opacity: .55; }
.placeholder-art small { font-family: var(--sans); font-weight: 500; font-size: .74rem; color: var(--ink-faint); text-transform: none; letter-spacing: 0; }
.placeholder-art-lg { aspect-ratio: 16/9; border-radius: var(--radius-l); font-size: 1.3rem; }
.placeholder-art-lg .placeholder-icon { width: 64px; height: 64px; }
.ficha-img-main { width: 100%; border-radius: var(--radius-l); border: 1px solid var(--line); aspect-ratio: 16/9; object-fit: contain; background: var(--surface); }
.ficha-thumbs { display: flex; gap: .6rem; margin-top: .8rem; list-style: none; padding: 0; overflow-x: auto; }
.ficha-thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); }
.card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-brand { font-size: .78rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.card-body h3 { font-size: 1.02rem; line-height: 1.3; }
.card-summary { font-size: .88rem; color: var(--ink-soft); flex: 1; }
.card-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.card-actions { display: flex; gap: .6rem; margin-top: .4rem; flex-wrap: wrap; }
.card-actions .btn { flex: 1; }

/* --- category / compare grids --- */
.category-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.category-card { display: block; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.category-card:hover { border-color: var(--accent); }
.category-card h3 { margin-bottom: .35rem; font-size: 1rem; }
.category-card p { font-size: .85rem; color: var(--ink-soft); }
.compare-grid { display: flex; flex-wrap: wrap; gap: .7rem; }
.compare-card { padding: .7rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .9rem; background: var(--surface); }
.compare-card:hover { border-color: var(--accent); color: var(--accent); }
.compare-brand-grid { display: grid; gap: 2rem; }
@media (min-width: 960px) { .compare-brand-grid { grid-template-columns: 1fr 1fr; } }
.guide-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.guide-links a { padding: .7rem 1.1rem; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; background: var(--surface); }
.guide-links a:hover { border-color: var(--accent); color: var(--accent); }
.how-we-choose { padding: 1.6rem; }
.how-we-choose p a { color: var(--accent); text-decoration: underline; }

/* --- ficha --- */
.ficha { display: flex; flex-direction: column; gap: clamp(1.6rem, 4vw, 2.6rem); padding-block: 1.5rem 3rem; }
.ficha-marca { font-size: .82rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.ficha-head h1 { margin-block: .3rem .8rem; }
.ficha-price { display: flex; flex-direction: column; gap: .2rem; margin-bottom: 1rem; }
.price-cta { font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--accent); }
.precio-nota { font-size: .8rem; color: var(--ink-faint); }
.radar-wrap { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; }
.radar-canvas { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); max-width: 100%; }
.score-bars { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: .5rem; }
.score-row { display: grid; grid-template-columns: 130px 1fr 48px; align-items: center; gap: .6rem; font-size: .82rem; }
.score-label { color: var(--ink-soft); }
.score-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.score-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.score-val { font-family: var(--mono); text-align: right; color: var(--ink-faint); }
.nota { font-size: .82rem; color: var(--ink-faint); margin-top: .8rem; }

.specs-table th, .specs-table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
.specs-table th { width: 42%; color: var(--ink-soft); font-weight: 600; }
.feature-table th, .feature-table td { text-align: left; padding: .65rem .9rem; border-bottom: 1px solid var(--line); font-size: .88rem; vertical-align: top; }
.feature-table thead th { color: var(--ink); font-weight: 700; background: var(--surface-2); }
.feature-table tbody th { color: var(--ink); font-weight: 600; width: 24%; }
.specs-extra { margin-top: 1rem; }
.specs-extra summary { cursor: pointer; font-weight: 600; padding: .6rem 0; }

.editorial-body p + p { margin-top: 1rem; }
.pros-contras { display: grid; gap: 1.2rem; margin-top: 1.5rem; }
@media (min-width: 720px) { .pros-contras { grid-template-columns: 1fr 1fr; } }
.pros-col h3, .contras-col h3 { margin-bottom: .5rem; }
.pros-col ul, .contras-col ul { padding-left: 1.2rem; }
.pros-col li, .contras-col li { margin-bottom: .4rem; font-size: .92rem; }
.ideal-para { margin-top: 1.2rem; font-size: .95rem; }
.who-skip { color: var(--ink-soft); }
.resenas-note {
  display: flex; gap: .9rem; align-items: flex-start; font-size: .9rem; color: var(--ink-soft);
  background: var(--surface-2); padding: 1.1rem 1.2rem; border-radius: var(--radius-m); border: 1px solid var(--line);
}
.resenas-note-icon { font-size: 1.3rem; color: var(--accent); flex: none; line-height: 1; }
.resenas-note strong { color: var(--ink); display: block; margin-bottom: .3rem; }
.resenas-note p { margin-top: 0; }
.similar-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 1rem; }
.aviso-afiliados { font-size: .8rem; color: var(--ink-faint); border-top: 1px solid var(--line); padding-top: 1rem; }

/* --- comparator --- */
.comparator-picker { position: relative; margin-bottom: 1.5rem; max-width: 460px; }
.comparator-picker input {
  width: 100%; padding: .8rem 1rem; border-radius: var(--radius-s); border: 1px solid var(--line);
  background: var(--surface); font-size: .95rem;
}
.comparator-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-m); max-height: 280px; overflow-y: auto; z-index: 10;
  box-shadow: 0 20px 40px -20px rgba(0,0,0,.25);
}
.comparator-results button { display: block; width: 100%; text-align: left; padding: .7rem 1rem; font-size: .9rem; }
.comparator-results button:hover { background: var(--surface-2); }
.comparator-slots { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-bottom: 2rem; }
.comparator-slot { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 1rem; }
.comparator-slot .remove-badge {
  position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: .9rem; display: grid; place-items: center;
}
.comparator-radar-wrap { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; margin-bottom: 2rem; }
.radar-legend { display: flex; flex-direction: column; gap: .4rem; font-size: .85rem; }
.radar-legend span { display: inline-flex; align-items: center; gap: .5rem; }
.legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.comparator-table-wrap { overflow-x: auto; }
.comparator-table { min-width: 640px; font-size: .88rem; table-layout: fixed; }
.comparator-table th, .comparator-table td {
  padding: .65rem .9rem; border-bottom: 1px solid var(--line); text-align: left;
  white-space: normal; overflow-wrap: break-word; word-break: normal; vertical-align: top;
  width: 190px; line-height: 1.45;
}
.comparator-table th:first-child, .comparator-table td:first-child {
  position: sticky; left: 0; background: var(--bg); font-weight: 600; width: 150px; min-width: 150px;
}
.comparator-table thead th { font-weight: 700; background: var(--surface-2); }
.comparator-table td.is-best { color: var(--success); font-weight: 700; }
.comparator-empty { padding: 2rem; text-align: center; color: var(--ink-faint); border: 1px dashed var(--line); border-radius: var(--radius-m); }
.comparator-table .btn {
  /* The base .btn sets white-space:nowrap, which is fine everywhere else but
     lets a "Check Price on Amazon" button overflow a fixed-width table cell
     on narrow screens instead of shrinking with it. Inside the comparator
     table only, let it fill the cell and wrap instead of spilling out. */
  width: 100%; white-space: normal; text-align: center; line-height: 1.25;
}
.swipe-hint { font-size: .82rem; font-weight: 600; color: var(--ink-faint); margin-bottom: .5rem; }

/* Mobile-only comparator table adjustments — desktop layout above is untouched. */
@media (max-width: 719px) {
  .comparator-table th, .comparator-table td { width: 220px; min-width: 220px; font-size: .85rem; }
  .comparator-table th:first-child, .comparator-table td:first-child { width: 128px; min-width: 128px; font-size: .8rem; }
}

/* --- ad slot --- */
.ad-slot {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 90px;
  border: 1px dashed var(--ink-faint); border-radius: var(--radius-s); color: var(--ink-faint);
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700; margin-block: 2rem;
  background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 10px, var(--surface) 10px, var(--surface) 20px);
}

/* --- faq / legal --- */
.faq-list { display: flex; flex-direction: column; gap: .6rem; max-width: 800px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
.faq-item summary { cursor: pointer; padding: 1rem 1.2rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item .faq-a { padding: 0 1.2rem 1.1rem; color: var(--ink-soft); font-size: .92rem; }
.faq-a p + p { margin-top: .6rem; }

.legal-page { max-width: 760px; margin: 0 auto; padding-block: clamp(2rem, 5vw, 3.5rem); }
.legal-page h1 { margin-bottom: 1rem; }
.legal-page h2 { margin-top: 1.6rem; margin-bottom: .6rem; font-size: 1.1rem; }
.legal-page p, .legal-page li { color: var(--ink-soft); margin-bottom: .7rem; }
.legal-page ul { padding-left: 1.2rem; }
.legal-page a { color: var(--accent); text-decoration: underline; }

.seo-copy { max-width: 75ch; color: var(--ink-soft); }
.seo-copy h2 { color: var(--ink); margin-bottom: .6rem; }
.seo-copy p + p, .seo-copy p + h2, .seo-copy ol, .seo-copy ul { margin-top: 1rem; }
.seo-copy a { color: var(--accent); text-decoration: underline; }

/* --- footer --- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2rem 1.4rem; margin-top: 3rem; background: var(--surface); }
.footer-top { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; margin-bottom: 1.4rem; }
.footer-brand p { font-size: .85rem; color: var(--ink-soft); margin-top: .4rem; max-width: 40ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .85rem; }
.footer-links a:hover { color: var(--accent); }
.aviso-afiliados { font-size: .78rem; color: var(--ink-faint); }
.copyright { font-size: .78rem; color: var(--ink-faint); margin-top: .6rem; }

/* =============================================================
   6. Responsive
   ============================================================= */
@media (max-width: 719px) {
  .score-row { grid-template-columns: 100px 1fr 40px; font-size: .76rem; }
}

/* =============================================================
   7. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mobile-nav { transition-duration: .01ms; }
}
