/* =============================================================
   MejorPick — styles.css
   1. Tokens  2. Reset  3. Utilities  4. Typography  5. Components
   6. Sections  7. Effects  8. Responsive  9. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #faf8f5;
  --bg-alt: #f1ece3;
  --surface: #ffffff;
  --ink: #1c1a17;
  --ink-soft: #55504a;
  --line: #e7e0d5;
  --accent: #b45309;
  --accent-2: #0e7c66;
  --accent-soft: #fdf1e4;
  --gold: #c9a15a;
  --danger: #c0392b;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(28,26,23,.06);
  --shadow-md: 0 8px 24px rgba(28,26,23,.08);
  --shadow-lg: 0 20px 48px rgba(28,26,23,.14);
  --container: 1240px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-theme="dark"] {
  --bg: #16140f;
  --bg-alt: #1e1b15;
  --surface: #221f19;
  --ink: #f3ede2;
  --ink-soft: #bcb2a2;
  --line: #332e25;
  --accent: #e08a3c;
  --accent-2: #34c9a8;
  --accent-soft: #2c2114;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 20px 48px rgba(0,0,0,.45);
}

/* =============================================================
   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(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  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.08; letter-spacing: -0.01em; font-family: var(--serif); font-weight: 600; }
ul, ol { padding-left: 1.2em; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.container-narrow { max-width: 820px; margin-inline: auto; padding-inline: 1.25rem; }
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
}
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.section-head { max-width: 640px; margin-bottom: 2rem; }
.section-head p { color: var(--ink-soft); margin-top: .6rem; font-size: 1.05rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }

/* =============================================================
   4. Typography
   ============================================================= */
.hero-title { font-size: clamp(2.2rem, 5.6vw, 3.8rem); max-width: 18ch; }
.hero-lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-soft); max-width: 56ch; margin-top: 1rem; }
.h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.h3 { font-size: clamp(1.25rem, 2.4vw, 1.5rem); }
.muted { color: var(--ink-soft); }
.price { font-family: var(--sans); font-weight: 800; font-size: 1.4rem; color: var(--ink); }
.price-old { font-size: .95rem; color: var(--ink-soft); text-decoration: line-through; margin-left: .4rem; }
.rating { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; font-size: .92rem; }
.rating .stars { color: var(--gold); letter-spacing: 1px; }

/* =============================================================
   5. Components
   ============================================================= */

/* --- Nav --- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
@supports not (backdrop-filter: blur(1px)) { .nav { background: var(--bg); } }
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: .85rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--serif); font-weight: 700; font-size: 1.3rem; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: grid; place-items: center; color: #fff; font-size: 1rem; font-weight: 800;
}
.nav-links { display: none; align-items: center; gap: 1.6rem; font-size: .95rem; font-weight: 600; }
.nav-links a { color: var(--ink-soft); transition: color .2s var(--ease-out); }
.nav-links a:hover, .nav-links a.is-active { color: var(--accent); }
.nav-cta {
  padding: .55rem 1.1rem; border-radius: 999px; background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: .9rem; transition: transform .2s var(--ease-out), background .2s var(--ease-out);
}
.nav-cta:hover { transform: translateY(-1px); background: var(--accent); }
.nav-toggle { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 8px; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink); position: relative; transition: transform .25s var(--ease-out);
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }
.nav-mobile { display: none; flex-direction: column; gap: .2rem; padding: .5rem 0 1rem; border-top: 1px solid var(--line); }
.nav-mobile.is-open { display: flex; }
.nav-mobile a { padding: .7rem .2rem; font-weight: 600; border-bottom: 1px solid var(--line); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s var(--ease-out);
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #963f05; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--accent); font-weight: 700; }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.02rem; }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }

.product-photo {
  aspect-ratio: 4/3; display: grid; place-items: center; position: relative; overflow: hidden;
}
.product-photo .icon { font-size: 2.6rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.2)); }
.product-photo .initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; color: rgba(255,255,255,.16); font-size: 5rem; letter-spacing: -.05em;
}
.badge {
  position: absolute; top: .7rem; left: .7rem; background: var(--danger); color: #fff;
  font-size: .72rem; font-weight: 800; padding: .3rem .55rem; border-radius: 999px; letter-spacing: .02em;
}

.product-card { display: flex; flex-direction: column; }
.product-card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-card-brand { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); }
.product-card-name { font-size: 1.08rem; font-weight: 700; font-family: var(--sans); line-height: 1.3; }
.product-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: .6rem; }

/* --- Category pill --- */
.pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .9rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem;
}

/* --- Category hero card (home) --- */
.cat-card {
  position: relative; border-radius: var(--radius); overflow: hidden; padding: 1.6rem;
  color: #fff; min-height: 190px; display: flex; flex-direction: column; justify-content: flex-end; gap: .3rem;
  box-shadow: var(--shadow-sm);
}
.cat-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.45)); }
.cat-card > * { position: relative; z-index: 1; }
.cat-card .icon { font-size: 1.8rem; }
.cat-card h3 { font-size: 1.4rem; }
.cat-card p { font-size: .9rem; opacity: .92; }

