/* Capa interactiva de stepsplay.com (visor de fotos, parallax, progreso).
   Sin dependencias; se carga después de site.css. */

/* ── Fotos que se pueden ampliar ─────────────────────────────── */
.lb-zoomable { cursor: zoom-in; }
.lb-zoomable:focus-visible { outline: 3px solid #007559; outline-offset: 3px; }

.zone-badge {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(254, 248, 243, .92); color: #007559;
  font: 700 12px/1 'DM Sans', sans-serif; letter-spacing: .02em;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
  pointer-events: none; transition: transform .3s ease;
}
.zone-badge .material-symbols-outlined { font-size: 16px; }
.zone-card:hover .zone-badge { transform: translateY(-3px); }
.gallery-img { transition: opacity .6s ease, transform .5s ease !important; }
.zone-card .zone-frame img { transition: opacity .6s ease, transform .7s cubic-bezier(.2, .7, .2, 1) !important; }
.zone-card:hover .zone-frame img { transform: scale(1.06); }

/* ── Visor ───────────────────────────────────────────────────── */
#lightbox {
  position: fixed; inset: 0; z-index: 4000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(18, 22, 20, .94);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
  touch-action: pan-y;
}
#lightbox.open { opacity: 1; visibility: visible; transition: opacity .25s ease, visibility 0s; }
#lightbox .lb-stage {
  position: relative; width: 100%; flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center; padding: 64px 16px 8px;
}
#lightbox .lb-img {
  max-width: min(100%, 1400px); max-height: 100%; object-fit: contain;
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  transition: opacity .2s ease, transform .3s cubic-bezier(.2, .7, .2, 1);
  user-select: none; -webkit-user-drag: none;
}
#lightbox .lb-img.lb-out { opacity: 0; transform: scale(.97); }
#lightbox .lb-bar {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 16px 22px; color: #F2ECE7;
}
#lightbox .lb-caption { font: 500 14px/1.4 'DM Sans', sans-serif; opacity: .85; text-align: center; }
#lightbox .lb-dots { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
#lightbox .lb-dot {
  width: 9px; height: 9px; border-radius: 999px; border: 0; padding: 0; cursor: pointer;
  background: rgba(242, 236, 231, .35); transition: width .25s ease, background .25s ease;
}
#lightbox .lb-dot[aria-current="true"] { width: 26px; background: #F2ECE7; }
#lightbox .lb-btn {
  position: absolute; z-index: 2; width: 48px; height: 48px; border-radius: 999px; border: 0;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: rgba(254, 248, 243, .95); color: #007559;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25); transition: transform .2s ease, background .2s ease;
}
#lightbox .lb-btn:hover { transform: scale(1.08); background: #fff; }
#lightbox .lb-btn:focus-visible { outline: 3px solid #fcd34d; outline-offset: 2px; }
#lightbox .lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
#lightbox .lb-next { right: 16px; top: 50%; translate: 0 -50%; }
#lightbox .lb-close { right: 16px; top: 12px; width: 44px; height: 44px; }
#lightbox .lb-counter {
  position: absolute; left: 20px; top: 22px; color: #F2ECE7;
  font: 700 13px/1 'DM Sans', sans-serif; letter-spacing: .08em; opacity: .7;
}
#lightbox.lb-single .lb-prev, #lightbox.lb-single .lb-next,
#lightbox.lb-single .lb-dots, #lightbox.lb-single .lb-counter { display: none; }
@media (max-width: 640px) {
  #lightbox .lb-prev, #lightbox .lb-next { top: auto; bottom: 18px; translate: none; width: 44px; height: 44px; }
  #lightbox .lb-bar { padding-left: 72px; padding-right: 72px; }
}

/* ── Barra de progreso y menú activo ─────────────────────────── */
#scroll-progress {
  position: absolute; left: 0; bottom: -1px; height: 3px; width: 100%;
  background: linear-gradient(90deg, #007559, #4fae8f);
  transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}
#main-nav a.nav-active { font-weight: 700; }
#main-nav a.nav-active::after { width: 100% !important; }

