/* =========================================================
   ARISTON 530 · ESTILO MODERNO OSCURO PREMIUM (2026)
   – Look dark elegante + acento dorado (#ffcc00)
   – Mantiene tus clases actuales (drop-in replacement)
   ========================================================= */

/* -------------------------
   Variables de diseño
------------------------- */
:root {
  --bg: #0b0b0b;
  /* fondo técnico oscuro */
  --bg-soft: #101010;
  /* variantes de superficie */
  --surface: #141414;
  --surface-2: #a1a1a1;
  --border: rgba(255, 255, 255, 0.10);
  --text: #eaeaea;
  --text-soft: #eaeaea;
  --muted: #a1a1a1;
  --accent: #ffcc00;
  /* dorado de marca */
  --accent-weak: rgba(255, 204, 0, 0.14);

  --radius: 14px;
  /* radios modernos */
  --radius-sm: 10px;

  --shadow-1: 0 6px 20px rgba(0, 0, 0, 0.40);
  --shadow-2: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, 0.60);

  --focus: 0 0 0 3px rgba(255, 204, 0, 0.55);
}

/* -------------------------
   Reset y base
------------------------- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Footer siempre abajo */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
  display: block;
}

/* Preferencia de menos movimiento */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* -------------------------
   Fondo / Slideshow
------------------------- */
.bg-slideshow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #fff center/cover no-repeat;
}

/*.bg-slideshow::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.78) 35%, rgba(0,0,0,0.88));
  backdrop-filter: blur(4px);
}
  */

/* -------------------------
   Header & Nav
------------------------- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 28px;
  background: rgba(16, 16, 16, 0.75);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

.logo {
  height: 85px;
  object-fit: contain;
  display: block;
}

.logo-fin {
  height: 160px;
  object-fit: contain;
  display: block;
}

.top-bar a.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.top-bar a.logo-link:focus-visible img {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

.menu {
  display: flex;
  gap: 26px;
  align-items: center;
}

.menu-item {
  color: var(--accent);
  text-decoration: none;
  padding: 10px 0;
  font-weight: 500;
  letter-spacing: .2px;
  position: relative;
}

.menu-item::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width .25s ease;
}

.menu-item:hover::after,
.menu-item[aria-current="page"]::after {
  width: 100%;
}

/* Submenú Coches (hover sobre el contenedor .menu-parent) */
.menu-parent {
  position: relative;
  display: inline-block;
}

.menu-parent:hover .submenu {
  display: block;
}

.submenu {
  position: absolute;
  top: 110%;
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
  min-width: 220px;
  padding: 8px 0;
  display: none;
  z-index: 9999;
}

.submenu a {
  display: block;
  text-decoration: none;
  color: var(--text);
  padding: 10px 14px;
  font-size: .95rem;
  transition: background .2s ease, padding-left .2s ease, color .2s ease;
}

.submenu a:hover {
  background: var(--accent-weak);
  color: var(--accent);
  padding-left: 22px;
}



/* === Móvil: submenu embebido (no centrado flotante), con fondo opaco === */
@media (max-width: 900px) {
  .menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(16, 16, 16, 0.98);
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .menu.is-open {
    display: flex;
  }

  .menu-label {
    cursor: pointer;
  }

  .submenu {
    position: static !important;
    display: none;
    background: rgba(22, 22, 22, 1);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 0;
    min-width: 0;
  }

  .menu-parent.is-open>.submenu {
    display: block;
  }

  .submenu a {
    padding: 10px 8px 10px 18px;
  }
}



/* En desktop sigue funcionando tu hover tal cual. */
@media (max-width: 900px) {

  /* Botón hamburguesa visible en móvil (si ya lo tienes, puedes omitir esto) */
  .nav-toggle {
    display: inline-flex;
  }

  /* Menú plegado por defecto en móvil */
  .menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(16, 16, 16, 0.95);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
  }

  .menu.is-open {
    display: flex;
  }

  /* El label del menú “Coches” se puede tocar */
  .menu-label {
    cursor: pointer;
  }

  /* Submenú dentro del flujo cuando está abierto por click */
  .submenu {
    position: static;
    /* quita el absolute en móvil */
    display: none;
    /* cerrado por defecto en móvil */
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    min-width: 0;
  }

  .menu-parent.is-open .submenu {
    display: block;
  }

  /* Links del submenu en móvil */
  .submenu a {
    padding: 10px 8px 10px 18px;
  }
}


