/* =========================
   MOBILE.CSS
   Hamburguesa, menú móvil, back-to-top, preloader
========================= */

/* ══════════════════════════════════════
   PRELOADER
══════════════════════════════════════ */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

/* Logo centrado */
.preloader-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ffffff;
}

.preloader-mark {
  display: block;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background:
    linear-gradient(45deg,  currentColor 0 45%, transparent 45%),
    linear-gradient(-45deg, #edff00 0 45%, transparent 45%);
}

.preloader-name {
  font-family: "Sora", sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

/* Barra de carga */
.preloader-bar-wrap {
  width: 200px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
}

.preloader-bar {
  height: 100%;
  width: 0%;
  background: #edff00;
  border-radius: 999px;
  transition: width 0.1s ease;
}

/* ══════════════════════════════════════
   HAMBURGUESA
══════════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: inherit;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
}

.hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.is-open span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════
   MENÚ MÓVIL FULLSCREEN
══════════════════════════════════════ */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9989;
  background: #050505;
  flex-direction: column;
  align-items: flex-start;   /* links alineados a la izquierda */
  justify-content: center;
  padding: 0 clamp(28px, 8vw, 64px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.mobile-nav.is-open {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav a {
  display: block;
  width: 100%;
  text-align: left;          /* texto a la izquierda */
  padding: 14px 0;
  color: #ffffff;
  text-decoration: none;
  font-family: "Sora", sans-serif;
  font-size: clamp(20px, 5.5vw, 28px);  /* 2 puntos menos que antes */
  font-weight: 900;
  letter-spacing: -0.04em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color 0.2s ease;
}

.mobile-nav a:first-child {
  border-top: 1px solid rgba(255,255,255,0.08);
}

.mobile-nav a:hover,
.mobile-nav a.is-active {
  color: #edff00;
}

/* Redes dentro del menú móvil */
.mobile-nav-social {
  display: flex;
  gap: 24px;
  margin-top: 32px;
}

.mobile-nav-social a {
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  color: rgba(255,255,255,0.5);
  transition: color 0.2s ease;
  text-decoration: none;
  width: auto;
  font-size: 0;
}

.mobile-nav-social a:hover { color: #edff00; }

/* ══════════════════════════════════════
   BACK TO TOP
══════════════════════════════════════ */
.back-to-top {
  position: fixed;
  bottom: 166px;
  right: 28px;
  z-index: 9998;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.12);
  background: #ffffff;
  color: #050505;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease,
              background 0.25s ease, border-color 0.25s ease,
              box-shadow 0.25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.back-to-top svg {
  width: 18px;
  height: 18px;
  display: block;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.back-to-top:hover {
  background: #edff00;
  border-color: #edff00;
  box-shadow: 0 8px 24px rgba(237,255,0,0.4);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Mostrar hamburguesa */
  .hamburger { display: flex; }

  /* Activar menú móvil */
  .mobile-nav { display: flex; }
}

/* Why image: más espacio encima en móvil (después del banner/pills) */
@media (max-width: 760px) {
  .why-image {
    margin-top: 48px !important;
  }

  .back-to-top {
    bottom: 152px;
    right: 20px;
    width: 42px;
    height: 42px;
  }

  .back-to-top svg {
    width: 16px;
    height: 16px;
  }
}

/* ══════════════════════════════════════
   HEADER MÓVIL INDEPENDIENTE
   Completamente separado del header desktop
══════════════════════════════════════ */

/* Por defecto: header móvil oculto */
.site-header-mobile {
  display: none;
}

@media (max-width: 1024px) {
  /* Ocultar header desktop */
  .site-header {
    display: none !important;
  }

  /* Mostrar header móvil */
  .site-header-mobile {
    position: fixed;
    inset: 0 0 auto 0;
    height: var(--header-height);
    z-index: 9999;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: #050505;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.14);
    transition: background-color 0.35s ease;
  }

  .site-header-mobile.is-hero {
    background: transparent;
    color: #050505;
  }

  .site-header-mobile.is-scrolled {
    background: #050505;
    color: #ffffff;
  }

  /* Logo izquierda */
  .site-header-mobile .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    text-decoration: none;
    font-family: "Sora", sans-serif;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.04em;
  }

  .site-header-mobile .logo-mark {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    background:
      linear-gradient(45deg,  currentColor 0 45%, transparent 45%),
      linear-gradient(-45deg, #edff00 0 45%, transparent 45%);
  }

  /* Controles derecha: bandera + hamburguesa */
  .mobile-header-right {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  /* Bandera */
  .site-header-mobile .lang-current {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    color: inherit;
  }

  .site-header-mobile.is-hero .lang-current {
    border-color: rgba(0,0,0,0.25);
  }

  .site-header-mobile .lang-flag svg {
    width: 22px;
    height: 15px;
    border-radius: 2px;
    display: block;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.14);
  }
}

/* ══════════════════════════════════════
   LANG SWITCHER MÓVIL — dropdown
══════════════════════════════════════ */
.lang-dropdown-mobile {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  padding: 6px;
  margin: 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10000;
}

.lang-switcher-mobile.is-open .lang-dropdown-mobile {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.lang-switcher-mobile {
  position: relative;
}

/* ══════════════════════════════════════
   HEADER MÓVIL — estado con menú abierto
   Fondo negro sólido para que la X sea visible
══════════════════════════════════════ */
.site-header-mobile.menu-open {
  background: #050505 !important;
  color: #ffffff !important;
}

.site-header-mobile.menu-open .logo {
  color: #ffffff !important;
}

.site-header-mobile.menu-open .lang-current {
  border-color: rgba(255,255,255,0.28) !important;
  color: #ffffff !important;
}

/* ══════════════════════════════════════
   ANIMACIONES MÓVIL — más rápidas y ligeras
   En móvil simplificamos los efectos para
   que no se perciban lentos en hardware limitado
══════════════════════════════════════ */
@media (max-width: 760px) {

  /* Reducir distancia de entrada — menos recorrido = más rápido */
  .js .reveal-up {
    translate: 0 40px !important;
    transition-duration: 0.6s !important;
  }

  .js .reveal-zoom img {
    transform: scale(1.08) !important;
    transition-duration: 0.8s !important;
  }

  .js .reveal-left {
    transform: translateX(-40px) !important;
    transition-duration: 0.6s !important;
  }

  /* Curtain más rápido en móvil */
  .js .reveal-curtain-left img:first-child {
    transition:
      clip-path 1.2s cubic-bezier(0.4, 0, 0.2, 1) 0.15s !important,
      transform  1.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s !important;
  }

  /* Why items más rápidos */
  .js .why-item > * {
    transition-duration: 0.5s !important;
  }

  /* Video hero: siempre visible en móvil
     El poster se muestra mientras carga */
  .hero-video {
    display: block;
  }
}

/* ══════════════════════════════════════
   POPUP CONFIRMACIÓN FORMULARIO
   Estilo coherente con la web
══════════════════════════════════════ */
.form-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(5, 5, 5, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 24px;

  display: none;  /* oculto por defecto — no ocupa espacio ni es visible */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.form-popup-overlay.is-open {
  display: flex;  /* visible al abrirse */
  opacity: 1;
  pointer-events: all;
  animation: popupFadeIn 0.3s ease forwards;
}

@keyframes popupFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.form-popup {
  background: #ffffff;
  border-radius: 16px;
  padding: clamp(36px, 6vw, 60px) clamp(32px, 5vw, 56px);
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 32px 80px rgba(0,0,0,0.28);

  transform: translateY(20px) scale(0.97);
  transition: transform 0.35s cubic-bezier(.19,1,.22,1);
}

.form-popup-overlay.is-open .form-popup {
  transform: translateY(0) scale(1);
}

/* Ícono check */
.form-popup-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--black);
  display: grid;
  place-items: center;
  margin: 0 auto 28px;
}

.form-popup-icon svg {
  width: 36px;
  height: 36px;
}

.form-popup h3 {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--black);
  margin-bottom: 16px;
}

.form-popup p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 36px;
  max-width: 360px;
  margin-inline: auto;
}

.form-popup-close {
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}

@media (max-width: 760px) {
  .form-popup {
    padding: 36px 28px;
  }

  .form-popup-icon {
    width: 60px;
    height: 60px;
  }

  .form-popup-icon svg {
    width: 28px;
    height: 28px;
  }
}
