/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-alt: #eef1f5;
  --text: #1a2233;
  --text-muted: #5b6472;
  --border: #e2e6ec;
  --accent: #ff5a3c;
  --accent-ink: #ffffff;
  --accent-soft: #fff1ee;
  --brand: #1a2233;
  --success: #1a9c5c;
  --success-soft: #e7f8ee;
  --warn: #b5860a;
  --star: #f5a524;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(20, 24, 34, .06), 0 8px 24px rgba(20, 24, 34, .06);
  --sans: "Inter", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b;
    --surface: #1b1f28;
    --surface-alt: #21262f;
    --text: #eef1f6;
    --text-muted: #9aa3b2;
    --border: #2b313d;
    --accent-soft: #331d17;
    --success-soft: #103622;
  }
}
:root[data-theme="dark"] {
  --bg: #12151b;
  --surface: #1b1f28;
  --surface-alt: #21262f;
  --text: #eef1f6;
  --text-muted: #9aa3b2;
  --border: #2b313d;
  --accent-soft: #331d17;
  --success-soft: #103622;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
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;
}
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; }
ul { list-style: none; padding: 0; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.section { padding-block: 3rem; }
.section-tight { padding-block: 1.5rem; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lede { font-size: 1.1rem; color: var(--text-muted); max-width: 60ch; }

/* =============================================================
   5. Components
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: .95rem;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(255, 90, 60, .35); }
.btn-secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--text); }
.btn-block { width: 100%; }
.btn-lg { padding: 1.05rem 1.8rem; font-size: 1.05rem; }
.btn[disabled], .btn.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-amazon-note { display: block; font-size: .72rem; font-weight: 500; color: var(--text-muted); margin-top: .35rem; }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.badge-sample { background: var(--warn); color: #fff; }
.badge-offer { background: var(--success); color: #fff; }
.badge-editor { background: var(--surface-alt); color: var(--text-muted); }
.badge-match { background: var(--accent-soft); color: var(--accent); }

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

.rating { display: inline-flex; align-items: center; gap: .35rem; font-size: .9rem; }
.rating .stars { color: var(--star); font-weight: 700; }
.rating .count { color: var(--text-muted); }

.price { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.price .now { font-size: 1.5rem; font-weight: 800; }
.price .was { font-size: .95rem; color: var(--text-muted); text-decoration: line-through; }
.price-note { font-size: .75rem; color: var(--text-muted); }

.nav-cta { background: var(--accent); color: var(--accent-ink); }
.nav-links a.nav-cta, .nav-links a.nav-cta:hover { color: var(--accent-ink); background: var(--accent); padding: .5rem 1rem; border-radius: 999px; }

/* =============================================================
   6. Sections — header / footer
   ============================================================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .9rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.brand-logo { width: 30px; height: 30px; border-radius: 50%; display: block; flex: none; }
.site-footer .brand-logo { width: 34px; height: 34px; }
.nav-links { display: none; align-items: center; gap: 1.6rem; font-weight: 600; font-size: .93rem; }
.nav-links a:hover { color: var(--accent); }
@media (min-width: 900px) { .nav-links { display: flex; } }
.nav-toggle { display: inline-flex; padding: .4rem; border-radius: 8px; }
@media (min-width: 900px) { .nav-toggle { display: none; } }
.mobile-nav { display: none; border-top: 1px solid var(--border); padding: .75rem 0; }
.mobile-nav.is-open { display: block; }
.mobile-nav a { display: block; padding: .6rem 0; font-weight: 600; }
@media (min-width: 900px) { .mobile-nav { display: none !important; } }

.sample-banner { background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 600; text-align: center; padding: .55rem 1rem; }

.disclosure { font-size: .78rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-block: 1rem; }
.site-footer { border-top: 1px solid var(--border); padding-block: 2.5rem; margin-top: 3rem; background: var(--surface); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: .88rem; font-weight: 600; margin-block: .75rem; }
.footer-links a:hover { color: var(--accent); }
.footer-legal { font-size: .78rem; color: var(--text-muted); max-width: 70ch; }

/* =============================================================
   7. Hero
   ============================================================= */
.hero { padding-block: 3.5rem 2.5rem; text-align: center; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 1.6rem; }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6rem; margin-top: 2.2rem; font-size: .85rem; color: var(--text-muted); }
.trust-row strong { color: var(--text); }

/* --- Photo hero (contextual: home / ruta / trail / principiantes) --- */
.hero-photo {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background-size: cover;
  background-position: center 30%;
  isolation: isolate;
}
.hero-photo::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(10,12,16,.35) 0%, rgba(10,12,16,.35) 35%, rgba(10,12,16,.88) 100%),
    linear-gradient(90deg, rgba(10,12,16,.55) 0%, rgba(10,12,16,.1) 55%);
}
.hero-photo-inner { padding-block: 3rem 3.2rem; max-width: 640px; }
.hero-photo .eyebrow { color: #ffb199; }
.hero-photo h1 { color: #fff; text-wrap: balance; }
.hero-photo .lede { color: rgba(255,255,255,.88); max-width: 52ch; }
.hero-photo .hero-actions { justify-content: flex-start; }
.hero-photo .trust-row { justify-content: flex-start; color: rgba(255,255,255,.78); margin-top: 1.8rem; }
.hero-photo .trust-row strong { color: #fff; }
.hero-photo .btn-secondary { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.4); backdrop-filter: blur(6px); }
.hero-photo .btn-secondary:hover { border-color: #fff; }
@media (max-width: 720px) { .hero-photo { min-height: 92vh; align-items: flex-end; } .hero-photo-inner { padding-bottom: 2.4rem; } }

/* --- Compact photo banner (utility pages: catálogo, comparador, encuesta…) --- */
.page-banner {
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  color: #fff;
  background-size: cover;
  background-position: center 35%;
  isolation: isolate;
}
.page-banner::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(10,12,16,.82) 0%, rgba(10,12,16,.5) 100%);
}
.page-banner .eyebrow { color: #ffb199; }
.page-banner h1 { color: #fff; }
.page-banner .lede { color: rgba(255,255,255,.85); }

/* --- Ficha context strip (photo band matching the shoe's terrain) --- */
.ficha-context {
  position: relative;
  min-height: 190px;
  display: flex;
  align-items: center;
  color: #fff;
  background-size: cover;
  background-position: center 40%;
  isolation: isolate;
}
.ficha-context::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,12,16,.35) 0%, rgba(10,12,16,.8) 100%);
}
.ficha-context span { font-weight: 700; font-size: .95rem; letter-spacing: .01em; }
.ficha-context span small { display: block; font-weight: 500; font-size: .8rem; color: rgba(255,255,255,.75); margin-top: .15rem; }

