/* =====================================================================
   estilos.css — colores y tipografía se cambian en :root
   ===================================================================== */
:root {
  --asfalto: #1C2023;      /* fondo oscuro, textos */
  --asfalto-2: #2A3034;
  --senal: #F5C400;        /* amarillo de la estrella */
  --hormigon: #E6E8E6;     /* fondo claro */
  --papel: #FFFFFF;
  --gris: #5B6368;         /* textos secundarios */
  --linea: #C9CDCB;
  --rojo: #B3261E;

  --titulos: "Barlow Condensed", "Arial Narrow", sans-serif;
  --texto: "Barlow", system-ui, sans-serif;
  --ancho: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--texto); font-size: 1.0625rem; line-height: 1.55;
  color: var(--asfalto); background: var(--hormigon);
}
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--senal); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--titulos); line-height: 1.05; margin: 0 0 .5em; font-weight: 700; }
h2 { font-size: clamp(2rem, 5vw, 2.75rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; max-width: 65ch; }
.contenedor { width: min(100% - 2.5rem, var(--ancho)); margin-inline: auto; }
.nota { font-size: .9rem; color: var(--gris); }

/* ---------- encabezado ---------- */
.cabecera { background: var(--asfalto); color: var(--papel); position: sticky; top: 0; z-index: 10; }
.cabecera .contenedor { display: flex; align-items: center; justify-content: space-between; min-height: 4rem; }
.marca { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--titulos); font-size: 1.5rem; font-weight: 700; letter-spacing: .02em; }
.marca img { height: 2.4rem; width: auto; }
.marca svg { width: 2rem; height: 2rem; fill: var(--senal); }
.menu { display: flex; gap: 1.25rem; font-size: .98rem; list-style: none; margin: 0; padding: 0; }
.menu a { text-decoration: none; font-weight: 500; opacity: .85; }
.menu a:hover, .menu a[aria-current="page"] { opacity: 1; box-shadow: inset 0 -3px var(--senal); }
.menu-btn { display: none; background: none; border: 0; color: inherit; font: inherit; font-weight: 600; padding: .5rem; cursor: pointer; }

@media (max-width: 1020px) {
  .menu-btn { display: block; }
  .menu { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0;
          background: var(--asfalto-2); padding: .5rem 1.25rem 1rem; }
  .menu a { display: block; padding: .7rem 0; }
  .menu-abierto .menu { display: flex; }
}

