/* =========================================
   THE MAKER JOB — Minimalist Premium
   ========================================= */

/* =========================================
   FUENTES SELF-HOSTED (variable fonts, subset latin)
   - Inter cubre pesos 100-900 en un solo archivo (~48 KB)
   - Playfair Display cubre 300-900 en un solo archivo (~38 KB)
   - font-display: swap evita FOIT, muestra fallback hasta cargar.
   ========================================= */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 300 900;
  font-display: optional; /* No bloquea LCP: si llega en ~100ms se usa, si no, fallback definitivo esta visita y caché para la siguiente */
  src: url('assets/fonts/playfair-display-variable.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =========================================
   FUENTE FALLBACK Playfair con size-adjust
   Times New Roman con métricas overridden para ocupar el mismo
   espacio que Playfair y minimizar layout shift al hacer swap.
   ========================================= */
@font-face {
  font-family: 'Playfair Display Fallback';
  src: local('Times New Roman');
  ascent-override: 91.0%;
  descent-override: 25.0%;
  line-gap-override: 0%;
  size-adjust: 106.0%;
}

:root {
  /* Color */
  --bg: #ffffff;
  --bg-dark: #0a0a0a;
  --bg-soft: #f6f6f6;
  --text: #0a0a0a;
  --text-light: #5a5a5a;
  --text-on-dark: #f5f5f5;
  --text-on-dark-soft: #a5a5a5;
  --accent: #c8102e;
  --accent-dim: rgba(200, 16, 46, 0.6);
  --accent-on-dark: #ff3b4e;   /* rojo más claro para texto pequeño sobre fondo oscuro (contraste AA) */
  --line: #e8e8e8;
  --line-dark: #1f1f1f;

  /* Layout */
  --max: 1240px;
  --narrow: 820px;
  --nav-h: 80px;            /* alto real del nav en desktop */
  --nav-h-mobile: 64px;     /* alto real del nav en móvil */

  /* Spacing scale (8px base) */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-6: 48px;
  --space-8: 64px;
  --space-12: 96px;
  --space-16: 128px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-full: 999px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-chart: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  scroll-padding-top: var(--nav-h);
}
@media (max-width: 767px) {
  html { scroll-padding-top: var(--nav-h-mobile); }
}

/* Scroll margin de respaldo: la section queda justo bajo la nav fija */
section[id] {
  scroll-margin-top: var(--nav-h);
}
@media (max-width: 767px) {
  section[id] { scroll-margin-top: var(--nav-h-mobile); }
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

/* height: auto deja que el navegador derive el aspect-ratio de los atributos width/height,
   reservando el espacio antes de que la imagen cargue (anti-CLS). */
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button {
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
}

.container { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 32px; }

/* =====================
   ACCESSIBILITY & GLOBAL UTILS
   ===================== */
::selection { background: var(--accent); color: #fff; }
::-moz-selection { background: var(--accent); color: #fff; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip link visible solo al recibir foco */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 12px 18px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

/* Custom scrollbar (desktop) */
@media (pointer: fine) {
  html { scrollbar-color: var(--text-light) transparent; scrollbar-width: thin; }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    border: 2px solid var(--bg);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-light); }
}

/* Respeta a quien tenga reducción de movimiento activada */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* =====================
   NAVIGATION
   Layout horizontal estable: logo izquierda 100x100, menú derecha.
   .is-compact: solo refuerza fondo/sombra al hacer scroll.
   Móvil (<768px): logo más pequeño + hamburguesa.
   ===================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(239, 236, 227, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--space-4);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-3);
}
.nav-logo {
  display: flex;
  align-items: center;
  margin-right: auto;   /* empuja el resto de elementos a la derecha */
}
.nav-logo img {
  height: 40px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s ease;
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a.is-active { color: var(--text); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--accent);
}

/* Icono IG en el nav */
.nav-ig a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  color: var(--text-light);
  transition: color 0.2s ease, transform 0.2s ease;
}
.nav-ig a:hover { color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .nav-ig a:hover { transform: translateY(-1px); }
}
.nav-ig a:active { transform: scale(0.9); }
.nav-ig a.is-active::after { display: none; }
.nav-ig svg { display: block; }

/* Selector de idioma EN/ES — elemento fijo del header, fuera del menú */
.nav-lang {
  display: flex;
  align-items: center;
}
/* En el header principal: tras el menú, antes de la hamburguesa */
.nav-inner > .nav-lang { order: 2; }
.nav-lang a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.nav-lang a:hover { background: #a50d26; border-color: #a50d26; }
.nav-lang a.is-active::after { display: none; }
/* La hamburguesa siempre la última a la derecha */
.nav-toggle { order: 3; }

/* Acciones del nav en páginas legales (idioma + volver) */
.legal-nav-actions { display: flex; align-items: center; gap: 16px; }

/* Hamburguesa (oculta en desktop) */
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  position: relative;
  align-items: center;
  justify-content: center;
}
.nav-toggle-bar {
  position: absolute;
  left: 12px; right: 12px;
  height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.2s ease, top 0.3s var(--ease);
}
.nav-toggle-bar:nth-child(1) { top: 14px; }
.nav-toggle-bar:nth-child(2) { top: 21px; }
.nav-toggle-bar:nth-child(3) { top: 28px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  top: 21px; transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  top: 21px; transform: rotate(-45deg);
}

