/* =========================================================
   TEMA HALLOWEEN
   Se activa con <body class="tema-halloween">.
   Decoración visible pero dosificada: hero + detalles en secciones.
========================================================= */
.tema-halloween {
  --halloween: #ff7a18;
}

/* ---------- HERO: brillo naranja + niebla ---------- */
.tema-halloween .hero-premium .hero-overlay {
  background:
    radial-gradient(circle at 80% 28%, rgba(255, 122, 24, 0.22), transparent 40%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.55));
}

.hw-fog {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -20px;
  height: 140px;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 70%, rgba(200, 200, 210, 0.16), transparent 60%),
    radial-gradient(ellipse at 60% 80%, rgba(200, 200, 210, 0.12), transparent 55%),
    radial-gradient(ellipse at 90% 70%, rgba(200, 200, 210, 0.14), transparent 60%);
  filter: blur(8px);
  animation: hwFog 18s ease-in-out infinite alternate;
}

@keyframes hwFog {
  from { transform: translateX(-4%); }
  to   { transform: translateX(4%); }
}

/* Espacio para que las calabazas no tapen las tarjetas del hero */
@media (min-width: 1024px) {
  .tema-halloween .hero-premium {
    padding-bottom: 84px;
  }
}

/* ---------- Telarañas en esquinas ---------- */
.hw-web {
  position: absolute;
  z-index: 2;
  width: 170px;
  height: 170px;
  opacity: 0.42;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23e8e8e8' stroke-width='.55'%3E%3Cpath d='M0 0L100 100M0 0L100 45M0 0L45 100M0 0L100 12M0 0L12 100'/%3E%3Cpath d='M16 0Q13 9 16 16Q9 13 0 16M34 0Q28 17 34 34Q17 28 0 34M54 0Q45 27 54 54Q27 45 0 54M76 0Q63 38 76 76Q38 63 0 76M98 0Q82 50 98 98Q50 82 0 98'/%3E%3C/svg%3E") no-repeat top left / contain;
}

.hw-web.left  { top: 0; left: 0; }
.hw-web.right { top: 0; right: 0; transform: scaleX(-1); }
.hw-web.small { width: 110px; height: 110px; opacity: 0.32; }

/* ---------- Murciélagos (cada ~16s, de forma tranquila) ---------- */
.hw-bats {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.hw-bats span {
  position: absolute;
  left: -60px;
  width: 38px;
  height: 20px;
  opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath fill='%23161616' d='M32 10c2-4 4-5 4-5l1 4c3-1 5 0 5 0-2 2-1 6-1 6 5-6 13-8 23-6-6 2-9 6-9 10-3-3-7-3-9 0-2-3-6-4-9-1-1-2-3-4-5-4s-4 2-5 4c-3-3-7-2-9 1-2-3-6-3-9 0 0-4-3-8-9-10 10-2 18 0 23 6 0 0 1-4-1-6 0 0 2-1 5 0l1-4s2 1 4 5z'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 0 8px rgba(255, 140, 40, 0.75));
  animation: hwBat 16s ease-in-out infinite;
}

.hw-bats span:nth-child(1) { top: 16%; animation-delay: 0.5s; }
.hw-bats span:nth-child(2) { top: 28%; width: 26px; animation-delay: 1.6s; }
.hw-bats span:nth-child(3) { top: 10%; width: 22px; animation-delay: 2.4s; }
.hw-bats span:nth-child(4) { top: 40%; width: 30px; animation-delay: 9s; }

@keyframes hwBat {
  0%   { opacity: 0; transform: translate(0, 0) scaleY(1); }
  3%   { opacity: 0.95; }
  10%  { transform: translate(30vw, -24px) scaleY(0.55); }
  20%  { transform: translate(60vw, 14px) scaleY(1); }
  30%  { transform: translate(90vw, -18px) scaleY(0.55); }
  36%  { opacity: 0.95; }
  40%  { opacity: 0; transform: translate(118vw, 0) scaleY(1); }
  100% { opacity: 0; transform: translate(118vw, 0); }
}

