/* Estilos sencillos: fondo blanco, texto oscuro, fuente del sistema. */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  margin: 0;
  background: #fff;
  color: #1a1a1a;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #0b4f8a; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #0b4f8a; outline-offset: 2px; }

.contenedor { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.saltar { position: absolute; left: -9999px; }
.saltar:focus { left: 16px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

/* Aviso de borrador (solo aparece mientras falten datos) */
.aviso-borrador { background: #7a1f1f; color: #fff; padding: 10px 16px; font-weight: bold; text-align: center; }
.pendiente { background: #fff3bf; color: #6b4200; border: 1px dashed #b07a00; padding: 0 4px; font-weight: bold; font-size: .9em; }

/* Cabecera */
.cabecera { border-bottom: 1px solid #e3e3e3; }
.cabecera-int { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo img { width: 255px; height: auto; }
.cabecera nav a, .pie nav a { margin-left: 20px; color: #1a1a1a; font-weight: bold; text-decoration: none; }
.cabecera nav a:first-child, .pie nav a:first-child { margin-left: 0; }
.cabecera nav a:hover, .pie nav a:hover { text-decoration: underline; }

h1 { font-size: 1.9rem; margin: 32px 0 8px; }
h2 { font-size: 1.5rem; margin: 40px 0 16px; }
.intro p { margin: 0; color: #444; max-width: 60ch; }

/* Catálogo */
.lista-coches { display: grid; grid-template-columns: 1fr; gap: 32px; }
@media (min-width: 760px) { .lista-coches { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .lista-coches { grid-template-columns: repeat(3, 1fr); } }

.coche { border: 1px solid #ddd; border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.info { padding: 16px; }

.foto-principal { display: block; width: 100%; padding: 0; border: 0; background: #f2f2f2; cursor: zoom-in; position: relative; aspect-ratio: 4 / 3; }
.foto-principal img { width: 100%; height: 100%; object-fit: contain; }
.lupa { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.7); color: #fff; font-size: .85rem; padding: 4px 8px; border-radius: 4px; }
.contador { margin: 6px 16px 0; font-size: .9rem; color: #555; }
.miniaturas { list-style: none; margin: 8px 0 0; padding: 0 16px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.miniatura { padding: 0; border: 2px solid transparent; background: #f2f2f2; cursor: pointer; width: 100%; aspect-ratio: 4 / 3; }
.miniatura img { width: 100%; height: 100%; object-fit: cover; }
.miniatura[aria-current="true"] { border-color: #1a1a1a; }
.sin-fotos { aspect-ratio: 4 / 3; background: #f2f2f2; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; }
.nota { margin: 8px 16px 0; font-size: .9rem; }

.estado { display: inline-block; margin: 0 0 8px; padding: 2px 10px; border-radius: 3px; font-size: .85rem; font-weight: bold; background: #e5f3ea; color: #145c2e; }
.estado-reservado .estado { background: #fdf0d5; color: #7a4b00; }
.estado-vendido .estado { background: #e9e9e9; color: #333; }
.estado-vendido .foto-principal img { opacity: .6; }
.coche h3 { margin: 0; font-size: 1.3rem; line-height: 1.25; }
.version { display: block; font-weight: normal; font-size: 1rem; color: #444; }
.ref { margin: 4px 0 0; font-size: .85rem; color: #555; }
.precio { font-size: 1.8rem; font-weight: bold; margin: 12px 0 0; }
.precio .pendiente { font-size: 1rem; }
.nota-precio { margin: 0 0 12px; font-size: .85rem; color: #444; }

.datos { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0 0 12px; }
.datos dt { color: #555; }
.datos dd { margin: 0; font-weight: bold; }
.descripcion, .detalle { margin: 0 0 10px; }
details { margin: 0 0 12px; }
summary { cursor: pointer; font-weight: bold; }
details ul { margin: 8px 0 0; padding-left: 20px; }

.acciones { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.boton { display: inline-block; padding: 10px 18px; border: 2px solid #1a1a1a; background: #1a1a1a; color: #fff; font: inherit; font-weight: bold; text-decoration: none; border-radius: 4px; cursor: pointer; }
.boton:hover { background: #fff; color: #1a1a1a; }

/* Contacto */
.contacto .datos { max-width: 640px; }
.privacidad-breve { max-width: 70ch; font-size: .9rem; color: #444; }

/* Pie */
.pie { margin-top: 56px; border-top: 1px solid #e3e3e3; padding: 20px 0; font-size: .9rem; }
.pie .contenedor { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px; }
.pie p { margin: 0; }

/* Visor de fotos ampliadas */
.visor { border: 0; padding: 0; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; background: #111; color: #fff; }
.visor::backdrop { background: rgba(0,0,0,.85); }
.visor[open] { display: flex; flex-direction: column; }
.visor-barra, .visor-nav { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.visor-barra p { margin: 0; }
#visor-titulo { flex: 1; font-weight: bold; }
.visor-nav { justify-content: center; }
#visor-img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.visor .boton { background: #fff; color: #111; border-color: #fff; }
.visor .boton:hover { background: #111; color: #fff; }

/* Páginas legales */
.legal { max-width: 820px; }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }

@media (max-width: 520px) {
  .cabecera nav a { margin-left: 14px; }
  .logo img { width: 200px; }
  h1 { font-size: 1.6rem; }
  .datos { grid-template-columns: 1fr; gap: 0; }
  .datos dd { margin-bottom: 6px; }
}
