/* ════════════════════════════════════════════════════════════
   css/layout.css — Estructura, grid, topbar, mobile menu, footer
   Coexsis v17
   ════════════════════════════════════════════════════════════ */


/* ========================================
   1. CONTENEDOR PRINCIPAL
   ======================================== */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  position: relative;
  z-index: 10;
}


/* ========================================
   2. SECCIONES / SLIDES — BASE
   ======================================== */
.slide {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;

  /* ✅ FIX: min-height en lugar de height fija
     Permite que secciones con mucho contenido (s2, s6, s7)
     crezcan más allá de 100vh sin recortar nada */
  min-height: 100vh;
  height: auto;
  width: 100%;

  padding: 100px var(--pad) 80px;

  /* ✅ FIX: visible en lugar de hidden
     overflow:hidden cortaba la terminal de s2
     y cualquier elemento que sobresaliera */
  overflow: visible;

  background: var(--bg);
  box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.9);
}

/* Hero — sin padding propio, lo maneja .hero-grid */
.hero {
  padding: 0;
  min-height: 100vh;
}

/* Watermark de fondo — texto decorativo gigante */
.slide::before {
  content: attr(data-watermark);
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  font-size: clamp(8rem, 15vw, 14rem);
  font-weight: 900;
  color: rgba(135, 66, 214, 0.06);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
  font-family: var(--font-family);
  user-select: none;
}

/* Fondos radiales alternos por sección */
.slide:not(.hero):nth-child(odd) {
  background: radial-gradient(
    circle at 30% 30%,
    hsla(var(--hue, 260), 80%, 50%, 0.05),
    transparent 60%
  ), var(--bg);
}
.slide:not(.hero):nth-child(even) {
  background: radial-gradient(
    circle at 70% 70%,
    hsla(calc(var(--hue, 260) + 40), 80%, 50%, 0.05),
    transparent 60%
  ), var(--bg);
}

/* Grid de puntos decorativo */
.bgfx {
  position: absolute; inset: 0;
  z-index: 0; pointer-events: none;
  opacity: 0.08;
  background-image: radial-gradient(rgba(255,255,255,0.3) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}


/* ========================================
   3. AJUSTES POR SECCIÓN
   ======================================== */

/* S1 — Hero ocupa exactamente la pantalla */
#s1.slide {
  min-height: 100vh;
  height: 100vh;
  padding: 0;
  overflow: hidden; /* ← solo el hero recorta los blobs */
}

/* S2 — Mucho contenido: workflow + cards + terminal
   ✅ FIX: align-items flex-start para que fluya desde arriba
   y no intente centrar verticalmente más de 100vh de contenido */
#s2.slide {
  align-items: flex-start;
  padding-top: 120px;
  padding-bottom: 100px;
}

/* S6, S7 — Dashboards e IA también tienen contenido extenso */
#s6.slide,
#s7.slide {
  align-items: flex-start;
  padding-top: 120px;
  padding-bottom: 100px;
}


/* ========================================
   4. SCROLL — NATIVO EN BODY
   ✅ FIX: Eliminado scroll-snap-type y overflow en .snap
   El scroll-snap forzaba detenerse en cada sección y
   se sentía "trabado". Ahora es scroll nativo, fluido,
   con inercia en trackpad y móvil.
   ======================================== */
html {
  scroll-behavior: smooth;
}

/* Desktop — .snap es solo un wrapper sin scroll propio */
@media (min-width: 1024px) {
  .snap {
    display: block;
    /* Sin height, sin overflow, sin scroll-snap */
  }
}

/* Mobile — flujo columna normal */
@media (max-width: 1023px) {
  .snap {
    display: flex;
    flex-direction: column;
  }
  .slide {
    min-height: auto;
    height: auto !important;
    padding: 80px 20px 60px;
  }
  #s1.slide {
    min-height: 100vh;
    height: 100vh !important;
    padding: 0;
  }
  #s2.slide,
  #s6.slide,
  #s7.slide {
    padding-top: 80px;
    padding-bottom: 60px;
  }
}


