/* ===========================================================
   Brisa Nómade — capa de Halloween
   -----------------------------------------------------------
   Mismo molde que dieciocho.css: va ENCIMA del sitio, no lo
   modifica, todo vive bajo el prefijo .bn31- y nada recibe
   clicks. Para sacarla: borrar las dos líneas del HTML.
   Para apagarla sin borrarla: HALLOWEEN.activo = false.

   A diferencia de la guirnalda dieciochera, las telarañas van
   en las esquinas y POR DEBAJO de la barra, así que no mueven
   nada de la página: no hace falta correr el encabezado de la
   tienda como allá.
   =========================================================== */

:root {
  --bn31-calabaza: #E8761F;
  --bn31-morado:   #7B4BA8;
  --bn31-hilo:     rgba(232, 238, 243, .62);
  --bn31-aleteo:   0;      /* 0 a 1, sube con el scroll */
}

/* ---------- telarañas de las esquinas ---------- */
.bn31-telas {
  position: fixed; inset: 0;
  z-index: 999;              /* justo debajo de la barra (1000) */
  pointer-events: none;
  overflow: hidden;
}
.bn31-tela {
  position: absolute; top: 0;
  width: 250px; height: 250px;
  opacity: .9;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.6));
}
.bn31-tela.izq   { left: 0; }
.bn31-tela.der   { right: 0; transform: scaleX(-1); }
.bn31-tela svg   { display: block; width: 100%; height: 100%; }

/* La araña cuelga de su hilo y sube y baja despacio */
/* Cuelga del lado DERECHO a propósito: a la izquierda se sentaba encima de
   la miga de pan de las páginas de tienda y tapaba el "Inicio". */
.bn31-arana {
  position: absolute; top: 0; right: 150px;
  width: 34px; height: 162px;
  animation: bn31-colgar 7.5s ease-in-out infinite alternate;
  transform-origin: 50% 0;
}
.bn31-arana svg { display: block; width: 100%; height: auto; overflow: visible; }

@keyframes bn31-colgar {
  from { transform: translateY(0) rotate(-1.6deg); }
  to   { transform: translateY(46px) rotate(1.6deg); }
}

/* ---------- murciélagos ---------- */
.bn31-cielo        { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bn31-cielo-fijo   { position: fixed;    inset: 0; z-index: 900; pointer-events: none; overflow: hidden; }

.bn31-mur {
  position: absolute;
  animation-name: bn31-volar;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  will-change: transform;
}
.bn31-mur svg { display: block; width: 100%; height: auto; overflow: visible;
                filter: drop-shadow(0 2px 4px rgba(0,0,0,.75)); }

/* El aleteo: las alas se achatan y vuelven. Con el scroll aletean más. */
.bn31-mur .alas {
  transform-origin: 50% 45%;
  animation: bn31-aletear .62s ease-in-out infinite alternate;
}

@keyframes bn31-volar {
  from { transform: translate(0, 0); }
  to   { transform: translate(var(--dx, 16vw), var(--dy, -14vh)); }
}
@keyframes bn31-aletear {
  from { transform: scaleY(1); }
  to   { transform: scaleY(calc(.78 - var(--bn31-aleteo) * .18)); }
}

/* ---------- cinta de saludo ---------- */
.bn31-cinta {
  position: fixed; left: 20px; z-index: 9300;
  bottom: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  display: flex; align-items: center; gap: 11px;
  padding: 9px 16px 9px 11px;
  border-radius: 40px;
  background: rgba(10,13,15,.86);
  border: 1px solid rgba(232,118,31,.5);
  backdrop-filter: blur(8px);
  box-shadow: 0 6px 22px rgba(0,0,0,.45);
  font-family: 'Raleway', sans-serif;
  opacity: 0; transform: translateY(14px);
  animation: bn31-entrar .7s 1.1s ease forwards;
}
.bn31-cinta svg { display: block; width: 26px; height: 26px; flex-shrink: 0; }
.bn31-cinta-txt { display: flex; flex-direction: column; line-height: 1.25; }
.bn31-cinta-txt strong { font-size: .74rem; font-weight: 700; letter-spacing: .06em; color: #F5F0E8; }
.bn31-cinta-txt small  { font-size: .66rem; color: #9fb0bb; margin-top: 2px; }

@keyframes bn31-entrar { to { opacity: 1; transform: translateY(0); } }

/* ---------- pantallas chicas ---------- */
@media (max-width: 700px) {
  .bn31-tela  { width: 172px; height: 172px; opacity: .8; }
  .bn31-arana { right: 96px; width: 26px; height: 124px; }
  .bn31-cinta { left: 14px; padding: 8px 14px 8px 10px;
                bottom: 16px;
                bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .bn31-cinta-txt strong { font-size: .68rem; }
  .bn31-cinta-txt small  { font-size: .6rem; }
}

/* ---------- quien pidió menos movimiento, recibe menos ---------- */
@media (prefers-reduced-motion: reduce) {
  .bn31-arana, .bn31-mur, .bn31-mur .alas, .bn31-cinta { animation: none !important; }
  .bn31-cinta { opacity: 1; transform: none; }
}

/* ---------- al imprimir, nada de adornos ---------- */
@media print {
  .bn31-telas, .bn31-cielo, .bn31-cielo-fijo, .bn31-cinta { display: none !important; }
}