/* Animación de entrada al cargar (anulada por reduced-motion via global rule) */
@keyframes navLogoIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes navMenuIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.nav-logo  { animation: navLogoIn 700ms var(--ease) both; }
.nav-links { animation: navMenuIn 600ms var(--ease) 200ms both; }
.nav-toggle { animation: navMenuIn 600ms var(--ease) 200ms both; }

/* =====================
   HERO
   ===================== */
.hero {
  position: relative;
  min-height: 100vh;          /* fallback */
  min-height: 100svh;         /* iOS Safari estable */
  min-height: 100dvh;         /* dinámica donde esté soportada */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 130px 24px 80px;
  background: #0a0a0a;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(0,0,0,0.55) 0%,
    rgba(0,0,0,0.35) 40%,
    rgba(0,0,0,0.7) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  max-width: 920px;
}
.hero-eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 32px;
  font-weight: 500;
}
.hero-title {
  font-family: 'Playfair Display', 'Playfair Display Fallback', Georgia, serif;
  font-size: clamp(44px, 7vw, 96px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
  text-shadow: 0 2px 30px rgba(0,0,0,0.4);
}
.hero-sub {
  font-size: clamp(16px, 1.6vw, 20px);
  color: rgba(255,255,255,0.92);
  margin-bottom: 56px;
  font-weight: 300;
  line-height: 1.5;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}
.hero-cta {
  display: inline-block;
  padding: 16px 32px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  letter-spacing: 0.02em;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.2s var(--ease);
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,0.05);
}
.hero-cta:hover {
  background: white;
  color: var(--bg-dark);
  border-color: white;
}
/* El lift solo en dispositivos con hover real (en táctil el tap dejaría el botón "pegado") */
@media (hover: hover) and (pointer: fine) {
  .hero-cta:hover { transform: translateY(-2px); }
}
/* Feedback de pulsación: se define después del hover para que gane durante :active */
.hero-cta:active { transform: scale(0.97); }

/* =====================
   SECTIONS
   ===================== */
.section {
  padding: 60px 0 140px;
  position: relative;
}
/* Compensa el -60px de margin-bottom del banner separador previo */
.banner-strip + section {
  padding-top: 120px;
}
.section-dark {
  background: var(--bg-dark);
  color: var(--text-on-dark);
}
.section-dark .lead { color: var(--text-on-dark-soft); }

.section-head {
  margin-bottom: 50px;
  max-width: 880px;
}
.section-head .lead {
  font-size: clamp(17px, 1.4vw, 19px);
  color: var(--text-light);
  max-width: 720px;
  font-weight: 300;
  line-height: 1.65;
}

/* =====================
   TYPOGRAPHY UTILS
   ===================== */
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 24px;
  display: inline-block;
}
.eyebrow.light { color: var(--text-on-dark-soft); }

.display {
  font-family: 'Playfair Display', 'Playfair Display Fallback', Georgia, serif;
  font-size: clamp(32px, 4.5vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.title-xl {
  font-size: clamp(38px, 5.5vw, 72px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin-bottom: 32px;
}

.lead {
  font-size: 19px;
  font-weight: 300;
  line-height: 1.65;
}

/* =====================
   SPECS GRID (El coche)
   ===================== */
.specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0;
  border-top: 1px solid var(--line-dark);
  margin-bottom: 120px;
}
.spec {
  padding: 56px 32px;
  border-bottom: 1px solid var(--line-dark);
  border-right: 1px solid var(--line-dark);
}
.spec:first-child { padding-left: 0; }
.spec:last-child { border-right: none; padding-right: 0; }
.spec-num {
  display: block;
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
.spec-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-on-dark-soft);
  margin-bottom: 20px;
  font-weight: 600;
}
.spec p {
  font-size: 14px;
  color: var(--text-on-dark-soft);
  line-height: 1.6;
}

/* =====================
   SPLIT (text + image)
   ===================== */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}
.split-text h3 {
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.split-text p {
  color: var(--text-on-dark-soft);
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.7;
}
/* Splits used on light sections: dark text instead */
.section:not(.section-dark) .split-text p {
  color: var(--text-light);
}
.split-media img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Banner separator strip */
.banner-strip {
  width: 100%;
  background: var(--bg);
  overflow: hidden;
  padding: 0;
  margin-bottom: -60px;   /* el bloque negro siguiente trepa sobre la zona blanca inferior */
  position: relative;
  z-index: 1;
}
.banner-strip img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 306px;
  object-fit: cover;
  object-position: center;
}

/* =====================
   SUBHEAD (intro intermedia entre bloques de una misma sección)
   ===================== */
.subhead {
  max-width: 760px;
  margin-bottom: 48px;
}
.subhead .eyebrow { margin-bottom: 18px; }
.subhead-title {
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: clamp(28px, 3vw, 44px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}
.subhead-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-light);
}

/* =====================
   REASONS GRID
   ===================== */
.reasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.reason {
  background: var(--bg);
  padding: 56px 40px;
  transition: background 0.3s ease;
}
.reason:hover { background: var(--bg-soft); }
.reason-num {
  display: block;
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 20px;
  font-weight: 600;
}
.reason h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.reason p {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.65;
}

/* =====================
   DESIGN SECTION (Frank Stephenson)
   ===================== */
