/* ===========================================
   animations.css — Keyframes y transiciones
   Grúas Chino
   =========================================== */

/* Pulso SOS rojo */
@keyframes pulse-sos {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50%      { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}

/* Pulso verde (en línea) */
@keyframes pulse-online {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* Pulso nocturno rojo */
@keyframes pulse-night {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.3; }
}

/* Líneas de carretera subiendo */
@keyframes road-lines {
  0%   { transform: translateY(0); }
  100% { transform: translateY(100px); }
}

/* Fade in desde abajo */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade in */
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Slide up (panel checklist) */
@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide down (menú mobile) */
@keyframes slide-down {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Contador numérico (escala) */
@keyframes count-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* Spin (spinner GPS) */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Shimmer (placeholder carga) */
@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

/* Glow ámbar (botón GPS) */
@keyframes glow-amber {
  0%, 100% { box-shadow: 0 0 8px rgba(245,158,11,0.4); }
  50%      { box-shadow: 0 0 20px rgba(245,158,11,0.7); }
}

/* Clase utilitaria: aplicar al entrar en viewport */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Checkbox check animado */
@keyframes check-mark {
  0%   { stroke-dashoffset: 24; }
  100% { stroke-dashoffset: 0; }
}

/* Preloader */
@keyframes preloader-spin {
  to { transform: rotate(360deg); }
}

@keyframes preloader-progress {
  0% { width: 0; }
  100% { width: 100%; }
}

@keyframes preloader-fade-out {
  to { opacity: 0; visibility: hidden; }
}

/* Scroll reveal animations */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-left {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes reveal-right {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes reveal-zoom {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

/* Floating button bounce */
@keyframes float-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Gradient shift for backgrounds */
@keyframes gradient-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Subtle glow pulse for cards on hover */
@keyframes subtle-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
  50% { box-shadow: 0 0 20px 2px rgba(245,158,11,0.15); }
}

/* Text shimmer effect */
@keyframes text-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Hero title — sin animación que oculte contenido */

/* ── CUSTOM CURSOR ───────────────────────── */
.custom-cursor {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99999;
  mix-blend-mode: difference;
}

.custom-cursor__dot {
  position: fixed;
  top: -4px;
  left: -4px;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
}

.custom-cursor__ring {
  position: fixed;
  top: -20px;
  left: -20px;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(245,158,11,0.5);
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  transition: width 0.3s ease, height 0.3s ease, top 0.3s ease, left 0.3s ease, border-color 0.3s ease;
}

.custom-cursor__ring--hover {
  width: 60px;
  height: 60px;
  top: -30px;
  left: -30px;
  border-color: var(--color-amber);
  background: rgba(245,158,11,0.05);
}

/* ── SCROLL PROGRESS BAR ─────────────────── */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--color-amber), var(--color-red), var(--color-amber));
  z-index: 99998;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(245,158,11,0.5);
}

/* ── GLOW CARD EFFECT ────────────────────── */
.services__card::before,
.weather__card::before,
.problems__card::after,
.testimonials__card::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 50%;
  z-index: 0;
}

.services__card:hover::before,
.weather__card:hover::before,
.problems__card:hover::after,
.testimonials__card:hover::before {
  opacity: 1;
}

.services__card,
.weather__card,
.testimonials__card {
  position: relative;
  overflow: hidden;
}

/* ── FLIP DIGITS ─────────────────────────── */
.flip-digit {
  display: inline-block;
  animation: flip-in 0.4s ease both;
}

@keyframes flip-in {
  from {
    transform: rotateX(90deg);
    opacity: 0;
  }
  to {
    transform: rotateX(0);
    opacity: 1;
  }
}

/* ── HERO PARTICLES ──────────────────────── */
/* hero__particles / hero__particle — eliminados (efecto de lluvia permanente) */

/* ── TYPING CURSOR BLINK ─────────────────── */
.hero__title {
  border-right: 3px solid transparent;
}

@keyframes blink-cursor {
  0%, 100% { border-color: var(--color-amber); }
  50% { border-color: transparent; }
}

/* ── HERO TRUCK SVG ──────────────────────── */
.hero-truck {
  width: 100%;
  max-width: 350px;
  margin: var(--space-lg) auto;
  opacity: 0;
  transform: translateX(100px);
  animation: truck-enter 1.5s cubic-bezier(0.16, 1, 0.3, 1) 2s forwards;
}

@keyframes truck-enter {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-truck__svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

/* Luz de emergencia parpadeante */
.hero-truck__light {
  animation: emergency-light 0.8s ease-in-out infinite alternate;
}

@keyframes emergency-light {
  0% { fill: #EF4444; opacity: 1; }
  100% { fill: #FCA5A5; opacity: 0.4; }
}

/* Ruedas girando */
.hero-truck__svg circle[cx="50"][r="14"],
.hero-truck__svg circle[cx="130"][r="14"] {
  transform-origin: center;
  animation: wheel-spin 1s linear infinite;
}

@keyframes wheel-spin {
  to { transform: rotate(360deg); }
}

/* Auto sobre plataforma con sutil bounce */
.hero-truck__car {
  animation: car-bounce 3s ease-in-out infinite;
}

@keyframes car-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

/* ── MOUNTAIN SEPARATORS ─────────────────── */
.mountain-sep {
  position: relative;
  width: 100%;
  height: 50px;
  overflow: hidden;
  margin: 0;
  line-height: 0;
}

.mountain-sep__svg {
  width: 100%;
  height: 100%;
  display: block;
}

.mountain-sep__svg path {
  fill: var(--color-bg2);
  transition: fill 0.3s ease;
}

/* Alternar colores según sección siguiente */
.services .mountain-sep__svg path,
.gallery + .mountain-sep .mountain-sep__svg path {
  fill: var(--color-bg2);
}

/* ── ROAD DRAW ON SCROLL ─────────────────── */
.road-draw {
  position: absolute;
  right: -20px;
  top: 0;
  bottom: 0;
  width: 80px;
  opacity: 0.4;
  pointer-events: none;
  display: none;
}

.road-draw__svg {
  width: 100%;
  height: 100%;
}

.road-draw__path-active {
  transition: stroke-dashoffset 0.1s ease;
}

/* Puntos de ciudades */
.road-draw__svg circle {
  opacity: 0.8;
}

@media (min-width: 1024px) {
  .road-draw {
    display: block;
    right: 0;
    width: 100px;
  }

  .hero-truck {
    max-width: 420px;
  }

  .mountain-sep {
    height: 70px;
  }
}

@media (min-width: 1280px) {
  .road-draw {
    right: 20px;
    width: 120px;
    opacity: 0.5;
  }
}
