/* Estilos globales y optimización móvil para Furgonet.Net */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Outfit:wght@500;600;700;800;900&display=swap');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========================================================== */
/* 1. TAMAÑOS EN ESCRITORIO (PC) - PRESERVADO EXACTO           */
/* ========================================================== */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

@media (min-width: 921px) {
  html {
    font-size: 16.5px;
  }
}

body {
  overflow-x: hidden;
  font-family: var(--font-main);
  background-color: #F8FAFC;
  color: #0F172A;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: 84px;
  line-height: 1.5;
}

@media (min-width: 921px) {
  body {
    padding-bottom: 0;
  }
}

.font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* Gradientes vivos y modernos */
.bg-gradient-brand {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 55%, #EA580C 100%);
}

.bg-gradient-hero {
  background: radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.20) 0%, transparent 40%),
              radial-gradient(circle at 10% 80%, rgba(59, 130, 246, 0.25) 0%, transparent 45%),
              linear-gradient(180deg, #0B1120 0%, #1E293B 100%);
}

.text-gradient {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 45%, #EA580C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-gold {
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Insignias DGT con alto contraste */
.badge-dgt-0 {
  background-color: #0284C7;
  color: #FFFFFF;
  font-weight: 900;
}

.badge-dgt-eco {
  background: linear-gradient(135deg, #059669 0%, #0284C7 100%);
  color: #FFFFFF;
  font-weight: 900;
}

.badge-dgt-c {
  background-color: #16A34A;
  color: #FFFFFF;
  font-weight: 900;
}

.badge-dgt-b {
  background-color: #EAB308;
  color: #713F12;
  font-weight: 900;
}

/* Botones táctiles optimizados */
.btn-touch {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  font-weight: 800;
}

/* Efectos de tarjeta */
.card-hover {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
}

/* ========================================================================== */
/* BLINDAJE DE TARJETAS Y FOTOS DE VEHÍCULOS (RESIZING Y ASPECT-RATIO 16:10)  */
/* ========================================================================== */
article,
.vehicle-grid article {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.aspect-\[16\/10\],
article .aspect-\[16\/10\] {
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 16 / 10 !important;
  overflow: hidden !important;
  display: block !important;
  background-color: #0F172A;
}

.aspect-\[16\/10\] > a,
article .aspect-\[16\/10\] > a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
}

.aspect-\[16\/10\] img,
article .aspect-\[16\/10\] img,
.vehicle-grid img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
}

/* Barra inferior móvil nativa */
.mobile-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 74px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid #E2E8F0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (min-width: 921px) {
  .mobile-bottom-bar {
    display: none;
  }
}

/* Scroll horizontal suave */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}


