/* === IMPORTAR TIPOGRAFÍA MODERNA (POPPINS) === */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* === VARIABLES DE DISEÑO CENTRALIZADAS === */
:root {
  --color-primario: #F59827;
  --color-primario-dark: #e65c00;
  --color-marfil: #f8f4e3;
  --color-blanco: #ffffff;
  --color-texto: #333333;
  --color-muted: #7a7a7a;
  --color-border: rgba(0,0,0,0.06);
  --color-danger: #cc0000;
  --shadow-soft: 0 6px 18px rgba(0,0,0,0.06);
  --shadow-medium: 0 8px 24px rgba(0,0,0,0.1);
  
  /* Variables de espaciado y diseño */
  --gap: 1.25rem;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
}

/* === ACCESIBILIDAD - FOCUS VISIBLE === */
*:focus-visible {
  outline: 3px solid rgba(245,152,39,0.5);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(245,152,39,0.3);
}
*:focus:not(:focus-visible) { 
  outline: none; 
}

/* === REDUCCIÓN DE MOVIMIENTO === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* === ESTILOS GENERALES MEJORADOS === */
* { box-sizing: border-box; }
html, body { height: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Poppins', 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--color-blanco);
  color: var(--color-texto);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Títulos con tipografía responsiva */
h1, h2, h3 {
  line-height: 1.2;
  margin-top: 0;
}
h1 {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
}
h2 {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

/* Imágenes responsivas */
img { 
  max-width: 100%; 
  height: auto; 
  display: block;
}

/* === CLASE BASE PARA BOTONES (CON TAMAÑO TÁCTIL) === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: all var(--transition);
  text-align: center;
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  min-height: 44px;
  text-decoration: none;
}
.btn-primary {
  background: var(--color-primario);
  color: var(--color-blanco);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-primario-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* === ENCABEZADO MEJORADO === */
.site-header {
  background-color: var(--color-primario);
  border-bottom: 2px solid var(--color-border);
  color: var(--color-blanco);
  position: sticky;
  top: 0;
  z-index: 100;
  animation: slideDown 0.5s ease;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  gap: var(--gap);
}

/* Botón hamburguesa accesible */
.nav-toggle {
  background: none;
  border: none;
  display: none;
  cursor: pointer;
  padding: 10px;
  z-index: 101;
  position: relative;
}
.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  background-color: var(--color-blanco);
  height: 3px;
  width: 25px;
  border-radius: 2px;
  position: relative;
  transition: transform 0.3s ease, top 0.3s ease;
}
.hamburger::before { 
  content: ''; 
  top: -8px; 
  position: absolute; 
}
.hamburger::after  { 
  content: ''; 
  top: 8px; 
  position: absolute; 
}

/* Estado activo para el ícono hamburguesa */
.nav-toggle.active .hamburger {
  background: transparent;
}
.nav-toggle.active .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-toggle.active .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

.logo img { 
  height: 50px; 
  transition: transform 0.3s ease;
}
.logo img:hover {
  transform: scale(1.05);
}

/* Search */
.search-container {
  display: flex;
  align-items: center;
  background-color: var(--color-marfil);
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s;
}
.search-container:focus-within {
  box-shadow: 0 0 0 2px rgba(245, 152, 39, 0.3);
}
.search-container input {
  border: none;
  padding: 8px;
  width: 200px;
  background: transparent;
  color: var(--color-texto);
  outline: none;
  font-family: inherit;
  min-height: 36px;
}
.search-container button {
  background-color: var(--color-primario);
  border: none;
  padding: 8px 12px;
  color: var(--color-blanco);
  border-radius: var(--radius-sm);
  margin-left: 6px;
  transition: background 0.2s;
  min-height: 36px;
}
.search-container button:hover,
.search-container button:focus {
  background: var(--color-primario-dark);
}

/* WhatsApp / contacto acciones */
.contact-actions .whatsapp-btn {
  background-color: var(--color-primario-dark);
  color: var(--color-blanco);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  gap: .5rem;
  transition: background var(--transition), transform 0.1s;
  font-weight: 600;
  min-height: 44px;
}
.contact-actions .whatsapp-btn:hover,
.contact-actions .whatsapp-btn:focus { 
  background-color: var(--color-primario); 
  transform: translateY(-2px);
}

/* === NAVEGACIÓN ACCESIBLE - MENÚ HAMBURGUESA === */
.site-nav {
  background-color: var(--color-marfil);
  border-top: 1px solid var(--color-border);
  position: relative;
}
.site-nav ul {
  display: flex;
  justify-content: center;
  padding: 10px 0;
  margin: 0;
  list-style: none;
  gap: 1rem;
  transition: max-height 0.5s ease-in-out, opacity 0.5s ease, padding 0.5s ease;
}
.site-nav li {
  position: relative;
  overflow: hidden;
}
.site-nav li a {
  color: var(--color-texto);
  margin: 0 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.3s, color 0.3s;
  display: block;
  position: relative;
}
.site-nav li a::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primario);
  transition: width 0.3s ease;
}
.site-nav li a:hover,
.site-nav li a:focus {
  background-color: var(--color-primario);
  color: var(--color-blanco);
}
.site-nav li a:hover::before,
.site-nav li a:focus::before {
  width: 100%;
}