/* -------------------------
   Tarjetas (secciones)
------------------------- */
.section-card {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 2rem 1.75rem;
  background: linear-gradient(180deg, rgba(25, 25, 25, 0.75), rgba(20, 20, 20, 0.75));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease;
}

.section-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.section-card h1,
.section-card h2 {
  margin: 0 0 .9rem;
  color: var(--text);
  letter-spacing: .3px;
}

.section-card p {
  margin: 0 0 1rem;
  line-height: 1.6;
  color: var(--text-soft);
}

/* Tarjetas “home” clicables y con subrayado del título */
body.home .section-card {
  cursor: pointer;
}

body.home .section-card h2 {
  position: relative;
  display: inline-block;
}

body.home .section-card h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width .25s ease;
}

body.home .section-card:hover h2::after {
  width: 100%;
}

/* Enlace estirado (por accesibilidad, si lo usas) */
body.home .section-card .section-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 3;
  text-indent: -9999px;
}

body.home .section-card .section-link:focus-visible {
  box-shadow: var(--focus);
}

/* -------------------------
   Secciones neutrales por defecto
------------------------- */
section {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  background: transparent;
  color: inherit;
}

/* -------------------------
   Parrilla de coches (coches.html)
------------------------- */
.cars-grid {
  display: grid;
  gap: 16px;
  margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.car-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform .25s ease, box-shadow .25s ease;
}

.car-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
}

.car-card--compact img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.car-card--compact h3 {
  margin: 0;
  padding: 12px;
  text-align: center;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
}

/* -------------------------
   Photo grid (3x3 responsive)
------------------------- */
.photo-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.photo-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease;
}

.photo-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
}

.photo-item img,
.photo-item>img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  transition: transform .25s ease, filter .25s ease;
  display: block;
}

.photo-item:hover img {
  transform: scale(1.04);
  filter: contrast(1.04) saturate(1.06);
}

@media (max-width: 900px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .photo-grid {
    grid-template-columns: 1fr;
  }
}

/* -------------------------
   Lightbox / Visor
------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .85);
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 86vh;
  margin: 0 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  touch-action: none;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 78vh;
  border-radius: var(--radius-sm);
  background: #111;
  box-shadow: var(--shadow-3);
  transform: translate(0, 0) scale(1);
  cursor: grab;
}

.lightbox-stage img.grabbing {
  cursor: grabbing;
}

.lightbox-caption {
  margin-top: 10px;
  color: #ddd;
  font-size: .95rem;
  text-align: center;
  display: grid;
  grid-auto-flow: column;
  gap: 10px;
  align-items: center;
}

.lightbox-btn {
  position: absolute;
  z-index: 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #111;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-2);
  transition: transform .15s ease, background .15s ease;
}

.lightbox-btn:hover {
  transform: translateY(-1px);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  font-size: 20px;
}

.lightbox-prev {
  left: 18px;
}

.lightbox-next {
  right: 18px;
}

.lightbox-zoom {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 2;
}

.zoom-btn {
  min-width: 56px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .9);
  color: #111;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-1);
}

.zoom-btn:active {
  transform: translateY(1px);
}

body.modal-open {
  overflow: hidden;
}

@media (max-width:600px) {
  .lightbox-stage {
    margin: 0 56px;
  }

  .lightbox-btn {
    width: 40px;
    height: 40px;
  }

  .zoom-btn {
    min-width: 48px;
  }
}

/* -------------------------
   Contacto: texto + mapa
------------------------- */
.contact-grid {
  display: grid;
  gap: 24px;
  align-items: start;
  grid-template-columns: 1fr 1.35fr;
}