.design-split {
  margin-bottom: 100px;
}
.design-split:last-of-type {
  margin-bottom: 0;
}
.design-split-flip .split-media { order: -1; }
.design-num {
  display: block;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}
.design-quote {
  margin-top: 100px;
  padding: 72px 32px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 48px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.design-quote-portrait {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
}
.design-quote-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% 28%;
  display: block;
}
.design-quote-text {
  flex: 1;
  max-width: 760px;
}
.design-quote blockquote {
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 24px;
}
.design-quote cite {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  font-style: normal;
}

@media (max-width: 720px) {
  .design-quote {
    flex-direction: column;
    text-align: center;
    gap: 32px;
    padding: 56px 20px;
  }
  .design-quote-portrait { width: 130px; height: 130px; }
}

/* =====================
   CHART CARD: gráfica de precio (protagonista, fondo oscuro)
   ===================== */
.chart-card {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  padding: var(--space-8) var(--space-8) var(--space-6);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-12);
}
.chart-eyebrow {
  color: var(--text-on-dark-soft);
  margin-bottom: var(--space-2);
}
.chart-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.chart-title {
  font-family: 'Playfair Display', 'Playfair Display Fallback', Georgia, serif;
  font-size: clamp(28px, 3.4vw, 44px);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-on-dark);
  margin: 0;
  flex: 1;
}
.chart-badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border: 1px solid var(--accent-on-dark);
  border-radius: var(--radius-full);
  color: var(--accent-on-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
  margin-top: 8px;
  flex-shrink: 0;
  transition: opacity 0.4s var(--ease) 1.8s, transform 0.4s var(--ease) 1.8s;
}
.js .chart-badge {
  opacity: 0;
  transform: scale(0.95);
}
.chart-card.is-animated .chart-badge {
  opacity: 1;
  transform: scale(1);
}

.chart-svg-wrap {
  width: 100%;
}
.price-chart {
  width: 100%;
  height: auto;
  display: block;
}

/* SVG inner */
.price-chart .chart-grid line {
  stroke: rgba(255,255,255,0.08);
  stroke-width: 1;
}
.price-chart .chart-y-labels text,
.price-chart .chart-x-labels text {
  fill: var(--text-on-dark-soft);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.price-chart .chart-x-last {
  fill: var(--accent-on-dark);
  font-weight: 500;
}

/* Línea principal: stroke-dasharray animado */
.price-chart .chart-line {
  fill: none;
  stroke: var(--text-on-dark);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke-dashoffset 1.9s var(--ease-chart);
}
/* El trazo arranca oculto solo con JS; sin JS se ve la línea completa. */
.js .price-chart .chart-line {
  stroke-dasharray: var(--chart-line-length, 3500);
  stroke-dashoffset: var(--chart-line-length, 3500);
}
.chart-card.is-animated .price-chart .chart-line { stroke-dashoffset: 0; }

/* Área bajo la línea: fade-in al ~30% del trazo (delay 0.6s sobre 1.9s = 31.5%) */
.price-chart .chart-area {
  fill: url(#priceAreaGradient);
  transition: opacity 1s ease 0.6s;
}
.js .price-chart .chart-area { opacity: 0; }
.chart-card.is-animated .price-chart .chart-area { opacity: 1; }

/* Puntos: aparición sincronizada con avance del trazo */
.price-chart .chart-point {
  fill: var(--text-on-dark);
  transition: opacity 0.3s ease;
}
.js .price-chart .chart-point { opacity: 0; }
.price-chart .chart-point-last { fill: var(--accent); }
.chart-card.is-animated .price-chart .chart-point:nth-of-type(1) { opacity: 1; transition-delay: 0.05s; }
.chart-card.is-animated .price-chart .chart-point:nth-of-type(2) { opacity: 1; transition-delay: 0.37s; }
.chart-card.is-animated .price-chart .chart-point:nth-of-type(3) { opacity: 1; transition-delay: 0.69s; }
.chart-card.is-animated .price-chart .chart-point:nth-of-type(4) { opacity: 1; transition-delay: 1.01s; }
.chart-card.is-animated .price-chart .chart-point:nth-of-type(5) { opacity: 1; transition-delay: 1.33s; }
.chart-card.is-animated .price-chart .chart-point:nth-of-type(6) { opacity: 1; transition-delay: 1.65s; }
.chart-card.is-animated .price-chart .chart-point-last { opacity: 1; transition-delay: 1.95s; }

/* Línea punteada vertical sobre 2024 */
.price-chart .chart-marker {
  stroke: var(--accent);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.5;
  transition: opacity 0.4s ease 1.95s;
}
.js .price-chart .chart-marker { opacity: 0; }
.chart-card.is-animated .price-chart .chart-marker { opacity: 0.5; }

/* Tooltip */
.price-chart .chart-tooltip {
  transition: opacity 0.4s ease 2.05s;
}
.js .price-chart .chart-tooltip { opacity: 0; }
.price-chart .chart-tooltip rect { fill: var(--accent); }
.price-chart .chart-tooltip text {
  fill: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 700;
}
.chart-card.is-animated .price-chart .chart-tooltip { opacity: 1; }

.chart-source {
  font-size: 13px;
  color: var(--text-on-dark-soft);
  margin: var(--space-4) 0 0;
  font-style: italic;
}

/* =====================
   SECONDARY STATS: dos cifras equivalentes debajo del chart
   ===================== */
.secondary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
  align-items: start;
}
/* Stack vertical de 2 stats apiladas (columna izquierda) */
.stats-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}
.s-stat .stat-num {
  display: inline-flex;
  align-items: baseline;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 900;
  font-size: clamp(48px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  margin-bottom: 16px;
}
.s-stat .stat-num-value { display: inline-block; }
.s-stat .stat-num-symbol {
  font-size: 0.62em;
  margin-left: 0.04em;
  font-weight: 900;
}
.s-stat .stat-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 12px;
}
.s-stat p {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-light);
  max-width: 380px;
  margin: 0;
}

