/*
  styles.css — Formulario de financiación en tienda · Moviraider
  Tokens y componentes según la identidad de marca (skill diseno-moviraider):
  naranja #FD5E15 de acción, tinta #121212, todo lo interactivo en píldora,
  tarjetas en 16/24px sin sombra, Poppins 700/800 en mayúsculas para titulares
  y botones, Inter 400 para cuerpo. Mobile-first.
*/

/* ---------------------------------------------------------------- *
 * Tokens
 * ---------------------------------------------------------------- */
:root {
  --mv-orange: #FD5E15;
  --mv-orange-90: #E0500F;
  --mv-orange-10: #FFE7DB;
  --mv-ink: #121212;
  --mv-ink-70: #4A4A4A;
  --mv-ink-20: #D9D9D9;
  --mv-ink-08: #F2F2F2;
  --mv-ink-04: #F7F7F7;
  --mv-paper: #FFFFFF;

  --r-pill: 999px;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 8px;

  --sh-sm: 0 2px 8px rgba(18, 18, 18, .06);
  --sh-md: 0 8px 24px rgba(18, 18, 18, .08);

  --focus-ring: 0 0 0 .25rem rgba(253, 94, 21, .25);

  --ease-brand: cubic-bezier(.2, .7, .2, 1);
  --dur-base: 200ms;

  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --max-width: 1320px;
  --form-width: 640px;
}

/* ---------------------------------------------------------------- *
 * Reset ligero
 * ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--mv-paper);
  color: var(--mv-ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--font-heading); color: var(--mv-ink); }

p { margin: 0; }

a { color: var(--mv-orange); }

button { font-family: inherit; }

/* Foco visible siempre: nunca quitar el outline sin sustituirlo */
:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--r-sm);
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- *
 * Patrón eyebrow + titular
 * ---------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1.68px;
  text-transform: uppercase;
  color: var(--mv-orange);
  margin: 0 0 .5rem;
}

/* ---------------------------------------------------------------- *
 * Cabecera
 * ---------------------------------------------------------------- */
.mv-header {
  background: var(--mv-ink);
  padding: 1rem 0;
}

.mv-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
}

.mv-header__logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .5px;
  color: var(--mv-paper);
}

.mv-header__bolt { color: var(--mv-orange); }

.mv-header__tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, .7);
}

/* ---------------------------------------------------------------- *
 * Layout principal
 * ---------------------------------------------------------------- */
/* padding-bottom generoso: hueco para que la barra de acción flotante fija
   (ver .step-nav) no tape el último elemento de listas largas. */
.mv-main { padding: 2rem 0 6.5rem; }

.mv-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.mv-title {
  font-weight: 800;
  font-size: 23.4px;
  line-height: 1.1;
  letter-spacing: -.4px;
  margin-bottom: .75rem;
  max-width: var(--form-width);
}

.mv-lead {
  color: var(--mv-ink-70);
  max-width: var(--form-width);
  margin-bottom: 1.75rem;
}

#financing-form { max-width: var(--form-width); }

/* ---------------------------------------------------------------- *
 * Línea de pasos — mismo espíritu que el `.mv-prog` real de
 * moviraider.es/shop (carrito → checkout): tarjeta blanca con borde sutil,
 * puntos conectados por una línea que se rellena de naranja al completarse,
 * punto actual con anillo, porcentaje a la derecha. Los pasos completados
 * son botones reales: tocarlos vuelve a ese paso.
 * ---------------------------------------------------------------- */
.fin-steps-wrap {
  max-width: var(--form-width);
  background: var(--mv-paper);
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-md);
  padding: 1rem 1.1rem .85rem;
  margin-bottom: 1.75rem;
}

.fin-steps__row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.fin-steps__list {
  flex: 1;
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.fin-steps__step {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* "stretch" (antes "center") para que la etiqueta ocupe todo el ancho de
     su columna y pueda partirse en dos líneas si la palabra no cabe entera
     — si no, con ancho libre nunca envuelve y una palabra suelta como
     "Vehículo" se desborda sobre la columna vecina. El punto se recentra
     aparte con align-self en .fin-steps__dot. */
  align-items: stretch;
  gap: .4rem;
  position: relative;
  min-width: 0;
}

.fin-steps__step::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 50%;
  width: 100%;
  height: 3px;
  background: var(--mv-ink-20);
  border-radius: 2px;
}