.contact-map {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
}

.contact-map::before {
  content: "";
  display: block;
  padding-bottom: 70%;
}

/* 7:10 ~ 0.7 */
.contact-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

@media (max-width: 900px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-map::before {
    padding-bottom: 75%;
  }

  /* 4:3 en móvil */
}

/* -------------------------
   Páginas legales (look estático)
------------------------- */
.no-underline .menu .menu-item::after,
.no-underline .menu .menu-item:hover::after {
  width: 0 !important;
  background: transparent !important;
}

.no-underline .section-card h1::after,
.no-underline .section-card h2::after,
.no-underline .section-card h3::after {
  content: none !important;
}

.legal-page .section-card {
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.8), rgba(20, 20, 20, 0.8));
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  backdrop-filter: blur(6px);
  cursor: default;
  transition: none;
}

.no-hover .section-card:hover {
  transform: none !important;
  box-shadow: var(--shadow-1) !important;
}

.legal {
  max-width: 1100px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

/* Tablas modernas (oscuro) */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

.table thead th {
  background: var(--surface-2);
  color: var(--accent);
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
  font-size: .95rem;
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

@media (max-width:640px) {
  .table thead {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .table tbody td {
    white-space: nowrap;
  }
}

/* -------------------------
   Footer
------------------------- */
.footer {
  background: rgba(16, 16, 16, 0.85);
  color: var(--text);
  text-align: center;
  padding: 32px;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  backdrop-filter: blur(6px);
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.25);
}

.footer a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 10px;
}

.footer a:hover {
  text-decoration: underline;
}

/* -------------------------
   Cookie banner (dark)
------------------------- */
.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  display: none;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  z-index: 9999;
  box-shadow: var(--shadow-2);
  border: 1px solid var(--border);
}

.cookie-banner.show {
  display: flex;
}

.cookie-banner a {
  color: var(--accent);
  text-decoration: underline;
}

.cookie-banner .btn-accept,
.cookie-banner .btn-config {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: transparent;
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}

.cookie-banner .btn-accept {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  font-weight: 700;
}

.cookie-banner .btn-accept:hover,
.cookie-banner .btn-config:hover {
  transform: translateY(-1px);
}

.cookie-pref-fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #111;
  color: var(--accent);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.cookie-pref-fab.show {
  display: flex;
}

.cookies-visible .footer {
  padding-bottom: 88px;
}

/* -------------------------
   Estados de foco accesibles
------------------------- */
a:focus-visible,
button:focus-visible,
.menu-item:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

/* -------------------------
   Responsive header
------------------------- */
@media (max-width: 760px) {
  .top-bar {
    padding: 12px 18px;
    gap: 16px;
  }

  .logo {
    height: 50px;
  }

  .menu {
    gap: 18px;
  }
}

/* ====== HEADER v2 · Modern Dark Premium ====== */
.app-bar {
  padding: 14px 22px;
  background: rgba(16, 16, 16, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px);
}

/* Contenedor del nav (alineación) */
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Links del menú como “chips” modernos */
.nav-link {
  position: relative;
  color: #eaeaea;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background .2s ease, color .2s ease, transform .2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-link[aria-current="page"] {
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.12);
}

/* “Coches” no clicable — botón con mismo look que links */
.menu-label {
  background: transparent;
  border: none;
  cursor: default;
  font: inherit;
  color: #ffcc00;
  padding: 10px 12px;
  border-radius: 10px;
}

.menu-label {
  display: inline-block;
  position: relative;
}

.menu-label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width .25s ease;
}

.menu-item::after { width: 0; }  /* base */

.menu-label:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.45);
}

/* ====== SUBMENÚ ====== */
.menu-parent {
  position: relative;
  display: inline-block;
}

.menu-parent>.menu-label:hover::after {
  width: 100%;
}

.menu-parent.is-current>.menu-label::after {
  width: 100%;
}


