/* Capa de efectos: color, brillo y movimiento extra encima de tienda.css.
   Es un adorno igual que animaciones.js: todo lo de aca cuelga de la clase .fx
   que pone efectos.js, asi que si el script no corre la tienda queda tal cual.

   🔑 Respeta la marca: nada de lunas, estrellas ni glifos. Las particulas son
   cuadrados, como las de Minecraft. Y respeta prefers-reduced-motion: .fx solo
   se pone si el sistema no pide menos movimiento (los sonidos van aparte). */

:root {
  --fx-rosa: #FF6FD8;
  --fx-cian: #5CE1FF;
  --fx-oro: #FFD45C;
  /* Color de brillo por familia de producto. Lo toma cada tarjeta por data-clave. */
  --fx-brillo: 124, 92, 232;
}
.paquete[data-clave="astral"]    { --fx-brillo: 169, 143, 255; }
.paquete[data-clave="cosmico"]   { --fx-brillo: 255, 111, 216; }
.paquete[data-clave="lunatico"]  { --fx-brillo: 255, 212, 92; }
.paquete[data-clave="vuelo"]     { --fx-brillo: 111, 224, 168; }
.paquete[data-clave="hierro"]    { --fx-brillo: 210, 214, 224; }
.paquete[data-clave="diamante"]  { --fx-brillo: 92, 225, 255; }
.paquete[data-clave="esmeralda"] { --fx-brillo: 111, 224, 168; }
.paquete[data-clave="amatista"]  { --fx-brillo: 201, 120, 255; }

/* ------------------------------------------------------ lienzos y barra */

.fx-lienzo { position: fixed; inset: 0; z-index: 99; pointer-events: none; }
.fx-hero { position: absolute; inset: 0; z-index: 2; pointer-events: none; }

/* Barra de progreso de lectura, pegada abajo de la cabecera. */
.fx-progreso {
  position: absolute; left: 0; bottom: -3px; height: 3px; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--violeta), var(--fx-rosa), var(--fx-oro), var(--fx-cian));
  background-size: 300% 100%;
  animation: fx-arcoiris 6s linear infinite;
  pointer-events: none;
}

@keyframes fx-arcoiris { to { background-position: 300% 0; } }

/* ----------------------------------------------------------- titulares */

/* El nombre del hero brilla en un degradado que corre. */
.fx .hero__titulo .acento {
  background: linear-gradient(90deg, var(--violeta-bisel), var(--fx-rosa), var(--fx-oro), var(--fx-cian), var(--violeta-bisel));
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: lun-word 700ms cubic-bezier(.22, 1, .36, 1) 200ms both, fx-arcoiris 7s linear infinite;
}

/* La raya del "ojo" de cada seccion se llena de color al aparecer. */
.fx .ojo .raya { background: linear-gradient(90deg, var(--violeta), var(--fx-rosa)); transform-origin: 0 50%; }
.fx .seccion:not(.fx-visto) .ojo .raya { transform: scaleX(0); }
.fx .fx-visto .ojo .raya { animation: fx-raya 900ms cubic-bezier(.22, 1, .36, 1) 150ms both; }
@keyframes fx-raya { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* El logo da un salto al tocarlo. */
.fx .hero__logo img { cursor: pointer; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.fx .hero__logo img:hover { transform: scale(1.06) rotate(-3deg); }
.fx .hero__logo img.fx-salto { animation: fx-salto 520ms cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fx-salto {
  0% { transform: scale(1); }
  30% { transform: scale(.86, 1.12); }
  55% { transform: scale(1.14, .9) translateY(-14px); }
  100% { transform: scale(1); }
}

/* ------------------------------------------------------------- botones */

/* Brillo que cruza los botones violetas al pasar por encima. */
.fx .boton { position: relative; overflow: hidden; isolation: isolate; transition: background .15s, transform .12s cubic-bezier(.34, 1.56, .64, 1); }
.fx .boton::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-20deg); pointer-events: none;
}
.fx .boton:hover:not(:disabled)::after { animation: fx-barrido 650ms ease-out; }
.fx .boton > span { position: relative; }
.fx .boton:hover:not(:disabled) { transform: translateY(-2px); }
.fx .boton:active:not(:disabled) { transform: translateY(1px) scale(.97); }
@keyframes fx-barrido { from { left: -60%; } to { left: 130%; } }

/* El boton de pagar respira mientras esta habilitado: es la meta de la pagina. */
.fx .boton--pagar:not(:disabled) { animation: fx-pagar 1.8s ease-in-out infinite; }
.fx .boton--pagar:not(:disabled)::after { animation: fx-barrido 1.6s ease-in-out 400ms infinite; }
@keyframes fx-pagar {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.15) drop-shadow(0 0 14px rgba(111, 224, 168, .55)); }
}

/* El carrito con cosas adentro se mueve de vez en cuando, para que no se olvide. */
.fx .boton--carrito.fx-lleno { animation: fx-meneo 7s ease-in-out 3s infinite; }
@keyframes fx-meneo {
  0%, 90%, 100% { transform: rotate(0); }
  92% { transform: rotate(-6deg) scale(1.06); }
  94% { transform: rotate(5deg) scale(1.06); }
  96% { transform: rotate(-3deg); }
  98% { transform: rotate(2deg); }
}