/* --- Spec table --- */
.spec-table { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table tr:last-child { border-bottom: 0; }
.spec-table th, .spec-table td { text-align: left; padding: .8rem 1rem; font-size: .95rem; }
.spec-table th { width: 40%; color: var(--ink-soft); font-weight: 600; background: var(--bg-alt); }
.spec-table td { font-weight: 600; }

/* --- Pros/cons --- */
.proscons { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.proscons ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.proscons li { padding-left: 1.6rem; position: relative; font-size: .95rem; }
.pros li::before { content: "✓"; position: absolute; left: 0; color: var(--accent-2); font-weight: 800; }
.cons li::before { content: "–"; position: absolute; left: 0; color: var(--danger); font-weight: 800; }
.proscons h4 { font-size: 1rem; font-family: var(--sans); margin-bottom: .5rem; }

/* --- Review summary box --- */
.review-box {
  background: var(--accent-soft); border-radius: var(--radius); padding: 1.3rem 1.5rem;
  border-left: 4px solid var(--accent);
}
.review-box .rating { margin-bottom: .5rem; }

/* --- Ad slot --- */
.ad-slot {
  display: flex; align-items: center; justify-content: center; min-height: 90px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm); color: var(--ink-soft);
  font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; font-weight: 700;
  background: var(--bg-alt);
}

/* --- Chart wrap --- */
.chart-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.chart-wrap canvas { max-width: 100%; }

/* --- Comparador --- */
.comparador-picker { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.picker-cat-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.picker-cat-tab {
  padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line); font-size: .85rem; font-weight: 700;
  transition: all .2s var(--ease-out);
}
.picker-cat-tab.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.picker-list { display: grid; grid-template-columns: 1fr; gap: .5rem; max-height: 340px; overflow-y: auto; padding-right: .3rem; }
.picker-item {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); cursor: pointer; transition: all .15s var(--ease-out);
}
.picker-item:hover { border-color: var(--accent); }
.picker-item.is-selected { background: var(--accent-soft); border-color: var(--accent); }
.picker-item input { accent-color: var(--accent); width: 18px; height: 18px; }
.picker-item .name { font-weight: 700; font-size: .92rem; flex: 1; }
.picker-item .price { font-size: .85rem; }
.compare-empty { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.compare-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.compare-table { min-width: 560px; }
.compare-table th, .compare-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; vertical-align: top; }
.compare-table th { background: var(--bg-alt); text-align: left; }
.compare-table thead th { position: sticky; top: 0; background: var(--bg-alt); }
.compare-col-head { display: flex; flex-direction: column; gap: .3rem; min-width: 160px; }
.compare-col-head .btn { margin-top: .4rem; }
.remove-chip {
  align-self: flex-start; font-size: .72rem; font-weight: 700; color: var(--danger);
  border: 1px solid var(--danger); border-radius: 999px; padding: .1rem .5rem;
}

/* --- Footer --- */
.footer { border-top: 1px solid var(--line); padding-block: 3rem 2rem; background: var(--bg-alt); margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.footer-col h4 { font-family: var(--sans); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .8rem; color: var(--ink-soft); }
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.footer-col a { font-size: .92rem; color: var(--ink-soft); transition: color .2s; }
.footer-col a:hover { color: var(--accent); }
.footer-legal { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-soft); display: flex; flex-direction: column; gap: .5rem; }

/* --- Breadcrumb --- */
.breadcrumb { font-size: .85rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--accent); }

/* --- Filter bar (categoría) --- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1.6rem; align-items: center; }
.filter-select {
  padding: .55rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface);
  font-weight: 600; font-size: .9rem;
}

/* --- Guide article --- */
.article-body h2 { margin-top: 2rem; margin-bottom: .8rem; }
.article-body h3 { margin-top: 1.5rem; margin-bottom: .6rem; }
.article-body p { margin-bottom: 1rem; color: var(--ink-soft); font-size: 1.02rem; }
.article-body ul, .article-body ol { margin-bottom: 1.2rem; color: var(--ink-soft); }
.article-body li { margin-bottom: .4rem; }
.faq-item { border-bottom: 1px solid var(--line); padding-block: 1rem; }
.faq-item summary { cursor: pointer; font-weight: 700; font-family: var(--sans); }

/* --- Legal page --- */
.legal-body h2 { margin-top: 1.8rem; margin-bottom: .7rem; font-size: 1.3rem; }
.legal-body p { margin-bottom: 1rem; color: var(--ink-soft); }

/* --- Gallery (product page) --- */
.gallery-main { border-radius: var(--radius); overflow: hidden; margin-bottom: .7rem; }
.gallery-thumbs { display: flex; gap: .6rem; }
.gallery-thumb { width: 64px; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 2px solid transparent; opacity: .6; transition: all .2s; }
.gallery-thumb.is-active, .gallery-thumb:hover { opacity: 1; border-color: var(--accent); }

/* --- Offers ribbon --- */
.discount-tag { color: var(--danger); font-weight: 800; font-size: .85rem; }

/* =============================================================
   6. Sections
   ============================================================= */
.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(2rem, 5vw, 3rem); }
.hero-grid { display: grid; gap: 2rem; align-items: center; }
.hero-visual {
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; position: relative;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: grid; place-items: center; box-shadow: var(--shadow-lg);
}
.hero-visual .emoji { font-size: 5rem; }

.cta-band {
  background: linear-gradient(135deg, var(--ink), #3a2d1e); color: #fff;
  border-radius: var(--radius); padding: clamp(2rem, 5vw, 3.5rem); text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,.75); margin-top: .6rem; }

/* =============================================================
   7. Effects
   ============================================================= */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease-soft), transform .7s var(--ease-soft); }
.reveal.is-visible { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none !important; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .proscons { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.1fr .9fr; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .product-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
}
@media (min-width: 1280px) {
  .grid-3.grid-3-wide { grid-template-columns: repeat(3, 1fr); }
}

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