/* ==============================================================
   FEST EVENTOS - BIOLINK OFICIAL
   CSS Corregido: Doble Fondo con "background-size: 100% auto"
   ============================================================== */

:root {
  /* Paleta Corporativa Oficial */
  --color-navy: #06063D;
  --color-gold: #FBAD04;
  --color-gold-hover: #FFAE00;
  --color-gold-glow: rgba(251, 173, 4, 0.4);

  /* Tarjetas y Botones */
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #FFFFFF;
  --border-gold: #FBAD04;
  --text-primary: #06063D;
  --text-secondary: rgba(6, 6, 61, 0.75);

  /* Sombras y Luces */
  --shadow-card: 0 8px 24px rgba(6, 6, 61, 0.18), 0 2px 6px rgba(251, 173, 4, 0.2);
  --shadow-hover: 0 14px 32px rgba(6, 6, 61, 0.28), 0 0 20px rgba(251, 173, 4, 0.5);

  /* Curvas de Aceleración */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------
   RESET Y BASE
   -------------------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  color: var(--text-primary);
  background-color: transparent !important;
  background: transparent !important;
  overflow-x: hidden;
  position: relative;
}

/* 1. FONDO PRINCIPAL EN BODY */
body {
  margin: 0;
  padding: 0;
  background-color: #07093D !important;
}

/* 2. ELIMINAR CUALQUIER CAPA EXTRA */
.background-backdrop,
.footer-characters-layer {
  display: none !important;
}

/* --------------------------------------------------------------
   2. CONTENEDOR PRINCIPAL (.biolink-app)
   -------------------------------------------------------------- */
.biolink-app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background-color: transparent !important;
  z-index: 1;
  overflow-x: hidden; /* Evita scroll horizontal por el scale del fondo */
  min-height: 100vh;
  min-height: 100dvh;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.4);

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1.25rem 0;
}

/* Pseudo-elemento exclusivo para la imagen de fondo con el desenfoque */
.biolink-app::before {
  content: "";
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background-image: url('RECURSOS FEST EVENTOS PNG/composicion festito 4k envio3.jpg');
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-color: #07093D;
  filter: blur(4px); /* Desenfoque suave */
  transform: scale(1.03); /* Evita bordes blancos por el blur */
  z-index: -1; 
  pointer-events: none;
}

/* --------------------------------------------------------------
   3. ANIMACIÓN INICIAL (EL GORRO Y EL NIÑO)
   -------------------------------------------------------------- */

/* Stage fijo: cubre toda la pantalla sin depender del scroll del contenedor */
.character-stage {
  position: fixed !important;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.character-stage.stage-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Personaje centrado en pantalla, suficientemente arriba para no recortarse */
.character-floating-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(80vw, 320px);
  aspect-ratio: 2590 / 3860;
  max-height: 65vh;
}

/* Flote continuo natural */
.character-body {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: naturalFloat 3s ease-in-out infinite;
  transition: opacity 0.5s ease, transform 0.5s ease;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
  will-change: transform, opacity;
}

@keyframes naturalFloat {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.character-body.is-faded-out {
  opacity: 0 !important;
  transform: translateY(15px) scale(0.96) !important;
  animation: none !important;
}

/* El Gorro: nace en la mano IZQUIERDA ALZADA, visible desde el primer frame */
#flyingCap,
.character-cap {
  position: absolute;
  top: 35% !important;
  left: -5% !important;
  width: 250px !important;
  height: auto;
  opacity: 1 !important;
  display: block !important;
  z-index: 2;
  animation: naturalFloat 3s ease-in-out infinite;
  filter: none !important;
  will-change: transform, opacity;
}

@keyframes throwCap {
  0%   { transform: translateY(0)      rotate(0deg)   scale(1);   opacity: 1; }
  100% { transform: translateY(-800px) rotate(360deg) scale(0.8); opacity: 0; }
}

.character-cap.is-flying {
  animation: throwCap 1s cubic-bezier(0.25, 1, 0.5, 1) forwards !important;
}

/* --------------------------------------------------------------
   4. CONTENIDO PRINCIPAL (CABECERA Y LOGO)
   -------------------------------------------------------------- */
.content-stage {
  width: 100%;
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
  will-change: opacity;
}

.content-stage.is-visible {
  opacity: 1;
  visibility: visible;
}

.brand-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 1.25rem;
  margin-bottom: 1.5rem;
}

/* 1. Limpieza absoluta del contenedor para quitar el aura estática y mal cortada */
.logo-wrapper, .brand-logo {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.logo-wrapper {
  position: relative;
  width: min(65vw, 210px);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 2. Configuración del botón interactivo */
#replayTrigger {
  cursor: pointer;
  display: inline-block;
  outline: none;
}

#replayTrigger img {
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* 3. Aura amarilla limpia aplicada solo a la silueta de la imagen al pasar el mouse */
#replayTrigger:hover img,
#replayTrigger:focus img {
  transform: scale(1.08);
  filter: drop-shadow(0 0 15px rgba(251, 173, 4, 0.8)) !important; 
}