.fin-steps__step:first-child::before { display: none; }

.fin-steps__step.is-done::before { background: var(--mv-orange); }

.fin-steps__link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: .4rem;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  width: 100%;
}

.fin-steps__dot {
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  background: var(--mv-paper);
  border: 2px solid var(--mv-ink-20);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  color: var(--mv-paper);
  transition: border-color var(--dur-base) var(--ease-brand), background var(--dur-base) var(--ease-brand), box-shadow var(--dur-base) var(--ease-brand);
}

.fin-steps__dot svg { width: 13px; height: 13px; }

.fin-steps__step.is-done .fin-steps__dot { background: var(--mv-orange); border-color: var(--mv-orange); }

.fin-steps__step.is-now .fin-steps__dot {
  border-color: var(--mv-orange);
  border-width: 2.5px;
  box-shadow: 0 0 0 5px rgba(253, 94, 21, .16);
}

.fin-steps__now-core { width: 9px; height: 9px; border-radius: var(--r-pill); background: var(--mv-orange); }

.fin-steps__label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--mv-ink-70);
  text-align: center;
  line-height: 1.2;
  min-width: 0;
  /* Con 5 pasos activos y 320px de ancho, una etiqueta de una sola palabra
     ("Vehículo", "Resumen"...) no siempre cabe entera en su columna. Antes
     se desbordaba sobre la columna vecina; ahora se parte en dos líneas,
     con guion si el navegador lo soporta (hyphens respeta el lang="es"
     del documento). */
  overflow-wrap: break-word;
  hyphens: auto;
}

.fin-steps__step.is-now .fin-steps__label { color: var(--mv-ink); font-weight: 700; }

.fin-steps__link:focus-visible { outline: none; }
.fin-steps__link:focus-visible .fin-steps__dot { box-shadow: var(--focus-ring); }

.fin-steps__pct {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--mv-orange);
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- *
 * Pasos
 * ---------------------------------------------------------------- */
.step { animation: step-in var(--dur-base) var(--ease-brand); }

@keyframes step-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.step__title {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.36px;
  margin-bottom: .4rem;
}

.step__subtitle {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.2px;
  margin: 1.25rem 0 .75rem;
}

.step__hint {
  color: var(--mv-ink-70);
  font-size: 14px;
  margin-bottom: 1.25rem;
}

.step__empty {
  color: var(--mv-ink-70);
  font-size: 14px;
  padding: 1rem;
  background: var(--mv-ink-04);
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-md);
  margin: .75rem 0;
}

/* Las dos frases de la ayuda de geolocalización denegada llevan el mismo
   peso a propósito: ninguna es "la principal". */
.step__empty p + p { margin-top: .6rem; }

/* GET /financiar/inicio sin respaldo: el botón de reintentar necesita algo
   más de aire que el texto normal del aviso. */
#boot-error .btn { margin-top: .75rem; }

.field__optional {
  font-family: var(--font-body);
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--mv-ink-70);
}

/* ---------------------------------------------------------------- *
 * Selector de tienda: tienda detectada (banner oscuro) + lista completa
 * agrupada por ciudad. Ver README para el porqué de este patrón (dos niveles
 * país→ciudad de moviraider.es/nuestras-tiendas-fisicas, adaptado a un único
 * país con selección directa por tarjeta).
 * ---------------------------------------------------------------- */
.store-nearest {
  background: var(--mv-ink);
  border-radius: var(--r-md);
  padding: 1.1rem 1.25rem;
  margin: .25rem 0 1.5rem;
}

.store-nearest .eyebrow { margin-bottom: .6rem; }

.store-nearest__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.store-nearest__info { min-width: 0; }

.store-nearest__name {
  color: var(--mv-paper);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  margin: 0;
}

