/* ==============================
   Reset y variables globales
   ============================== */
:root {
  --primary: #006eff;
  --secondary: #83c5be;
  --accent: #edf6f9;
  --dark: #011627;
  --light: #ffffff;
  --radius: 8px;
  --header-height: 80px;
  --header-height-mobile: 60px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--accent);
  color: var(--dark);
  line-height: 1.6;
}

/* ==============================
   Header y Video Hero
   ============================== */
header#hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Centra el contenido verticalmente */
  align-items: center;
  text-align: center;
  padding: 0 20px;
  overflow: hidden;
  color: var(--light);
}

/* Superposición oscura para legibilidad del texto del hero */
header#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1; /* Detrás del texto del hero y la navbar */
}

.header-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  z-index: 0;
  object-fit: cover;
}

/* ==============================
   Navbar (Estilo Original Restaurado)
   ============================== */
.navbar {
  position: sticky; /* Fija la barra al hacer scroll */
  top: 0;
  width: 100%;
  z-index: 100; /* Siempre encima de todo */
  background: var(--light); /* Fondo blanco */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  height: var(--header-height);
  padding: 1rem;
}

.navbar .nav-content {
  max-width: 1200px;
  margin: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Enlaces de navegación con texto oscuro */
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background-color 0.3s ease, color 0.3s ease;
  color: var(--dark); /* Texto oscuro */
}

/* Hover azul original */
.nav-links a:hover {
  background-color: var(--primary);
  color: var(--light);
}

/* Icono hamburguesa oscuro */
.hamburger {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--dark);
}

/* Logo "sobresaliente" original */
.logo {
  height: 70px;
  margin: -85px 0 0;
  transform: translateY(70%);
  display: block;
}

/* ==============================
   Ajustes de Navbar en móvil (<768px)
   ============================== */
@media (max-width: 768px) {
  .navbar {
    height: var(--header-height-mobile);
    padding: 0.5rem 1rem;
  }

  .logo {
    height: 50px;
    margin: 0;
    transform: translateY(-5%);
    margin-left: auto;
  }

  .nav-links {
    display: none;
  }
  .hamburger {
    display: block;
  }
}

/* ==============================
   Contenido del Hero (Texto y botón)
   ============================== */
.hero-content {
  position: relative; /* Cambiado a relativo para que fluya en el layout */
  z-index: 2; /* Encima de la superposición del video */
  color: var(--light);
  /* Se añade un padding top para compensar la altura de la navbar */
  padding-top: var(--header-height);
}

#hero-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--light);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

#hero-subtitle {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: var(--light);
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.hero-btn {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: var(--light);
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.3s ease, transform 0.1s ease;
}

.hero-btn:hover {
  background: var(--secondary);
  color: var(--dark);
  transform: translateY(-2px);
}

.hero-btn:active {
  transform: translateY(1px);
}

/* ==============================
   Layout Principal
   ============================== */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
  display: grid;
  gap: 4rem;
}

section {
  scroll-margin-top: calc(var(--header-height) + 20px); /* Espacio para la navbar fija */
}

section > h2 {
  font-size: 2rem;
  margin-bottom: 2.5rem; /* Aumentado para dar más espacio al título */
  position: relative;
  text-align: center;
}

section > h2::after {
  content: "";
  width: 50px;
  height: 4px;
  background: var(--primary);
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  border-radius: var(--radius);
}

/* ==============================
   Services Cards
   ============================== */
.services {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--light);
  border-radius: var(--radius);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  padding: 2rem;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  opacity: 0;
  transform: translateY(20px);
}
.card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

/* ==============================
   Testimonials
   ============================== */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.testimonial {
  background: var(--light);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: 0 3px 10px rgba(0,0,0,0.05);
  display: flex;
  gap: 1rem;
  align-items: center;
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.4s ease;
  opacity: 0;
  transform: translateY(20px);
}
.testimonial.visible {
    opacity: 1;
    transform: translateY(0);
}

