/* =========================================================
   Animaciones y efectos de Juegazo Store
   ========================================================= */

/* Encabezado: se compacta al bajar */
.top { transition: background .3s, box-shadow .3s; }
.top-in { transition: height .3s; }
.top.scrolled { background: rgba(6, 10, 19, .92); box-shadow: 0 8px 30px rgba(0, 0, 0, .45), 0 1px 0 rgba(60, 200, 255, .15); }
.top.scrolled .top-in { height: 60px; }
.brand-ico { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), filter .3s; }
.brand:hover .brand-ico { transform: rotate(-10deg) scale(1.08); filter: drop-shadow(0 0 16px rgba(60, 200, 255, .8)); }

/* Menú con subrayado animado */
.nav a { position: relative; padding: 4px 0; transition: color .2s; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
  background: var(--acc); box-shadow: var(--glow); transform: scaleX(0); transform-origin: right; transition: transform .3s ease;
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Botones: brillo que cruza al pasar el mouse */
.btn { position: relative; overflow: hidden; isolation: isolate; }
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s ease;
}
.btn:hover::after { transform: translateX(120%); }
.btn-wa:hover { transform: translateY(-2px); }
.btn svg { transition: transform .3s; }
.btn:hover svg { transform: rotate(-12deg) scale(1.1); }

/* Portada: entrada escalonada */
.hero-in > * { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.hero-in > :nth-child(2) { animation-delay: .1s; }
.hero-in > :nth-child(3) { animation-delay: .2s; }
.hero-in > :nth-child(4) { animation-delay: .3s; }
.hero-in > :nth-child(5) { animation-delay: .4s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* Palabra destacada con brillo que recorre */
h1 .hl {
  background: linear-gradient(90deg, var(--acc) 0%, #B5ECFF 25%, var(--acc) 50%, #2F9BFF 75%, var(--acc) 100%);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite; text-shadow: none; filter: drop-shadow(0 0 18px rgba(60, 200, 255, .45));
}
@keyframes shine { to { background-position: -200% center; } }

.tag { animation: rise .9s cubic-bezier(.2, .8, .2, 1) both, tagGlow 3.5s ease-in-out 1s infinite; }
@keyframes tagGlow { 50% { box-shadow: 0 0 26px rgba(60, 200, 255, .5); border-color: var(--acc); } }

.trust li { transition: transform .25s, border-color .25s, box-shadow .25s; }
.trust li:hover { transform: translateY(-3px); border-color: rgba(60, 200, 255, .6); box-shadow: 0 0 18px rgba(60, 200, 255, .25); }

/* Secciones que aparecen al hacer scroll */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.sec-head h2 span { display: inline-block; transition: transform .3s; }
.sec-head:hover h2 span { transform: skewX(-8deg); }

/* Tarjetas: entrada, luz que sigue al mouse y detalles */
.card.pop { animation: pop .55s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.card { position: relative; }
.card::before, .steps li::before, .vs-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), rgba(60, 200, 255, .13), transparent 65%);
  opacity: 0; transition: opacity .3s;
}
.card:hover::before, .steps li:hover::before, .vs-card:hover::before { opacity: 1; }
.cover::after { transition: transform .6s cubic-bezier(.2, .8, .2, 1), opacity .4s; }
.card:hover .cover::after { transform: scale(1.6) translate(-12px, 10px); opacity: .38; }
.cover h3 { transition: transform .3s; }
.card:hover .cover h3 { transform: translateX(4px); }
.plat { transition: transform .25s; }
.card:hover .plat { transform: translateY(-2px); }
.opt { transition: color .2s, border-color .2s, background .2s, transform .15s; }
.opt:hover { border-color: rgba(60, 200, 255, .5); transform: translateY(-1px); }
.price { display: inline-block; }
.price.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.12); color: var(--acc); text-shadow: var(--glow); } }

/* Chips y selector */
.chip { transition: color .2s, border-color .2s, background .2s, box-shadow .2s, transform .15s; }
.chip:hover { transform: translateY(-2px); box-shadow: 0 0 14px rgba(60, 200, 255, .2); }
.chip:active { transform: scale(.96); }
select { transition: border-color .2s, box-shadow .2s; }
select:hover, select:focus { border-color: var(--acc); box-shadow: 0 0 14px rgba(60, 200, 255, .2); outline: 0; }

/* Preventas en movimiento automático */
.rail.auto { scroll-snap-type: none; scrollbar-width: none; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.rail.auto::-webkit-scrollbar { display: none; }
#preventas-sec .sec-head h2::after {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 14px; vertical-align: middle; border-radius: 50%;
  background: var(--acc); box-shadow: var(--glow); animation: live 1.6s ease-in-out infinite;
}
@keyframes live { 50% { opacity: .25; transform: scale(.7); } }

/* Pasos y comparación */
.steps li, .vs-card { position: relative; transition: transform .3s, border-color .3s, box-shadow .3s, opacity .7s, translate .7s; }
.steps li:hover, .vs-card:hover { border-color: rgba(60, 200, 255, .5); box-shadow: var(--shadow), 0 0 26px rgba(60, 200, 255, .15); }
.steps li.in:hover, .vs-card.in:hover { transform: translateY(-5px); }
.steps b { transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s, background .3s, color .3s; }
.steps li:hover b { transform: rotate(-8deg) scale(1.1); background: var(--acc); color: #071225; box-shadow: 0 0 26px rgba(60, 200, 255, .6); }
.vs-card li { transition: transform .2s; }
.vs-card li:hover { transform: translateX(6px); }

/* Preguntas frecuentes */
.faq details { transition: border-color .3s, box-shadow .3s, background .3s, opacity .7s, transform .7s; }
.faq details:hover { border-color: rgba(60, 200, 255, .35); }
.faq details[open] { box-shadow: 0 0 24px rgba(60, 200, 255, .1); background: linear-gradient(160deg, #0F1E3A, var(--card)); }
.faq summary { transition: color .2s; }
.faq summary:hover { color: var(--acc); }

/* Llamado final */
.cta::before {
  content: ""; position: absolute; width: 700px; height: 700px; left: 50%; top: -350px; margin-left: -350px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent, rgba(60, 200, 255, .25), transparent 40%);
  animation: spin 12s linear infinite; z-index: 0;
}
.cta > * { position: relative; z-index: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.cta-ico { animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-10px) rotate(-4deg); } }

/* Botón flotante de WhatsApp con pulso */
.fab::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--wa);
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.6); opacity: 0; } }

/* Buscador */
.search svg { transition: transform .3s; }
.search:focus-within svg { transform: scale(1.15) rotate(-8deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
