/* ==========================================================================
   LOZADA EXPRESS — base.css
   Estilos compartidos + animaciones temáticas de carga y mudanzas:
   - .camion  → camión que cruza la pantalla con ruedas girando
   - .carretera → franja de asfalto con línea discontinua en movimiento
   - .marquesina → tren infinito de contenedores
   Paleta: azul marino de flota + rojo carga + amarillo señal.
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
  --marino: #14273f;
  --marino-oscuro: #0b1a2c;
  --rojo: #d9232e;
  --rojo-oscuro: #b01a24;
  --amarillo: #ffc531;
  --asfalto: #2b3644;
  --crema: #f8f9fb;
  --blanco: #ffffff;
  --gris-texto: #51606f;
  --gris-borde: #e5eaf0;

  --fuente-titulos: 'Archivo', 'Segoe UI', sans-serif;
  --fuente-cuerpo: 'Inter', 'Segoe UI', sans-serif;

  --contenedor: 1200px;
  --radio: 14px;
  --sombra: 0 16px 38px rgba(11, 26, 44, 0.14);
  --sombra-suave: 0 6px 22px rgba(11, 26, 44, 0.08);
  --transicion: 0.25s ease;
  --alto-header: 80px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--fuente-cuerpo);
  color: var(--gris-texto);
  background: var(--blanco);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

h1, h2, h3, h4 {
  font-family: var(--fuente-titulos);
  color: var(--marino);
  line-height: 1.15;
  font-weight: 800;
}

/* ---------- Utilidades ---------- */
.contenedor {
  width: min(var(--contenedor), 92%);
  margin-inline: auto;
}

.seccion {
  padding: 96px 0;
}

.etiqueta {
  display: inline-block;
  font-family: var(--fuente-titulos);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rojo);
  margin-bottom: 14px;
}

.titulo-seccion {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  margin-bottom: 18px;
}

/* ---------- Animación de aparición ---------- */
[data-animar] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-animar].visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-block;
  padding: 15px 34px;
  border-radius: 12px;
  font-family: var(--fuente-titulos);
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transicion);
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-rojo {
  background: var(--rojo);
  color: var(--blanco);
  box-shadow: 0 10px 26px rgba(217, 35, 46, 0.4);
}

.btn-rojo:hover {
  background: var(--rojo-oscuro);
  transform: translateY(-2px);
}

.btn-contorno {
  background: transparent;
  color: var(--blanco);
  border-color: rgba(255, 255, 255, 0.55);
}

.btn-contorno:hover {
  border-color: var(--blanco);
  background: rgba(255, 255, 255, 0.1);
}

.btn-marino {
  background: var(--marino);
  color: var(--blanco);
}

.btn-marino:hover {
  background: var(--marino-oscuro);
  transform: translateY(-2px);
}

/* ---------- Header ---------- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header--solido {
  background: rgba(11, 26, 44, 0.96);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--alto-header);
}

.header__logo img {
  height: 48px;
  width: auto;
}

.nav__lista {
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav__enlace {
  font-family: var(--fuente-titulos);
  color: rgba(255, 255, 255, 0.85);
  font-weight: 600;
  font-size: 0.93rem;
  padding: 6px 0;
  position: relative;
  transition: var(--transicion);
}

.nav__enlace::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--rojo);
  transition: width var(--transicion);
}

.nav__enlace:hover,
.nav__enlace--activo {
  color: var(--blanco);
}

.nav__enlace:hover::after,
.nav__enlace--activo::after {
  width: 100%;
}

/* Menú móvil */
.header__hamburguesa {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 42px;
  height: 42px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.header__hamburguesa span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--blanco);
  transition: var(--transicion);
}

/* ==========================================================================
   CARRETERA — franja de asfalto con línea discontinua en movimiento
   Colócala al pie de un hero: <div class="carretera"></div>
   ========================================================================== */
.carretera {
  position: relative;
  height: 54px;
  background: var(--asfalto);
}

/* Línea central discontinua que avanza (sensación de velocidad) */
.carretera::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  background-image: linear-gradient(90deg, var(--amarillo) 0 42px, transparent 42px 84px);
  background-size: 84px 5px;
  animation: rodar-linea 0.9s linear infinite;
}

/* Borde superior de la calzada */
.carretera::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.14);
}

@keyframes rodar-linea {
  from { background-position-x: 0; }
  to   { background-position-x: -84px; }
}

/* ==========================================================================
   CAMIÓN SVG ANIMADO
   <div class="camion"> ... svg ... </div> dentro de un contenedor
   position:relative. Cruza la pantalla, rebota levemente (suspensión)
   y sus ruedas (clase .camion__rueda en el SVG) giran.
   ========================================================================== */
.camion {
  position: absolute;
  bottom: 34px;            /* apoya sobre .carretera */
  left: 0;
  width: 300px;
  z-index: 5;
  animation: conducir 14s linear infinite;
  will-change: transform;
}

