/* ══════════════════════════════════════════
   NAVBAR.CSS — Estilos de la barra de navegación superior
   Si cambia el diseño del navbar, solo tocas este archivo.
══════════════════════════════════════════ */

#navbar {
  background: var(--primary);
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 4px;
  position: relative;
  z-index: 200;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  flex-wrap: wrap;
}

#navbar > * { flex-shrink: 0; }
/* ── LOGO ── */
.nav-logo {
  margin-right: 20px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.nav-logo img { height: 26px; }

/* ── DIVISOR ── */
.nav-divider {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,0.15);
  margin-right: 4px;
  flex-shrink: 0;
}

/* ── CONTENEDOR DEL MENÚ DESKTOP ── */
#nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
  padding: 4px 0;
}

#nav-menu::-webkit-scrollbar { display: none; }

/* ── ITEM DEL NAVBAR ── */
.nav-item { position: relative; flex-shrink: 0; }

.nav-btn {
  background: none;
  border: none;
  color: white;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s;
  white-space: nowrap;
}

.nav-btn:hover          { background: rgba(255,255,255,0.10); }
.nav-item.open .nav-btn { background: rgba(255,255,255,0.15); }

/* ── FLECHA ── */
.nav-arrow {
  font-size: 9px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.nav-item.open .nav-arrow { transform: rotate(180deg); }

/* ── DROPDOWN ── */
.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: white;
  border-radius: 8px;
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  overflow: hidden;
  z-index: 300;
  border: 1px solid rgba(0,0,0,0.08);
}

.nav-item.open .nav-dropdown { display: block; }

/* ── ITEM DENTRO DEL DROPDOWN ── */
.nav-dropdown-item {
  padding: 11px 16px;
  font-size: 13px;
  color: #1a1a2e;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.nav-dropdown-item:last-child { border-bottom: none; }
.nav-dropdown-item:hover      { background: #f5f7ff; color: var(--primary); }

/* ── BOTÓN HAMBURGUESA (solo móvil) ── */
#hamburger-btn {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

#hamburger-btn:hover { background: rgba(255,255,255,0.1); }

/* ── RESPONSIVE SOLO MÓVIL ── */
@media (max-width: 850px) {

  #hamburger-btn { display: block; }
  #nav-menu      { display: none; overflow: visible; }

  #nav-menu.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--primary);
    padding: 8px 0;
    z-index: 199;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 56px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }

  .nav-item { width: 100%; }

  .nav-btn {
    width: 100%;
    padding: 14px 20px;
    border-radius: 0;
    font-size: 14px;
    justify-content: space-between;
  }

  .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: var(--submenu);
    min-width: 100%;
    width: 100%;
  }

  .nav-dropdown-item {
    padding: 12px 20px 12px 36px;
    font-size: 13px;
    color: #cdd9ec;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .nav-dropdown-item:hover {
    background: var(--submenu-item);
    color: white;
  }

  .nav-logo img { height: 22px; }

  .Btn {
    bottom: 16px;
    left: 12px;
    z-index: 198;
  }
}

/* ── USER POPUP ── */
.user-popup {
  position: relative;
  margin-left: auto;
  display: inline-block;
  flex-shrink: 0;
}
.user-popup input { display: none; }

.user-burger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 36px;
  padding: 0 12px;
  gap: 8px;
  border-radius: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}
.user-burger:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.6);
}

.user-popup-window {
  transform: scale(0.85);
  visibility: hidden;
  opacity: 0;
  position: absolute;
  right: 0;
  left: unset;
  top: calc(36px + 12px);
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border: 1px solid #eee;
  padding: 6px 4px;
  min-width: 200px;
  transition: all 0.15s ease-in-out;
  z-index: 500;
}
.user-popup input:checked ~ nav {
  transform: scale(1);
  visibility: visible;
  opacity: 1;
}

.user-popup-window legend {
  padding: 4px 16px;
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: inherit;
}
.user-popup-window ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.user-email-display {
  padding: 6px 16px;
  font-size: 12px;
  color: #555;
  font-family: 'Montserrat', sans-serif;
}
.user-popup-window hr {
  border: none;
  border-bottom: 1px solid #eee;
  margin: 4px 0;
}
.user-popup-window ul button {
  width: 100%;
  border: none;
  background: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #333;
  font-size: 13px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.user-popup-window ul button svg { color: var(--accent); }
.user-popup-window ul button:hover {
  background: var(--accent);
  color: white;
}
.user-popup-window ul button:hover svg { color: white; }

.user-navbar-email {
  color: rgba(255,255,255,0.85);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* cerrar popup al hacer click afuera */
@media (max-width: 850px) {
  .user-popup { margin-left: 0; }
}