.brand-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s var(--ease-smooth);
  will-change: transform, opacity;
}

.content-stage.is-visible .brand-logo {
  opacity: 1;
  transform: translateY(0);
}

.brand-tagline {
  /* Dorado sobre una cápsula azul marino translúcida: se lee sobre cualquier fondo */
  font-family: 'Outfit', sans-serif;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--color-gold);
  width: fit-content;
  max-width: 100%;
  margin: 0.85rem auto 0;
  padding: 0.5rem 1.15rem;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
  background: rgba(6, 6, 61, 0.72);
  border: 1.5px solid rgba(251, 173, 4, 0.75);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(6, 6, 61, 0.35), 0 0 16px var(--color-gold-glow);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease 0.1s, transform 0.6s var(--ease-smooth) 0.1s;
}

.content-stage.is-visible .brand-tagline {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------
   5. ESPACIADO DEL CONTENIDO (PADDING-BOTTOM AJUSTADO)
   -------------------------------------------------------------- */
.links-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  position: relative;
  z-index: 5;

  /* Quita el relleno inferior gigante que tenían los enlaces */
  padding-bottom: 20px !important; 
}

/* Personajes al final de todo, en el flujo normal con scroll */
.bottom-characters {
  position: relative !important;
  display: block !important;
  margin: 50px auto 0 !important; /* Separación del último botón */
  width: 100% !important;
  max-width: 500px !important;
  z-index: 10 !important;
  pointer-events: none;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

.link-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.92rem 1.25rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--border-gold);
  border-radius: 20px;
  text-decoration: none;
  color: var(--color-navy);
  box-shadow: var(--shadow-card);
  cursor: pointer;

  opacity: 0;
  transform: translateY(24px);
  transition: transform 0.3s ease, 
              box-shadow 0.3s ease, 
              border-color 0.3s ease, 
              background-color 0.3s ease;
  will-change: transform, opacity;
}

/* Entrada en Cascada Escalonada */
.content-stage.is-visible .link-card {
  animation: cardCascadeIn 0.6s var(--ease-smooth) forwards;
}

.content-stage.is-visible .link-card:nth-child(1) { animation-delay: 0.12s; }
.content-stage.is-visible .link-card:nth-child(2) { animation-delay: 0.22s; }
.content-stage.is-visible .link-card:nth-child(3) { animation-delay: 0.32s; }
.content-stage.is-visible .link-card:nth-child(4) { animation-delay: 0.42s; }
.content-stage.is-visible .link-card:nth-child(5) { animation-delay: 0.52s; }
.content-stage.is-visible .link-card:nth-child(6) { animation-delay: 0.62s; }
.content-stage.is-visible .link-card:nth-child(7) { animation-delay: 0.72s; }

@keyframes cardCascadeIn {
  0% {
    opacity: 0;
    transform: translateY(24px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.icon-box,
.link-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  margin-right: 1.05rem;
  transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.icon-box {
  background: rgba(6, 6, 61, 0.05);
  border: 1px solid rgba(251, 173, 4, 0.3);
}

.link-icon {
  font-size: 1.45rem;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.35);
}

.social-svg {
  color: var(--color-gold);
  fill: var(--color-gold);
  transition: transform 0.3s ease, fill 0.3s ease;
}

.link-label,
.link-content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
}

.label-main,
.link-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-navy);
  margin: 0;
  line-height: 1.25;
}

.label-sub,
.link-content p {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0.15rem 0 0;
  line-height: 1.2;
}

.link-arrow {
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  margin-left: 0.5rem;
  font-size: 1.05rem;
}

/* --------------------------------------------------------------
   5.1 BOTÓN DESTACADO WHATSAPP (COTIZACIONES Y CATÁLOGO)
   -------------------------------------------------------------- */
.link-card.whatsapp-btn {
  border: 2px solid #25D366;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.22), var(--shadow-card);
}

.link-card.whatsapp-btn:hover,
.link-card.whatsapp-btn:active {
  background: #FFFFFF;
  border-color: #25D366;
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.4), 0 0 18px rgba(37, 211, 102, 0.35);
  transform: translateY(-4px) scale(1.015);
}

.whatsapp-btn .link-arrow {
  color: #25D366;
}

.whatsapp-btn:hover .link-arrow,
.whatsapp-btn:active .link-arrow {
  color: #128C7E;
  transform: translateX(5px);
}

.whatsapp-btn:hover .link-icon,
.whatsapp-btn:active .link-icon {
  transform: scale(1.1);
  box-shadow: 0 0 14px rgba(37, 211, 102, 0.7);
}

/* --------------------------------------------------------------
   6. BOTÓN VIP DISCORD (AURA DORADA Y PULSO)
   -------------------------------------------------------------- */