/* ========================================================================== */
/* 2. ESTÁNDARES NATIVOS DE APP MÓVIL (iOS HIG & Material Design 3) <= 920px   */
/* ========================================================================== */
@media (max-width: 920px) {

  /* Base tipográfica estándar en smartphones (1rem = 16px) */
  html {
    font-size: 16px;
  }

  /* 1 Vehículo por columna obligatorio en móvil y tablet (minmax(0, 1fr) previene desbordamientos de Grid) */
  .vehicle-grid,
  .grid-vehicles {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Prevenir auto-zoom molesto en iOS Safari asegurando 16px en campos interactivos */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  select,
  textarea {
    font-size: 16px;
  }

  /* Formularios principales (Hero, Contacto, Auth) */
  .hero-search-form input,
  .hero-search-form select,
  .form-touch input,
  .form-touch select {
    min-height: 48px !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
  }

  /* Botón de búsqueda hero en móvil */
  .hero-search-form button[type="submit"] {
    min-height: 48px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
  }

  /* Pastillas de búsqueda frecuente (Demandados) */
  .mt-5.pt-4 a {
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
  }

  /* Carrusel de Fabricantes en Móvil */
  .flex-shrink-0.min-w-\[150px\],
  .flex-shrink-0.min-w-\[130px\],
  .flex-shrink-0.min-w-\[140px\] {
    min-width: 140px !important;
    padding: 12px !important;
  }

  .flex-shrink-0.min-w-\[150px\] span:first-child,
  .flex-shrink-0.min-w-\[140px\] span:first-child {
    font-size: 15px !important;
    font-weight: 800 !important;
  }

  .flex-shrink-0.min-w-\[150px\] span:last-child,
  .flex-shrink-0.min-w-\[140px\] span:last-child {
    font-size: 12px !important;
    font-weight: 600 !important;
  }

  /* TARJETAS DE VEHÍCULOS EN MÓVIL (Ergonomía táctil y proporciones equilibradas) */
  article {
    border-radius: 20px !important;
  }

  /* Título del vehículo en la tarjeta */
  article h3,
  article h3 a {
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
  }

  /* Subtítulo / Versión */
  article p.line-clamp-1 {
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-top: 2px !important;
    margin-bottom: 8px !important;
  }

  /* Badges DGT, Carrocería y Garantía */
  article .absolute.top-2\.5 a,
  article .absolute.top-2\.5 span {
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 3px 8px !important;
    border-radius: 8px !important;
  }

  /* Cajas de métricas técnicas (Volumen, Carga Útil, Kms) */
  article .grid-cols-3 {
    padding: 8px 10px !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
    border-radius: 14px !important;
  }

  article .grid-cols-3 span.block {
    font-size: 10.5px !important;
    font-weight: 800 !important;
    margin-bottom: 1px !important;
  }

  article .grid-cols-3 span:last-child {
    font-size: 13.5px !important;
    font-weight: 900 !important;
  }

  /* Botones táctiles de la tarjeta en móvil */
  article .btn-touch {
    min-height: 44px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    padding: 8px 10px !important;
  }

  article .btn-touch svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* BARRA INFERIOR DE NAVEGACIÓN MÓVIL (PWA) */
  .mobile-bottom-bar {
    height: 68px !important;
  }

  .mobile-bottom-bar a span {
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-top: 2px !important;
  }

  .mobile-bottom-bar svg {
    width: 22px !important;
    height: 22px !important;
  }

  /* CABECERA SUPERIOR MÓVIL (Ajuste ergonómico sin desbordamiento) */
  header .max-w-7xl {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  header .font-display {
    font-size: 1.1rem !important; /* ~17.5px en smartphone */
    letter-spacing: -0.02em !important;
  }

  header a[href="/login"] {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    min-height: 28px !important;
    padding: 5px 8px !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
  }

  #pwa-install-btn {
    white-space: nowrap !important;
    font-size: 10.5px !important;
    padding: 4px 8px !important;
  }

}

  header .font-display {
    font-size: 1.1rem !important; /* ~17.5px en smartphone */
    letter-spacing: -0.02em !important;
  }

  header a[href="/login"] {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    min-height: 28px !important;
    padding: 5px 8px !important;
    white-space: nowrap !important;
    border-radius: 8px !important;
  }

  #pwa-install-btn {
    white-space: nowrap !important;
    font-size: 10.5px !important;
    padding: 4px 8px !important;
  }

}

/* ========================================================== */
/* 4. MODO OSCURO COMPLETO (Soporte Alto Contraste B2B)       */
/* ========================================================== */

html.dark body {
  background-color: #0B1120 !important;
  color: #F1F5F9 !important;
}

