:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef0f8;
  --ink: #12142b;
  --muted: #565c75;
  --primary: #4338ca;
  --primary-2: #6d5efc;
  --on-primary: #ffffff;
  --primary-soft: #ebebfd;
  --accent: #0b7f74;
  --accent-soft: #d9f4f0;
  --border: #dfe1ee;
  --venta: #c2321f;
  --on-venta: #ffffff;
  --warn-bg: #fff4d6;
  --warn-ink: #5c4300;
  --shadow: 0 1px 2px rgba(18, 20, 43, .06), 0 8px 24px rgba(18, 20, 43, .06);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d1c;
    --surface: #141731;
    --surface-2: #1b1f40;
    --ink: #eceefb;
    --muted: #a5abc7;
    --primary: #a3abff;
    --primary-2: #c0b0ff;
    --on-primary: #0b0d1c;
    --primary-soft: #232859;
    --accent: #43d3c3;
    --accent-soft: #123a3a;
    --border: #272b4d;
    --warn-bg: #2a2310;
    --warn-ink: #f1d98a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d1c;
  --surface: #141731;
  --surface-2: #1b1f40;
  --ink: #eceefb;
  --muted: #a5abc7;
  --primary: #a3abff;
  --primary-2: #c0b0ff;
  --on-primary: #0b0d1c;
  --primary-soft: #232859;
  --accent: #43d3c3;
  --accent-soft: #123a3a;
  --border: #272b4d;
  --warn-bg: #2a2310;
  --warn-ink: #f1d98a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.7 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--primary-2); outline-offset: 2px; border-radius: 4px; }
.salto { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 10px 14px; z-index: 100; }
.salto:focus { left: 8px; top: 8px; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.prose-wrap { max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* Barra de venta */
.venta-bar { position: sticky; top: 0; z-index: 50; background: var(--venta); color: var(--on-venta); font-size: 14.5px; }
.venta-bar .wrap { display: flex; gap: 10px 16px; align-items: center; justify-content: center; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.venta-bar p { margin: 0; }
.venta-bar a { color: var(--on-venta); font-weight: 700; background: rgba(255,255,255,.18); padding: 3px 12px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.venta-bar a:hover { background: rgba(255,255,255,.3); }

/* Aviso de sitio no oficial */
.no-oficial { background: var(--warn-bg); color: var(--warn-ink); font-size: 13.5px; border-bottom: 1px solid rgba(0,0,0,.06); }
.no-oficial .wrap { padding-top: 6px; padding-bottom: 6px; text-align: center; }
.no-oficial p { margin: 0; }

/* Cabecera */
.cab { background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--border); }
.cab .wrap { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.marca { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; text-decoration: none; color: var(--ink); }
.marca svg { width: 30px; height: 30px; }
.nav { margin-left: auto; min-width: 0; max-width: 100%; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav a { display: block; padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
@media (max-width: 760px) { .nav { margin-left: 0; width: 100%; } }

/* Migas */
.migas { font-size: 14px; color: var(--muted); padding: 18px 0 0; }
.migas ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.migas li + li::before { content: "›"; margin-right: 8px; color: var(--muted); }
.migas a { color: var(--muted); }

/* Hero */
.hero { padding: 48px 0 24px; }
.hero .wrap { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.15fr .85fr; gap: 56px; } .hero { padding: 72px 0 40px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 5px 12px; border-radius: 999px; margin: 0 0 18px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); line-height: 1.08; letter-spacing: -.035em; margin: 0 0 18px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.2rem; color: var(--muted); margin: 0 0 26px; max-width: 58ch; }
.acciones { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-weight: 700; text-decoration: none; border: 2px solid transparent; font-size: 16px; }
.btn svg { width: 18px; height: 18px; }
.btn-primario { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent); }
.btn-primario:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--ink); border-color: var(--border); background: var(--surface); }
.btn-ghost:hover { border-color: var(--primary); }
.btn-venta { background: var(--venta); color: var(--on-venta); }
.hero-arte { justify-self: center; width: min(100%, 360px); }

/* Cabecera de página interior */
.pagina-cab { padding: 28px 0 8px; }
.pagina-cab h1 { font-size: clamp(1.9rem, 4.2vw, 2.7rem); line-height: 1.12; letter-spacing: -.03em; margin: 14px 0 14px; }
.meta { font-size: 14px; color: var(--muted); margin: 0; }

/* Secciones */
.seccion { padding: 44px 0; }
.seccion.alt { background: var(--surface); border-block: 1px solid var(--border); }
.seccion h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.025em; line-height: 1.2; margin: 0 0 10px; }
.seccion .sub { color: var(--muted); margin: 0 0 28px; max-width: 62ch; }

/* Cifras */
.cifras { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 800px) { .cifras { grid-template-columns: repeat(4, 1fr); } }
.cifras li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.cifras strong { display: block; font-size: 2rem; letter-spacing: -.03em; line-height: 1.1; color: var(--primary); }
.cifras span { display: block; margin-top: 6px; color: var(--muted); font-size: 14.5px; line-height: 1.45; }

/* Tarjetas */
.rejilla { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .rejilla { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .rejilla.c4 { grid-template-columns: repeat(4, 1fr); } .rejilla.c3 { grid-template-columns: repeat(3, 1fr); } }
.tarjeta { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); height: 100%; }
.alt .tarjeta { background: var(--bg); box-shadow: none; }
.tarjeta h3 { margin: 14px 0 6px; font-size: 1.15rem; letter-spacing: -.01em; }
.tarjeta p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
.icono { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.icono svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
a.tarjeta { display: block; text-decoration: none; color: inherit; transition: transform .15s, border-color .15s; }
a.tarjeta:hover { transform: translateY(-2px); border-color: var(--primary); }
a.tarjeta .mas { display: inline-flex; gap: 6px; align-items: center; margin-top: 12px; color: var(--primary); font-weight: 700; font-size: 15px; white-space: nowrap; }
a.tarjeta .mas svg { width: 18px; height: 18px; flex: none; }
h1, h2, h3, .lead { overflow-wrap: anywhere; }

/* Pasos */
.pasos { counter-reset: paso; display: grid; gap: 16px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 800px) { .pasos { grid-template-columns: repeat(3, 1fr); } }
.pasos li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 22px 22px; counter-increment: paso; }
.pasos li::before { content: counter(paso); position: absolute; top: -16px; left: 20px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--primary); color: var(--on-primary); box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 40%, transparent); }
.pasos h3 { margin: 4px 0 6px; font-size: 1.1rem; }
.pasos p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }
@media (min-width: 800px) { .pasos li:not(:last-child)::after { content: ""; position: absolute; top: 50%; right: -17px; width: 18px; height: 2px; background: var(--border); } }