.store-nearest__address {
  color: rgba(255, 255, 255, .7);
  font-size: 13px;
  margin: .3rem 0 0;
}

.store-nearest__distance {
  color: var(--mv-orange);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  white-space: nowrap;
  margin: 0;
}

.store-nearest__change {
  display: inline-block;
  margin-top: .9rem;
  color: rgba(255, 255, 255, .85);
  font-size: 13px;
  text-decoration: underline;
}

.store-nearest__change:hover { color: var(--mv-paper); }

/* Botón manual de geolocalización: mismo componente .btn--ghost de siempre,
   solo con el espaciado propio de aparecer suelto en mitad del paso. */
.store-geolocate-btn { display: flex; margin: .25rem 0 1.25rem; }

/* Banner de empate: varias tiendas dentro del margen de error del GPS. */
.store-nearest__tie-text {
  color: var(--mv-paper);
  font-size: 14px;
  margin: 0 0 .9rem;
}

.store-tie__options {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.store-tie__option {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--r-md);
  padding: .75rem 1rem;
  min-height: 48px;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--dur-base) var(--ease-brand), border-color var(--dur-base) var(--ease-brand);
}

.store-tie__option:hover {
  background: rgba(255, 255, 255, .1);
  border-color: var(--mv-orange);
}

.store-tie__name {
  color: var(--mv-paper);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
}

.store-tie__address {
  color: rgba(255, 255, 255, .7);
  font-size: 12.5px;
}

.store-group + .store-group { margin-top: .6rem; }

/* Acordeón por ciudad — mismo patrón que moviraider.es/nuestras-tiendas-fisicas:
   plegado por defecto (pensado para 80 tiendas), el nombre de la ciudad
   siempre a la vista, un toque para ver sus tarjetas. */
.store-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--mv-ink-04);
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-md);
  padding: .9rem 1.1rem;
  min-height: 48px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.store-group__title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--mv-ink);
}

.store-group__chevron {
  width: 9px; height: 9px;
  border-right: 2px solid var(--mv-ink-70);
  border-bottom: 2px solid var(--mv-ink-70);
  transform: rotate(45deg);
  transition: transform var(--dur-base) var(--ease-brand);
  flex-shrink: 0;
}

.store-group__toggle[aria-expanded="true"] .store-group__chevron { transform: rotate(-135deg); }

.store-group__toggle:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.store-cards {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  margin-top: .6rem;
}

.store-card {
  display: flex;
  align-items: center;
  gap: .85rem;
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-md);
  padding: .9rem 1rem;
  min-height: 48px;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-brand), background var(--dur-base) var(--ease-brand);
}

.store-card:hover { background: var(--mv-ink-04); }

.store-card.is-selected {
  border-color: var(--mv-orange);
  background: var(--mv-orange-10);
}

/* Tienda visible pero no vendible ahora mismo (p. ej. bloqueo fiscal). Sigue
   a la vista siempre —nunca desaparece— pero no se puede elegir ni pulsar. */
.store-card--disabled {
  cursor: not-allowed;
}

.store-card--disabled:hover { background: none; }

.store-card__blocked {
  color: var(--mv-ink-70);
  font-size: 12px;
  margin-top: .15rem;
}

.store-card__radio {
  accent-color: var(--mv-orange);
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  margin: 0;
}

.store-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.store-card__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
}

.store-card__address {
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--mv-ink-70);
}

.store-card__distance {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13px;
  color: var(--mv-orange);
  white-space: nowrap;
  flex: 0 0 auto;
  text-align: right;
}

/* ---------------------------------------------------------------- *
 * Campos de formulario
 * ---------------------------------------------------------------- */
.field { margin-bottom: 1.25rem; }

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.field label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .3px;
  margin-bottom: .4rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--mv-ink-20);
  background: var(--mv-paper);
  color: var(--mv-ink);
  font-family: var(--font-body);
  font-size: 16px;
  padding: .75rem 1.1rem;
  transition: border-color var(--dur-base) var(--ease-brand), box-shadow var(--dur-base) var(--ease-brand);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select {
  border-radius: var(--r-pill);
  min-height: 48px;
}

