/* ============================================================
   BYD Codinova — Estilos principales
   Paleta: rojo BYD #D32F2F · rojo oscuro #B71C1C · WhatsApp #25D366
   Tipografía: Montserrat
   Convención de nombres: bloque + elemento legible (hero / hero-banner /
   hero-caption). Pensado para leerse de corrido.
   ============================================================ */

:root {
    --byd-red: #D32F2F;
    --byd-red-dark: #B71C1C;
    --wa-green: #25D366;
    --ink: #1a1a1a;
    --surface: #313232;   /* gris del navbar, del footer y de las franjas oscuras: rgb(49, 50, 50) */
    --muted: #6b6b6b;
    --line: #e6e6e6;
    --bg: #ffffff;
    --bg-soft: #f5f5f7;
    --maxw: 1280px;
    --radius: 10px;
    --shadow: 0 8px 30px rgba(0, 0, 0, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
    width: 100%;
    max-width: var(--maxw);
    margin-inline: auto;
    padding-inline: 20px;
}

/* El ancla de scroll compensa el header fijo */
.section-anchor { scroll-margin-top: 120px; }

/* Enlace de accesibilidad para saltar al contenido */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--byd-red);
    color: #fff;
    padding: .7rem 1.2rem;
    z-index: 200;
}
.skip-link:focus { left: 10px; top: 10px; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-family: inherit;   /* también cuando el botón es un <button> */
    padding: .72rem 1.6rem;
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
}
.btn-outline { background: transparent; color: #fff; border-color: #fff; }
.btn-outline:hover { background: #fff; color: var(--ink); }
.btn-outline-dark { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline-dark:hover { background: var(--ink); color: #fff; }
.btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn-ghost:hover { background: #fff; color: var(--ink); }

.btn-group { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn-group-center { justify-content: center; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 1600px;
    margin-inline: auto;
    padding: 0 28px;
    min-height: 56px;
}

/* Marca / logos (blancos sobre el header gris) */
.brand { display: flex; align-items: center; gap: .9rem; }
.brand-logo-byd { height: 20px; width: auto; }
.brand-logo-codinova { height: 17px; width: auto; }

/* Navegación: los ítems se reparten con space-between */
.main-nav { flex: 1; display: flex; }
.nav-list { display: flex; width: 100%; justify-content: space-between; align-items: center; padding-left: 4rem; }
.nav-item { position: relative; }
.nav-item > a {
    font-size: .9rem;
    font-weight: 500;
    color: #fff;
    padding: .5rem 0;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}
.nav-item > a:hover { opacity: .75; }
.has-dropdown > a::after {
    content: '';
    width: 7px; height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .2s;
}
.has-dropdown.open > a::after { transform: rotate(-135deg) translateY(2px); }

/* Submenú: se abre con clic (clase .open), fondo gris igual que el navbar */
.dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 230px;
    background: var(--surface);
    color: #fff;
    padding: .6rem;
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
}
.has-dropdown.open .dropdown { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown a { display: block; padding: .6rem .9rem; font-size: .88rem; color: #fff; }
.dropdown a:hover { background: rgba(255, 255, 255, .12); }

.header-actions { display: flex; gap: .7rem; align-items: center; }

/* Botón hamburguesa */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 2;            /* por encima del panel del menú, para poder cerrarlo */
}
.nav-toggle span { width: 26px; height: 2px; background: #fff; transition: .25s; }

/* ============================================================
   HERO
   ============================================================ */
.hero-banner { position: relative; width: 100%; overflow: hidden; background: #000; }
/* El hero conserva su proporción original (16:9): las imágenes traen texto e iconos
   incluidos, así que no se recortan. */
.hero-img-desktop { display: block; width: 100%; height: auto; }
.hero-img-mobile { display: none; width: 100%; }
.hero-caption {
    position: absolute;
    left: 0; right: 0; bottom: 16%;   /* más arriba para no tapar la información que trae la imagen */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    padding-inline: 20px;
}

/* ============================================================
   MODELOS
   ============================================================ */
.model { position: relative; background: #fff; }
.model-visual { position: relative; background: #000; }   /* negro detrás de la foto: evita una línea clara entre imágenes pegadas (subpíxeles) */
/* Igual que el hero: proporción original 16:9, a todo el ancho, sin recorte */
.model-img-desktop { display: block; width: 100%; height: auto; }
.model-img-mobile { display: none; width: 100%; }
.model-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    text-align: center;
    padding: 0 20px 6%;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, .45) 0%, rgba(0, 0, 0, 0) 45%);
}
.model-name {
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    letter-spacing: .02em;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .4);
}
.model-subtitle {
    font-size: clamp(.9rem, 1.6vw, 1.1rem);
    font-weight: 400;
    margin-top: .3rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .4);
}
.model-overlay .btn-group { margin-top: 1.4rem; justify-content: center; }

/* Iconos de características: superpuestos abajo-derecha sobre la imagen.
   Son iconos blancos; se posicionan sobre la zona inferior de la foto. */
.model-features {
    position: absolute;
    right: 24px;
    bottom: 16px;
    z-index: 2;
}
.model-features img {
    width: auto;
    max-width: min(340px, 34vw);
    height: auto;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5));
}

/* ============================================================
   PÁGINAS DE PRODUCTO — banners (mismo tamaño 16:9 que el home)
   ============================================================ */
.product-banner { position: relative; overflow: hidden; background: #000; color: #fff; }
.product-banner-img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: center; }
/* Degradado inferior para que se lean los iconos blancos y los botones */
.product-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, .4) 0%, rgba(0, 0, 0, 0) 40%);
}
.product-banner .model-features,
.product-banner-title,
.product-banner-stats,
.product-banner-cta { z-index: 2; }

