/* ─── TOP BAR ────────────────────────────────────────────────────────────
   Logo · Producto | Funcionalidades | Contáctanos · Iniciar sesión · ENG
   Sticky; ≤ 900 px the links fold into a burger panel (funcs/topBar.js).
   ───────────────────────────────────────────────────────────────────── */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  transition: box-shadow 0.2s;
}
.top-bar.is-scrolled { box-shadow: 0 2px 14px rgba(7, 106, 137, 0.10); }

.top-bar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--top-bar-height);
  padding-inline: clamp(16px, 6vw, 88px);
  max-width: 1440px;
}

.top-bar__logo { flex: none; display: block; }
.top-bar__logo img { width: clamp(108px, 11vw, 152px); height: auto; }

/* ─── NAV ─── */
.main-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-left: clamp(16px, 4vw, 64px);
}

.main-nav__links {
  display: flex;
  align-items: center;
}
.main-nav__links li { display: flex; align-items: center; }
.main-nav__links li + li::before {
  content: "";
  width: 1px;
  height: 18px;
  margin-inline: clamp(12px, 1.8vw, 26px);
  background: var(--border-soft);
}

.nav-link {
  color: var(--text-small-titles);
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s;
  position: relative;
}
.nav-link:hover { color: var(--app-theme); }

/* Current section (funcs/navSpy.js): darker teal + short underline */
.nav-link.is-active { color: var(--app-theme); }
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--app-theme);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}
.nav-link.is-active::after { transform: scaleX(1); }

.main-nav__actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* "Crear cuenta" only lives in the mobile menu: the desktop design shows
   "Comenzar prueba gratuita" in the hero for that. */
.main-nav__signup { display: none; }

.lang-btn {
  padding: 8px 4px;
  border: 0;
  background: none;
  color: #3B3B3B;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.lang-btn:hover { color: var(--app-theme); }

/* ─── BURGER ─── */
.burger {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 11px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.burger span {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: var(--app-theme);
  transition: transform 0.25s, opacity 0.2s;
}
.top-bar.is-open .burger span:nth-child(1) { transform: translateY(8.75px) rotate(45deg); }
.top-bar.is-open .burger span:nth-child(2) { opacity: 0; }
.top-bar.is-open .burger span:nth-child(3) { transform: translateY(-8.75px) rotate(-45deg); }

/* ─── TABLET / MOBILE ─── */
@media (max-width: 900px) {
  :root { --top-bar-height: 72px; }

  .burger { display: flex; }

  .main-nav {
    position: fixed;
    inset: var(--top-bar-height) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px var(--gutter) 28px;
    background: var(--white);
    box-shadow: 0 18px 30px rgba(7, 106, 137, 0.12);
    max-height: calc(100dvh - var(--top-bar-height));
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .top-bar.is-open .main-nav {
    visibility: visible;
    opacity: 1;
    transform: none;
  }

  .main-nav__links { flex-direction: column; align-items: stretch; }
  .main-nav__links li + li::before { display: none; }
  .main-nav__links li { border-bottom: 1px solid #EEF3F5; }
  .nav-link { display: block; width: 100%; padding: 16px 4px; font-size: 18px; }
  .nav-link::after { left: 4px; right: auto; width: 28px; bottom: 10px; transform-origin: left; }

  .main-nav__actions {
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 12px;
  }
  .main-nav__actions .btn { flex: 1 1 160px; height: 48px; }
  .main-nav__signup { display: inline-flex; }
  .lang-btn { flex-basis: 100%; text-align: left; padding: 10px 4px; }
}
