/* =====================================================================
   NAV — barra superior fija, menú de enlaces, selector de idioma,
   botón hamburguesa y menú móvil. Lógica en js/modules/nav.js
   ===================================================================== */

nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
/* se activa al hacer scroll (nav.js) */
nav.scrolled { background: var(--nav-glass); backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); border-color: var(--border); }
.nav-in {
  max-width: 1320px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.nav-actions .btn-sm { white-space: nowrap; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
#navUser, #navGuest { display: flex; gap: 10px; align-items: center; }
#navUser[hidden], #navGuest[hidden] { display: none !important; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; }
.brand b { font-family: 'Space Grotesk'; font-size: 19px; font-weight: 800; letter-spacing: 3.5px; line-height: 1; }
.brand small { display: block; font-size: 9px; letter-spacing: 6.5px; color: var(--muted); font-weight: 600; }

/* ---------- Enlaces ---------- */
.nav-links {
  display: flex; align-items: center; gap: 2px; padding: 5px;
  background: var(--tint-1); border: 1px solid var(--border); border-radius: 999px;
}
.nav-links a { font-size: 13px; font-weight: 500; color: var(--muted); padding: 8px 12px; border-radius: 999px; transition: .25s; white-space: nowrap; }
.nav-links a:hover { color: var(--fg-strong); }
.nav-links a.active { background: var(--red-dim); color: var(--fg-strong); box-shadow: inset 0 0 0 1px var(--border-red); }
/* ---------- Selector de idioma ---------- */
.lang-sw { display: flex; border: 1px solid var(--border); border-radius: 20px; overflow: hidden; }
.lang-sw button {
  background: transparent; border: 0; color: var(--muted);
  font-size: 11.5px; font-weight: 800; padding: 7px 11px; letter-spacing: .5px;
}
.lang-sw button.on { background: var(--red); color: #0b0b0d; }

/* ---------- Menú móvil ---------- */
.burger { display: none; background: none; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; color: var(--fg-strong); }
.mobile-menu { display: none; }
.mm-auth { display: none; }

@media (max-width: 1300px) {
  .nav-links { display: none; }
  .burger { display: block; }
  .mobile-menu {
    position: fixed; top: 72px; left: 16px; right: 16px; z-index: 99;
    max-height: calc(100vh - 90px); overflow-y: auto; padding: 14px;
    background: var(--menu); border: 1px solid var(--border); border-radius: 18px;
    backdrop-filter: blur(20px);
  }
  .mobile-menu.open { display: grid; gap: 4px; }
  .mobile-menu a { padding: 13px 16px; border-radius: 12px; font-size: 15px; color: var(--muted); }
  .mobile-menu a:hover { background: rgba(255,122,26,.1); color: var(--fg-strong); }
}
@media (min-width: 1301px) {
  .mobile-menu { display: none !important; }
}
/* en móvil los botones de sesión pasan al menú desplegable */
@media (max-width: 680px) {
  .nav-in { padding: 14px 16px; gap: 10px; }
  .brand small { letter-spacing: 3.5px; }
  #navGuest { display: none !important; }
  .mm-auth {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border);
  }
  .mm-auth[hidden] { display: none; }
}

/* nombre «Acrox Solutions» con la tipografía oficial (img/acrox-solutions.png) */
.brand img.wordmark { width: auto; height: 18px; border-radius: 0; object-fit: contain; }
@media (max-width: 680px) { .brand img.wordmark { height: 14px; } }
@media (max-width: 380px) { .brand img.wordmark { display: none; } }

/* portátiles: «Inicio» sobra (el logo ya lleva arriba) y deja sitio a «Calendar» */
@media (max-width: 1440px) { .nav-links a[href="#home"] { display: none; } }

/* con el interruptor sol/luna la barra necesita un poco más de sitio */
@media (max-width: 1500px) {
  .nav-links a { padding: 8px 9px; font-size: 12.5px; }
  .brand { gap: 10px; }
  .brand img:not(.wordmark) { width: 36px; height: 36px; }
  .brand img.wordmark { height: 15px; }
  .lang-sw button { padding: 7px 9px; }
  .nav-actions { gap: 8px; }
  .nav-actions .btn-sm { padding: 10px 16px; }
  .nav-in { gap: 12px; padding-left: 20px; padding-right: 20px; }
}