/* Banner 1: título centrado arriba y fila de cifras centrada abajo */
.product-banner-title {
    position: absolute;
    top: clamp(2rem, 7vw, 7rem);
    left: 0; right: 0;
    padding-inline: 20px;
    text-align: center;
    text-transform: uppercase;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}
/* Variante: título tal cual se escribe (sin forzar mayúsculas) */
.product-banner-title-plain { text-transform: none; }
.product-banner-stats {
    position: absolute;
    left: 0; right: 0;
    bottom: clamp(5rem, 11vw, 11rem);  /* por encima de los iconos */
    display: flex;
    justify-content: center;
    gap: clamp(1.5rem, 5vw, 5rem);
    padding-inline: 20px;
    text-align: center;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
.product-stat-value { font-size: clamp(1.2rem, 2.4vw, 2rem); font-weight: 600; line-height: 1.2; }
.product-stat-label { font-size: clamp(.8rem, 1.2vw, 1rem); margin-top: .2rem; }
/* Separador vertical entre cifras */
.product-stat + .product-stat { position: relative; padding-left: clamp(1.5rem, 5vw, 5rem); }
.product-stat + .product-stat::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
    background: #fff;
}

/* Texto solo para lectores de pantalla (la referencia oculta el título del banner 2) */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Título + botones centrados abajo (banner 2) */
.product-banner-cta {
    position: absolute;
    left: 0; right: 0; bottom: 6%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding-inline: 20px;
    text-align: center;
}
/* La foto de este banner es casi cuadrada: se recorta el cielo y se conserva el auto */
.product-banner-campaign .product-banner-img { object-position: center 55%; }

/* ============================================================
   PÁGINAS DE PRODUCTO — secciones de información
   ============================================================ */
.info-section { max-width: 1250px; margin-inline: auto; padding: clamp(2rem, 5vw, 4rem) 24px; }

/* Texto + imagen lado a lado (cada uno ocupa la mitad) */
.info-section-inner { display: flex; align-items: center; gap: clamp(1.5rem, 4vw, 3rem); }
.info-section-text { flex: 1 1 49%; display: flex; flex-direction: column; gap: 1.25rem; }
.info-section-media { flex: 1 1 50%; min-width: 0; }
.info-section-media img { width: 100%; height: auto; }
/* Variante: imagen a la izquierda y texto a la derecha */
.info-section-reverse .info-section-text { order: 2; }