/* ── Cómo funciona: pasos que se encienden ───────────────────── */
[data-steps] .step-num { transition: background-color .5s ease, color .5s ease, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
[data-steps] .step-num.lit { background-color: #007559; color: #fff; transform: scale(1.12); }

/* ── Parallax ────────────────────────────────────────────────── */
/* Parallax sin ampliar la foto: la imagen es un 16% más alta que la franja y se
   desplaza en vertical. Así el ancho no se escala y la foto no pierde nitidez. */
.parallax-img { position: absolute; left: 0; top: -8%; width: 100%; height: 116% !important; will-change: transform; }
.hero-tilt { transition: transform .6s cubic-bezier(.2, .7, .2, 1); will-change: transform; }

/* ── Quien prefiere menos movimiento ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .animate-marquee { animation: none !important; }
  .parallax-img, .hero-tilt { transform: none !important; }
  .parallax-img { top: 0; height: 100% !important; }
  .zone-card:hover .zone-frame img { transform: none; }
  #lightbox, #lightbox .lb-img { transition: none; }
}

/* ── Ilustraciones de la marca ───────────────────────────────── */
.decor {
  position: absolute; z-index: 5; pointer-events: none; line-height: 0;
  opacity: 0; transform: translateY(28px) scale(.6) rotate(var(--tilt, -8deg));
  transition: opacity .5s ease, transform .9s cubic-bezier(.34, 1.56, .64, 1);
}
.decor.in { opacity: 1; transform: rotate(var(--rest, 0deg)); }
.decor img { width: 100%; height: auto; display: block; user-select: none; -webkit-user-drag: none; }
.decor-bob { display: block; animation: decor-bob var(--bob, 5s) ease-in-out infinite; animation-delay: var(--bob-delay, 0s); }
@keyframes decor-bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}
.mascot { pointer-events: auto; cursor: pointer; }
.mascot img { transform-origin: 50% 100%; }
/* Cada personaje tiene su propio gesto al pasar el cursor (clase hv-*) */
.mascot.hv-cheer:hover img  { animation: hv-cheer .9s ease-out; }
.mascot.hv-shake:hover img  { animation: hv-shake .7s linear; transform-origin: 50% 60%; }
.mascot.hv-beat:hover img   { animation: hv-beat 1s ease-in-out; transform-origin: 50% 50%; }
.mascot.hv-jelly:hover img  { animation: hv-jelly .9s ease-out; }
.mascot.hv-spin:hover img   { animation: hv-spin .9s cubic-bezier(.5, -0.3, .3, 1.3); transform-origin: 50% 50%; }
.mascot.hv-offer:hover img  { animation: hv-offer 1.1s ease-in-out; }
.mascot.hv-float:hover img  { animation: hv-float 1.6s ease-in-out; transform-origin: 50% 0; }
.mascot.hv-walk:hover img   { animation: hv-walk 1.1s ease-in-out; }
.mascot.hv-dance:hover img  { animation: hv-dance 1.2s ease-in-out; }
/* El salto al pulsar manda sobre el gesto (el cursor siempre está encima al hacer clic) */
.mascot img.jump { animation: decor-jump .7s cubic-bezier(.3, .7, .4, 1) !important; transform-origin: 50% 100% !important; }
@keyframes hv-cheer {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  12% { transform: translateY(0) scale(1.06, .92); }
  30% { transform: translateY(-18px) scale(.96, 1.05); }
  45% { transform: translateY(0) scale(1.05, .94); }
  62% { transform: translateY(-12px) scale(.98, 1.03); }
  78% { transform: translateY(0) scale(1.02, .98); }
}
@keyframes hv-shake {
  0%, 100% { transform: rotate(0); }
  10%, 30%, 50%, 70% { transform: rotate(-6deg) translateX(-2px); }
  20%, 40%, 60%, 80% { transform: rotate(6deg) translateX(2px); }
}
@keyframes hv-beat {
  0%, 40%, 100% { transform: scale(1); }
  15% { transform: scale(1.12); }
  25% { transform: scale(.97); }
  55% { transform: scale(1.1); }
  70% { transform: scale(1); }
}
@keyframes hv-jelly {
  0%, 100% { transform: scale(1, 1); }
  20% { transform: scale(1.15, .85); }
  40% { transform: scale(.9, 1.12); }
  60% { transform: scale(1.06, .95); }
  80% { transform: scale(.98, 1.02); }
}
@keyframes hv-spin {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(200deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}
@keyframes hv-offer {
  0%, 100% { transform: rotate(0); }
  30%, 60% { transform: rotate(9deg) translateX(4px); }
  45% { transform: rotate(6deg) translateX(3px); }
}
@keyframes hv-float {
  0%, 100% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-22px) rotate(-5deg); }
  65% { transform: translateY(-14px) rotate(4deg); }
}
@keyframes hv-walk {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-5px) translateY(-6px) rotate(-6deg); }
  40% { transform: translateX(-10px) rotate(0); }
  60% { transform: translateX(-15px) translateY(-6px) rotate(-6deg); }
  80% { transform: translateX(-8px) rotate(0); }
}
@keyframes hv-dance {
  0%, 100% { transform: rotate(0) translateY(0); }
  15% { transform: rotate(-10deg) translateY(-6px); }
  30% { transform: rotate(10deg) translateY(0); }
  45% { transform: rotate(-10deg) translateY(-6px); }
  60% { transform: rotate(10deg) translateY(0); }
  80% { transform: rotate(0) translateY(-10px) scale(1.05); }
}
@keyframes decor-jump {
  0%   { transform: translateY(0) scale(1, 1); }
  15%  { transform: translateY(0) scale(1.12, .86); }
  45%  { transform: translateY(-42px) scale(.94, 1.08) rotate(-6deg); }
  75%  { transform: translateY(0) scale(1.08, .92); }
  100% { transform: translateY(0) scale(1, 1); }
}
/* Garabatos: aparecen con un barrido de izquierda a derecha */
.doodle { opacity: 1; transform: rotate(var(--rest, 0deg)); transition: none; }
.doodle img { clip-path: inset(0 100% 0 0); transition: clip-path 1.3s cubic-bezier(.6, .05, .3, 1); }
.doodle.in img { clip-path: inset(0 0 0 0); }
.decor-sm-hide { display: none; }
/* En móvil las zonas van apiladas: hueco para que el personaje no tape el texto de arriba */
@media (max-width: 767px) { .zone-card:not(:first-child) { margin-top: 36px; } }
@media (min-width: 768px) { .decor-sm-hide { display: block; } }

.burst-piece { position: fixed; z-index: 3500; pointer-events: none; width: 16px; height: 16px; left: 0; top: 0; }

@media (prefers-reduced-motion: reduce) {
  .decor, .doodle { transition: none; transform: rotate(var(--rest, 0deg)); opacity: 1; }
  .doodle img { clip-path: none; transition: none; }
  .decor-bob, .mascot img, .mascot:hover img, .mascot img.jump { animation: none !important; }
}
