/* ==============================================================================
   PUNTIVA FESTIVE THEMES ENGINE - CSS ESTACIONAL
   Detalles sutiles, elegantes y modernos inspirados en Amazon & Google Doodles.
   Todos los elementos flotantes tienen pointer-events: none para no obstruir clics.
   ============================================================================== */

/* Contenedor global de partículas y adornos */
.festive-canvas-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 998;
  overflow: hidden;
}

/* Partícula base flotante */
.festive-particle {
  position: absolute;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
}

/* ==============================================================================
   1. TEMA: DÍA DE MUERTOS / HALLOWEEN (day_of_dead)
   ============================================================================== */
[data-festive="day_of_dead"] .header-nav-wrap::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 5px;
  background: repeating-linear-gradient(
    90deg,
    #F97316 0, #F97316 20px,
    #8B5CF6 20px, #8B5CF6 40px,
    #10B981 40px, #10B981 60px,
    #EC4899 60px, #EC4899 80px,
    #FBBF24 80px, #FBBF24 100px
  );
  opacity: 0.85;
}

/* Telaraña sutil en esquina superior */
[data-festive="day_of_dead"] .festive-corner-spiderweb {
  position: fixed;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  pointer-events: none;
  z-index: 1001;
  opacity: 0.35;
  background-image: radial-gradient(circle at 100% 0%, transparent 20%, rgba(139, 92, 246, 0.2) 21%, transparent 22%),
                    radial-gradient(circle at 100% 0%, transparent 40%, rgba(139, 92, 246, 0.2) 41%, transparent 42%),
                    radial-gradient(circle at 100% 0%, transparent 60%, rgba(139, 92, 246, 0.2) 61%, transparent 62%),
                    radial-gradient(circle at 100% 0%, transparent 80%, rgba(139, 92, 246, 0.2) 81%, transparent 82%);
}

@keyframes floatSugarSkull {
  0% { transform: translateY(105vh) rotate(0deg) scale(0.8); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% { transform: translateY(-10vh) rotate(360deg) scale(1); opacity: 0; }
}

@keyframes swayPetal {
  0% { transform: translateY(-5vh) translateX(0) rotate(0deg); opacity: 0; }
  15% { opacity: 0.75; }
  50% { transform: translateY(50vh) translateX(30px) rotate(180deg); }
  85% { opacity: 0.75; }
  100% { transform: translateY(105vh) translateX(-20px) rotate(360deg); opacity: 0; }
}

/* ==============================================================================
   2. TEMA: NAVIDAD & FIESTAS (christmas)
   ============================================================================== */
/* Guirnalda de luces navideñas colgando del header */
[data-festive="christmas"] .header-nav-wrap::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 0;
  right: 0;
  height: 8px;
  background-image: radial-gradient(circle 3px, #EF4444 100%, transparent 0),
                    radial-gradient(circle 3px, #10B981 100%, transparent 0),
                    radial-gradient(circle 3px, #FBBF24 100%, transparent 0),
                    radial-gradient(circle 3px, #3B82F6 100%, transparent 0);
  background-size: 32px 8px;
  background-position: 0 0, 8px 0, 16px 0, 24px 0;
  animation: fairyLights 1.6s infinite alternate ease-in-out;
  opacity: 0.85;
}

@keyframes fairyLights {
  0% { opacity: 0.5; filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.6)); }
  100% { opacity: 1; filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.8)); }
}

/* Gorrito navideño en el isotipo */
[data-festive="christmas"] .nav-logo {
  position: relative;
}
[data-festive="christmas"] .nav-logo-icon::before {
  content: "🎅";
  position: absolute;
  top: -12px;
  left: -8px;
  font-size: 1.15rem;
  transform: rotate(-15deg);
  pointer-events: none;
}

@keyframes fallSnowflake {
  0% { transform: translateY(-5vh) translateX(0); opacity: 0; }
  10% { opacity: 0.85; }
  90% { opacity: 0.85; }
  100% { transform: translateY(105vh) translateX(25px); opacity: 0; }
}

/* ==============================================================================
   3. TEMA: AÑO NUEVO (new_year)
   ============================================================================== */
[data-festive="new_year"] .header-nav-wrap::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F59E0B, #FDE68A, #D97706, #FBBF24);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

@keyframes floatSparkle {
  0% { transform: translateY(105vh) scale(0.6); opacity: 0; }
  20% { opacity: 0.8; }
  50% { transform: translateY(50vh) scale(1.1) rotate(180deg); }
  80% { opacity: 0.8; }
  100% { transform: translateY(-5vh) scale(0.6) rotate(360deg); opacity: 0; }
}

/* ==============================================================================
   4. TEMA: SEMANA SANTA / SPRING BREAK (spring_break)
   ============================================================================== */
[data-festive="spring_break"] .header-nav-wrap::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #06B6D4, #3B82F6, #10B981, #F59E0B);
}

@keyframes floatTropical {
  0% { transform: translateY(105vh) rotate(0deg); opacity: 0; }
  15% { opacity: 0.75; }
  85% { opacity: 0.75; }
  100% { transform: translateY(-5vh) rotate(180deg); opacity: 0; }
}

/* ==============================================================================
   5. TEMA: BUEN FIN / BLACK FRIDAY (black_friday)
   ============================================================================== */
[data-festive="black_friday"] .header-nav-wrap::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #EF4444, #F59E0B, #DC2626);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

@keyframes pulseDealFlame {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(239, 68, 68, 0.4)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.7)); }
}

[data-festive="black_friday"] .section-tag {
  animation: pulseDealFlame 2s infinite ease-in-out;
}

/* ==============================================================================
   6. TEMA: VERANO / SUMMER (summer)
   ============================================================================== */
[data-festive="summer"] .header-nav-wrap::after {
  content: "";
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #F59E0B, #F97316, #06B6D4);
}

@keyframes floatSummerSun {
  0% { transform: translateY(105vh) rotate(0deg); opacity: 0; }
  15% { opacity: 0.8; }
  85% { opacity: 0.8; }
  100% { transform: translateY(-5vh) rotate(360deg); opacity: 0; }
}

/* ==============================================================================
   ACCESIBILIDAD: PREFERS REDUCED MOTION
   Si el usuario tiene activada la reducción de movimiento, desactivar animaciones.
   ============================================================================== */
@media (prefers-reduced-motion: reduce) {
  .festive-canvas-overlay {
    display: none !important;
  }
  .header-nav-wrap::after {
    animation: none !important;
  }
}