/* ========================================
   5. GRIDS DE LAYOUT
   ======================================== */

/* Split 2 columnas — s3, s4, s5, s8 */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 100px);
  align-items: center;
  width: 100%;
}

/* Visual a la izquierda */
.split--reverse .split__visual { order: -1; }

/* Centro con flexbox */
.center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.center .lead { margin: 0 auto 2rem; }

/* CTA row — botones en fila */
.cta-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 2rem;
  align-items: center;
}

@media (max-width: 1023px) {
  .split {
    grid-template-columns: 1fr;
    gap: 50px;
    text-align: center;
  }
  .split--reverse .split__visual { order: 0; }
  .split__visual { display: flex; justify-content: center; margin-top: 30px; }
  .cta-row { justify-content: center; }
}


/* ========================================
   6. TOPBAR — Píldora flotante desktop
   ======================================== */
.topbar {
  position: fixed;
  top: 20px; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 var(--pad);
  transition: all 0.4s var(--ease);
  pointer-events: none; /* el inner captura los clicks */
}

.topbar__inner {
  pointer-events: auto;
  width: 100%;
  max-width: 1200px;
  background: rgba(5, 8, 20, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 10px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s var(--ease);
}

/* Estado scrolled */
.topbar.scrolled .topbar__inner {
  background: rgba(5, 8, 20, 0.92);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.topbar__inner:hover {
  border-color: rgba(236, 72, 153, 0.2);
  box-shadow:
    0 8px 32px rgba(236, 72, 153, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Logo */
.brand-inline {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s ease;
  z-index: 10;
}
.brand-inline:hover { transform: scale(1.05); }
.brand-inline img {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.3));
}

/* Menú desktop */
.menu {
  position: relative;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Píldora deslizante */
.menu-pill {
  position: absolute;
  height: 34px;
  background: linear-gradient(
    135deg,
    rgba(236, 72, 153, 0.2),
    rgba(139, 92, 246, 0.2)
  );
  border: 1px solid rgba(236, 72, 153, 0.3);
  border-radius: 20px;
  transition: all 0.35s var(--ease);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  backdrop-filter: blur(4px);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.15);
}

.menu a {
  padding: 10px 18px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 20px;
  transition: color 0.3s ease;
  position: relative;
  z-index: 2;
  white-space: nowrap;
}
.menu a:hover,
.menu a.active { color: #fff; }

/* Separador vertical */
.topbar__sep {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 8px;
  flex-shrink: 0;
}

.topbar__actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Burger — solo mobile */
.burger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: background 0.3s ease;
  position: relative;
  z-index: 10;
}
.burger:hover { background: rgba(255, 255, 255, 0.1); }
.burger__bars {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  position: relative;
  transition: 0.3s;
}
.burger__bars::before,
.burger__bars::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: #fff;
  left: 0;
  transition: 0.3s;
}
.burger__bars::before { top: -7px; }
.burger__bars::after  { top: 7px; }
.burger.open .burger__bars             { background: transparent; }
.burger.open .burger__bars::before     { transform: rotate(45deg)  translate(5px, 5px); }
.burger.open .burger__bars::after      { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile: topbar full-width sin píldora */
@media (max-width: 1023px) {
  .topbar {
    top: 0;
    padding: 0;
  }
  .topbar__inner {
    border-radius: 0;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(5, 8, 20, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    max-width: 100%;
  }
  .menu          { display: none !important; }
  .topbar__sep   { display: none; }
  .burger        { display: flex !important; }
  /* Ocultar botón Cotizar en mobile — está en el footer del menú */
  .topbar__actions .btn { display: none; }
}


/* ========================================
   7. MOBILE MENU OVERLAY
   ======================================== */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 190;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 300px;
  background: linear-gradient(160deg, #0d1428 0%, #080d1a 100%);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  border-left: 1px solid rgba(236, 72, 153, 0.15);
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
}
.mobile-menu.open { transform: translateX(0); }

.mobile-menu__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mobile-menu__logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.mobile-menu__logo img {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 0 8px rgba(236, 72, 153, 0.3));
}

.mobile-menu__nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.mobile-nav-group { margin-bottom: 4px; }
.mobile-nav-group__label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.2);
  font-weight: 700;
  padding: 14px 12px 6px;
}
.mobile-nav-group + .mobile-nav-group {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 4px;
}