.field textarea {
  border-radius: var(--r-md);
  resize: vertical;
  min-height: 4.5rem;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--mv-orange);
  box-shadow: var(--focus-ring);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--mv-orange);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A4A4A' stroke-width='1.6' fill='none' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.1rem center;
  padding-right: 2.5rem;
}

.field select:disabled {
  background-color: var(--mv-ink-04);
  color: var(--mv-ink-70);
  cursor: not-allowed;
}

.field__error {
  color: var(--mv-orange-90);
  font-size: 13px;
  margin-top: .4rem;
}

.field__status {
  color: var(--mv-ink-70);
  font-size: 13px;
  margin-top: .5rem;
}

.field__counter {
  color: var(--mv-ink-70);
  font-size: 12px;
  text-align: right;
  margin-top: .3rem;
}

.field--checkbox {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
}

.field--checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  margin-top: .15rem;
  accent-color: var(--mv-orange);
  border-radius: var(--r-sm);
}

.field--checkbox label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  color: var(--mv-ink-70);
}

.phone-field {
  display: flex;
  align-items: center;
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-pill);
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-brand), box-shadow var(--dur-base) var(--ease-brand);
}

.phone-field:focus-within {
  border-color: var(--mv-orange);
  box-shadow: var(--focus-ring);
}

.phone-field__prefix {
  padding: .75rem 0 .75rem 1.1rem;
  color: var(--mv-ink-70);
  font-weight: 700;
  font-family: var(--font-heading);
  font-size: 14px;
}

.phone-field input {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  flex: 1;
}

.phone-field input:focus-visible { box-shadow: none !important; }

/* ---------------------------------------------------------------- *
 * Botones
 * ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: var(--r-pill);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .52px;
  text-transform: uppercase;
  text-decoration: none;
  padding: .9rem 1.75rem;
  min-height: 48px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-brand), border-color var(--dur-base) var(--ease-brand), color var(--dur-base) var(--ease-brand), opacity var(--dur-base) var(--ease-brand);
}

.btn--primary {
  background: var(--mv-orange);
  border-color: var(--mv-orange);
  color: var(--mv-paper);
}

.btn--primary:hover { background: var(--mv-orange-90); border-color: var(--mv-orange-90); }

.btn--primary:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.btn--ghost {
  background: transparent;
  border-color: var(--mv-ink-20);
  color: var(--mv-ink);
}

.btn--ghost:hover { border-color: var(--mv-ink); }

/* Barra de acción flotante (patrón de app móvil): fija abajo, aparece en
   cuanto el paso actual tiene una selección válida — para no obligar a
   bajar hasta el final de listas largas, como la de tiendas (9 hoy, 80 en
   el horizonte). `env(safe-area-inset-bottom)` la separa del indicador de
   inicio de iOS. En escritorio vuelve al flujo normal: ver breakpoint. */
.step-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap-reverse;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  margin: 0;
  padding: .85rem 16px calc(.85rem + env(safe-area-inset-bottom, 0px));
  background: var(--mv-paper);
  border-top: 1px solid var(--mv-ink-20);
  box-shadow: 0 -6px 20px rgba(18, 18, 18, .08);
  animation: step-nav-in var(--dur-base) var(--ease-brand);
}

@keyframes step-nav-in {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.step-nav .btn { flex: 1; }

.disclosure {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: none;
  color: var(--mv-orange);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .3px;
  text-transform: uppercase;
  cursor: pointer;
  padding: .5rem 0;
  margin: 1rem 0;
}

.disclosure::after {
  content: '';
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--dur-base) var(--ease-brand);
}

.disclosure[aria-expanded="true"]::after { transform: rotate(-135deg); }

.btn-more {
  display: block;
  width: 100%;
  background: var(--mv-ink-04);
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-pill);
  color: var(--mv-ink);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .3px;
  text-transform: uppercase;
  padding: .75rem 1rem;
  cursor: pointer;
  margin-top: .75rem;
  transition: background var(--dur-base) var(--ease-brand);
}

