/* Añadidos propios de LIDIAUTO sobre el CSS original de la web. */

[hidden] { display: none !important; }
html.lidi-bloqueo, html.lidi-bloqueo body { overflow: hidden; }

/* ---- Sello VENDIDO cruzando la foto (petición de Juan) ---- */
.lidi-vendido {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: hidden;
  container-type: inline-size;
}
.lidi-vendido::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
}
.lidi-vendido span {
  position: relative;
  transform: rotate(-22deg);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 800;
  font-size: 2.75rem;
  font-size: clamp(1.5rem, 12cqw, 5.5rem); /* cabe entero dentro de la foto, también en móvil */
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #dc2626;
  background: rgba(255, 255, 255, 0.92);
  border: 0.08em solid #dc2626;
  padding: 0.12em 0.45em 0.1em 0.55em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* ---- Avisos tras enviar un formulario ---- */
.lidi-avisos {
  position: fixed;
  top: 6.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(92vw, 26rem);
  pointer-events: none;
}
.lidi-aviso {
  pointer-events: auto;
  background: #0c0c0c;
  color: #e8e4de;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.5;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: lidi-entrar 250ms ease-out;
}
.lidi-aviso.ok { border-left: 3px solid #10b981; }
.lidi-aviso.error { border-left: 3px solid #ef4444; }
.lidi-aviso a { text-decoration: underline; }
@keyframes lidi-entrar { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---- Textos legales ---- */
.prose-legal { color: hsl(var(--foreground)); padding-right: 1.5rem; }
.prose-legal h2 { font-size: 1.125rem; font-weight: 600; margin-bottom: 0.75rem; }
.prose-legal h3 { font-size: 0.95rem; font-weight: 600; margin: 1.25rem 0 0.35rem; }
.prose-legal p { font-size: 0.875rem; line-height: 1.7; color: hsl(var(--muted-foreground)); margin-bottom: 0.5rem; }

/* ---- Campos con error ---- */
.lidi-error { border-color: #ef4444 !important; }

/* ---- Deslizadores de los filtros (tirador invisible encima del original) ---- */
.lidi-rango { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; pointer-events: none; -webkit-appearance: none; appearance: none; background: transparent; }
.lidi-rango::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 24px; height: 24px; cursor: pointer; }
.lidi-rango::-moz-range-thumb { pointer-events: auto; width: 24px; height: 24px; cursor: pointer; border: 0; }

/* =====================================================================
   Repaso de octubre: transiciones suaves y mejor en el móvil.
   Todo respeta «reducir movimiento» del sistema.
   ===================================================================== */

/* ---- Paso suave de una página a otra (Chrome, Edge y Safari recientes; el resto, como siempre) ---- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; animation-timing-function: ease; }
header.fixed { view-transition-name: lidi-cabecera; }
.lidi-wa-flotante { view-transition-name: lidi-whatsapp; }

/* ---- Cabecera: transparente sobre la portada, con fondo al bajar ---- */
header.fixed { transition: height 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease, -webkit-backdrop-filter 0.35s ease, backdrop-filter 0.35s ease; }
header.fixed.lidi-con-fondo {
  height: 4.5rem;
  background-color: rgba(10, 10, 12, 0.9);
  background-color: color-mix(in srgb, var(--theme-bg, #0a0a0c) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px -12px rgba(0, 0, 0, 0.55);
}
header.fixed.lidi-con-fondo a[href="/"] > img { height: 2.5rem; }
@media (min-width: 768px) { header.fixed.lidi-con-fondo a[href="/"] > img { height: 2.75rem; } }

/* menú completo en la cabecera (pantallas anchas, si cabe) */
header nav.lidi-nav-ancha a { position: relative; padding: 6px 2px; }
header nav.lidi-nav-ancha a::after {
  content: ''; position: absolute; left: 2px; right: 2px; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left; transition: transform 0.3s ease;
}
header nav.lidi-nav-ancha a:hover::after, header nav.lidi-nav-ancha a.lidi-actual::after { transform: scaleX(1); }
header nav a.lidi-actual { color: var(--theme-text, #fff) !important; }

/* ---- Menú del móvil: los enlaces entran uno detrás de otro y se puede bajar si no caben ---- */
.lidi-menu { overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
.lidi-menu nav > * { opacity: 0; transform: translateY(10px); transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.65, 0.3, 1); }
.lidi-menu.lidi-abierto nav > * { opacity: 1; transform: none; transition-delay: calc(80ms + var(--i, 0) * 32ms); }
.lidi-menu nav a.lidi-actual { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px; }
@media (max-height: 760px) { .lidi-menu nav { gap: 1.6rem; padding-top: 1.5rem; } }
@media (max-height: 600px) { .lidi-menu nav { gap: 1.1rem; } }

/* ---- Bloques que aparecen al llegar a ellos ---- */
.lidi-revelar {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.55s cubic-bezier(0.2, 0.65, 0.3, 1), transform 0.55s cubic-bezier(0.2, 0.65, 0.3, 1);
  transition-delay: var(--lidi-retardo, 0ms);
}
.lidi-revelar.lidi-visible { opacity: 1; transform: none; }

/* ---- Tarjetas de coches y botones: respuesta al pasar el ratón y al pulsar ---- */
@media (hover: hover) and (pointer: fine) {
  [data-rejilla-coches] > [data-coche] { transition: transform 0.35s cubic-bezier(0.2, 0.65, 0.3, 1); }
  [data-rejilla-coches] > [data-coche]:hover { transform: translateY(-4px); }
}
.btn-luxury, .btn-luxury-accent, .btn-luxury-white { transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.15s ease, box-shadow 0.3s ease; }
.btn-luxury:active, .btn-luxury-accent:active, .btn-luxury-white:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .btn-luxury-accent:hover { box-shadow: 0 10px 24px -10px rgba(47, 85, 196, 0.7); }
}
[data-fotos] img { transition: opacity 0.3s ease, transform 0.7s ease-out; }
/* en cada fila de coches, los botones «Más información» a la misma altura aunque los títulos ocupen distinto */
[data-rejilla-coches] > [data-coche] > .flex-1 > a:first-child { flex: 1 1 auto; }

/* ---- Botón flotante de WhatsApp: entra con suavidad; en el móvil, redondo para no tapar los coches ---- */
.lidi-wa-flotante { animation: lidi-wa-entrar 0.5s cubic-bezier(0.2, 0.65, 0.3, 1) 0.6s backwards; transition: opacity 0.25s ease, transform 0.25s ease; }
@keyframes lidi-wa-entrar { from { opacity: 0; transform: translateY(12px) scale(0.9); } to { opacity: 1; transform: none; } }
html.lidi-bloqueo .lidi-wa-flotante { opacity: 0; pointer-events: none; }
@media (max-width: 639px) {
  a.lidi-wa-flotante {
    width: 3.5rem; height: 3.5rem; padding: 0; gap: 0; justify-content: center; font-size: 0; line-height: 0;
    right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom));
    box-shadow: 0 10px 25px -8px rgba(0, 0, 0, 0.55);
  }
  a.lidi-wa-flotante img { width: 28px; height: 28px; }
}

/* ---- Portada en el móvil ---- */
@media (max-width: 639px) {
  /* «Consolidada · Ágil · Incluida» en una fila, como en el ordenador */
  [data-editor-section="hero"] .grid.grid-cols-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin-top: 2.25rem; }
  [data-editor-section="hero"] .grid.grid-cols-1 > div > span:first-child { font-size: 1.0625rem; }
  /* los dos botones, del mismo ancho */
  [data-editor-section="hero"] .flex.flex-wrap { flex-direction: column; align-items: stretch; gap: 0.75rem; max-width: 20rem; margin-left: auto; margin-right: auto; }
  [data-editor-section="hero"] .flex.flex-wrap > a { text-align: center; }
}

/* ---- Anuncios con foto de fondo: el texto se lee bien también sobre el coche rojo ---- */
[data-editor-section="importacion"] .absolute.inset-0 > .absolute.inset-0 {
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.66) 0%, rgba(0, 0, 0, 0.5) 55%, rgba(0, 0, 0, 0.38) 100%);
}
[data-editor-section="importacion"] p { color: rgba(255, 255, 255, 0.8); }
[data-editor-section="hero"] .bg-gradient-to-t { background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.55) 55%, rgba(0, 0, 0, 0.2)); }
[data-editor-section="hero"] .bg-gradient-to-t ~ * p, [data-editor-section="hero"] p.text-white\/50 { color: rgba(255, 255, 255, 0.78); }