/* Items con animación escalonada de entrada */
.mobile-nav-item {
  display: flex !important;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 11px 14px !important;
  border-radius: 10px;
  margin-bottom: 2px !important;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateX(20px);
  transition:
    opacity    0.35s ease,
    transform  0.35s var(--ease),
    background 0.2s ease,
    color      0.2s ease;
}
.mobile-menu.open .mobile-nav-item {
  opacity: 1;
  transform: translateX(0);
}
.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: #fff;
  background: rgba(236, 72, 153, 0.08);
}

/* Delays de entrada escalonados */
.mobile-nav-delay-1 { transition-delay: 0.05s !important; }
.mobile-nav-delay-2 { transition-delay: 0.09s !important; }
.mobile-nav-delay-3 { transition-delay: 0.13s !important; }
.mobile-nav-delay-4 { transition-delay: 0.17s !important; }
.mobile-nav-delay-5 { transition-delay: 0.21s !important; }
.mobile-nav-delay-6 { transition-delay: 0.25s !important; }
.mobile-nav-delay-7 { transition-delay: 0.29s !important; }
.mobile-nav-delay-8 { transition-delay: 0.33s !important; }

.mobile-nav-icon {
  font-size: 18px;
  min-width: 22px;
  text-align: center;
  filter: grayscale(60%);
  transition: filter 0.3s ease;
}
.mobile-nav-item:hover .mobile-nav-icon,
.mobile-nav-item.active .mobile-nav-icon { filter: grayscale(0%); }

.mobile-nav-text  { flex: 1; }
.mobile-nav-arrow {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.15);
  transition: all 0.3s ease;
  line-height: 1;
}
.mobile-nav-item:hover .mobile-nav-arrow {
  color: var(--p1);
  transform: translateX(4px);
}

.mobile-menu__footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0, 0, 0, 0.25);
}

.xbtn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.xbtn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  transform: rotate(90deg);
}

@media (max-width: 400px) {
  .mobile-menu { width: 100%; border-left: none; }
}


/* ========================================
   8. FOOTER
   ======================================== */
.main-footer {
  background: #080a14;
  border-top: 1px solid var(--glass-border);
  padding: 5rem 0 2rem;
  position: relative;
  z-index: 10;
}

.footer-container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand__logo    { display: inline-block; margin-bottom: 1.5rem; }
.footer-brand__tagline { color: var(--text-mut); font-size: 0.95rem; max-width: 300px; }

.footer-col__title {
  display: block;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}
.footer-col__links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-col__links a { color: var(--text-mut); transition: 0.3s; }
.footer-col__links a:hover {
  color: var(--p1);
  transform: translateX(5px);
  display: inline-block;
}

.footer-contact__item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  color: var(--text-mut);
  margin-bottom: 1rem;
}

.newsletter-form  { display: flex; gap: 0.5rem; margin-top: 1.5rem; }
.newsletter-input {
  flex: 1;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: #fff;
  font-family: var(--font-family);
  outline: none;
}
.newsletter-input::placeholder { color: rgba(255,255,255,0.3); }
.newsletter-btn {
  padding: 0 1.5rem;
  background: var(--p2);
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  transition: 0.3s;
  font-family: var(--font-family);
}
.newsletter-btn:hover { background: var(--p1); }

.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem var(--pad) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--glass-border);
  color: var(--text-mut);
  font-size: 0.85rem;
}
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a:hover { color: #fff; }

@media (max-width: 1024px) {
  .footer-container { grid-template-columns: 1fr 1fr; gap: 3rem; }
}
@media (max-width: 600px) {
  .footer-container { grid-template-columns: 1fr; gap: 2.5rem; }
  .footer-bottom { flex-direction: column; gap: 1rem; text-align: center; }
}