.info-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.25;
    color: #313232;
}
/* Línea corta sobre cada título */
.info-section-title::before {
    content: '';
    display: block;
    width: 90px; height: 3px;
    background: #0a0a0a;
    margin-bottom: 1rem;
}
.info-section-text p,
.info-section-text li,
.info-section-stack p { font-size: 1rem; line-height: 1.5; color: #24292e; }
.info-section-text strong { display: block; margin-bottom: .2rem; }
.info-section-text ul { display: grid; gap: .5rem; padding-left: 1.2rem; list-style: disc; }
.info-section-stack p { max-width: 70ch; }
/* Notas al pie (aclaraciones de autonomía, tiempos de carga, etc.) */
.info-section-text .info-section-note { font-size: .8rem; line-height: 1.4; color: var(--muted); }

/* Video en bucle (sin sonido) de una función; se reproduce solo al verse */
.feature-video { position: relative; width: 100%; height: clamp(200px, 32vw, 400px); background: #000; overflow: hidden; }
.feature-video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-toggle {
    position: absolute;
    right: 12px; bottom: 12px;
    width: 40px; height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    cursor: pointer;
    transition: background-color .2s;
}
.video-toggle:hover { background: rgba(0, 0, 0, .85); }
.video-toggle::before {            /* ícono de pausa (dos barras) */
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 12px; height: 14px;
    transform: translate(-50%, -50%);
    border-left: 4px solid #fff;
    border-right: 4px solid #fff;
}
.feature-video.is-paused .video-toggle::before {   /* ícono de play (triángulo) */
    width: 0; height: 0;
    transform: translate(-35%, -50%);
    border-left: 12px solid #fff;
    border-right: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

/* Imagen a todo el ancho; si es muy alta no supera el alto de la pantalla */
.info-section-full img { display: block; width: auto; max-width: 100%; height: auto; max-height: 90vh; margin-inline: auto; }
.info-section-stack { display: flex; flex-direction: column; gap: 1.5rem; align-items: flex-start; }

/* Video de YouTube 16:9 */
.video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Botón de descarga de la ficha técnica (rojo, como en la referencia) */
.btn-download {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 1.4rem;
    background: #e81d26;
    color: #fff;
    border-radius: 5px;
    font-size: 1rem;
    transition: background-color .4s;
}
.btn-download:hover { background: var(--ink); }

/* ---------- Galería con pestañas y carrusel ---------- */
.gallery { max-width: 1250px; margin: 2.5rem auto; padding-inline: 24px; }
.gallery .info-section-title { margin-bottom: .6rem; }
.gallery-note { font-size: .9rem; color: var(--muted); margin-bottom: 1.2rem; }

/* Selector tipo píldora: un indicador oscuro se desliza entre las dos opciones */
.gallery-tabs {
    --pad: 4px;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: min(100%, 300px);
    margin: 0 auto 1rem;
    padding: var(--pad);
    border-radius: 999px;
    background: #eeeef0;
}
.gallery-tabs-thumb {
    position: absolute;
    top: var(--pad); bottom: var(--pad); left: var(--pad);
    width: calc(50% - var(--pad));
    border-radius: 999px;
    background: var(--ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.gallery-tabs[data-active="1"] .gallery-tabs-thumb { transform: translateX(100%); }
.gallery-tab {
    position: relative;               /* por encima del indicador */
    padding: .65rem 1rem;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: color .3s ease;
}
.gallery-tab:hover { color: var(--ink); }
.gallery-tab[aria-selected="true"] { color: #fff; }

/* Carrusel "peek": la foto activa va centrada y grande, las vecinas se asoman
   a los lados más pequeñas y atenuadas. */
.carousel { --slide-w: min(760px, 72vw); position: relative; }
.carousel[hidden] { display: none; }
.carousel-track {
    position: relative;               /* referencia para calcular el centrado */
    display: flex;
    gap: 16px;
    padding: 1rem calc(50% - var(--slide-w) / 2);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
    flex: 0 0 var(--slide-w);
    padding: 0;
    border: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #eee;
    cursor: zoom-in;
    scroll-snap-align: center;
    transform: scale(.86);
    opacity: .45;
    transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .45s ease;
}
.carousel-slide.is-active { transform: scale(1); opacity: 1; box-shadow: 0 18px 40px rgba(0, 0, 0, .18); }
/* Proporción de las fotos: 4/3 por defecto; con fotos 16:9 se indica en el carrusel
   (style="--slide-ratio: 16 / 9") para no recortarlas. */
.carousel-slide img { display: block; width: 100%; aspect-ratio: var(--slide-ratio, 4 / 3); object-fit: cover; }

/* Barra inferior: flecha · contador · progreso · flecha */
.carousel-bar { display: flex; align-items: center; gap: 1rem; max-width: 560px; margin: 1rem auto 0; padding-inline: 12px; }
.carousel-counter { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.carousel-counter strong { color: var(--ink); font-size: 1rem; }
.carousel-progress { flex: 1; height: 3px; border-radius: 3px; background: #ddd; overflow: hidden; }
.carousel-progress span { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 3px; transition: width .35s ease; }

.carousel-arrow {
    position: relative;
    flex: none;
    width: 44px; height: 44px;
    border: 1px solid #cfcfcf;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: background-color .2s, border-color .2s;
}
.carousel-arrow:hover { background: var(--ink); border-color: var(--ink); }
.carousel-arrow::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 9px; height: 9px;
    border-top: 2px solid var(--ink);
    border-right: 2px solid var(--ink);
    transition: border-color .2s;
}
.carousel-arrow:hover::before { border-color: #fff; }
.carousel-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.carousel-next::before { transform: translate(-70%, -50%) rotate(45deg); }

/* Visor a pantalla completa (se crea desde main.js al ampliar una foto) */
.lightbox {
    width: 100vw; height: 100vh;
    height: 100dvh;                   /* en móvil descuenta la barra del navegador */
    max-width: none; max-height: none;
    margin: 0; padding: 0;
    border: 0;
    overflow: hidden;                 /* sin scroll dentro del visor */
    background: transparent;
    color: #fff;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .94); }
/* La celda de la cuadrícula tiene tamaño fijo (minmax(0, 1fr)): así el max-height
   en % de la foto se calcula contra el espacio disponible y nunca lo supera. */
.lightbox-stage {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    place-items: center;
    width: 100%; height: 100%;
    padding: 4rem 4.5rem;
}
.lightbox-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lightbox-counter { position: absolute; top: 1.2rem; left: 1.5rem; font-size: .9rem; opacity: .85; font-variant-numeric: tabular-nums; }
.lightbox-btn {
    position: absolute;
    width: 48px; height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
    transition: background-color .2s;
}
.lightbox-btn:hover { background: rgba(255, 255, 255, .28); }
.lightbox-btn::before { content: ''; position: absolute; top: 50%; left: 50%; }
.lightbox-close { top: 1rem; right: 1.2rem; }
.lightbox-close::before { content: '✕'; transform: translate(-50%, -50%); font-size: 1.1rem; }
.lightbox-prev, .lightbox-next { top: 50%; margin-top: -24px; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }
.lightbox-prev::before, .lightbox-next::before { width: 10px; height: 10px; border-top: 2px solid #fff; border-right: 2px solid #fff; }
.lightbox-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.lightbox-next::before { transform: translate(-70%, -50%) rotate(45deg); }

/* ============================================================
   PÁGINA DE CONCESIONARIOS
   ============================================================ */
/* Banner más bajo que el de los modelos (la referencia lo limita a 718 px) */
.product-banner-short .product-banner-img { aspect-ratio: auto; height: min(56.25vw, 718px); }

/* Título + frase sobre el banner, a la izquierda y sobre la zona oscura del piso */
.page-hero-text {
    position: absolute;
    left: 12%; top: 52%;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 15px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
.page-hero-title { font-size: 1.5rem; line-height: 1.2; font-weight: 700; }
.page-hero-tagline { font-size: 1.2rem; padding-left: 15px; border-left: 2px solid #fff; line-height: 1.6; }

.dealers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 960px;
    margin: 3rem auto;
    padding-inline: 24px;
}
.dealer-card { border: 1px solid rgba(0, 0, 0, .2); border-radius: 10px; padding: 2.5rem; }
.dealer-title { font-size: 1.5rem; margin-bottom: 1rem; }
.dealer-line { display: flex; align-items: center; gap: 8px; margin-top: 1rem; line-height: 1.5; }
.dealer-line img { flex: none; width: 20px; height: auto; }
.dealer-line a:hover { color: var(--byd-red); }
.dealer-divider { border: 0; border-bottom: 1px solid rgba(0, 0, 0, .2); margin: 1rem 0; }
.dealer-hours { display: flex; flex-direction: column; gap: 20px; margin-bottom: 1.5rem; }
.dealer-hours-row { display: flex; flex-direction: column; gap: 2px; }
.dealer-hours dt { font-weight: 600; }
.dealer-map {
    display: block;
    padding: .5rem;
    text-align: center;
    color: #fff;
    background: #313232;
    transition: background-color .3s;
}
.dealer-map:hover { background: #161616; }

/* ============================================================
   PÁGINAS LEGALES (política de datos, términos)
   ============================================================ */
.legal-hero { background: var(--surface); color: #fff; text-align: center; padding: clamp(2.5rem, 7vw, 4.5rem) 20px; }
.legal-hero-title { font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 700; line-height: 1.15; }
.legal-hero-tagline { margin-top: .6rem; opacity: .8; font-size: 1.05rem; }

.error-links { text-align: center; padding: 3rem 20px 4rem; }
.error-links p { margin-bottom: 1.2rem; }

.legal-doc { max-width: 860px; margin: 3rem auto; padding-inline: 24px; color: #24292e; line-height: 1.65; }
.legal-title { font-size: 1.6rem; line-height: 1.3; margin-bottom: 1.5rem; color: #313232; }
.legal-title::before { content: ''; display: block; width: 90px; height: 3px; background: #0a0a0a; margin-bottom: 1rem; }
.legal-heading { font-size: 1.15rem; margin: 2.2rem 0 .7rem; color: #313232; }
.legal-doc p { margin-bottom: 1rem; }
.legal-doc ul { margin: 0 0 1rem; padding-left: 1.4rem; list-style: disc; }
.legal-doc li { margin-bottom: .4rem; }
.legal-doc a { text-decoration: underline; }
.legal-doc a:hover { color: var(--byd-red); }

/* ============================================================
   PÁGINA "COTICE SU BYD" (formulario)
   ============================================================ */
.quote {
    position: relative;
    display: flex;
    align-items: center;
    min-height: min(calc(100svh - 56px), 900px);
    padding-block: 3rem;
    background: #1a1a1a;
    overflow: hidden;
}
.quote-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 75% center; }

/* Variante con la tarjeta a la derecha (cotizar-ti7.html): el auto queda visible a la izquierda de la foto */
.quote-right { justify-content: flex-end; }
.quote-right .quote-bg { object-position: 30% center; }
.quote-right .quote-card { margin-left: 0; margin-right: clamp(16px, 3vw, 56px); }
@media (max-width: 767px) {
    /* En el celular la foto vertical se ve completa arriba y el formulario queda debajo, sin taparla */
    .quote.quote-right { flex-direction: column; align-items: stretch; padding-block: 0 2rem; }
    .quote-right picture { display: block; width: 100%; }
    .quote-right .quote-bg { position: static; height: auto; }
    .quote-right .quote-card { margin: 1.5rem auto 0; }
}

.quote-card {
    position: relative;
    z-index: 1;
    width: min(480px, calc(100% - 32px));
    margin-left: clamp(16px, 10vw, 160px);
    background: rgba(33, 34, 35, .93);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 12px;
    overflow: hidden;
    color: #fff;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.quote-card-head { background: #3d4042; padding: 14px 32px; }
.quote-title { font-size: 1.35rem; font-weight: 700; line-height: 1.25; }
.quote-card-body { padding: 24px 32px 32px; }
.quote-intro { font-size: .92rem; opacity: .85; margin-bottom: 1.4rem; }

.field { margin-bottom: 1rem; }
.field > label { display: block; font-size: .85rem; color: #f0f0f1; margin-bottom: .4rem; }
.quote-form input[type="text"],
.quote-form input[type="email"],
.quote-form input[type="tel"],
.quote-form select {
    width: 100%;
    padding: .8rem .9rem;
    font: inherit;
    font-size: .95rem;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid transparent;
    border-bottom-color: rgba(255, 255, 255, .55);
    border-radius: 6px 6px 0 0;
    transition: background-color .2s, border-color .2s;
}
.quote-form input::placeholder { color: rgba(255, 255, 255, .55); }
.quote-form input:focus-visible,
.quote-form select:focus-visible { outline: 2px solid rgba(255, 255, 255, .85); outline-offset: 2px; background: rgba(255, 255, 255, .12); }
.quote-form [aria-invalid="true"] { border-bottom-color: #ff8a8a; }
.quote-form select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.4rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    background-size: 12px 8px;
    cursor: pointer;
}
.quote-form select:invalid { color: rgba(255, 255, 255, .55); }
.quote-form select option { color: #1a1a1a; background: #fff; }

.field-error { min-height: 0; margin-top: .3rem; font-size: .8rem; color: #ff9d9d; }
.field-error:empty { display: none; }

.field-check { margin-bottom: .8rem; }
.check { display: grid; grid-template-columns: 18px 1fr; gap: .7rem; font-size: .85rem; line-height: 1.45; color: #e8e8e9; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: #fff; cursor: pointer; }
.check a { text-decoration: underline; }
.check em { opacity: .7; font-style: normal; }

.form-status { margin: .6rem 0 1rem; padding: .8rem 1rem; font-size: .9rem; background: rgba(255, 138, 138, .14); border-left: 3px solid #ff8a8a; border-radius: 4px; }
.form-status button { margin-top: .6rem; }
.quote-submit { width: 100%; margin-top: .6rem; }
.quote-submit:disabled { opacity: .6; cursor: progress; }

/* Páginas de resultado del formulario (gracias.html y error-envio.html) */
.result { max-width: 640px; margin: 0 auto; padding: 3rem 24px 4rem; text-align: center; }
.result p { line-height: 1.6; margin-bottom: 1rem; color: #24292e; }
.result-icon {
    width: 64px; height: 64px;
    margin: 0 auto 1.5rem;
    display: grid; place-items: center;
    border: 2px solid var(--surface);
    border-radius: 50%;
    font-size: 1.9rem;
    color: var(--surface);
}
.result .btn-group { margin-top: 1.6rem; }
.result-contacts { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: .95rem; }
.result-contacts strong { display: block; margin-bottom: .2rem; }
.result-contacts a { text-decoration: underline; }
.result-contacts a:hover { color: var(--byd-red); }
.result-contacts ul { display: grid; gap: 1rem; margin-top: 1rem; }

/* Campo trampa para bots: fuera de pantalla, no se muestra a nadie */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ============================================================
   BATERÍA BLADE
   ============================================================ */
.blade {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    background: var(--bg-soft);
}
.blade-img-desktop { display: block; width: 100%; height: 100%; object-fit: cover; }
.blade-img-mobile { display: none; }
.blade-content { padding: clamp(2rem, 5vw, 5rem); }
.blade-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.15;
}
.blade-title span { color: var(--surface); }
.blade-list { display: grid; gap: 1.2rem; }
.blade-list li { display: flex; gap: .9rem; align-items: flex-start; }
.blade-num {
    flex: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--surface);   /* gris del sitio (antes rojo) */
    color: #fff;
    display: grid; place-items: center;
    font-weight: 700;
}
.blade-list h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.blade-list p { color: var(--muted); font-size: .92rem; }

/* ============================================================
   CTA FINAL
   ============================================================ */
.cta {
    background: var(--ink);
    color: #fff;
    text-align: center;
    padding: clamp(3rem, 7vw, 5rem) 20px;
}
.cta-title { font-size: clamp(1.6rem, 3.5vw, 2.6rem); font-weight: 700; margin-bottom: .8rem; }
.cta-text { max-width: 62ch; margin: 0 auto 1.8rem; opacity: .92; font-size: 1.05rem; }

/* Cierre de las páginas de modelo: misma sección en todas, con la foto del modelo
   de fondo y un mensaje propio. La foto se indica con --cta-bg (y --cta-bg-mobile). */
.cta-photo {
    background:
        linear-gradient(rgba(10, 10, 10, .72), rgba(10, 10, 10, .72)),
        var(--cta-bg) center / cover no-repeat;
    padding-block: clamp(4rem, 9vw, 7rem);
}
.cta-photo .cta-title { max-width: 22ch; margin-inline: auto; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--surface); color: #cfcfcf; font-size: .88rem; }
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2rem;
    padding: 3.5rem 0 2.5rem;
}
.footer-about p { color: #9a9a9a; font-size: .84rem; margin: 1rem 0; }
.footer-title {
    color: #fff;
    font-size: .8rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.footer-col ul { display: grid; gap: .55rem; }
.footer-col a:hover { color: var(--byd-red); }

.social-links { display: flex; gap: .8rem; }
.social-links a {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    display: grid; place-items: center;
}
.social-links a:hover { background: var(--byd-red); }
.social-links img { width: 18px; height: 18px; filter: invert(1); }

.footer-disclaimer { font-size: .72rem; color: #a8a8a8; padding-bottom: 1.5rem; line-height: 1.6; }
.footer-legal {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: 1.4rem 0;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: .78rem;
    color: #b0b0b0;
}
.footer-legal a:hover { color: #fff; }

/* ============================================================
   BOTONES FLOTANTES LATERALES
   ============================================================ */
.floating-buttons {
    position: fixed;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: .7rem;
    z-index: 90;
}
.float-btn {
    width: 48px; height: 48px;
    display: grid; place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    transition: transform .2s;
}
.float-btn:hover { transform: scale(1.08); }
.float-wa { background: var(--wa-green); }
.float-red { background: var(--byd-red); }
.float-ico { width: 24px; height: 24px; flex: none; fill: currentColor; }
.float-red .float-ico { fill: none; } /* los íconos rojos son de línea (stroke) */

/* Submenú de WhatsApp (se abre sobre el botón, alineado a la derecha) */
.wa-widget { position: relative; }
.wa-popup {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: 250px;
    max-width: calc(100vw - 40px);
    padding: 1rem;
    background: #fff;
    color: var(--ink);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all .2s ease;
}
.wa-widget.open .wa-popup { opacity: 1; visibility: visible; transform: none; }
.wa-popup-title { font-size: .85rem; font-weight: 700; margin-bottom: .6rem; }
.wa-popup-city {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: .6rem 0 .2rem;
}
.wa-line { display: flex; align-items: center; gap: .8rem; padding: .45rem .3rem; border-radius: 8px; }
.wa-line:hover { background: var(--bg-soft); }
.wa-line-ico {
    flex: none;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--wa-green);
    color: #fff;
    display: grid; place-items: center;
}
.wa-line-ico .float-ico { width: 18px; height: 18px; }
.wa-line strong { display: block; font-size: .9rem; line-height: 1.2; }
.wa-line small { color: var(--muted); font-size: .75rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991px) {
    .header-actions { display: none; }
    .nav-toggle { display: flex; }
    .main-nav {
        position: fixed;
        top: 0; right: -100%;
        width: min(340px, 85vw);
        height: 100vh;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        padding: 90px 1.5rem 2rem;
        box-shadow: var(--shadow);
        transition: right .3s ease;
        overflow-y: auto;
    }
    body.nav-open .main-nav { right: 0; }
    body.nav-open .nav-toggle span { background: var(--ink); }   /* la X se ve sobre el panel blanco */
    body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
    body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .nav-list { flex-direction: column; gap: 0; align-items: stretch; width: 100%; padding-left: 0; }
    .nav-item { border-bottom: 1px solid var(--line); }
    .nav-item > a { padding: .9rem 0; justify-content: space-between; color: var(--ink); }
    .dropdown {
        position: static;
        transform: none;
        opacity: 1; visibility: visible;
        min-width: 0;
        padding: 0 0 .5rem 1rem;
        background: transparent;
        display: none;
    }
    .dropdown a { color: var(--ink); }
    .dropdown a:hover { background: var(--bg-soft); }
    .has-dropdown.open .dropdown { display: block; transform: none; }
    .has-dropdown > a::after { margin-left: auto; }
}

@media (max-width: 767px) {
    /* Header más compacto en móvil: logos pequeños */
    .header-inner { min-height: 48px; padding-inline: 16px; }
    .brand { gap: .6rem; }
    .brand-logo-byd { height: 16px; }
    .brand-logo-codinova { height: 14px; }
    .nav-toggle { margin-right: -8px; }
    .main-nav { padding-top: 72px; }
    .product-banner-img { aspect-ratio: auto; }
    .info-section-inner { flex-direction: column; align-items: stretch; }
    .info-section-reverse .info-section-text { order: 0; } /* en móvil siempre texto arriba */
    .info-section-title { font-size: 1.4rem; }
    .carousel { --slide-w: 78vw; }
    .cta-photo { background-image: linear-gradient(rgba(10, 10, 10, .72), rgba(10, 10, 10, .72)), var(--cta-bg-mobile, var(--cta-bg)); }
    .carousel-bar { gap: .7rem; }
    .lightbox-stage { padding: 4rem 1rem; }
    .lightbox-prev { left: .4rem; }
    .lightbox-next { right: .4rem; }
    /* Formulario en móvil: la tarjeta ocupa el ancho y la foto queda detrás */
    .quote { align-items: flex-start; padding-block: 1.5rem; }
    .quote-card { margin-inline: auto; }
    .quote-card-head, .quote-card-body { padding-inline: 20px; }
    /* Concesionarios en móvil: banner vertical completo y título centrado */
    .product-banner-short .product-banner-img { height: auto; }
    .page-hero-text { left: 0; right: 0; top: 30%; flex-direction: column; gap: .6rem; text-align: center; }
    .page-hero-tagline { padding-left: 0; border-left: 0; }
    .dealer-card { padding: 1.8rem; }
    /* Móvil (banner vertical): cifras apiladas con una raya horizontal corta entre ellas */
    .product-banner-title { top: 12%; }
    .product-banner-stats { flex-direction: column; align-items: center; gap: 1rem; bottom: 22%; }
    .product-stat + .product-stat { padding-left: 0; padding-top: 1rem; }
    .product-stat + .product-stat::before { left: 50%; right: auto; bottom: auto; width: 60px; height: 2px; transform: translateX(-50%); }
    /* Iconos en móvil: centrados y más grandes. El botón de cada banner/modelo sube para
       quedar por encima de ellos (alto de iconos ≈ ancho ÷ 3.4, más el aire de abajo). */
    .model-features { left: 0; right: 0; bottom: 14px; }
    .model-features img { margin-inline: auto; max-width: min(70vw, 300px); }
    .product-banner-cta { bottom: calc(min(70vw, 300px) / 3.4 + 2.5rem); }
    .hero-banner:has(.model-features) .model-overlay,
    .model:has(.model-features) .model-overlay { padding-bottom: calc(min(70vw, 300px) / 3.4 + 2.5rem); }
    .hero-img-desktop { display: none; }
    .hero-img-mobile { display: block; }
    .model-img-desktop { display: none; }
    .model-img-mobile { display: block; }
    .blade { grid-template-columns: 1fr; }
    .blade-img-desktop { display: none; }
    .blade-img-mobile { display: block; width: 100%; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }
}

@media (max-width: 479px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   PÁGINA "SOBRE NOSOTROS"
   ============================================================ */
/* En esta foto el título va más arriba, sobre el cielo, para no tapar los autos */
.page-hero-text-about { left: 18%; top: 36%; }

.about-line { display: block; width: 90px; height: 3px; background: #0a0a0a; }
.about-line-red { background: #e81d26; margin-inline: auto; }

.about-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    max-width: 1250px;
    margin: 0 auto;
    padding: 6rem 24px;
}
.about-intro-text { display: flex; flex-direction: column; gap: 1.25rem; }
.about-intro-text p { text-align: justify; line-height: 1.55; }
.about-title { font-size: 1.75rem; line-height: 1.25; font-weight: 600; color: #0a0a0a; margin-top: .4rem; }
.about-intro-img { width: 100%; height: auto; display: block; }

.about-values { max-width: 1250px; margin: 0 auto; padding: 3rem 24px 5rem; }
.about-values-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem 4rem; margin-top: 2.5rem; padding-inline: 1.5rem; }
.about-value { display: flex; gap: 1.25rem; align-items: flex-start; }
.about-value-icon { width: 60px; height: 60px; flex-shrink: 0; border-radius: 8px; }
.about-value h3 { font-size: 1.5rem; font-weight: 500; line-height: 1.2; margin-bottom: .6rem; }
.about-value p { font-size: .95rem; line-height: 1.55; color: #333; }

.about-tech-head, .about-cta {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem;
    max-width: 880px; margin: 0 auto; padding: 4rem 24px 2rem;
}
.about-eyebrow { font-size: 1rem; font-weight: 700; color: #313232; }
.about-subtitle { font-size: 1.75rem; line-height: 1.25; font-weight: 600; color: #313232; }
.about-lead { line-height: 1.55; }

.about-tech {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    max-width: 1250px;
    margin: 0 auto;
    padding: 3rem 24px 4rem;
}
.about-tech-text { display: flex; flex-direction: column; gap: 1.6rem; }
.about-tech-text h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.about-tech-text p { line-height: 1.55; }
.about-tech-img { width: 100%; max-height: 500px; object-fit: cover; display: block; }

.about-cta { padding-bottom: 6rem; }
.about-cta-buttons { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: center; margin-top: .6rem; }
.about-cta-btn { background: var(--surface); color: #fff; padding: .8rem 1.1rem; font-size: .9rem; text-decoration: none; transition: background-color .2s; }
.about-cta-btn:hover { background: #4a4b4b; }

@media (max-width: 991px) {
    .about-intro, .about-tech { grid-template-columns: 1fr; }
    .about-intro { padding-block: 4rem; }
}
@media (max-width: 767px) {
    .about-values-grid { grid-template-columns: 1fr; padding-inline: 0; }
    .about-intro-text p { text-align: left; }
    .about-title, .about-subtitle { font-size: 1.5rem; }
    .page-hero-text-about { left: 0; top: 30%; }
}

/* ============================================================
   PÁGINA "GARANTÍAS"
   ============================================================ */
.warranty { max-width: 1000px; margin: 0 auto; padding: 3rem 24px 5rem; }
.warranty-title { font-size: 1.6rem; line-height: 1.3; font-weight: 700; color: #313232; margin-bottom: 2.2rem; }
.warranty-list { list-style: none; display: flex; flex-direction: column; gap: 1.8rem; padding: 0; }
.warranty-item { display: flex; align-items: center; gap: 1.4rem; line-height: 1.55; }
.warranty-icon { width: 64px; height: 64px; flex-shrink: 0; object-fit: contain; }
.warranty-sublist { list-style: none; padding: 0; margin-top: .3rem; }
.warranty-sublist li::before { content: '•'; margin-right: .5rem; }
.warranty-note { margin-top: 2.4rem; font-size: .8rem; line-height: 1.5; color: var(--muted); }

@media (max-width: 767px) {
    /* La portada de garantías usa la misma foto en móvil: se hace más alta para que el título respire */
    .product-banner-warranty .product-banner-img { aspect-ratio: 4 / 3; object-position: 70% center; }
    .warranty-title { font-size: 1.35rem; }
    .warranty-item { gap: 1rem; }
    .warranty-icon { width: 52px; height: 52px; }
}