/* 3) Accesibilidad: si el foco está en el submenú o dentro del grupo */
.menu-parent:focus-within>.menu-label::after {
  width: 100%;
}

/* 4) En móvil, cuando abres el submenú por clic */
.menu-parent.is-open>.menu-label::after {
  width: 100%;
}

.menu-parent:hover .dropdown,
.menu-parent:focus-within .dropdown {
  display: block;
}

.dropdown {
  position: absolute;
  top: 110%;
  left: 0;
  display: none;
  min-width: 240px;
  background: #3d3d3d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  padding: 8px;
  z-index: 9999;
}

.dropdown-link {
  display: block;
  text-decoration: none;
  color: #eaeaea;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background .2s ease, padding-left .2s ease, color .2s ease;
}

.dropdown-link:hover,
.dropdown-link:focus-visible {
  background: rgba(255, 204, 0, 0.14);
  color: #ffcc00;
  padding-left: 18px;
  outline: none;
}

/* ====== HAMBURGUESA / MENÚ MÓVIL ====== */
.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #111;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle-bar {
  width: 22px;
  height: 2px;
  background: #eaeaea;
  display: block;
  margin: 3px 0;
  border-radius: 2px;
}

/* Responsive: en móvil, nav en columna y dropdowns tipo bloque */
@media (max-width: 860px) {
  .app-bar {
    gap: 12px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    display: none;
    flex-direction: column;
    gap: 6px;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    margin: 0 16px;
    padding: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  }

  .nav.open {
    display: flex;
  }

  .menu-parent {
    width: 100%;
  }

  .dropdown {
    position: static;
    display: none;
    box-shadow: none;
    border: none;
    background: transparent;
    padding: 6px 0 0;
  }

  .menu-parent.open .dropdown {
    display: block;
  }
}

/* “Coches” como etiqueta NO clicable en el menú */
.menu .menu-label {
  display: inline-block;
  padding: 10px 0;
  color: var(--text);
  font-weight: 500;
  letter-spacing: .2px;
  cursor: default;
  /* <- no mano */
  user-select: none;
}

/* Evitar que herede el subrayado dorado de .menu-item */
.menu .menu-label::after {
  content: none !important;
}

/* Abrir el submenú al pasar o al enfocar con teclado */
.menu-parent {
  position: relative;
  display: inline-block;
}

.menu-parent:hover .submenu,
.menu-parent:focus-within .submenu {
  display: block;
}

/* (Opcional) foco visible accesible cuando navegas con Tab */
.menu .menu-label:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 8px;
}

/* Enlace activo del menú principal */
.menu a[aria-current="page"] {
  color: var(--accent) !important;
}

.menu-parent span[aria-current="page"] {
  color: var(--accent) !important;
}

.menu-parent span[aria-current="page"]::after {
  width: 100% !important;
}

.menu a[aria-current="page"]::after {
  width: 100% !important;
  /* subrayado dorado completo */
}

/* Enlace activo dentro del submenú */
.submenu a[aria-current="page"] {
  background: var(--accent-weak);
  color: var(--accent);
  border-radius: 10px;
}

/* “Coches” (no clicable) resaltado cuando estás en coches.html o en un modelo */
.menu-parent.is-current .menu-label {
  color: var(--accent);
  background: var(--accent-weak);
  border-radius: 10px;
  padding: 10px 12px;
  /* mismo padding visual que los links */
}

/* ===== FIX: el submenú no debe desaparecer al mover el ratón ===== */
/* El label "Coches" puede alojar el subrayado */
.top-bar .menu-label {
  display: inline-block;
  position: relative;
}

/* Subrayado del label (mismo estilo que tus links) */
.top-bar .menu-label::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0%;
  height: 2px;
  background: var(--accent);
  transition: width .25s ease;
}

/* 1) Hover (por si alguna cascada neutraliza el genérico) */
.top-bar .menu-parent.nav-item.has-dropdown > .menu-label.menu-item:hover::after {
  width: 100%;
}