/* ---------- portada ---------- */
.portada { background: var(--asfalto); color: var(--papel); padding: 3.5rem 0 4.5rem; }
.portada h1 { font-size: clamp(2.6rem, 8vw, 4.75rem); max-width: 14ch; }
.portada p { color: #C8CDD0; font-size: 1.15rem; }

/* La placa patente: el elemento protagonista */
.placa {
  display: flex; flex-direction: column; align-items: stretch; max-width: 30rem;
  background: var(--papel); color: #111; border: 3px solid #111; border-radius: 10px;
  padding: .35rem .9rem .6rem; box-shadow: 0 0 0 5px var(--papel), 0 12px 30px rgba(0,0,0,.35);
  margin: 2rem 0 1rem;
}
.placa-pais { display: flex; justify-content: space-between; font-family: var(--titulos); font-weight: 600;
  font-size: .85rem; letter-spacing: .3em; padding: 0 .1rem; border-bottom: 2px solid #111; }
.placa input {
  width: 100%; border: 0; background: transparent; text-align: center; text-transform: uppercase;
  font-family: var(--titulos); font-weight: 600; font-size: clamp(2.8rem, 12vw, 4.4rem);
  letter-spacing: .08em; padding: .1rem 0 0; color: #111;
}
.placa input::placeholder { color: #B9BEC0; }
.placa input:focus { outline: none; }
.placa:focus-within { box-shadow: 0 0 0 5px var(--senal), 0 12px 30px rgba(0,0,0,.35); }
.boton {
  display: inline-block; background: var(--senal); color: var(--asfalto); border: 0; border-radius: 6px;
  font-family: var(--titulos); font-weight: 700; font-size: 1.25rem; padding: .7rem 1.4rem;
  text-decoration: none; cursor: pointer;
}
.acciones { display: flex; flex-wrap: wrap; gap: .75rem; }
.boton:hover { filter: brightness(1.07); }
.boton.secundario { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }

/* ---------- franja de datos rápidos ---------- */
.franja { background: var(--senal); }
.franja .contenedor { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem 2rem; padding-block: 1.25rem; }
.franja div { font-size: .98rem; }
.franja strong { display: block; font-family: var(--titulos); font-size: 1.15rem; }

/* ---------- secciones ---------- */
.seccion { padding: 4rem 0; }
.seccion.clara { background: var(--papel); }
.dos-col { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); align-items: start; }

/* Requisitos */
.requisito { border-top: 3px solid var(--asfalto); padding: 1rem 0 .5rem; }
.requisito summary { font-family: var(--titulos); font-size: 1.45rem; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.requisito summary::-webkit-details-marker { display: none; }
.requisito summary::after { content: "+"; }
.requisito[open] summary::after { content: "–"; }
.requisito ul { padding-left: 1.2rem; margin: .8rem 0; }
.requisito li { margin-bottom: .35rem; }
.aviso { background: var(--papel); border-left: 5px solid var(--senal); padding: 1rem 1.25rem; margin-top: 1.5rem; }
.seccion.clara .aviso { background: var(--hormigon); }

/* Tablas de tarifas */
.tabla-scroll { overflow-x: auto; }
#tarifas table, .liquidacion { width: 100%; border-collapse: collapse; }
#tarifas th, #tarifas td { padding: .75rem .6rem; text-align: left; border-bottom: 1px solid var(--linea); vertical-align: top; }
#tarifas thead th { font-family: var(--titulos); font-size: 1.05rem; border-bottom: 3px solid var(--asfalto); white-space: nowrap; }
#tarifas tbody th { font-weight: 600; min-width: 9rem; }
#tarifas td strong { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
#tarifas td small { color: var(--gris); white-space: nowrap; }
.utm { display: inline-block; background: var(--asfalto); color: var(--papel); padding: .25rem .7rem; border-radius: 4px; font-weight: 600; margin-bottom: 1rem; }

/* Calculadora */
.calculadora { background: var(--asfalto); color: var(--papel); border-radius: 10px; padding: 1.75rem; margin-top: 2.5rem; }
.calculadora form { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .95rem; }
input, select, textarea { font: inherit; padding: .65rem .7rem; border: 2px solid var(--linea); border-radius: 6px; background: var(--papel); color: var(--asfalto); width: 100%; }
.liquidacion { margin-top: 1.5rem; background: var(--papel); color: var(--asfalto); border-radius: 6px; overflow: hidden; }
.liquidacion td { padding: .65rem 1rem; border-bottom: 1px solid var(--linea); }
.liquidacion td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.liquidacion tfoot td { font-family: var(--titulos); font-size: 1.4rem; font-weight: 700; background: var(--senal); border: 0; }
.calculadora .nota { color: #B9BEC0; margin-top: .75rem; }
.error { color: #FFB4AB; font-weight: 600; }

/* Preguntas */
.pregunta { border-bottom: 1px solid var(--linea); }
.pregunta summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; padding: 1rem 0; }
.pregunta div { padding-bottom: 1rem; }
.pregunta ol { margin: 0 0 1rem; padding-left: 1.3rem; }

/* Fotos del recinto */
.galeria { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.galeria figure { margin: 0; }
.galeria img { aspect-ratio: 4/3; object-fit: cover; width: 100%; border-radius: 6px; background: var(--linea); }
.galeria figcaption { font-weight: 600; margin-top: .4rem; }

/* ---------- listado de vehículos ---------- */
.buscador-listado { background: var(--asfalto); color: var(--papel); padding: 2.5rem 0 3rem; }
.buscador-listado .placa { margin: 1.25rem 0 1.5rem; }
.filtros { display: flex; flex-wrap: wrap; gap: .5rem; }
.filtros button { font: inherit; font-weight: 600; background: transparent; color: var(--papel); border: 2px solid #5B6368; border-radius: 999px; padding: .35rem 1rem; cursor: pointer; }
.filtros button[aria-pressed="true"] { background: var(--senal); border-color: var(--senal); color: var(--asfalto); }
#resultado { margin: 1.5rem 0; font-weight: 600; }
#resultado strong { display: block; font-size: 1.25rem; }
#lista { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(9.5rem, 45%), 1fr)); }
.auto { background: var(--papel); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.auto-foto { border: 0; padding: 0; background: var(--linea); aspect-ratio: 3/4; cursor: zoom-in; display: block; width: 100%; }
.auto-foto[disabled] { cursor: default; }
.auto-foto img { width: 100%; height: 100%; object-fit: cover; }
.auto-datos { padding: .7rem .8rem .9rem; display: grid; gap: .25rem; }
.placa-mini { font-family: var(--titulos); font-weight: 700; font-size: 1.45rem; letter-spacing: .06em; border: 2px solid #111; border-radius: 5px; text-align: center; padding: 0 .3rem; }
.auto-fecha { font-size: .9rem; color: var(--gris); }
.auto-estado { font-size: .85rem; font-weight: 700; padding: .15rem .55rem; border-radius: 4px; justify-self: start; }
.custodia .auto-estado { background: var(--senal); color: var(--asfalto); }
.retirado .auto-estado { background: var(--hormigon); color: var(--gris); }
.retirado .auto-foto img { filter: grayscale(1); opacity: .75; }
.remate .auto-estado { background: var(--rojo); color: var(--papel); }
#mas { margin: 2rem auto 0; display: block; }
#visor { border: 0; padding: 0; background: transparent; max-width: 95vw; max-height: 92vh; }
#visor::backdrop { background: rgba(10,12,14,.88); }
#visor img { max-height: 90vh; width: auto; margin: auto; border-radius: 6px; cursor: zoom-out; }

/* ---------- contacto y pie ---------- */
.formulario { display: grid; gap: 1rem; }
.pie { background: var(--asfalto); color: #C8CDD0; padding: 3rem 0 2rem; font-size: .95rem; }
.pie .contenedor { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.pie h3 { color: var(--papel); font-size: 1.2rem; }
.pie ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.pie a { color: var(--papel); }
.pie .legal { grid-column: 1 / -1; border-top: 1px solid var(--asfalto-2); padding-top: 1.25rem; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- páginas de texto (deberes, privacidad) ---------- */
.texto-largo h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin-top: 2rem; }
.texto-largo ul { padding-left: 1.2rem; max-width: 65ch; }
.texto-largo li { margin-bottom: .6rem; }
.texto-largo .dos-col h2 { margin-top: 1rem; }
.texto-largo .aviso { margin-top: 2.5rem; }

/* ---------- logo ---------- */
.marca img { height: 2.8rem; width: auto; }
.marca img + .marca-texto { display: none; }
.marca-texto { display: flex; align-items: center; gap: .6rem; }

/* ---------- fotos de fondo ----------
   Para cambiar una foto de fondo, reemplaza el archivo en img/ con el mismo nombre.
   El degradado oscuro encima mantiene el texto legible. Si la foto no existe, queda fondo oscuro. */
.portada {
  background:
    linear-gradient(90deg, rgba(20,23,25,.92) 0%, rgba(20,23,25,.75) 55%, rgba(20,23,25,.45) 100%),
    url("img/fondo-inicio.jpg") center / cover no-repeat,
    var(--asfalto);
  padding: 5rem 0 5.5rem;
}
.portada h1 { max-width: 20ch; font-size: clamp(2.4rem, 6.5vw, 4.25rem); }
.horario-portada { border-left: 4px solid var(--senal); padding-left: .9rem; }
.titular {
  background:
    linear-gradient(rgba(20,23,25,.82), rgba(20,23,25,.82)),
    url("img/fondo-paginas.jpg") center / cover no-repeat,
    var(--asfalto);
  color: var(--papel); padding: 3.5rem 0;
}
.titular h1 { font-size: clamp(2.4rem, 7vw, 3.75rem); margin: 0; }
.titular p { color: #C8CDD0; margin: .75rem 0 0; }

.boton.secundario.oscuro { color: var(--asfalto); }
.seccion .galeria { margin-top: 0; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.seccion.clara .calculadora { margin-top: 1.5rem; }
.buscador-placa .placa { margin-top: 1.5rem; }
.seccion.clara .placa { box-shadow: 0 0 0 5px var(--asfalto), 0 8px 20px rgba(0,0,0,.2); }

/* contacto */
.datos { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: 1rem; }
.datos strong { display: block; font-family: var(--titulos); font-size: 1.15rem; }
.mapa { width: 100%; aspect-ratio: 4 / 3; border: 0; border-radius: 8px; background: var(--linea); }

/* Todas las fotos de la lista con el mismo alto, aunque la foto original tenga otra proporción */
.auto-foto { position: relative; overflow: hidden; }
.auto-foto img { position: absolute; inset: 0; }

/* Selector de orden en la lista de vehículos */
.filtros { align-items: center; }
.orden { display: flex; align-items: center; gap: .5rem; margin-left: auto; color: #C8CDD0; font-weight: 600; }
.orden select { width: auto; padding: .4rem 2rem .4rem .7rem; border-radius: 999px; border-color: #5B6368; }
@media (max-width: 600px) { .orden { margin-left: 0; width: 100%; } .orden select { flex: 1; } }