/* Animación stagger del bloque secundario (cualquier hijo: stats o endorsement) */
.secondary-stats > * {
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.js .secondary-stats > * {
  opacity: 0;
  transform: translateY(12px);
}
.secondary-stats.is-animated > *:nth-child(1) { transition-delay: 0ms;   opacity: 1; transform: translateY(0); }
.secondary-stats.is-animated > *:nth-child(2) { transition-delay: 180ms; opacity: 1; transform: translateY(0); }
.secondary-stats.is-animated > *:nth-child(3) { transition-delay: 360ms; opacity: 1; transform: translateY(0); }

/* =====================
   ENDORSEMENT (Hagerty Bull Market List)
   Mismo lenguaje visual que .s-stat (mark + label + texto + link),
   ocupando todo el ancho del bloque.
   ===================== */
/* .endorsement: el grid de .secondary-stats ya da el ritmo vertical */
.endorsement-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.endorsement-mark {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(48px, 5vw, 72px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}
.endorsement-tag {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-light);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.endorsement-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 12px;
}
.endorsement-text {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-light);
  margin: 0 0 24px;
}
.endorsement-text em {
  color: var(--text);
  font-style: italic;
}
.endorsement-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.endorsement-link:hover {
  color: var(--text);
  border-color: var(--text);
}
.endorsement-link svg {
  transition: transform 0.25s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .endorsement-link:hover svg { transform: translate(2px, -2px); }
}
@media (max-width: 767px) {
  .endorsement-head {
    gap: 12px;
  }
}

/* Reduced motion: todo en estado final, sin animar */
@media (prefers-reduced-motion: reduce) {
  .price-chart .chart-line,
  .price-chart .chart-area,
  .price-chart .chart-point,
  .price-chart .chart-marker,
  .price-chart .chart-tooltip,
  .chart-badge,
  .secondary-stats .s-stat {
    transition: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
    transform: none !important;
  }
  .price-chart .chart-marker { opacity: 0.5 !important; }
}

/* =====================
   MI UNIDAD: data, JCW kit, gallery
   ===================== */
.unit-data {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
  margin-bottom: 96px;
}
.unit-cell {
  padding: 36px 24px;
  border-right: 1px solid var(--line-dark);
}
/* En grid 3-cols: 1ª col flush izq, 3ª col flush der + sin border-right */
.unit-cell:nth-child(3n+1) { padding-left: 0; }
.unit-cell:nth-child(3n)   { border-right: none; padding-right: 0; }
/* Separador horizontal entre la fila 1 y la fila 2 */
.unit-cell:nth-child(-n+3) { border-bottom: 1px solid var(--line-dark); }
.unit-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-on-dark-soft);
  margin-bottom: 16px;
  font-weight: 600;
}
.unit-value {
  display: block;
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.jcw-block {
  margin-bottom: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  overflow: hidden;
}

/* Summary del acordeón JCW */
.jcw-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 36px 40px;
  user-select: none;
  transition: background 0.2s ease;
}
.jcw-summary::-webkit-details-marker { display: none; }
.jcw-summary:hover { background: rgba(255,255,255,0.04); }

.jcw-header {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}
.jcw-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--text-on-dark-soft);
  transition: transform 0.35s var(--ease), background 0.2s ease, color 0.2s ease;
  margin-top: 4px;
}
.jcw-summary:hover .jcw-chevron {
  background: #fff;
  color: var(--text);
  border-color: #fff;
}
details[open] > .jcw-summary .jcw-chevron {
  transform: rotate(180deg);
}
details.jcw-block .jcw-list { margin: 0 40px; }
details.jcw-block .jcw-source { margin: 0 40px 36px; }
.jcw-badge {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent);
  color: white;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
  border-radius: 100px;
  margin-bottom: 20px;
  text-transform: uppercase;
}
.jcw-badge.badge-chili {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.45);
}
.jcw-badge.badge-premium {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}
.jcw-title {
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.jcw-sub {
  color: var(--text-on-dark-soft);
  font-size: 15px;
  font-weight: 300;
  max-width: 720px;
  line-height: 1.65;
}
.jcw-source {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1px solid var(--line-dark);
}
.jcw-source p {
  font-size: 13px;
  color: var(--text-on-dark-soft);
  font-weight: 300;
  font-style: italic;
  line-height: 1.6;
}
.jcw-source a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.jcw-source a:hover { text-decoration-color: var(--accent); }
.jcw-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line-dark);
  border: 1px solid var(--line-dark);
}
.jcw-list li {
  background: var(--bg-dark);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.jcw-list li.highlight {
  background: linear-gradient(135deg, rgba(200,16,46,0.15) 0%, rgba(200,16,46,0.04) 100%);
  border-left: 2px solid var(--accent);
}
.jcw-list li.highlight strong { color: #fff; }
.jcw-list li.highlight strong::before {
  content: "★ ";
  color: var(--accent);
  font-size: 12px;
}
.jcw-list strong {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-on-dark);
  letter-spacing: -0.005em;
}
.jcw-list span {
  font-size: 13px;
  color: var(--text-on-dark-soft);
  font-weight: 300;
  line-height: 1.55;
}

/* Gallery — uniform grid 4:3 ratio */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.g-item {
  overflow: hidden;
  border-radius: 3px;
  background: #111;
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
}
.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .g-item:hover img { transform: scale(1.04); }
}