/* ---------- Calabazas con luz parpadeante ---------- */
.hw-pumpkins {
  position: absolute;
  right: max(24px, calc((100% - 1180px) / 2));
  bottom: 6px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  pointer-events: none;
}

.hw-pumpkin {
  width: 64px;
  animation: hwBob 4s ease-in-out infinite;
}

.hw-pumpkin.small {
  width: 44px;
  animation-delay: 0.8s;
}

.hw-pumpkin .face {
  animation: hwFlicker 2.6s infinite;
}

.hw-pumpkin svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(255, 122, 24, 0.55));
}

@keyframes hwBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-6px) rotate(2deg); }
}

@keyframes hwFlicker {
  0%, 100% { opacity: 1; }
  42%      { opacity: 0.75; }
  46%      { opacity: 1; }
  70%      { opacity: 0.85; }
}

/* ---------- Araña colgando (Promos) ---------- */
.promos-section {
  position: relative;
  overflow: hidden;
}

.hw-spider {
  position: absolute;
  top: 0;
  right: max(40px, calc((100% - 1180px) / 2 + 30px));
  z-index: 3;
  width: 26px;
  pointer-events: none;
  transform-origin: top center;
  animation: hwSpider 7s ease-in-out infinite;
}

.hw-spider::before {
  content: "";
  display: block;
  width: 1px;
  height: 70px;
  margin: 0 auto;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.45));
}

.hw-spider svg {
  display: block;
  width: 26px;
  height: auto;
}

@keyframes hwSpider {
  0%, 100% { transform: translateY(-40px) rotate(0deg); }
  45%      { transform: translateY(0) rotate(3deg); }
  60%      { transform: translateY(-6px) rotate(-3deg); }
}

/* ---------- Toques en el resto de la página ---------- */
.tema-halloween .section-title::after {
  background: linear-gradient(90deg, transparent, var(--halloween), transparent);
}

.tema-halloween .cart-btn::after {
  content: "🎃";
  position: absolute;
  bottom: -7px;
  left: -7px;
  font-size: 0.8rem;
  line-height: 1;
}

.tema-halloween .footer {
  position: relative;
}

/* Tarjeta de la Burger Pizza en Promos */
.promo-flyer-card.promo-halloween {
  border-color: rgba(255, 122, 24, 0.55);
  animation: hwGlow 3.2s ease-in-out infinite;
}

.promo-halloween .promo-day-badge {
  background: linear-gradient(135deg, #ffa149, var(--halloween));
}

.promo-halloween .promo-flyer-image {
  object-fit: cover;
  object-position: center 40%;
}

.promo-halloween .promo-flyer-btn {
  border-color: rgba(255, 122, 24, 0.45);
  color: #ffb070;
}

@keyframes hwGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 24, 0), 0 18px 38px rgba(0, 0, 0, 0.44); }
  50%      { box-shadow: 0 0 26px 2px rgba(255, 122, 24, 0.3), 0 18px 38px rgba(0, 0, 0, 0.44); }
}

/* ---------- Celular: menos elementos y más pequeños ---------- */
@media (max-width: 768px) {
  .hw-web { width: 110px; height: 110px; opacity: 0.32; }
  .hw-web.right,
  .hw-bats span:nth-child(3),
  .hw-bats span:nth-child(4) { display: none; }
  .hw-pumpkins { right: 14px; bottom: 12px; }
  .hw-pumpkin { width: 46px; }
  .hw-pumpkin.small { display: none; }
  .hw-spider { right: 22px; }
}

/* ---------- Respeta "reducir movimiento" ---------- */
@media (prefers-reduced-motion: reduce) {
  .hw-bats { display: none; }
  .hw-fog,
  .hw-pumpkin,
  .hw-pumpkin .face,
  .hw-spider,
  .promo-flyer-card.promo-halloween { animation: none; }
}

/* Contenedor para la telaraña de Contacto */
.tema-halloween #contacto {
  position: relative;
  overflow: hidden;
}