/* 2) Estás en una ficha/listado de coches → marcado por JS */
.top-bar .menu-parent.nav-item.has-dropdown.is-current > .menu-label.menu-item::after {
  width: 100% !important;  /* anula la base .menu-item::after { width:0 } */
}

/* 3) Accesibilidad: si hay foco dentro del grupo */
.top-bar .menu-parent.nav-item.has-dropdown:focus-within > .menu-label.menu-item::after {
  width: 100%;
}

/* 4) Móvil: cuando abres el dropdown por clic */
.top-bar .menu-parent.nav-item.has-dropdown.is-open > .menu-label.menu-item::after {
  width: 100%;
}

/* (Opcional) Resalta también el enlace activo dentro del submenú */
.submenu a[aria-current="page"] {
  background: var(--accent-weak, rgba(255,204,0,0.12));
  color: var(--accent, #ffcc00);
  font-weight: 600;
}


.top-bar .menu-parent.nav-item.has-dropdown.is-current > .menu-label.menu-item::after {
  background: #ffcc00 !important;
}


/* El submenú debe tocar al elemento padre (sin hueco) */
.menu-parent {
  position: relative;
}

.menu-parent .submenu {
  position: absolute;
  top: 100% !important;
  /* <- antes estaba 110%, eso generaba el “salto” */
  left: 0;
  margin-top: 0 !important;
  /* evita huecos adicionales */
  transform: none !important;
  /* evita desplazamientos visuales con gap */
  display: none;
  z-index: 9999;
  /* por encima del header */
}

/* Mostrar al pasar/enfocar */
.menu-parent:hover .submenu,
.menu-parent:focus-within .submenu {
  display: block;
}

/* (Opcional si tu diseño tenía “espaciado visual”)
   Usar un borde o sombra en lugar de margin para separar visualmente */
.menu-parent .submenu {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  /* separación visual sutil */
}

/* Asegura que los ítems sean fáciles de clicar */
.submenu a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
}

.submenu a:hover,
.submenu a:focus-visible {
  background: var(--accent-weak);
  color: var(--accent);
}

/* ===== Galería moderna (mosaic) para fichas ===== */
.gallery-modern {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

.gallery-modern .gm-item {
  position: relative;
  display: block;
  grid-column: span 6;
  /* base */
  border-radius: var(--radius, 14px);
  overflow: hidden;
  background: #111;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.10));
  box-shadow: var(--shadow-1, 0 6px 20px rgba(0, 0, 0, .4));
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.gallery-modern .gm-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2, 0 12px 32px rgba(0, 0, 0, .55));
  border-color: rgba(255, 255, 255, 0.16);
}

.gallery-modern .gm-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform .28s ease, filter .28s ease;
}

.gallery-modern .gm-item:hover img {
  transform: scale(1.03);
  filter: contrast(1.05) saturate(1.05);
}

/* Spans para el mosaic (ajusta al gusto) */
.gallery-modern .gm-xl {
  grid-column: span 12;
  aspect-ratio: 16 / 8;
}

.gallery-modern .gm-lg {
  grid-column: span 6;
  aspect-ratio: 16 / 10;
}

.gallery-modern .gm-md {
  grid-column: span 4;
  aspect-ratio: 4 / 3;
}

.gallery-modern .gm-sm {
  grid-column: span 3;
  aspect-ratio: 4 / 3;
}

/* Responsive */
@media (max-width: 1100px) {
  .gallery-modern .gm-md {
    grid-column: span 6;
  }

  .gallery-modern .gm-sm {
    grid-column: span 6;
  }
}

@media (max-width: 740px) {
  .gallery-modern .gm-item {
    grid-column: span 12;
  }

  .gallery-modern .gm-xl,
  .gallery-modern .gm-lg,
  .gallery-modern .gm-md,
  .gallery-modern .gm-sm {
    aspect-ratio: 4 / 3;
  }
}