/* También las miniaturas del transporte hacen zoom-in */
.t-item { cursor: zoom-in; }

/* =====================
   LIGHTBOX
   ===================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 60px);
  cursor: zoom-out;
  animation: lightboxIn 0.25s var(--ease);
}
.lightbox[hidden] { display: none; }
.lightbox-figure {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  cursor: default;
}
.lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.lightbox-caption {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  text-align: center;
  max-width: 720px;
  line-height: 1.5;
}
.lightbox-caption:empty { display: none; }
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,0.22); }
@media (hover: hover) and (pointer: fine) {
  .lightbox-close:hover { transform: scale(1.05); }
}
.lightbox-close:active { transform: scale(0.95); }

/* Botones prev/next */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  z-index: 1;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-nav:hover {
  background: rgba(255,255,255,0.22);
}
/* Conserva el translateY(-50%) de posicionamiento al añadir el press */
.lightbox-nav:active { transform: translateY(-50%) scale(0.92); }
.lightbox-nav:disabled,
.lightbox-nav[disabled] {
  opacity: 0;
  pointer-events: none;
}

/* Contador "3 / 9" abajo */
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.lightbox-counter:empty { display: none; }

@media (max-width: 540px) {
  .lightbox-nav { width: 44px; height: 44px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@keyframes lightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* =====================
   TIMELINE (Restauración)
   ===================== */
.timeline {
  display: flex;
  flex-direction: column;
  margin-top: 40px;
}
/* Cada fase es un <details> acordeón */
.phase {
  display: block;
  border-bottom: 1px solid var(--line);
  padding: 0;
}
.timeline > .phase:first-of-type { border-top: 1px solid var(--line); }

/* Summary en una sola línea: nº + título + fecha + acciones */
.phase-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  user-select: none;
}
.phase-summary::-webkit-details-marker { display: none; }

.phase-num {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.phase-summary h3 {
  flex: 1;
  min-width: 0;
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phase-date {
  flex-shrink: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 500;
}
/* Acciones a la derecha del summary: badge + chevron alineados */
.phase-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.phase-status {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  white-space: nowrap;
}
.phase-status.done { background: #0d3a1f; color: #6ce0a0; }
.phase-status.next { background: #3a2a0d; color: #f0c060; }
.phase-status.pending { background: #1f1f1f; color: #777; border: 1px solid #2a2a2a; }

/* Chevron a la derecha */
.phase-chevron {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text-light);
  transition: transform 0.35s var(--ease), background 0.2s ease, color 0.2s ease;
}
.phase-chevron svg { width: 16px; height: 16px; }
.phase-summary:hover .phase-chevron {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.phase-summary:hover h3 { color: var(--accent); }
details[open] > .phase-summary .phase-chevron {
  transform: rotate(180deg);
}

/* Cuerpo del acordeón */
.phase-body {
  padding: 0 0 40px;
  max-width: 100%;
}
.phase-body > p {
  color: var(--text-light);
  font-size: 16px;
  line-height: 1.75;
  margin-bottom: 16px;
  max-width: 760px;
}
.phase-body > p:last-child { margin-bottom: 0; }
.phase-body em { font-style: italic; }
.phase-body strong {
  color: var(--text);
  font-weight: 600;
}
.phase-body .phase-media {
  margin-top: 32px;
  max-width: 900px;
}
.phase-media img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
  border-radius: 4px;
}
.phase-body .transport-gallery { margin-top: 32px; }

/* Figura destacada centrada dentro de una fase */
.phase-figure {
  display: block;
  width: 85%;
  max-width: 760px;
  margin: 36px auto;
  border-radius: 4px;
  overflow: hidden;
  background: #111;
  cursor: zoom-in;
}
.phase-figure img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .phase-figure:hover img { transform: scale(1.02); }
}
@media (max-width: 600px) {
  .phase-figure {
    width: 100%;
    margin: 24px 0;
  }
}

/* Cierre narrativo "Continuará…" — invita a la siguiente fase */
.phase-continuara {
  clear: both;            /* Si una figura flotante quedaba activa, la cerramos */
  margin-top: 40px;
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-style: italic;
  font-size: 22px;
  color: var(--text-light);
  text-align: right;
  letter-spacing: 0.01em;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.transport-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.t-item {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  background: #111;
  aspect-ratio: 1 / 1;       /* celdas cuadradas uniformes (filas iguales) */
  cursor: zoom-in;
}
.t-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;          /* recorta para llenar el cuadrado */
  object-position: center;    /* centro de la foto = punto de recorte */
  display: block;
  transition: transform 0.5s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .t-item:hover img { transform: scale(1.04); }
}

/* =====================
   CONTACT
   ===================== */
.section-contact {
  background: var(--bg-soft);
  padding: 160px 0;
}
.contact-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}
.contact-mark {
  width: 220px;
  height: 220px;
  object-fit: contain;
  display: block;
}
.contact-content {
  text-align: left;
}
.section-contact .lead {
  margin-bottom: 40px;
  color: var(--text-light);
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 500px;
}

@media (max-width: 720px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: center;
    justify-items: center;
  }
  .contact-mark { width: 160px; height: 160px; }
  .contact-content { text-align: center; }
  .contact-links { width: 100%; max-width: 500px; }
}
.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  background: white;
  border-radius: 4px;
  border: 1px solid var(--line);
  transition: border-color 0.3s var(--ease), transform 0.2s var(--ease);
}
.contact-link:hover {
  border-color: var(--text);
}
@media (hover: hover) and (pointer: fine) {
  .contact-link:hover { transform: translateY(-2px); }
}
.contact-link:active { transform: scale(0.99); }
.contact-link span {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 500;
}
.contact-link strong {
  font-weight: 500;
  font-size: 16px;
}

/* =====================
   COOKIE CONSENT — banner + panel
   ===================== */
:root {
  --cc-bg: #ffffff;
  --cc-text: var(--text);
  --cc-text-soft: var(--text-light);
  --cc-line: var(--line);
  --cc-shadow: 0 -8px 30px rgba(0, 0, 0, 0.10);
  --cc-radius: 6px;
}

/* Banner abajo, no bloquea scroll */
.cc-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  background: var(--cc-bg);
  border: 1px solid var(--cc-line);
  border-radius: var(--cc-radius);
  box-shadow: var(--cc-shadow);
  padding: var(--space-3) var(--space-4);
  max-width: 1100px;
  margin: 0 auto;
  animation: ccSlideUp 0.4s var(--ease);
}
.cc-banner[hidden] { display: none; }
.cc-banner-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: background 0.2s ease, color 0.2s ease;
  cursor: pointer;
}
.cc-banner-close:hover { background: var(--bg-soft); color: var(--text); }

