/*
 * NATGAS — Easter egg "Doodle" de Independencia de México.
 * v1 (2026-08-31)
 *
 * Vigencia: 2026-08-31 a 2026-09-17 (controlado por JS en
 * assets/js/mx-independence-doodle.v1.js, no por CSS).
 * Vive únicamente en el home (index.php / index-Natgas.php) — no se
 * incluye en assets/includes/menu.php, que es compartido por todo el sitio.
 *
 * Paleta: navy/azul de marca (#002B49 / #007DBA) para el cuerpo del coche,
 * verde de marca (#43B02A) para el guiño "GNV = combustión limpia", y
 * verde/blanco/rojo únicamente como acento festivo de temporada (no se usan
 * en el resto del sitio).
 */

@media (prefers-reduced-motion: reduce) {
  .ng-doodle-badge { animation: none !important; }
  .ng-doodle-car, .ng-doodle-confetti { display: none !important; }
}

/* Insignia "haz clic" sobre el logo mientras el doodle está vigente */
.ng-doodle-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: conic-gradient(#1AAF1A 0 33%, #ffffff 33% 66%, #CE1126 66% 100%);
  box-shadow: 0 0 0 2px rgba(0,43,73,.9);
  animation: ng-doodle-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
header .logo { position: relative; cursor: pointer; }

@keyframes ng-doodle-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: .75; }
}

/* Contenedor de la animación, superpuesto al header, no bloquea clics fuera del coche/mensaje */
.ng-doodle-stage {
  position: absolute;
  inset: 0;
  z-index: 205; /* por encima de .navbar-top-default (199) */
  pointer-events: none;
  overflow: visible;
}

.ng-doodle-car {
  position: absolute;
  top: 50%;
  left: -120px;
  width: 96px;
  height: 44px;
  margin-top: -22px;
  animation: ng-doodle-drive 2.6s cubic-bezier(.45,.05,.55,.95) forwards;
}
@keyframes ng-doodle-drive {
  0%   { left: -120px; }
  85%  { left: calc(100% + 40px); }
  100% { left: calc(100% + 140px); }
}

.ng-doodle-car .ng-wheel { animation: ng-doodle-spin .4s linear infinite; transform-origin: center; }
@keyframes ng-doodle-spin { to { transform: rotate(360deg); } }

.ng-doodle-car .ng-pennant {
  transform-origin: 2px 10px;
  animation: ng-doodle-flutter .5s ease-in-out infinite alternate;
}
@keyframes ng-doodle-flutter {
  from { transform: rotate(-6deg); }
  to   { transform: rotate(10deg); }
}

.ng-doodle-car .ng-puff {
  opacity: 0;
  animation: ng-doodle-puff 1.4s ease-out infinite;
}
.ng-doodle-car .ng-puff:nth-child(2) { animation-delay: .35s; }
.ng-doodle-car .ng-puff:nth-child(3) { animation-delay: .7s; }
@keyframes ng-doodle-puff {
  0%   { opacity: .85; transform: translate(0,0) scale(.4); }
  100% { opacity: 0;   transform: translate(-22px,-10px) scale(1.3); }
}

/* Confeti tricolor */
.ng-doodle-confetti {
  position: absolute;
  top: -6px;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  animation: ng-doodle-fall 1.8s ease-in forwards;
}
@keyframes ng-doodle-fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(70px) rotate(240deg); opacity: 0; }
}

/* Mensaje festivo */
.ng-doodle-toast {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -12px);
  margin-top: 10px;
  max-width: 92%;
  width: 380px;
  background: #ffffff;
  color: #002B49;
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(17,24,39,.22);
  padding: 14px 40px 14px 16px;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  font-size: .85rem;
  line-height: 1.45;
  opacity: 0;
  pointer-events: auto;
  transition: opacity .35s ease, transform .35s ease;
  border-top: 3px solid transparent;
  border-image: linear-gradient(to right, #1AAF1A 33%, #ffffff 33% 66%, #CE1126 66%) 1;
}
.ng-doodle-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.ng-doodle-toast strong { color: #007DBA; }
.ng-doodle-toast .ng-doodle-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: none;
  font-size: 1rem;
  line-height: 1;
  color: #737373;
  cursor: pointer;
  padding: 4px;
}
.ng-doodle-toast .ng-doodle-close:hover { color: #002B49; }

@media (max-width: 575px) {
  .ng-doodle-car { width: 72px; height: 33px; margin-top: -16px; }
  .ng-doodle-toast { width: 300px; font-size: .8rem; }
}