/* =============================================================
   8. Product cards & grid
   ============================================================= */
.product-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
@media (min-width: 640px) { .product-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }

.product-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.product-card .thumb { aspect-ratio: 4/3; overflow: hidden; background: var(--surface-alt); position: relative; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .badge { position: absolute; top: .6rem; left: .6rem; }
.product-card .body { padding: 1.1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.product-card .name { font-size: 1.02rem; font-weight: 700; }
.product-card .brand { font-size: .8rem; color: var(--text-muted); }
.product-card .tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { font-size: .72rem; font-weight: 600; color: var(--text-muted); background: var(--surface-alt); padding: .25rem .55rem; border-radius: 999px; }
.product-card .spacer { flex: 1; }
.product-card .why { font-size: .82rem; color: var(--text-muted); }
.product-card .why li { position: relative; padding-left: 1.1rem; }
.product-card .why li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 800; }

/* =============================================================
   9. Category cards
   ============================================================= */
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-card { padding: 1.4rem; text-align: center; transition: transform .15s var(--ease-out); }
.cat-card:hover { transform: translateY(-3px); }
.cat-card .icon { font-size: 1.8rem; margin-bottom: .4rem; }

.cat-card-photo {
  position: relative; overflow: hidden; min-height: 200px;
  display: flex; align-items: flex-end; padding: 1.2rem;
  background-size: cover; background-position: center 30%;
  color: #fff; text-align: left; isolation: isolate;
  border: none;
}
.cat-card-photo::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,12,16,.05) 40%, rgba(10,12,16,.85) 100%);
  transition: background .2s var(--ease-out);
}
.cat-card-photo:hover::before { background: linear-gradient(180deg, rgba(10,12,16,.15) 30%, rgba(10,12,16,.92) 100%); }
.cat-card-photo h3 { color: #fff; font-size: 1.05rem; }
.cat-card-photo p { color: rgba(255,255,255,.82); font-size: .8rem; margin-top: .15rem; }

/* =============================================================
   10. Quiz
   ============================================================= */
.quiz-shell { max-width: 640px; margin-inline: auto; }
.quiz-progress { height: 6px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; margin-bottom: 2rem; }
.quiz-progress-bar { height: 100%; background: var(--accent); width: 0%; transition: width .3s var(--ease-out); }
.quiz-step { display: none; }
.quiz-step.is-active { display: block; animation: fadeIn .25s var(--ease-out); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.quiz-question { font-size: 1.35rem; font-weight: 800; margin-bottom: .4rem; }
.quiz-help { font-size: .88rem; color: var(--text-muted); margin-bottom: 1.2rem; }
.quiz-options { display: grid; gap: .7rem; margin-top: 1.2rem; }
.quiz-option { display: block; padding: 1rem 1.1rem; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; text-align: left; transition: border-color .15s var(--ease-out), background .15s var(--ease-out); }
.quiz-option:hover { border-color: var(--accent); }
.quiz-option.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; }
.quiz-step-count { font-size: .82rem; color: var(--text-muted); }

/* =============================================================
   11. Results
   ============================================================= */
.results-answers { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.match-score { display: flex; align-items: center; gap: .6rem; }
.match-ring { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .82rem; background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--surface-alt) 0); position: relative; flex: none; }
.match-ring::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--surface); }
.match-ring span { position: relative; z-index: 1; }
.result-card { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 780px) { .result-card { grid-template-columns: 240px 1fr; } }
.result-card .thumb { aspect-ratio: auto; height: 100%; min-height: 180px; }
.result-card .body { padding: 1.4rem; }
.result-rank { font-size: .78rem; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }

/* =============================================================
   12. Ficha (product page)
   ============================================================= */
.ficha-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 900px) { .ficha-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.ficha-gallery img { border-radius: var(--radius); border: 1px solid var(--border); }
.ficha-head .name { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: .3rem; }
.ficha-head .brand { color: var(--text-muted); margin-bottom: .6rem; }
.buy-box { padding: 1.2rem; margin-top: 1rem; }
.spec-table { margin-top: .5rem; }
.spec-table th, .spec-table td { text-align: left; padding: .55rem .3rem; border-bottom: 1px solid var(--border); font-size: .92rem; }
.spec-table th { color: var(--text-muted); font-weight: 600; width: 45%; }
.spec-group-title { font-weight: 700; margin-top: 1.4rem; margin-bottom: .3rem; }
.score-bars { display: grid; gap: .65rem; margin-top: .5rem; }
.score-bar-row { display: grid; grid-template-columns: 130px 1fr 2.2rem; align-items: center; gap: .6rem; font-size: .85rem; }
.score-bar-track { height: 8px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.score-bar-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.pros-cons { display: grid; grid-template-columns: 1fr; gap: 1.2rem; margin-top: 1rem; }
@media (min-width: 640px) { .pros-cons { grid-template-columns: 1fr 1fr; } }
.pros-cons h4 { margin-bottom: .5rem; }
.pros-cons ul li { position: relative; padding-left: 1.3rem; margin-bottom: .45rem; font-size: .92rem; }
.pros li::before { content: "+"; position: absolute; left: 0; color: var(--success); font-weight: 800; }
.cons li::before { content: "–"; position: absolute; left: 0; color: #c0392b; font-weight: 800; }
.ideal-para { background: var(--accent-soft); color: var(--accent); padding: 1rem 1.2rem; border-radius: var(--radius-sm); font-weight: 600; margin-top: 1.2rem; }
.editorial-body p { margin-bottom: .9rem; color: var(--text-muted); }

/* =============================================================
   13. Comparator
   ============================================================= */
.compare-picker { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.compare-table-wrap { overflow-x: auto; }
.compare-table { min-width: 640px; }
.compare-table th, .compare-table td { border: 1px solid var(--border); padding: .7rem .8rem; font-size: .88rem; vertical-align: top; }
.compare-table th.row-label { background: var(--surface-alt); text-align: left; width: 170px; }
.compare-table td.best { background: var(--success-soft); font-weight: 700; }
.compare-slot-remove { color: #c0392b; font-weight: 700; font-size: .8rem; }
.radar-wrap { display: flex; justify-content: center; margin-block: 1.5rem; }

/* =============================================================
   14. Forms & misc
   ============================================================= */
select, input[type="text"], input[type="email"] {
  font: inherit; padding: .7rem .9rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 100%;
}
.filters-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-bottom: 1.5rem; }
.filters-row select { width: auto; min-width: 160px; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.js-required-note { display: none; padding: 1rem; background: var(--surface-alt); border-radius: var(--radius-sm); font-size: .9rem; }
.no-js .js-required-note { display: block; }

/* =============================================================
   15. Reduced motion — only intrusive
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .quiz-step.is-active { animation: none; }
}