.cc-banner-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-4);
  align-items: center;
}
.cc-banner-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--cc-text);
  margin: 0;
  padding-right: 24px;
}
.cc-banner-link {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-light);
  transition: color 0.2s ease;
}
.cc-banner-link:hover { color: var(--accent); }

.cc-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* BOTONES — los 3 con misma jerarquía visual (requisito legal) */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  min-height: 40px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: var(--cc-radius);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
}
.cc-btn-primary {
  background: var(--text);
  color: #fff;
  border: 1px solid var(--text);
}
.cc-btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.cc-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}
.cc-btn-secondary:hover { background: var(--text); color: #fff; }
/* Feedback de pulsación (la transición de transform ya estaba declarada en .cc-btn) */
.cc-btn:active { transform: scale(0.97); }

/* PANEL DE CONFIGURACIÓN (modal) */
.cc-panel {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cc-panel[hidden] { display: none; }
.cc-panel-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  animation: ccFadeIn 0.25s var(--ease);
}
.cc-panel-inner {
  position: relative;
  z-index: 1;
  background: var(--cc-bg);
  border-radius: var(--cc-radius);
  width: 100%;
  max-width: 600px;
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: ccPanelIn 0.3s var(--ease);
  box-shadow: 0 30px 60px rgba(0,0,0,0.3);
}
.cc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--cc-line);
}
.cc-panel-header h2 {
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}
.cc-panel-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: background 0.2s ease, color 0.2s ease;
}
.cc-panel-close:hover { background: var(--bg-soft); color: var(--text); }

.cc-panel-body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}
.cc-panel-intro {
  font-size: 14px;
  line-height: 1.6;
  color: var(--cc-text-soft);
  margin-bottom: 24px;
}

/* Categorías */
.cc-category {
  padding: 18px 0;
  border-bottom: 1px solid var(--cc-line);
}
.cc-category:last-child { border-bottom: none; }
.cc-category-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: flex-start;
}
.cc-category-text { padding-top: 2px; }
.cc-category-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--cc-text);
  margin-bottom: 4px;
}
.cc-category-name small {
  font-weight: 500;
  color: var(--text-light);
  font-size: 12px;
}
.cc-category-text p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--cc-text-soft);
  margin: 0;
}

/* Toggle switch */
.cc-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}
.cc-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}
.cc-toggle input:disabled { cursor: not-allowed; }
.cc-toggle-track {
  position: absolute;
  inset: 0;
  background: #d4d4d4;
  border-radius: 100px;
  transition: background 0.2s ease;
}
.cc-toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.cc-toggle input:checked + .cc-toggle-track { background: var(--text); }
.cc-toggle input:checked + .cc-toggle-track::after { transform: translateX(18px); }
.cc-toggle input:disabled + .cc-toggle-track { opacity: 0.6; }
.cc-toggle input:focus-visible + .cc-toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cc-panel-footer {
  display: flex;
  gap: 10px;
  padding: 20px 28px;
  border-top: 1px solid var(--cc-line);
  justify-content: flex-end;
}