.btn-more:hover { background: var(--mv-ink-08); }

/* ---------------------------------------------------------------- *
 * Tarjetas de vehículo (Destacados)
 * ---------------------------------------------------------------- */
.vehicle-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
}

.vehicle-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--mv-paper);
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-md);
  overflow: hidden; /* la foto bleed a los bordes no debe salirse del radio de la tarjeta */
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-brand), background var(--dur-base) var(--ease-brand);
}

.vehicle-card:hover { background: var(--mv-ink-04); }

.vehicle-card.is-selected {
  border-color: var(--mv-orange);
  background: var(--mv-orange-10);
}

/* Badge del radio flotando sobre la foto de producto: es justo el caso que la skill sanciona
   para usar sombra (chip/badge flotante sobre imagen), no una sombra de tarjeta. */
.vehicle-card__input {
  position: absolute;
  top: .6rem; right: .6rem;
  z-index: 1;
  width: 20px; height: 20px;
  accent-color: var(--mv-orange);
  background: var(--mv-paper);
  border-radius: 50%;
  box-shadow: var(--sh-sm);
  margin: 0;
}

.vehicle-card__input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 50%;
}

/* Foto de producto: sin padding, a sangre en el ancho de la tarjeta, proporción fija reservada
   desde el primer render (nunca salta el layout) y fondo neutro mientras carga o si no hay foto. */
.vehicle-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--mv-ink-04);
  color: var(--mv-ink-70);
  overflow: hidden;
}

.vehicle-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* fotos de catálogo sobre fondo claro: cover recortaría el vehículo */
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-brand);
}

.vehicle-card__img.is-loaded { opacity: 1; }

.vehicle-card__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vehicle-card__fallback svg { width: 40%; height: 40%; }

.vehicle-card__body {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .75rem 1rem 1rem;
}

.vehicle-card__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
}

.vehicle-card__price {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  color: var(--mv-orange);
}

/* ---------------------------------------------------------------- *
 * Cascada de catálogo
 * ---------------------------------------------------------------- */
.catalog-cascade {
  background: var(--mv-ink-04);
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.catalog-cascade .field:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------- *
 * Vehículo seleccionado (resumen visual del paso 2)
 * ---------------------------------------------------------------- */
.vehicle-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--mv-ink);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.vehicle-selected__label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .6);
  margin-bottom: .2rem;
}

.vehicle-selected__name {
  color: var(--mv-paper);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
}

.vehicle-selected__price {
  color: var(--mv-orange);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- *
 * Lista de unidades (números de serie)
 * ---------------------------------------------------------------- */
.unit-list {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  max-height: 22rem;
  overflow-y: auto;
  padding-right: .25rem;
}

.unit-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-md);
  padding: .85rem 1rem;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-brand), background var(--dur-base) var(--ease-brand);
}

.unit-option:hover { background: var(--mv-ink-04); }

.unit-option.is-selected {
  border-color: var(--mv-orange);
  background: var(--mv-orange-10);
}

.unit-option input {
  accent-color: var(--mv-orange);
  width: 18px; height: 18px;
  flex: 0 0 18px;
}

.unit-option__serial {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.unit-option--none .unit-option__serial {
  font-weight: 400;
  color: var(--mv-ink-70);
  font-style: italic;
}

/* ---------------------------------------------------------------- *
 * Resumen final
 * ---------------------------------------------------------------- */
.summary {
  background: var(--mv-ink-04);
  border: 1px solid var(--mv-ink-20);
  border-radius: var(--r-md);
  padding: 1.25rem;
  margin: 0 0 1rem;
}

.summary__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  padding: .6rem 0;
  font-size: 14px;
}

.summary__row + .summary__row { border-top: 1px solid var(--mv-ink-20); }

.summary__row dt { color: var(--mv-ink-70); }
/* El importe nunca se parte en dos líneas, en ninguna fila: número y
   símbolo van siempre juntos. La que puede envolver, si hace falta, es
   la etiqueta de la izquierda (dt), nunca la cifra. */