/* Transiciones suaves al cambiar tema */
body, header, article, input, select, textarea, .mobile-bottom-bar {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Cabecera Superior en Modo Oscuro */
html.dark header {
  background-color: rgba(11, 17, 32, 0.95) !important;
  border-bottom-color: #1E293B !important;
}

html.dark header .font-display span.text-slate-900 {
  color: #F8FAFC !important;
}

html.dark header nav a {
  color: #CBD5E1 !important;
}

html.dark header nav a:hover {
  background-color: #1E293B !important;
  color: #60A5FA !important;
}

/* Tarjetas y Contenedores */
html.dark article,
html.dark .bg-white {
  background-color: #1E293B !important;
  color: #F1F5F9 !important;
  border-color: #334155 !important;
}

html.dark article h3,
html.dark article h3 a {
  color: #F8FAFC !important;
}

html.dark article p {
  color: #94A3B8 !important;
}

html.dark article div.flex.items-center.gap-2.text-xs,
html.dark article div.flex.items-center.gap-1\.5.text-xs {
  color: #CBD5E1 !important;
}

/* Cajas de métricas técnicas (Volumen, Carga, Kms) */
html.dark article .grid-cols-3 {
  background-color: #0F172A !important;
  border-color: #334155 !important;
}

html.dark article .grid-cols-3 span.block {
  color: #94A3B8 !important;
}

html.dark article .grid-cols-3 span:last-child {
  color: #F8FAFC !important;
}

/* Fondos y Secciones */
html.dark .bg-slate-50,
html.dark .bg-slate-100 {
  background-color: #0B1120 !important;
}

html.dark .bg-slate-200 {
  background-color: #1E293B !important;
}

html.dark .bg-gray-50,
html.dark .bg-gray-100 {
  background-color: #0F172A !important;
}

/* Tipografía y Textos */
html.dark .text-slate-900,
html.dark .text-slate-800 {
  color: #F8FAFC !important;
}

html.dark .text-slate-700 {
  color: #E2E8F0 !important;
}

html.dark .text-slate-600 {
  color: #CBD5E1 !important;
}

html.dark .text-slate-500 {
  color: #94A3B8 !important;
}

html.dark .text-slate-400 {
  color: #A0AEC0 !important;
}

/* Bordes y Separadores */
html.dark .border-slate-100,
html.dark .border-slate-200,
html.dark .border-slate-300 {
  border-color: #334155 !important;
}

html.dark .divide-slate-100 > :not([hidden]) ~ :not([hidden]),
html.dark .divide-slate-200 > :not([hidden]) ~ :not([hidden]) {
  border-color: #334155 !important;
}

/* Formularios, Inputs y Selects */
html.dark input,
html.dark select,
html.dark textarea {
  background-color: #0F172A !important;
  border-color: #334155 !important;
  color: #F8FAFC !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748B !important;
}

html.dark form label {
  color: #E2E8F0 !important;
}

/* Carrusel de Fabricantes / Logos Oficiales en Modo Oscuro */
html.dark .brand-card,
html.dark a[href*="/catalogo?make="] {
  background-color: #1E293B !important;
  border-color: #334155 !important;
}

html.dark .brand-card:hover,
html.dark a[href*="/catalogo?make="]:hover {
  background-color: #243044 !important;
  border-color: #3B82F6 !important;
}

html.dark .brand-card span,
html.dark a[href*="/catalogo?make="] span {
  color: #F8FAFC !important;
}

/* Inversión a blanco puro de logos en modo oscuro */
html.dark .brand-logo-img,
html.dark .brand-card .brand-logo-img,
html.dark a[href*="/catalogo?make="] img {
  filter: brightness(0) invert(1) !important;
  opacity: 0.95 !important;
  transition: transform 0.3s ease, filter 0.25s ease;
}

/* El logo de Mercedes-Benz es metálico 3D cromado; se preserva su brillo sin invertir */
html.dark .brand-logo-img[alt="Mercedes-Benz"],
html.dark .brand-card img[alt="Mercedes-Benz"],
html.dark a[href*="/catalogo?make="] img[alt="Mercedes-Benz"] {
  filter: brightness(1.2) contrast(1.1) !important;
  opacity: 1 !important;
}

/* Tablas (Comparador, Fichas Técnicas, Listados) */
html.dark table th {
  background-color: #0F172A !important;
  color: #CBD5E1 !important;
  border-color: #334155 !important;
}

html.dark table td {
  border-color: #1E293B !important;
  color: #E2E8F0 !important;
}

/* Columna lateral fija (Sticky) del comparador en modo oscuro */
html.dark table th.sticky,
html.dark table td.sticky,
html.dark table .sticky {
  background-color: #0F172A !important;
  color: #F8FAFC !important;
  border-right: 1px solid #334155 !important;
}

/* Barra Móvil de Navegación */
html.dark .mobile-bottom-bar {
  background-color: rgba(15, 23, 42, 0.98) !important;
  border-top-color: #334155 !important;
}

html.dark .mobile-bottom-bar a.text-slate-500 {
  color: #94A3B8 !important;
}

html.dark .mobile-bottom-bar a:hover {
  color: #F8FAFC !important;
}

/* Ficha Técnica y Calculadora de Europalets */
html.dark .bg-slate-50.p-4.rounded-2xl,
html.dark .bg-slate-50.p-6.rounded-2xl {
  background-color: #1E293B !important;
  border-color: #334155 !important;
}

/* Desplazamiento táctil fluido para tablas y paneles en dispositivos móviles */
.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

/* Barra de desplazamiento suave y delgada para tablas anchas en móvil */
.overflow-x-auto::-webkit-scrollbar {
  height: 4px;
}
.overflow-x-auto::-webkit-scrollbar-track {
  background: transparent;
}
.overflow-x-auto::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 9999px;
}



/* Respeto a las preferencias de reducción de movimiento (a11y) */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