/* Footer link "Configurar cookies" */
.footer-links {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.footer-links a,
.footer-link-btn {
  color: var(--text-on-dark-soft);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.2);
  transition: color 0.2s ease;
}
.footer-links a:hover,
.footer-link-btn:hover { color: #fff; }

/* Responsive móvil */
@media (max-width: 700px) {
  .cc-banner {
    left: 8px; right: 8px; bottom: 8px;
    padding: 20px 18px;
  }
  .cc-banner-inner {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cc-banner-text { padding-right: 32px; font-size: 13px; }
  .cc-banner-actions {
    justify-content: stretch;
    flex-direction: column;
  }
  .cc-btn { width: 100%; }
  .cc-panel-header { padding: 18px 20px; }
  .cc-panel-body { padding: 18px 20px; }
  .cc-panel-footer {
    padding: 16px 20px;
    flex-direction: column;
  }
  .cc-panel-footer .cc-btn { width: 100%; }
}

/* Animaciones */
@keyframes ccSlideUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ccFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes ccPanelIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cc-banner,
  .cc-panel-overlay,
  .cc-panel-inner { animation: none; }
}

/* =====================
   PÁGINAS LEGALES (privacidad, cookies, aviso legal)
   ===================== */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 56px) 24px 80px;
}
@media (max-width: 767px) {
  .legal-page { padding: calc(var(--nav-h-mobile) + 32px) 20px 60px; }
}

.legal-back {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  transition: color 0.2s ease;
}
.legal-back:hover { color: var(--accent); }

.legal-header {
  margin-bottom: 56px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}
.legal-header .eyebrow { color: var(--accent); }
.legal-header h1 {
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: clamp(36px, 4.6vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 12px 0 16px;
}
.legal-updated {
  font-size: 13px;
  color: var(--text-light);
  font-style: italic;
}

/* Cuerpo del documento legal: tipografía cómoda */
.legal-content {
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
}
.legal-content h2 {
  font-family: 'Playfair Display', 'Playfair Display Fallback', serif;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 56px 0 18px;
}
.legal-content h2:first-child { margin-top: 0; }
.legal-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 32px 0 12px;
  letter-spacing: -0.005em;
}
.legal-content p {
  margin-bottom: 16px;
  color: var(--text-light);
}
.legal-content strong { color: var(--text); font-weight: 600; }
.legal-content em { font-style: italic; }
.legal-content ul,
.legal-content ol {
  list-style: revert;
  padding-left: 24px;
  margin-bottom: 20px;
  color: var(--text-light);
}
.legal-content li { margin-bottom: 8px; }
.legal-content a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}
.legal-content a:hover { color: var(--accent); }

/* Tabla (cookies) */
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 14px;
}
.legal-table th,
.legal-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.legal-table th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.legal-table td { color: var(--text-light); }
.legal-table code {
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 13px;
  color: var(--text);
  background: var(--bg-soft);
  padding: 1px 6px;
  border-radius: 3px;
}
@media (max-width: 600px) {
  .legal-table { font-size: 13px; }
  .legal-table th, .legal-table td { padding: 10px 8px; }
}

/* Caja de placeholders pendientes (visible para el dueño antes de publicar) */
.legal-placeholders {
  background: #fff8e1;
  border-left: 4px solid #d97706;
  padding: 18px 22px;
  margin-bottom: 48px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.6;
}
.legal-placeholders strong {
  display: block;
  color: #92400e;
  font-weight: 700;
  margin-bottom: 8px;
}
.legal-placeholders ul {
  margin: 0;
  padding-left: 20px;
  color: #6b4609;
}
.legal-placeholders code {
  font-family: 'SF Mono', Consolas, Monaco, monospace;
  font-size: 13px;
  background: rgba(255,255,255,0.7);
  padding: 1px 5px;
  border-radius: 3px;
  color: #92400e;
  font-weight: 600;
}

/* =====================
   FOOTER
   ===================== */