.summary__row dd {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Fila del vehículo: nombre + "Cambiar vehículo" apilados a la izquierda,
   precio siempre entero a la derecha. El precio nunca se parte en dos
   líneas (numero y símbolo van pegados con nowrap); el nombre es el que
   cede y envuelve si hace falta, incluso con los más largos del catálogo. */
.summary__row--vehicle { align-items: flex-start; }

.summary__vehicle-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .35rem;
  min-width: 0;
}

.summary__vehicle-info dt {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* El total manda: fila propia, más aire, fondo tenue y la cifra en naranja
   de marca — el único acento de color de todo el bloque. Selector doble
   para pesar más que ".summary__row + .summary__row" y anular su borde
   sin recurrir a !important. */
.summary__row.summary__row--total {
  align-items: center;
  margin-top: .25rem;
  padding: .85rem .9rem;
  border-radius: var(--r-sm);
  background: var(--mv-paper);
  border-top: none;
}

.summary__row--total dt,
.summary__row--total dd {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  color: var(--mv-ink);
  white-space: nowrap;
}

.summary__row--total dd { color: var(--mv-orange); }

.summary__quote {
  font-size: 12.5px;
  color: var(--mv-ink-70);
  margin-bottom: 1.25rem;
}

/* ---------------------------------------------------------------- *
 * Diálogo de resultado (éxito / error)
 * ---------------------------------------------------------------- */
.mv-dialog {
  border: none;
  border-radius: var(--r-lg);
  padding: 1.75rem;
  max-width: 420px;
  width: calc(100% - 2rem);
  box-shadow: var(--sh-md);
}

.mv-dialog::backdrop {
  background: rgba(18, 18, 18, .55);
}

.mv-dialog__title {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -.3px;
  margin: .25rem 0 .75rem;
}

#dialog-error-message {
  color: var(--mv-ink-70);
  font-size: 14px;
  margin-bottom: 1.25rem;
}

#dialog-redirect-text {
  color: var(--mv-ink-70);
  font-size: 14px;
  margin-bottom: 1.25rem;
}

.mv-dialog__actions {
  display: flex;
  flex-direction: column;
  gap: .75rem;
}

/* ---------------------------------------------------------------- *
 * Pie
 * ---------------------------------------------------------------- */
.mv-footer {
  padding: 1.5rem 0;
  text-align: center;
  color: var(--mv-ink-70);
  font-size: 12px;
  border-top: 1px solid var(--mv-ink-20);
}

/* ---------------------------------------------------------------- *
 * Botón de envío en carga
 * ---------------------------------------------------------------- */
.btn.is-loading { position: relative; color: transparent; }

.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: var(--mv-paper);
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}

@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- *
 * Breakpoints — escritorio
 * ---------------------------------------------------------------- */
@media (min-width: 768px) {
  .mv-container { padding: 0 24px; }
  .mv-main { padding: 3rem 0 5rem; }
  .mv-title { font-size: 32px; }
  .field-row { grid-template-columns: 1fr 1fr; }
  .vehicle-cards { grid-template-columns: repeat(3, 1fr); }

  /* En escritorio no hace falta flotante: el formulario cabe sin apenas
     scroll y una barra fija superpuesta estorbaría más que ayudaría. Vuelve
     al flujo normal, siempre visible una vez el paso está satisfecho. */
  .step-nav {
    flex-wrap: nowrap;
    position: static;
    margin-top: 2rem;
    padding: 0;
    background: none;
    border-top: none;
    box-shadow: none;
    animation: none;
  }

  .mv-dialog__actions { flex-direction: row-reverse; }
  .mv-dialog__actions .btn { flex: 1; }
}

@media (min-width: 992px) {
  .mv-title { font-size: 40.3px; }
}

/* ---------------------------------------------------------------- *
 * Varias reglas de arriba fijan `display` (.btn, .vehicle-selected,
 * .btn-more, .vehicle-card__fallback…) con la misma especificidad que
 * el estilo nativo de `[hidden]`, así que ganaban por orden de
 * aparición y el atributo dejaba de ocultar el elemento. Esta regla
 * va al final a propósito para recuperar el comportamiento nativo
 * sin recurrir a !important.
 * ---------------------------------------------------------------- */