/* --- Ajuste de layout: usar GRID para superponer flechas sobre la imagen --- */
.carousel {
  /* Para centrar el carrusel dentro del contenido y evitar que “desborde” */
  display: grid;
  grid-template-rows: auto max-content;
  /* fila 1 = imagen, fila 2 = puntos */
  width: min(100%, var(--carousel-max-width, 1200px));
  margin: clamp(8px, 2vw, 24px) auto;
  /* centrado */
  position: relative;
  /* contenedor de referencia si algo usa absolute */
  padding: 0;
}

.carousel-viewport {
  grid-area: 1 / 1;
  position: relative;
  /* ancla interna para capas */
  overflow: hidden;
  border-radius: var(--carousel-radius, 10px);
  background: var(--carousel-bg, #0b0b0b);
  aspect-ratio: var(--carousel-aspect, 16 / 9);
  min-height: 260px;
}

.carousel-track {
  display: flex;
  width: 100%;
  height: 100%;
  transform: translateX(0%);
  transition: transform 600ms ease;
  will-change: transform;
}

/* Quita márgenes del figure para que no “empuje” nada */
.carousel-slide {
  margin: 0;
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  overflow: hidden;
}

/* Asegura que las imágenes llenen el alto del viewport */
.carousel-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Flechas: ahora van en la misma “celda” de la imagen (fila 1) y centradas verticalmente */
.carousel-btn {
  grid-area: 1 / 1;
  /* misma celda que la imagen */
  place-self: center;
  /* centradas verticalmente */
  width: var(--carousel-btn-size, 44px);
  height: var(--carousel-btn-size, 44px);
  border: none;
  border-radius: 50%;
  color: #111;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 2;
  opacity: 0.9;
}

.carousel-btn:hover {
  opacity: 1;
}

.carousel-btn:focus-visible {
  outline: 3px solid var(--carousel-accent, #ffcc00);
  outline-offset: 2px;
}

.carousel-prev {
  justify-self: start;
  margin-left: 8px;
}

.carousel-next {
  justify-self: end;
  margin-right: 8px;
}

/* Puntos: a la segunda fila del grid, centrados */
.carousel-dots {
  grid-area: 2 / 1;
  list-style: none;
  margin: 10px 0 0 0;
  padding: 0;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.carousel-dot[aria-selected="true"] {
  background: var(--carousel-accent, #ffcc00);
}

.carousel-dot:focus-visible {
  outline: 3px solid var(--carousel-accent, #ffcc00);
  outline-offset: 2px;
}

/* Captión */
.carousel-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.75rem 1rem;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  font-size: 0.95rem;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .carousel-track {
    transition: transform 0.01ms;
  }
}

/* ===== Fondo slideshow borroso ===== */
:root{
  --bg-interval: 6000ms; /* tiempo entre cambios */
  --bg-fade: 1200ms;     /* duración del fundido */
  --bg-blur: 14px;       /* intensidad del blur */
}

.bg-slideshow{
  position: fixed;
  inset: 0;
  z-index: -1;           /* queda por detrás del contenido */
  overflow: hidden;
  pointer-events: none;  /* no intercepta clics */
}


/* El overlay toma el valor de la variable, con fallback transparente */
.bg-slideshow::after{
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-veil, transparent); /* fallback transparente */
}


/* Cada foto es una capa de fondo que se va mostrando/ocultando por opacidad */
.bg-slideshow .bg-slide{
  position: absolute;
  inset: -10px;                 /* pequeño margen para cubrir bordes del blur */
  background-position: center center;
  background-size: cover;
  filter: blur(var(--bg-blur));
  transform: scale(1.06);       /* compensa el blur para que no se vean bordes */
  opacity: 0;
  transition: opacity var(--bg-fade) ease-in-out;
  will-change: opacity;
}

.bg-slideshow .bg-slide.is-active{
  opacity: 1;
}

/* Si el usuario prefiere reducir animaciones, mostramos la 1ª y sin transiciones */
@media (prefers-reduced-motion: reduce){
  .bg-slideshow .bg-slide{ transition: none !important; }
  .bg-slideshow .bg-slide{ opacity: 0; }
  .bg-slideshow .bg-slide:first-child{ opacity: 1; }
}