.footer {
  background: var(--bg-dark);
  color: var(--text-on-dark-soft);
  padding: 60px 0;
  text-align: center;
  font-size: 14px;
}
.footer-small {
  font-size: 12px;
  margin-top: 8px;
  opacity: 0.6;
}
.footer-dev {
  color: var(--text-on-dark-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.2);
  transition: color 0.2s ease;
}
.footer-dev:hover { color: #fff; }

/* =====================
   SCROLL ANIMATIONS
   ===================== */
.reveal {
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
/* Estado oculto SOLO con JS activo. Sin .js (JS desactivado o script
   caído por onerror) el contenido se muestra sin depender del observer. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.specs.visible .spec,
.reasons.visible .reason {
  animation: fadeUp 0.9s var(--ease) both;
}
.specs.visible .spec:nth-child(1) { animation-delay: 0.05s; }
.specs.visible .spec:nth-child(2) { animation-delay: 0.15s; }
.specs.visible .spec:nth-child(3) { animation-delay: 0.25s; }
.specs.visible .spec:nth-child(4) { animation-delay: 0.35s; }

.gallery.visible .g-item {
  animation: fadeUp 0.7s var(--ease) both;
}
.gallery.visible .g-item:nth-child(1) { animation-delay: 0.05s; }
.gallery.visible .g-item:nth-child(2) { animation-delay: 0.10s; }
.gallery.visible .g-item:nth-child(3) { animation-delay: 0.15s; }
.gallery.visible .g-item:nth-child(4) { animation-delay: 0.20s; }
.gallery.visible .g-item:nth-child(5) { animation-delay: 0.25s; }
.gallery.visible .g-item:nth-child(6) { animation-delay: 0.30s; }
.gallery.visible .g-item:nth-child(7) { animation-delay: 0.35s; }
.gallery.visible .g-item:nth-child(8) { animation-delay: 0.40s; }
.gallery.visible .g-item:nth-child(9) { animation-delay: 0.45s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================
   RESPONSIVE
   ===================== */

/* Nav móvil (<768px): logo más pequeño + hamburguesa + drawer */
/* Menú a hamburguesa hasta 1023px (cubre tablet portrait, móviles apaisados
   modernos hasta ~960px y deja menú horizontal solo en iPad landscape y desktop) */
@media (max-width: 1023px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: rgba(239, 236, 227, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 24px;
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    overflow-y: auto;
    height: calc(100dvh - var(--nav-h));
    animation: none;
  }
  .nav-links.is-open { transform: translateX(0); }
  .nav-links a {
    font-size: 24px;
    padding: 14px 8px;
    color: var(--text);
    font-weight: 500;
  }
  .nav-links a.is-active::after { display: none; }
  .nav-links a.is-active { color: var(--accent); }
  body.menu-open { overflow: hidden; }
}

/* Compactación visual solo en móvil real */
@media (max-width: 767px) {
  .nav-inner {
    padding: 14px 20px;
    gap: 0;
  }
  .nav-logo img {
    height: 32px;
    width: auto;
  }
  /* Separación entre el pill de idioma y la hamburguesa (gap del header es 0 en móvil) */
  .nav-lang { margin-right: 14px; }
}

@media (max-width: 900px) {
  .section { padding: 90px 0; }
  .section-head { margin-bottom: 40px; }
  .split {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .design-split-flip .split-media { order: 0; }
  .design-split { margin-bottom: 64px; }
  .design-quote { margin-top: 64px; padding: 48px 20px; }

  .transport-gallery { grid-template-columns: 1fr 1fr; }

  .specs { grid-template-columns: 1fr 1fr; }
  .spec { padding: 36px 20px; }
  .spec:nth-child(odd) { padding-left: 0; }
  .spec:nth-child(even) { padding-right: 0; border-right: none; }
  .container, .narrow { padding: 0 20px; }

  .unit-data { grid-template-columns: 1fr 1fr; }
  .unit-cell {
    padding: 28px 16px;
    border-bottom: none;
  }
  .unit-cell:nth-child(odd) { padding-left: 0; }
  .unit-cell:nth-child(even) { padding-right: 0; border-right: none; }
  /* En 2-col con 6 cells = 3 filas: hairline entre filas 1-2 y 2-3 */
  .unit-cell:nth-child(-n+4) { border-bottom: 1px solid var(--line-dark); }

  /* Acordeones JCW: padding interno menor en móvil */
  .jcw-summary { padding: 24px 20px; gap: 20px; }
  details.jcw-block .jcw-list { margin: 0 20px; }
  details.jcw-block .jcw-source { margin: 0 20px 24px; }

  /* Acordeones de fase en móvil: título a 2 líneas, sin fecha */
  .phase-summary {
    align-items: flex-start;
    gap: 14px;
    padding: 18px 0;
  }
  .phase-num { padding-top: 3px; }
  .phase-summary h3 {
    white-space: normal;
    overflow: visible;
    font-size: 17px;
  }
  .phase-date { display: none; }
  .phase-body { padding: 0 0 32px; }
  .phase-actions { gap: 10px; padding-top: 1px; }
  .phase-status { font-size: 9px; padding: 4px 9px; }

  /* CHART CARD — móvil */
  .chart-card { padding: var(--space-6) var(--space-4); }
  .chart-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }
  .chart-badge { margin-top: 0; }
  /* Ocultar años impares en X axis para no solapar */
  .price-chart .chart-x-odd { display: none; }
  .price-chart .chart-y-labels text,
  .price-chart .chart-x-labels text { font-size: 16px; }
  .price-chart .chart-tooltip text { font-size: 18px; }

  /* SECONDARY STATS — apilado (incluyendo el stack y endorsement) */
  .secondary-stats {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .stats-stack {
    gap: 0;
  }
  .s-stat,
  .secondary-stats > .endorsement {
    padding: var(--space-6) 0;
    border-bottom: 1px solid var(--line);
  }
  .s-stat:first-child { padding-top: 0; }
  .s-stat:last-child { border-bottom: none; padding-bottom: 0; }
  .s-stat .stat-num { font-size: clamp(56px, 15vw, 88px); }

  .gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .specs { grid-template-columns: 1fr; }
  .spec {
    border-right: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .hero { padding: 100px 20px 60px; }

  /* Mantenemos 2 columnas en móvil pequeño: los valores son cortos y caben bien */
  .unit-data { grid-template-columns: 1fr 1fr; }
  .unit-cell {
    padding: 22px 12px !important;
    border-right: 1px solid var(--line-dark) !important;
  }
  .unit-cell:nth-child(odd) { padding-left: 0 !important; }
  .unit-cell:nth-child(even) {
    padding-right: 0 !important;
    border-right: none !important;
  }
  .unit-value { font-size: clamp(24px, 7vw, 32px); }

  .gallery { grid-template-columns: 1fr; }

  .transport-gallery { grid-template-columns: 1fr 1fr; }   /* mantener 2 cols incluso muy estrecho */

  /* Banner separator: en móvil le damos más altura para que los coches se vean */
  .banner-strip img {
    height: 220px;
    max-height: 220px;
    object-position: 30% center;
  }
}