[hidden] { display: none; }

/* Enlace para rectificar el vehículo desde el resumen. Aparece sobre todo
   cuando el modelo llega preseleccionado por el QR. Va debajo del nombre,
   fuera de la fila del precio a propósito: acción secundaria, en tinta
   suave — el naranja se reserva para el total y el botón de pagar. */
.summary__change {
  padding: 0;
  border: 0;
  background: none;
  color: var(--mv-ink-70);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.summary__change:hover,
.summary__change:focus-visible {
  color: var(--mv-ink);
}

/* El foco de los titulos de paso es PROGRAMATICO: se pone desde JS para que
   los lectores de pantalla anuncien el paso nuevo al avanzar. No es navegacion
   visual del usuario, asi que no debe dibujar el anillo de foco: al cargar la
   pagina salia un recuadro alrededor de "Tienda" como si estuviera seleccionado.
   El foco sigue haciendo su trabajo para accesibilidad; solo se oculta. */
.step__title:focus,
.step__title:focus-visible {
  outline: none;
  box-shadow: none;
}

/* Pista bajo un campo (serie tecleada del paso de unidad). */
.field__hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  opacity: 0.75;
}

/* Aviso del paso de unidad cuando el modelo no está en el depósito. */
.unit-empty {
  margin: 0 0 1rem;
  font-weight: 500;
}

/* Separa el campo de serie de la lista de unidades. */
.unit-manual {
  margin-top: 1rem;
}

/* Varios vehículos: acción terciaria bajo el desglose y serie de cada vehículo. */
.summary__add {
  display: inline-block;
  margin: 0.25rem 0 1rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mv-ink-70);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.summary__add:hover,
.summary__add:focus-visible {
  color: var(--mv-ink);
}
.summary__serial {
  display: block;
  font-size: 12px;
  color: var(--mv-ink-70);
  word-break: break-all;
}

/* Venta por encargo: tarjeta que se marca y desmarca de un toque. Mismo
   lenguaje que .unit-option (borde fino, radio md, naranja al seleccionar). */
.unit-encargo {
  display: flex;
  align-items: center;
  gap: .85rem;
  width: 100%;
  min-height: 64px;
  margin-top: 1rem;
  padding: .85rem 1rem;
  border: 1px dashed var(--mv-ink-20);
  border-radius: var(--r-md);
  background: var(--mv-paper);
  color: var(--mv-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color var(--dur-base) var(--ease-brand), background var(--dur-base) var(--ease-brand);
}
.unit-encargo[hidden] { display: none; }
.unit-encargo:active { background: var(--mv-ink-04); }
.unit-encargo:focus-visible { outline: 3px solid rgba(253, 94, 21, .25); outline-offset: 2px; }
.unit-encargo__icon { width: 26px; height: 26px; flex: 0 0 26px; color: var(--mv-ink-70); }
.unit-encargo__text { display: flex; flex-direction: column; gap: .15rem; flex: 1 1 auto; }
.unit-encargo__title { font-family: var(--font-heading, Poppins, sans-serif); font-weight: 700; font-size: 15px; }
.unit-encargo__sub { font-size: 13px; color: var(--mv-ink-70); line-height: 1.35; }
.unit-encargo__check {
  width: 24px; height: 24px; flex: 0 0 24px;
  border: 2px solid var(--mv-ink-20);
  border-radius: 999px;
  position: relative;
}
.unit-encargo.is-selected {
  border-style: solid;
  border-color: var(--mv-orange);
  background: var(--mv-orange-10);
}
.unit-encargo.is-selected .unit-encargo__icon { color: var(--mv-orange); }
.unit-encargo.is-selected .unit-encargo__check { background: var(--mv-orange); border-color: var(--mv-orange); }
.unit-encargo.is-selected .unit-encargo__check::after {
  content: '';
  position: absolute; left: 7px; top: 3px;
  width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
