/* ==========================================================================
   ZEA Segura — Mejoras de UX/front (V28) — estilos
   ========================================================================== */

/* ===== 1. REVEAL-ON-SCROLL ============================================== */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1),
              transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.reveal.reveal-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 2. NAV ACTIVO (persistente) ===================================== */
/* El subrayado animado del nav queda fijo en la página actual. */
.main-nav a[data-page-link].is-active:not(.nav-meet)::after {
  transform: scaleX(1) !important;
}
.main-nav a[data-page-link].is-active:not(.nav-meet) {
  color: #fff;
}
/* Si la página activa es MEET ZEA (botón), lo dejamos "encendido". */
.main-nav a.nav-meet.is-active {
  background: var(--pink);
  color: var(--green-deep);
}

/* ===== 3. BOTÓN "VOLVER ARRIBA" ======================================== */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 250;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--pink);
  border-radius: 999px;
  background: var(--green-deep);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(.9);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, background .2s ease;
  box-shadow: 0 10px 28px rgba(15, 59, 34, .28);
}
.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.back-to-top:hover,
.back-to-top:focus-visible {
  background: var(--pink);
  color: var(--green-deep);
  transform: translateY(-3px) scale(1);
}
/* Cuando coexiste con el CTA flotante de contacto, apilar el botón encima. */
body:has(.global-contact-cta) .back-to-top {
  bottom: 84px;
}
/* En móvil, apartarlo de posibles CTAs flotantes. */
@media (max-width: 640px) {
  .back-to-top { right: 16px; bottom: 16px; width: 46px; height: 46px; }
  body:has(.global-contact-cta) .back-to-top { bottom: 82px; }
}

/* ===== 4. INDICADOR DE SCROLL EN EL HERO =============================== */
.hero-frame { overflow: visible; }
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #fff;
  opacity: .95;
  transition: opacity .4s ease, transform .4s ease;
  pointer-events: none;
}
.scroll-hint.is-hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
}
.scroll-hint-label {
  font-family: "Epilogue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-shadow: 0 1px 12px rgba(15, 59, 34, .7);
}
.scroll-hint svg {
  animation: scroll-bounce 1.9s ease-in-out infinite;
  filter: drop-shadow(0 1px 8px rgba(15, 59, 34, .7));
}
@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ===== 2b. ANIMACIÓN DE ENTRADA DEL MODAL DE CONTACTO ================== */
/* Antes aparecía de golpe (display:none). Ahora entra con fade + escala,
   igual que el pop-up de confirmación, para un lenguaje coherente. */
.contact-modal:not([hidden]) .modal-backdrop,
.case-modal:not([hidden]) .modal-backdrop {
  animation: modal-fade .28s ease forwards;
}
.contact-modal:not([hidden]) .modal-panel,
.case-modal:not([hidden]) .modal-panel {
  animation: modal-rise .32s cubic-bezier(.22,.61,.36,1) forwards;
}
@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-rise {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Respeto a prefers-reduced-motion ============================== */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .scroll-hint svg { animation: none !important; }
  .contact-modal:not([hidden]) .modal-panel,
  .case-modal:not([hidden]) .modal-panel,
  .contact-modal:not([hidden]) .modal-backdrop,
  .case-modal:not([hidden]) .modal-backdrop { animation: none !important; }
  .back-to-top { transition: opacity .2s ease; }
}