/* ---- Stock destacado de la portada: tres columnas en pantallas grandes ---- */
@media (min-width: 1200px) {
  [data-editor-section="coches"] [data-rejilla-coches] { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.25rem; }
}

/* ---- Pie: sin huecos donde había un enlace a una página quitada ---- */
footer li:empty { display: none; }

/* ---- Menos movimiento si el sistema lo pide ---- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .lidi-revelar { opacity: 1; transform: none; transition: none; }
  .lidi-menu nav > * { transition: none; }
  .lidi-wa-flotante { animation: none; }
  [data-rejilla-coches] > [data-coche], header.fixed { transition: none; }
  [data-rejilla-coches] > [data-coche]:hover { transform: none; }
}

/* ---- Ficha del coche en el móvil: nada cortado por la derecha ----
   La rejilla de la ficha (foto + datos | precio y botones) tiene una sola columna en el móvil y se ensanchaba con
   lo más ancho que llevara dentro (la tira de miniaturas, o una descripción con «<<<<<<» sin espacios), y el
   precio, los botones y el texto se quedaban cortados. */
@media (max-width: 1023px) {
  .grid.lg\:grid-cols-12 { grid-template-columns: minmax(0, 1fr); }
}
.whitespace-pre-wrap { overflow-wrap: anywhere; }
/* «Llamar ahora» y «WhatsApp» de la ficha: el icono al lado del texto, no encima (el estilo del botón le quitaba el flex) */
.btn-luxury.flex, .btn-luxury-accent.flex, .btn-luxury-white.flex { display: flex; }

/* ---- Al imprimir o guardar en PDF, todo a la vista (lo que aún no había aparecido al bajar) ---- */
@media print {
  .lidi-revelar { opacity: 1 !important; transform: none !important; transition: none !important; }
  .lidi-wa-flotante { display: none !important; }
  header.fixed { position: absolute !important; }
}
