/* ═══════════════════════════════════════════
   GLOBAL STYLES — Sci-Fi Web Mejorado
   Estilos compartidos entre todas las páginas
   ═══════════════════════════════════════════ */

/* ── Reset básico ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background: #f9f9ff;
  color: #0b1b35;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Space Grotesk', sans-serif;
}

/* ── Accessibility: focus visible ── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid #00c8ff;
  outline-offset: 2px;
}

/* Skip-to-content link (screen-reader only) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #0b1b35;
  color: #fff;
  padding: 8px 16px;
  z-index: 100;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 8px 0;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ── LOADER ── */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #050b18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#page-loader.hide {
  opacity: 0;
  visibility: hidden;
}
.loader-logo {
  height: 90px;
  width: auto;
  animation: loader-pulse 1.5s ease-in-out infinite;
}
@keyframes loader-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.7; transform: scale(0.95); }
}
.loader-bar-wrap {
  width: 180px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, #00c8ff, #7b2fff);
  border-radius: 2px;
  animation: loader-fill 1.2s ease-in-out forwards;
}
@keyframes loader-fill {
  0%   { width: 0%; }
  60%  { width: 75%; }
  100% { width: 100%; }
}
.loader-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  animation: loader-blink 1.2s ease-in-out infinite;
}
@keyframes loader-blink {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.7; }
}
.loader-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.loader-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.loader-blob-1 {
  top: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0,100,132,0.18) 0%, transparent 65%);
}
.loader-blob-2 {
  bottom: -15%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(96,0,218,0.15) 0%, transparent 65%);
}

/* ── SCROLL REVEAL — múltiples direcciones ── */
.sr {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.sr.sr-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

/* Desde abajo (default) */
.sr-up {
  transform: translateY(40px);
}

/* Desde la izquierda */
.sr-left {
  transform: translateX(-60px);
}

/* Desde la derecha */
.sr-right {
  transform: translateX(60px);
}

/* Desde arriba */
.sr-down {
  transform: translateY(-40px);
}

/* Escala suave */
.sr-scale {
  transform: scale(0.92);
}

/* Con desenfoque */
.sr-blur {
  transform: translateY(30px);
  filter: blur(8px);
}
.sr-blur.sr-visible {
  filter: blur(0);
}

/* Rotación sutil */
.sr-rotate {
  transform: translateY(30px) rotate(-2deg);
}
.sr-rotate-right {
  transform: translateY(30px) rotate(2deg);
}

/* Stagger delays */
.sr-delay-1 { transition-delay: 0.10s; }
.sr-delay-2 { transition-delay: 0.20s; }
.sr-delay-3 { transition-delay: 0.30s; }
.sr-delay-4 { transition-delay: 0.40s; }
.sr-delay-5 { transition-delay: 0.50s; }
.sr-delay-6 { transition-delay: 0.60s; }

/* Reduced motion: desactivar animaciones */
@media (prefers-reduced-motion: reduce) {
  .sr {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}

/* ── WHATSAPP BUTTON ── */
.wa-btn {
  animation: pulse-wa 2.5s infinite;
}
@keyframes pulse-wa {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0.4); }
  50%      { box-shadow: 0 0 0 10px rgba(37,211,102,0); }
}

/* ── GRADIENT UTILITIES ── */
.gradient-text {
  background: linear-gradient(135deg, #00C8FF, #7B2FFF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-bg {
  background: linear-gradient(135deg, #00C8FF, #7B2FFF);
}
.hero-gradient {
  background: linear-gradient(135deg, #0b1b35 0%, #006684 50%, #6000da 100%);
}

/* ── MOBILE MENU (Tailwind pages) ── */
#mobileMenu {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
}
#mobileMenu.open {
  max-height: 400px;
  opacity: 1;
}

/* ── HOVER LIFT (utility) ── */
.hover-lift {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease;
}
.hover-lift:hover {
  transform: translateY(-4px);
}

/* ── LINK UNDERLINE ANIMATION ── */
.link-underline {
  position: relative;
  text-decoration: none;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #00c8ff, #7b2fff);
  transition: width 0.3s ease;
}
.link-underline:hover::after {
  width: 100%;
}

/* ── BACK TO TOP ── */
.back-to-top {
  position: fixed;
  bottom: 92px;
  right: 20px;
  z-index: 45;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c8ff, #7b2fff);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 14px rgba(0,200,255,0.35);
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  box-shadow: 0 6px 20px rgba(0,200,255,0.5);
  transform: translateY(-2px);
}

/* ── SERVICE CARD HOVER (reemplaza onmouseover inline) ── */
.service-card-hover {
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease;
}
.service-card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 40px rgba(0,102,132,0.12);
}

/* ── DECORATIVE BACKGROUNDS ── */
.bg-glow {
  position: relative;
  overflow: hidden;
}
.bg-glow::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0,200,255,0.06) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.bg-glow::after {
  content: '';
  position: absolute;
  bottom: -40%;
  right: -15%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(123,47,255,0.05) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}
.bg-glow > * {
  position: relative;
  z-index: 1;
}

/* ── SECTION DIVIDER ── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,200,255,0.25), rgba(123,47,255,0.25), transparent);
  border: none;
  margin: 0;
}

/* ── STICKY CTA BANNER ── */
.sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 45;
  background: rgba(5, 11, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(0, 200, 255, 0.15);
  padding: 14px 24px;
  transform: translateY(110%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.sticky-cta.show {
  transform: translateY(0);
}
.sticky-cta-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sticky-cta-text {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.4;
}
.sticky-cta-text strong {
  color: #00c8ff;
  font-weight: 600;
}
.sticky-cta-btn {
  background: linear-gradient(135deg, #00c8ff, #7b2fff);
  color: white;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-block;
}
.sticky-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,200,255,0.3);
}
.sticky-cta-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  min-width: 32px;
  min-height: 32px;
}
.sticky-cta-close:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

@media (max-width: 640px) {
  .sticky-cta-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .sticky-cta-text {
    font-size: 0.85rem;
  }
  .sticky-cta {
    padding: 14px 16px;
  }
}

/* ── SHRINK NAV ON SCROLL ── */
/* Index nav */
.nav, .nav-inner {
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav-inner > a > img {
  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.nav.scrolled {
  background: rgba(255,255,255,0.98);
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
.nav.scrolled .nav-inner {
  height: 64px;
}
.nav.scrolled .nav-inner > a > img {
  height: 44px !important;
}

/* Tailwind nav (secondary pages) */
#mainNav {
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#mainNavInner {
  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#mainNavLogo {
  transition: height 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
#mainNav.scrolled {
  background-color: rgba(249, 249, 255, 0.98) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}
#mainNav.scrolled #mainNavInner {
  height: 64px;
}
#mainNav.scrolled #mainNavLogo {
  height: 44px;
}