/* Mobile nav toggle */
@media (max-width: 768px) {
  .nav-toggle { 
    display: block; 
  }
  
  /* Estado inicial del menú (cerrado) */
  .site-nav ul { 
    flex-direction: column; 
    display: block;
    max-height: 0;
    opacity: 0;
    padding: 0;
    overflow: hidden;
  }
  
  /* Estado activo del menú (abierto) */
  .site-nav ul.active { 
    max-height: 500px; /* espacio suficiente */
    opacity: 1;
    padding: 20px 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .site-nav ul { 
    text-align: center; 
  }
  
  /* Ajustes para elementos del header en móviles */
  .header-top {
    flex-wrap: wrap;
  }
  .search-container {
    order: 3;
    width: 100%;
    margin-top: 10px;
    display: none;
  }
  .search-container.active {
    display: flex;
  }
  .search-container input {
    width: 100%;
  }
  .logo {
    order: 1;
  }
  .contact-actions {
    order: 2;
  }
  .nav-toggle {
    order: 4;
  }
  
  /* Ocultar texto de WhatsApp en móviles */
  .whatsapp-btn span:not(.icon) {
    display: none;
  }
}

/* === HERO CON TIPOGRAFÍA RESPONSIVA === */
.hero {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border);
}

/* Imagen de fondo + blur */
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url('carretera.jpg') center/cover no-repeat;
  filter: blur(8px);
  transform: scale(1.05);
  z-index: 0;
}

/* Capa oscura semitransparente encima de la imagen para legibilidad */
.hero::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.35);
  z-index: 1;
}

/* Contenido sobre la imagen */
.hero-content {
  position: relative;
  z-index: 2;
  color: var(--color-blanco);
  padding: 0 1rem;
  animation: fadeInUp 1s ease-out;
}
.hero h1 { 
  font-size: clamp(1.6rem, 4vw, 2.6rem); 
  margin: 0 0 .4rem; 
  color: var(--color-blanco); 
  animation: slideInLeft 1s ease-out;
}
.hero p  { 
  font-size: clamp(0.95rem, 2vw, 1.1rem); 
  margin: 0; 
  color: rgba(255,255,255,0.9); 
  max-width: 600px; 
  margin: 0 auto 1.5rem; 
  animation: slideInRight 1s ease-out;
}
.hero .btn-primary {
  animation: fadeIn 1.5s ease-out;
}

/* === SECCIONES CON ANIMACIONES === */
section { 
  padding: 60px 20px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
section.visible {
  opacity: 1;
  transform: translateY(0);
}
.nosotros h2, .ventajas h2, .autos h2 {
  color: var(--color-primario);
  margin-bottom: 20px;
  font-weight: 700;
  position: relative;
  display: inline-block;
}
.nosotros h2::after, .ventajas h2::after, .autos h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 50px;
  height: 3px;
  background-color: var(--color-primario);
  transition: width 0.5s ease;
}
.nosotros h2:hover::after, .ventajas h2:hover::after, .autos h2:hover::after {
  width: 100%;
}