/* Pestañas: la elegida entra con un saltito. */
.fx .pestanas button { transition: background .15s, color .15s, border-color .15s, transform .15s cubic-bezier(.34, 1.56, .64, 1); }
.fx .pestanas button:hover { transform: translateY(-2px); }
.fx .pestanas button[aria-selected="true"] { animation: fx-pestana 360ms cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fx-pestana { 0% { transform: scale(.9); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* ------------------------------------------------------------- tarjetas */

/* 🔑 La inclinacion va por las propiedades sueltas `rotate` y `translate`, NO por
   `transform`: la entrada lun-in de tienda.css anima transform con fill `both`,
   y una animacion le gana a cualquier :hover. Las sueltas se componen aparte. */
.fx .rejilla { perspective: 1100px; }
.fx .paquete {
  --tx: 1; --ty: 0; --ang: 0deg; --gx: 50%; --gy: 50%;
  rotate: var(--ty) var(--tx) 0 var(--ang);
  transition: translate .3s cubic-bezier(.22, 1, .36, 1), rotate .12s ease-out, border-color .24s, box-shadow .24s;
  transform-style: preserve-3d;
}
.fx .paquete:hover { translate: 0 -8px; border-color: rgb(var(--fx-brillo)); }
.fx .paquete::before {
  content: ''; position: absolute; inset: -3px; z-index: -1; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(var(--fx-brillo), 0), 0 20px 60px rgba(var(--fx-brillo), 0);
  transition: box-shadow .3s;
}
.fx .paquete:hover::before { box-shadow: 0 0 0 3px rgba(var(--fx-brillo), .35), 0 24px 70px rgba(var(--fx-brillo), .42); }
/* Reflejo de luz que sigue al puntero. */
.fx .paquete::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, .16), transparent 48%);
  opacity: 0; transition: opacity .25s;
  mix-blend-mode: screen;
}
.fx .paquete:hover::after { opacity: 1; }

/* El emblema flota y gira al pasar por encima. */
.fx .paquete__glifo { display: inline-block; width: fit-content; animation: fx-flota 3.6s ease-in-out infinite; }
.fx .paquete:nth-child(2) .paquete__glifo { animation-delay: -1.2s; }
.fx .paquete:nth-child(3) .paquete__glifo { animation-delay: -2.4s; }
.fx .paquete__glifo .glifo-img { transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), filter .3s; }
.fx .paquete:hover .paquete__glifo .glifo-img { transform: scale(1.14) rotate(-6deg); filter: drop-shadow(0 0 12px rgba(var(--fx-brillo), .8)); }
@keyframes fx-flota { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }

/* El precio toma el color de su familia y destella cuando termina de contar. */
.fx .paquete:hover .precio { color: rgb(var(--fx-brillo)); text-shadow: 0 0 18px rgba(var(--fx-brillo), .6); }
.fx .precio { transition: color .25s, text-shadow .25s; }
.fx .precio.fx-destello { animation: fx-destello 600ms ease-out; }
@keyframes fx-destello {
  0% { text-shadow: 0 0 0 transparent; }
  30% { text-shadow: 0 0 22px rgba(var(--fx-brillo), .95); transform: scale(1.08); }
  100% { text-shadow: 0 0 0 transparent; transform: scale(1); }
}
.fx .precio { display: inline-block; }

/* La insignia "EL MAS ELEGIDO" late. */
.fx .paquete__insignia {
  background: linear-gradient(90deg, var(--violeta), var(--fx-rosa), var(--violeta));
  background-size: 200% 100%;
  animation: fx-arcoiris 3s linear infinite, fx-latido 1.8s ease-in-out infinite;
}
@keyframes fx-latido { 0%, 100% { scale: 1; } 50% { scale: 1.07; } }

/* Las viñetas entran una por una cuando la tarjeta aparece. */
.fx .destacados li { animation: fx-vineta 420ms cubic-bezier(.22, 1, .36, 1) both; }
.fx .destacados li:nth-child(1) { animation-delay: 280ms; }
.fx .destacados li:nth-child(2) { animation-delay: 340ms; }
.fx .destacados li:nth-child(3) { animation-delay: 400ms; }
.fx .destacados li:nth-child(4) { animation-delay: 460ms; }
.fx .destacados li:nth-child(5) { animation-delay: 520ms; }
.fx .destacados li:nth-child(n+6) { animation-delay: 580ms; }
@keyframes fx-vineta { from { opacity: 0; translate: -10px 0; } to { opacity: 1; translate: 0 0; } }

/* ------------------------------------------------- preguntas y avisos */

.fx .faq { transition: box-shadow .2s, translate .2s; }
.fx .faq:hover { translate: 4px 0; box-shadow: 0 0 0 3px var(--violeta-borde); }
.fx .faq[open] { box-shadow: 0 0 0 3px var(--violeta); }