.camion svg {
  width: 100%;
  height: auto;
  display: block;
  animation: suspension 0.5s ease-in-out infinite alternate;
}

.camion__rueda {
  animation: girar 0.7s linear infinite;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes conducir {
  from { transform: translateX(-340px); }
  to   { transform: translateX(calc(100vw + 60px)); }
}

@keyframes suspension {
  from { transform: translateY(0); }
  to   { transform: translateY(-2.5px); }
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   MARQUESINA — tren infinito de contenedores
   <div class="marquesina"><div class="marquesina__pista"> [imgs] [imgs duplicadas] </div></div>
   El contenido va duplicado para el bucle perfecto (translateX -50%).
   ========================================================================== */
.marquesina {
  overflow: hidden;
  position: relative;
}

.marquesina__pista {
  display: flex;
  align-items: flex-end;
  gap: 0;
  width: max-content;
  animation: tren 26s linear infinite;
  will-change: transform;
}

.marquesina__pista img {
  height: 120px;
  width: auto;
  flex-shrink: 0;
}

.marquesina:hover .marquesina__pista {
  animation-play-state: paused;
}

@keyframes tren {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Hero interno de página ---------- */
.hero-pagina {
  position: relative;
  background:
    radial-gradient(ellipse at 82% 18%, rgba(217, 35, 46, 0.18), transparent 55%),
    linear-gradient(135deg, var(--marino-oscuro) 0%, var(--marino) 100%);
  color: var(--blanco);
  padding: calc(var(--alto-header) + 76px) 0 0;
}

.hero-pagina .contenedor {
  padding-bottom: 84px;
}

.hero-pagina .etiqueta {
  color: var(--amarillo);
}

.hero-pagina h1 {
  color: var(--blanco);
  font-size: clamp(2.1rem, 4.6vw, 3.2rem);
  margin-bottom: 18px;
}

.hero-pagina p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  margin-bottom: 26px;
}

/* ---------- CTA final compartido ---------- */
.cta-final {
  position: relative;
  background:
    radial-gradient(ellipse at 15% 80%, rgba(217, 35, 46, 0.16), transparent 55%),
    linear-gradient(135deg, var(--marino) 0%, var(--marino-oscuro) 100%);
  text-align: center;
  overflow: hidden;
}

.cta-final .etiqueta {
  color: var(--amarillo);
}

.cta-final h2 {
  color: var(--blanco);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  max-width: 780px;
  margin: 0 auto 16px;
}

.cta-final p {
  color: rgba(255, 255, 255, 0.85);
  max-width: 620px;
  margin: 0 auto 34px;
}

.cta-final__botones {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--marino-oscuro);
  color: rgba(255, 255, 255, 0.75);
  padding: 70px 0 0;
  font-size: 0.95rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 50px;
}

.footer__logo img {
  height: 50px;
  width: auto;
  margin-bottom: 20px;
  background: var(--blanco);
  border-radius: 10px;
  padding: 8px 14px;
}

.footer__descripcion {
  margin-bottom: 22px;
  line-height: 1.7;
}

.footer h4 {
  color: var(--blanco);
  font-size: 1rem;
  margin-bottom: 20px;
}

.footer__lista li {
  margin-bottom: 12px;
}

.footer__lista a {
  transition: var(--transicion);
}

.footer__lista a:hover {
  color: var(--amarillo);
}

.footer__social {
  display: flex;
  gap: 12px;
}

.footer__social a {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
  transition: var(--transicion);
}

.footer__social a:hover {
  background: var(--rojo);
  border-color: var(--rojo);
}

.footer__social svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 22px 0;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-flotante {
  position: fixed;
  bottom: 26px;
  right: 26px;
  z-index: 90;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25d366;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.45);
  transition: var(--transicion);
}

.whatsapp-flotante:hover {
  transform: scale(1.08);
}

.whatsapp-flotante svg {
  width: 30px;
  height: 30px;
  fill: var(--blanco);
}

/* ---------- Accesibilidad: sin animaciones si el usuario lo pide ---------- */
@media (prefers-reduced-motion: reduce) {
  .camion,
  .camion svg,
  .camion__rueda,
  .carretera::before,
  .marquesina__pista {
    animation: none !important;
  }

  [data-animar] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .seccion {
    padding: 68px 0;
  }

  .header__hamburguesa {
    display: flex;
  }

  .header {
    background: rgba(11, 26, 44, 0.96);
  }

  .nav {
    position: absolute;
    top: var(--alto-header);
    left: 0;
    right: 0;
    background: var(--marino-oscuro);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .nav--abierto {
    max-height: 460px;
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.3);
  }

  .nav__lista {
    flex-direction: column;
    gap: 0;
    padding: 12px 0 24px;
  }

  .nav__lista li {
    width: 100%;
    text-align: center;
  }

  .nav__enlace {
    display: block;
    padding: 14px 0;
  }

  .camion {
    width: 220px;
    bottom: 30px;
  }

  .marquesina__pista img {
    height: 84px;
  }
}

@media (max-width: 540px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}