/* Ventajas: tarjetas marfil */
.ventajas ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--gap);
}
.ventajas li {
  background-color: var(--color-marfil);
  color: var(--color-texto);
  padding: 18px 22px;
  border-radius: var(--radius);
  max-width: 240px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}
.ventajas li.visible {
  opacity: 1;
  transform: translateY(0);
}
.ventajas li:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  background-color: var(--color-blanco);
}

/* === GALERÍA DE AUTOS CON MEJOR RENDIMIENTO === */
.galeria-autos {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--gap);
  padding: 1rem;
  align-items: start;
}

/* Tarjeta */
.auto-card {
  background-color: var(--color-blanco);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.4s ease;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 12px;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.auto-card.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Imágenes con transición suave */
.auto-card img {
  width: auto;
  max-width: 80%;
  max-height: 140px;
  object-fit: contain;
  margin: 16px auto 8px;
  background: transparent;
  border-radius: var(--radius-sm);
  transition: transform 0.4s ease;
}

/* Info */
.auto-info {
  padding: 0 1rem 1rem;
  width: 100%;
  box-sizing: border-box;
}

/* Encabezado y texto del card */
.auto-info h3 { 
  margin: 0 0 8px; 
  color: var(--color-primario); 
  transition: color 0.3s ease;
}
.auto-info p { 
  margin: 0 0 12px; 
  color: var(--color-muted); 
}
.estado.disponible {
  color: #2ecc71;
  font-weight: 600;
}
.estado.no-disponible {
  color: #e74c3c;
  font-weight: 600;
}

/* Botón */
.auto-info .btn-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primario);
  color: var(--color-blanco);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  margin-top: 6px;
  transition: background var(--transition), transform 0.1s;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}
.auto-info .btn-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.auto-info .btn-info:hover,
.auto-info .btn-info:focus { 
  background: var(--color-primario-dark); 
  transform: translateY(-2px);
}
.auto-info .btn-info:hover::before {
  left: 100%;
}

/* Efecto hover para tarjetas de auto */
.auto-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}
.auto-card:hover img {
  transform: scale(1.05);
}
.auto-card:hover h3 {
  color: var(--color-primario-dark);
}

/* === CONTENEDOR DE DOS CAJAS === */
.section-container {
  display: flex;
  align-items: center;
  gap: calc(var(--gap)*1.6);
  flex-wrap: wrap;
  padding: 2rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.section-container.visible {
  opacity: 1;
  transform: translateY(0);
}
.section-container.reverse { flex-direction: row-reverse; }

/* === CAJAS (BOXES) CON VARIABLES === */
.box {
  flex: 1 1 300px;
  padding: calc(var(--gap)*1.6);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--color-border);
  transition: transform var(--transition);
  overflow: hidden;
  position: relative;
}
.box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primario), var(--color-primario-dark));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s ease;
}
.box:hover {
  transform: translateY(-5px);
}
.box:hover::before {
  transform: scaleX(1);
}
.box img { 
  max-width: 100%; 
  display: block; 
  margin: 0 auto; 
  transition: transform 0.5s ease;
}
.box:hover img {
  transform: scale(1.05);
}

/* Caja naranja con texto blanco */
.box-accent {
  background-color: var(--color-primario);
  color: var(--color-blanco);
}

/* Mejora contraste para texto en caja naranja */
.box-accent p {
  color: rgba(255,255,255,0.9);
}

/* Caja marfil / hueso con texto oscuro */
.box-light {
  background-color: var(--color-marfil);
  color: var(--color-texto);
}

/* Ajuste de tipografía dentro de los boxes */
.box-accent h2, .box-light h2 { margin-top: 0; color: inherit; }
.box-accent ul { list-style: none; padding: 0; }
.box-accent ul li {
  margin-bottom: 0.75rem;
  position: relative;
  padding-left: 1.5rem;
  transition: transform 0.3s ease;
}
.box-accent ul li:hover {
  transform: translateX(5px);
}
.box-accent ul li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: var(--color-blanco);
}