/* El aviso de "AGREGADO" entra con rebote y con el tic en verde brillante. */
.fx .aviso.fx-entra .aviso__tic { animation: fx-tic 520ms cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fx-tic {
  0% { transform: scale(.3) rotate(-30deg); background: var(--verde); color: var(--verde-texto); }
  60% { transform: scale(1.25) rotate(8deg); background: var(--verde); color: var(--verde-texto); }
  100% { transform: scale(1) rotate(0); }
}

/* --------------------------------------------------- boton de sonido */

.fx-sonido {
  position: fixed; left: 18px; bottom: 18px; z-index: 70;
  display: grid; place-items: center; width: 42px; height: 42px; padding: 0;
  border: 0; cursor: pointer; color: var(--t2); background: var(--sec);
  box-shadow: inset 2px 2px 0 var(--bisel-claro), inset -2px -2px 0 var(--bisel-oscuro), 0 0 0 3px var(--tinta);
  transition: color .15s, background .15s, transform .15s cubic-bezier(.34, 1.56, .64, 1);
}
.fx-sonido:hover { color: var(--t1); background: var(--sec-hover); transform: translateY(-2px); }
.fx-sonido:active { transform: scale(.94); }
.fx-sonido svg { display: block; }
.fx-sonido .fx-onda, .fx-sonido .fx-tacha { transition: opacity .2s; }
.fx-sonido .fx-tacha { opacity: 0; }
.fx-sonido[aria-pressed="false"] .fx-onda { opacity: 0; }
.fx-sonido[aria-pressed="false"] .fx-tacha { opacity: 1; }
.fx-sonido[aria-pressed="false"] { color: var(--t4); }
/* Con un dialogo abierto el velo lo tapa igual; en el telefono se achica. */
@media (max-width: 560px) { .fx-sonido { left: 12px; bottom: 12px; width: 38px; height: 38px; } }

/* La sugerencia de mejora del carrito entra con un saltito y su borde late. */
.fx .mejora:not([hidden]) { animation: lun-pop 420ms cubic-bezier(.34, 1.56, .64, 1) both, fx-mejora 2.4s ease-in-out 600ms infinite; }
@keyframes fx-mejora {
  0%, 100% { box-shadow: 0 0 0 3px var(--tinta); }
  50%      { box-shadow: 0 0 0 3px var(--tinta), 0 0 26px color-mix(in srgb, var(--acento) 45%, transparent); }
}

/* La linea del chat con rango entra deslizando, como un mensaje nuevo. */
.fx .chatmc__fila:not(.chatmc__fila--antes) .chatmc__linea,
.fx .chatmc--carrito .chatmc__linea { animation: fx-chat 380ms cubic-bezier(.22, 1, .36, 1) both; }
@keyframes fx-chat { from { opacity: 0; translate: -14px 0; } to { opacity: 1; translate: 0 0; } }

/* Carrito: la linea recien agregada entra deslizando con un destello de su color. */
.fx .linea--nueva { animation: fx-linea 520ms cubic-bezier(.22, 1, .36, 1) both; }
@keyframes fx-linea {
  0%   { opacity: 0; translate: 24px 0; background: color-mix(in srgb, var(--franja) 30%, var(--panel)); }
  60%  { opacity: 1; translate: 0 0; }
  100% { background: var(--panel); }
}
/* El total destella cuando cambia (lo marca efectos.js). */
.fx #total.fx-destello { --fx-brillo: 245, 239, 214; display: inline-block; }
.fx .entregar__vivo:not([hidden]) { animation: fx-chat 320ms cubic-bezier(.22, 1, .36, 1) both; }

/* Meteorito secreto (diez clics al logo, ver efectos.js). */
html.fx-oscuro body::before {
  content: ''; position: fixed; inset: 0; z-index: 98; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, rgba(5, 6, 20, .1), rgba(5, 6, 20, .7));
  animation: fx-oscurecer 500ms ease-out both;
}
@keyframes fx-oscurecer { from { opacity: 0; } to { opacity: 1; } }
.fx-destello-pantalla {
  position: fixed; inset: 0; z-index: 100; pointer-events: none;
  background: radial-gradient(circle at 50% 55%, #FFFFFF 0%, rgba(255, 210, 150, .85) 18%, rgba(255, 122, 26, .35) 45%, transparent 75%);
  animation: fx-destello-pantalla 850ms ease-out both;
}
@keyframes fx-destello-pantalla { 0% { opacity: 0; } 8% { opacity: 1; } 100% { opacity: 0; } }
html.fx-temblor :is(main, .cab, .pie) { animation: fx-temblor 650ms cubic-bezier(.36, .07, .19, .97) both; }
@keyframes fx-temblor {
  0%, 100% { translate: 0 0; }
  10% { translate: -14px 8px; }
  20% { translate: 12px -10px; }
  30% { translate: -10px 6px; }
  45% { translate: 8px -5px; }
  60% { translate: -5px 3px; }
  75% { translate: 3px -2px; }
}

/* En el telefono el parlante flotante se achica y se aparta: tapaba texto de las tarjetas. */
@media (max-width: 620px) {
  .fx-sonido { width: 34px; height: 34px; left: 10px; bottom: 10px; opacity: .72; }
  .fx-sonido:hover, .fx-sonido:focus-visible { opacity: 1; }
}