.testimonial:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.testimonial img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ==============================
   Sección Ver Planes (NUEVO ESTILO)
   ============================== */
#ver-planes {
  background: transparent; /* Quitamos fondo de color a la sección */
  padding: 0;
}

.ver-planes-card {
  background: var(--light); /* Fondo blanco */
  color: var(--dark); /* Texto oscuro por defecto */
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.ver-planes-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.ver-planes-card h3 {
    font-size: 1.8rem;
    color: var(--primary); /* Título en azul */
    margin-bottom: 0.5rem;
}

.ver-planes-btn {
  background: var(--primary); /* Botón azul */
  color: var(--light); /* Texto blanco */
  border: none;
  padding: 0.8rem 2rem;
  border-radius: var(--radius);
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.3s ease;
  margin-top: 1rem;
}

.ver-planes-btn:hover {
  background-color: var(--dark); /* Hover a color oscuro */
  transform: translateY(-4px) scale(1.05);
}

/* ==============================
   Sección Contacto
   ============================== */
.contact {
  background: var(--primary);
  color: var(--light);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
}

.contact button {
  background: var(--secondary);
  color: var(--dark);
  /* ...otros estilos de botón de contacto... */
}

.contact .container {
  position: relative;
  width: 100%;
  height: 150px;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ... (resto de estilos de animaciones de contacto, footer, sidebar y keyframes sin cambios)... */
.contact .container .loader {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 160px;
  height: 100px;
  margin: -50px 0 0 -80px;
  border-radius: 5px;
  background: #1e3f57;
  animation: dot1_ 3s cubic-bezier(0.55,0.3,0.24,0.99) infinite;
}

.contact .container .loader:nth-child(2) {
  width: 150px;
  height: 90px;
  margin: -45px 0 0 -75px;
  background: #3c517d;
  animation-name: dot2_;
}

.contact .container .loader:nth-child(3) {
  width: 40px;
  height: 20px;
  margin: 50px 0 0 -20px;
  border-radius: 0 0 5px 5px;
  background: #6bb2cd;
  animation-name: dot3_;
}

/* ==============================
   Footer
   ============================== */
footer {
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: #555;
  border-top: 1px solid #ddd;
}

/* ==============================
   Sidebar (móvil)
   ============================== */
.sidebar {
  position: fixed;
  left: -280px;
  top: 0;
  width: 280px;
  height: 100vh;
  background: var(--light);
  padding: 2rem;
  transition: left 0.4s ease-in-out;
  z-index: 2000;
  overflow-y: auto;
  box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}

.sidebar.active {
  left: 0;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
  color: var(--dark);
  cursor: pointer;
  transition: transform 0.3s;
}

.close-btn:hover {
  transform: rotate(90deg);
}

.sidebar-links {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-links a {
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--dark);
  font-weight: 500;
  transition: all 0.3s;
}

.sidebar-links a:hover {
  background: var(--accent);
  transform: translateX(10px);
}

/* ==============================
   Animaciones
   ============================== */
@keyframes dot1_ {
  3%,97%  { width:160px; height:100px; margin:-50px 0 0 -80px; }
  30%,36% { width:80px;  height:120px; margin:-60px 0 0 -40px; }
  63%,69% { width:40px;  height:80px;  margin:-40px 0 0 -20px; }
}

@keyframes dot2_ {
  3%,97%  { width:150px; height:90px;  margin:-45px 0 0 -75px; }
  30%,36% { width:70px;  height:96px;  margin:-48px 0 0 -35px; }
  63%,69% { width:32px;  height:60px;  margin:-30px 0 0 -16px; }
}

@keyframes dot3_ {
  3%,97%  { width:40px;  height:20px;  margin:50px 0 0 -20px; }
  30%,36% { width:8px;   height:8px;   margin:49px 0 0 -5px;  border-radius:8px; }
  63%,69% { width:16px;  height:4px;   margin:-37px 0 0 -8px; border-radius:10px;}
}