/* =====================================================
   Menú hamburguesa para dispositivos móviles
   Estilo futurista que complementa el diseño existente
====================================================== */

/* Botón de hamburguesa */
.hamburger-menu {
  display: none;
  position: relative;
  width: 30px;
  height: 24px;
  cursor: pointer;
  z-index: 1010;
  -webkit-tap-highlight-color: transparent; /* Elimina el resaltado al tocar en dispositivos móviles */
}

.hamburger-menu span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: #1698b0;
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger-menu span:nth-child(1) {
  top: 0px;
}

.hamburger-menu span:nth-child(2),
.hamburger-menu span:nth-child(3) {
  top: 10px;
}

.hamburger-menu span:nth-child(4) {
  top: 20px;
}

/* Estado activo del botón hamburguesa */
.hamburger-menu.active span:nth-child(1) {
  top: 10px;
  width: 0%;
  left: 50%;
}

.hamburger-menu.active span:nth-child(2) {
  transform: rotate(45deg);
}

.hamburger-menu.active span:nth-child(3) {
  transform: rotate(-45deg);
}

.hamburger-menu.active span:nth-child(4) {
  top: 10px;
  width: 0%;
  left: 50%;
}

/* Menú móvil */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 2, 51, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* Soporte para Safari */
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none; /* Permite que los clics pasen a través cuando está oculto */
}

.mobile-nav-overlay.active {
  opacity: 1;
  display: block;
  pointer-events: auto; /* Captura los clics cuando está visible */
}

.mobile-nav-links {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  text-align: center;
  padding: 0 20px;
}

.mobile-nav-link {
  display: block;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 1.5rem 0;
  color: #fff;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.mobile-nav-overlay.active .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
}

/* Efecto de línea al pasar el cursor */
.mobile-nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 0;
  height: 2px;
  background: #1698b0;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.mobile-nav-link:hover::after,
.mobile-nav-link.active::after {
  width: 80px;
}

/* Efecto de brillo futurista */
.mobile-nav-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 30px;
  background: radial-gradient(circle, rgba(22, 152, 176, 0.2) 0%, rgba(22, 152, 176, 0) 70%);
  transform: translate(-50%, -50%);
  transition: width 0.3s ease;
  z-index: -1;
}

.mobile-nav-link:hover::before {
  width: 200px;
}

/* Ajustes responsivos */
@media (max-width: 992px) {
  .hamburger-menu {
    display: block;
    position: relative;
    z-index: 1010;
    margin-left: auto;
  }
  
  .nav-links {
    display: none;
  }
  
  nav {
    justify-content: space-between;
    position: relative;
    z-index: 1010;
    flex-direction: row !important;
    align-items: center;
  }
  
  /* Asegurarse de que el botón hamburguesa sea fácil de tocar en móviles */
  .hamburger-menu {
    padding: 10px;
    margin: -10px;
    margin-left: 15px;
  }
}

/* Animación para los elementos del menú */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav-overlay.active .mobile-nav-link:nth-child(1) {
  animation: fadeInUp 0.3s ease forwards;
  animation-delay: 0.1s;
}

.mobile-nav-overlay.active .mobile-nav-link:nth-child(2) {
  animation: fadeInUp 0.3s ease forwards;
  animation-delay: 0.2s;
}

.mobile-nav-overlay.active .mobile-nav-link:nth-child(3) {
  animation: fadeInUp 0.3s ease forwards;
  animation-delay: 0.3s;
}

.mobile-nav-overlay.active .mobile-nav-link:nth-child(4) {
  animation: fadeInUp 0.3s ease forwards;
  animation-delay: 0.4s;
}

.mobile-nav-overlay.active .mobile-nav-link:nth-child(5) {
  animation: fadeInUp 0.3s ease forwards;
  animation-delay: 0.5s;
}

/* Efecto de tecnología en el menú móvil */
.mobile-nav-tech-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.tech-line {
  position: absolute;
  background: linear-gradient(90deg, rgba(22, 152, 176, 0), rgba(22, 152, 176, 0.2), rgba(22, 152, 176, 0));
  height: 1px;
  width: 100%;
  animation: techLine 8s linear infinite;
}

@keyframes techLine {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(1000%);
  }
}

/* Ajustes adicionales para dispositivos muy pequeños */
@media (max-width: 480px) {
  .mobile-nav-link {
    font-size: 1.3rem;
    margin: 1.2rem 0;
  }
}