.link-card.vip-gold-card {
  background: linear-gradient(135deg, #FBAD04, #ffc13b);
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 15px rgba(251, 173, 4, 0.6);
  animation: cardCascadeIn 0.6s var(--ease-smooth) 0.12s forwards, 
             goldPulse 2s infinite ease-in-out 0.72s;
}

.vip-gold-card .label-main,
.vip-gold-card .label-sub {
  color: #06063D !important;
}

.vip-gold-card .icon-box {
  background: rgba(6, 6, 61, 0.1);
  border: 1px solid rgba(6, 6, 61, 0.25);
}

.vip-gold-card .social-svg,
.vip-gold-card .link-arrow {
  color: #06063D !important;
  fill: #06063D !important;
}

@keyframes goldPulse {
  0%, 100% {
    box-shadow: 0 0 10px rgba(251, 173, 4, 0.5), 0 4px 14px rgba(6, 6, 61, 0.15);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 25px rgba(251, 173, 4, 0.95), 0 0 35px rgba(255, 255, 255, 0.45);
    transform: translateY(-2px);
  }
}

.link-card.vip-gold-card:hover,
.link-card.vip-gold-card:active {
  background: linear-gradient(135deg, #FFC13B, #FFD36B);
  border-color: #FFFFFF;
  box-shadow: 0 0 30px rgba(251, 173, 4, 1), 0 0 45px rgba(255, 255, 255, 0.6);
  transform: translateY(-4px) scale(1.02);
}

.vip-gold-card:hover .icon-box,
.vip-gold-card:active .icon-box {
  background: #06063D;
  transform: scale(1.08);
}

.vip-gold-card:hover .social-svg,
.vip-gold-card:active .social-svg {
  color: #FBAD04 !important;
  fill: #FBAD04 !important;
}

.vip-gold-card:hover .link-arrow,
.vip-gold-card:active .link-arrow {
  color: #06063D !important;
  transform: translateX(5px);
}

/* --------------------------------------------------------------
   7. MICROINTERACCIÓN DEL BIRRETE EN HOVER / ACTIVE
   -------------------------------------------------------------- */
.hover-cap-badge {
  position: absolute;
  top: -14px;
  left: 24px;
  width: 40px;
  height: auto;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px) rotate(-10deg);
  transition: opacity 0.3s ease, transform 0.3s ease;
  filter: drop-shadow(0 4px 10px rgba(6, 6, 61, 0.35));
  z-index: 5;
  will-change: opacity, transform;
}

.link-card:hover,
.link-card:active {
  background: var(--bg-card-hover);
  border-color: var(--border-gold);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.link-card:hover .icon-box,
.link-card:active .icon-box {
  background: var(--color-navy);
  transform: scale(1.05);
}

.link-card:hover .social-svg,
.link-card:active .social-svg {
  fill: var(--color-gold-hover);
  transform: scale(1.08);
}

.link-card:hover .link-arrow,
.link-card:active .link-arrow {
  opacity: 0;
  transform: translateX(4px);
  transition: opacity 0.3s ease;
}

.link-card:hover .hover-cap-badge,
.link-card:active .hover-cap-badge {
  opacity: 1;
  transform: translateY(0) rotate(0deg);
}

/* --------------------------------------------------------------
   7.1 INTERACCIÓN CHIBI EN HOVER / POP-UP A LA DERECHA
   -------------------------------------------------------------- */

/* Posicionamiento base del personaje (oculto por defecto) */
.hover-chibi {
  position: absolute;
  right: 15px; /* Ubicado en la parte derecha del botón */
  bottom: 0;
  height: 90%; /* Ajusta el tamaño para que encaje dentro del botón */
  width: auto;
  opacity: 0;
  transform: translateY(15px) scale(0.9);
  transition: all 0.3s ease;
  pointer-events: none; /* Evita que bloquee el clic del botón */
  z-index: 10;
  object-fit: contain;
}

/* Efecto de aparición al hacer hover */
.link-card:hover .hover-chibi,
.link-card:active .hover-chibi {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* --------------------------------------------------------------
   8. PIE DE PÁGINA
   -------------------------------------------------------------- */
.biolink-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  margin-top: 1.25rem;
}

.footer-copy {
  font-size: 0.78rem;
  line-height: 1.55;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  max-width: 32rem;
  margin: 0 auto;
  padding: 0 0.25rem 1.5rem;
  text-wrap: balance;
}
.footer-copy:empty,
.brand-tagline:empty { display: none; }

/* Íconos de Font Awesome (redes que se agregan desde el panel) */
.icon-box i {
  font-size: 1.55rem;
  line-height: 1;
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--color-navy);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease;
}

.replay-btn:hover,
.replay-btn:active {
  background: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(251, 173, 4, 0.35);
}

/* --------------------------------------------------------------
   RESPONSIVE PARA PANTALLAS PEQUEÑAS
   -------------------------------------------------------------- */
@media (max-width: 360px) {
  .brand-header {
    margin-top: 1rem;
  }
  .brand-title {
    font-size: 1.35rem;
  }
  .label-main {
    font-size: 0.98rem;
  }
  .icon-box {
    width: 38px;
    height: 38px;
    min-width: 38px;
    margin-right: 0.75rem;
  }
  .hover-cap-badge {
    left: 18px;
    top: -12px;
    width: 34px;
  }
}
