/* ==========================================================================
   EPDS · Barra de navegación unificada (rediseño 2026)
   Se carga DESPUÉS del CSS de cada página (styles.css o styles2.css) para
   imponer el mismo menú en todo el sitio sin tocar el resto del diseño.
   Los selectores usan ".topbar ..." para ganar especificidad sobre el CSS viejo.
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 6, 8, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar .topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 84px;
  max-width: 1280px;
  margin: 0 auto;
}

.topbar .logo {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.topbar .logo-img {
  max-height: 52px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Menú */
.topbar .main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.7rem;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar .main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0;
  color: #c7ced9;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.topbar .main-nav a svg {
  width: 20px;
  height: 20px;
  color: #22d3ee;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.topbar .main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: #22d3ee;
  transition: width 0.25s ease;
}

.topbar .main-nav a:hover {
  color: #ffffff;
}

.topbar .main-nav a:hover::after {
  width: 100%;
}

.topbar .main-nav a:hover svg {
  transform: translateY(-1px) scale(1.08);
}

/* Botón hamburguesa (móvil) */
.topbar .nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
}

.topbar .nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: #ffffff;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .topbar .main-nav {
    gap: 1.2rem;
    font-size: 0.92rem;
  }
}

@media (max-width: 760px) {
  .topbar .nav-toggle {
    display: flex;
  }

  .topbar .main-nav {
    position: fixed;
    inset: 84px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0.5rem 1.5rem 1.5rem;
    background: rgba(5, 6, 8, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateY(-130%);
    transition: transform 0.3s ease;
    font-size: 1.05rem;
  }

  body.nav-open .topbar .main-nav {
    transform: translateY(0);
  }

  .topbar .main-nav a {
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
}
