#mobile-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 28px;
  height: 22px;
  cursor: pointer;
  z-index: 1100;
}
#mobile-toggle span {
  display: block;
  height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: 0.3s;
}
#mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 50vw;
  height: 100vh;
  background: var(--white);
  list-style: none;
  padding: 4rem 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
#mobile-menu.open {
  transform: translateX(0);
}

/* 1. Estilo base de cada botón-enlace */
#mobile-menu li a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #002b49; /* color base */
  color: #ffffff;
  font-weight: 600;
  border-radius: 0.5rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

/* 2. Hover/focus */
#mobile-menu li a:hover,
#mobile-menu li a:focus {
  background-color: #005a8a; /* un tono más claro al hover */
  transform: translateX(4px);
}

/* 3. Íconos tamaño & color */
#mobile-menu li a i {
  font-size: 1.1rem;
  color: var(--white);
  transition: color 0.3s ease;
}
#mobile-menu li a:hover i,
#mobile-menu li a:focus i {
  color: var(--white);
}

/* 4. Separación entre items */
#mobile-menu li + li {
  margin-top: 0.5rem;
}

/* 5. Fondo semi-transparente y blur */
#mobile-menu {
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.85);
}

/* 6. Animación toggle to X (opcional) */
#mobile-toggle.open span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}
#mobile-toggle.open span:nth-child(2) {
  opacity: 0;
}
#mobile-toggle.open span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Solo en móvil */
@media (max-width: 768px) {
  #mobile-toggle {
    display: flex;
  }
  /* Ocultamos cualquier nav de Bootstrap si existe */
  .navbar .navbar-nav {
    display: none !important;
  }
}

/* —— Desktop: menú desplegable centrado & suave —— */
@media (min-width: 769px) {
  .navbar {
    position: relative;
  }
  .navbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* dropdown bajo la navbar */
  #mobile-menu {
    list-style: none;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;

    position: absolute !important;
    top: 100%;
    left: 0;
    width: 100%;

    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);

    overflow: hidden;
    max-height: 0; /* colapsado */
    opacity: 0; /* invisible */
    pointer-events: none; /* no interactuable */

    /* transiciones iguales */
    transition: max-height 0.5s ease, opacity 0.5s ease;

    padding: 0.5rem 0;
    gap: 1.5rem;
    z-index: 1000;
  }

  /* estado abierto */
  #mobile-menu.open {
    max-height: 100px; /* suficiente para tus botones */
    opacity: 1;
    pointer-events: auto; /* vuelve a ser clicable */
  }

  /* estilo D para los links */
  #mobile-menu li a {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #002b49;
    color: #ffffff;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: background 0.3s ease, transform 0.2s ease;
  }
  #mobile-menu li a:hover,
  #mobile-menu li a:focus {
    background: #005a8a;
    transform: translateY(-2px);
  }
  #mobile-menu li a i {
    color: #00b2e2;
  }

  /* toggle siempre visible y en la derecha */
  #mobile-toggle {
    display: flex !important;
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    z-index: 1001;
  }
  #mobile-toggle span {
    background: #ffffff;
  }
}