/* === FOOTER CON GRADIENTE Y REDES SOCIALES === */
.site-footer {
  background: linear-gradient(135deg, var(--color-primario), var(--color-primario-dark));
  color: var(--color-blanco);
  padding: 40px 20px;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
}
.footer-widgets {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: var(--gap);
}
.site-footer .widget h4 { 
  margin-bottom: 15px; 
  color: var(--color-blanco);
  font-weight: 600;
  position: relative;
  padding-bottom: 10px;
}
.site-footer .widget h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 2px;
  background: rgba(255,255,255,0.5);
  transition: width 0.3s ease;
}
.site-footer .widget:hover h4::after {
  width: 100%;
}
.site-footer a { color: var(--color-blanco); }
.site-footer a:hover { color: rgba(255,255,255,0.8); }
.footer-bottom {
  text-align: center;
  margin-top: 30px;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.9);
}

/* Redes sociales en el footer */
.social-links {
  display: flex;
  gap: 15px;
  margin-top: 15px;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: white;
  transition: all 0.2s ease;
  text-decoration: none;
}
.social-link:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-3px) rotate(5deg);
}

/* === BOTÓN WHATSAPP FLOTANTE === */
.btn-whatsapp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--color-primario);
  color: var(--color-blanco);
  padding: 14px;
  border-radius: 50px;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.12);
  transition: all 0.3s ease;
  z-index: 1000;
  text-decoration: none;
  overflow: hidden;
  animation: pulse 2s infinite;
}
.btn-whatsapp .whatsapp-text {
  display: none;
  margin-left: 8px;
  font-size: 14px;
  font-weight: 600;
}
.btn-whatsapp:hover {
  background-color: var(--color-primario-dark); 
  transform: translateY(-3px) scale(1.05);
  padding-right: 20px;
  padding-left: 20px;
}
.btn-whatsapp:hover .whatsapp-text {
  display: inline;
}

/* === ANIMACIONES PERSONALIZADAS === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 152, 39, 0.6);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(245, 152, 39, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 152, 39, 0);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* === UTILIDADES === */
.hidden { display: none !important; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* === RESPONSIVIDAD ADICIONAL === */
@media (max-width: 768px) {
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  .hero { height: 320px; }
  .hero h1 { font-size: 1.6rem; }
  .auto-card img { max-height: 120px; }
  .footer-widgets { flex-direction: column; }
  .btn-whatsapp:hover {
    padding: 14px;
  }
  .btn-whatsapp:hover .whatsapp-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .contact-actions {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
  }
  .auto-card img { max-height: 100px; }
  .galeria-autos { gap: 1rem; padding: .5rem; }
  .section-container {
    flex-direction: column;
  }
  .box {
    flex: 1 1 100%;
  }
}
/* === CARRUSEL DE AUTOS === */
.cars-carousel {
  position: relative;
  max-width: 1200px;
  margin: 2rem auto 0;
  padding: 0 1rem;
}

.carousel-container {
  position: relative;
  padding: 0 40px;
}

.carousel-track-container {
  overflow: hidden;
  border-radius: var(--radius);
}

.carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  list-style: none;
  margin: 0;
  padding: 0;
}

.carousel-slide {
  flex: 0 0 auto;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-primario);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.carousel-control:hover {
  background: var(--color-primario-dark);
  transform: translateY(-50%) scale(1.1);
}

.carousel-control.prev {
  left: 0;
}

.carousel-control.next {
  right: 0;
}

.carousel-nav {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.carousel-indicator {
  border: 0;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  background: rgba(0, 0, 0, 0.2);
  margin: 0 5px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.carousel-indicator.current-slide {
  background: var(--color-primario);
}

/* Responsive */
@media (min-width: 768px) {
  .carousel-slide {
    width: 50%;
  }
}

@media (min-width: 992px) {
  .carousel-slide {
    width: 33.333%;
  }
}

@media (max-width: 480px) {
  .carousel-container {
    padding: 0 30px;
  }
  
  .carousel-control {
    width: 30px;
    height: 30px;
    font-size: 1rem;
  }
}