/* Línea de tiempo */
.tiempo { list-style: none; margin: 8px 0 0; padding: 0 0 0 26px; border-left: 3px solid var(--border); }
.tiempo li { position: relative; padding: 0 0 28px 22px; }
.tiempo li::before { content: ""; position: absolute; left: -36px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 4px solid var(--primary); }
.tiempo li.hito::before { background: var(--primary); box-shadow: 0 0 0 6px var(--primary-soft); }
.tiempo time, .tiempo .fecha { display: inline-block; font-weight: 800; color: var(--primary); font-size: 15px; letter-spacing: .01em; }
.tiempo h3, .prose .tiempo h3 { margin: 2px 0 4px; font-size: 1.15rem; }
.tiempo p { margin: 0; color: var(--muted); font-size: 16px; max-width: 62ch; }
.etiqueta { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 8px; vertical-align: 2px; }

/* Texto largo */
.prose { padding: 28px 0 48px; }
.prose h2 { font-size: 1.65rem; letter-spacing: -.025em; line-height: 1.2; margin: 44px 0 12px; }
.prose h3 { font-size: 1.2rem; margin: 28px 0 8px; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose strong { font-weight: 700; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; margin: 18px 0; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--muted); font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; }
.tabla { overflow-x: auto; }

.indice { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 8px 0 8px; }
.indice p { margin: 0 0 6px; font-weight: 700; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.indice ol { margin: 0; padding-left: 20px; columns: 1; }
@media (min-width: 640px) { .indice ol { columns: 2; column-gap: 32px; } }
.indice li { margin: 3px 0; font-size: 15.5px; break-inside: avoid; }

.nota { border-left: 4px solid var(--primary); background: var(--primary-soft); padding: 14px 18px; border-radius: 0 12px 12px 0; margin: 22px 0; font-size: 16px; }
.nota p { margin: 0 0 6px; max-width: none; }
.nota p:last-child { margin: 0; }
.nota.aviso { border-color: #d49a00; background: var(--warn-bg); color: var(--warn-ink); }
.fuente { font-size: 14.5px; color: var(--muted); margin: 14px 0 0; }

/* Relacionado */
.relacionado { padding: 8px 0 56px; }
.relacionado h2 { font-size: 1.3rem; margin: 0 0 14px; letter-spacing: -.02em; }

/* FAQ / glosario */
details.faq { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 700; padding: 16px 20px; list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--primary); flex: none; }
details.faq[open] summary::after { content: "−"; }
details.faq .resp { padding: 0 20px 18px; color: var(--ink); }
details.faq .resp p { margin: 0 0 8px; }
.glosario dt { font-weight: 800; margin-top: 22px; font-size: 1.1rem; scroll-margin-top: 90px; }
.glosario dd { margin: 4px 0 0; color: var(--ink); max-width: 68ch; }

/* Venta */
.caja-venta { background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); border: 1px solid var(--border); border-radius: 18px; padding: 28px; margin: 28px 0; }
.caja-venta h2 { margin: 0 0 8px !important; }

/* Pie */
.pie { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0 28px; margin-top: 24px; font-size: 15px; color: var(--muted); }
.pie-cols { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .pie-cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.pie h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink); margin: 0 0 10px; }
.pie ul { list-style: none; margin: 0; padding: 0; }
.pie li { margin: 6px 0; }
.pie a { color: var(--muted); text-decoration: none; }
.pie a:hover { color: var(--primary); text-decoration: underline; }
.pie p { margin: 0 0 10px; }
.pie .legal { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13.5px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } a.tarjeta { transition: none; } }
@media print { .venta-bar, .no-oficial, .nav, .pie { display: none; } }
