/* ═══════════════════════════════════════════════════════════
   BIASO DIGITAL — nav.css
   Navegação principal · desktop + mobile
═══════════════════════════════════════════════════════════ */

/* ── NAVBAR WRAPPER ── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 800;
  transition:
    background var(--duration-md) var(--ease),
    border-color var(--duration-md) var(--ease),
    backdrop-filter var(--duration-md) var(--ease);
  border-bottom: 1px solid transparent;
}

/* Estado sólido — ativado via JS após scroll */
#navbar.solid {
  background: rgba(3, 7, 13, 0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-color: var(--border);
}

/* ── NAV INNER ── */
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 18px var(--container-pad);
  max-width: var(--container-max);
  margin: 0 auto;
}

/* ── LOGO ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity var(--duration) var(--ease);
}

.nav-logo:hover {
  opacity: 0.88;
}

.nav-globe {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav-wordmark {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  white-space: nowrap;
}

.nav-wordmark span {
  color: var(--cyan);
}

/* ── LINKS DESKTOP ── */
.nav-links {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-links ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-link {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: var(--r-sm);
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* ── CTAs DESKTOP ── */
.nav-ctas {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ── BURGER BUTTON ── */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color var(--duration) var(--ease);
}

.nav-burger:hover {
  border-color: rgba(0, 204, 255, 0.3);
}

.burger-bar {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--duration-md) var(--ease), opacity var(--duration) var(--ease);
}

/* Burger → X quando drawer aberto */
.nav-burger.open .burger-bar:nth-child(1) {
  transform: translateY(6.5px) rotate(45deg);
}
.nav-burger.open .burger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-burger.open .burger-bar:nth-child(3) {
  transform: translateY(-6.5px) rotate(-45deg);
}

/* ── MOBILE DRAWER ── */
.mob-drawer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);

  position: fixed;
  inset: 0;
  z-index: 790;

  background: rgba(3, 7, 13, 0.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);

  /* Animação de entrada/saída */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-md) var(--ease);
}

.mob-drawer.open {
  opacity: 1;
  pointer-events: all;
}

/* Botão fechar (X) */
.mob-close {
  position: absolute;
  top: 22px;
  right: var(--container-pad);
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.mob-close:hover {
  border-color: rgba(0, 204, 255, 0.3);
  color: var(--cyan);
}

/* Links do drawer */
.mob-drawer nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
}

.mob-link {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-sm);
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease);
  letter-spacing: var(--tracking-tight);
}

.mob-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

/* CTAs do drawer */
.mob-ctas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.mob-ctas .btn {
  min-width: 240px;
  justify-content: center;
}

/* ── RESPONSIVO ── */
@media (max-width: 960px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 820px) {
  .nav-ctas {
    display: none;
  }

  .nav-burger {
    display: flex;
  }
}

@media (max-width: 480px) {
  .nav-inner {
    padding: 16px 20px;
  }

  .nav-wordmark {
    font-size: 15px;
  }

  .nav-globe {
    width: 28px;
    height: 28px;
  }
}

.nav-item {
  position: relative;
  list-style: none;
}

.nav-dropdown {
  top: calc(100% + 6px); /* desce levemente o painel */
}

/* Botão "Soluções" — mesmo visual dos links */
.nav-link--dropdown {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
  transition: color var(--duration) var(--ease);
}

.nav-link--dropdown:hover,
.nav-item--has-dropdown:hover .nav-link--dropdown,
.nav-link--dropdown[aria-expanded="true"] {
  color: #ffffff;
}

/* Chevron — rotaciona quando aberto */
.nav-chevron {
  transition: transform var(--duration-md) var(--ease);
  flex-shrink: 0;
  color: var(--muted);
}

.nav-link--dropdown[aria-expanded="true"] .nav-chevron,
.nav-item--has-dropdown:hover .nav-chevron {
  transform: rotate(180deg);
  color: var(--cyan);
}

/* ══════════════════════════════════════
   DROPDOWN PANEL
══════════════════════════════════════ */

.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 520px;
  background: #0b1526;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(0, 204, 255, 0.06) inset;
  padding: 6px;
  z-index: 200;

  /* Estado inicial — escondido */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-50%) translateY(-8px);
  transition:
    opacity var(--duration-md) var(--ease),
    transform var(--duration-md) var(--ease),
    visibility var(--duration-md);
}

.nav-item--has-dropdown {
  position: relative;
}

.nav-dropdown {
  top: calc(100% + 4px); /* desce levemente o painel */
}

/* Seta decorativa apontando para o botão */
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 6px;
  background: #0b1526;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* Abrir ao hover ou quando aria-expanded=true */
.nav-item--has-dropdown:hover .nav-dropdown,
.nav-dropdown[data-open="true"] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* Inner — grid de 2 colunas */
.nav-dropdown__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  padding: 8px 4px;
}

/* Divisor vertical */
.nav-dropdown__divider {
  width: 1px;
  background: var(--border);
  margin: 0 12px;
  align-self: stretch;
}

/* Coluna */
.nav-dropdown__col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

/* Label da coluna */
.nav-dropdown__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--ghost);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 4px 8px 8px;
}

/* Item completo — com ícone + texto */
.nav-dropdown__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px;
  border-radius: var(--r-sm);
  text-decoration: none;
  transition:
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
  border: 1px solid transparent;
}

.nav-dropdown__item:hover {
  background: rgba(0, 204, 255, 0.05);
  border-color: rgba(0, 204, 255, 0.1);
}

/* Ícone do item */
.nav-dropdown__item-ico {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
  transition: color var(--duration) var(--ease);
}

.nav-dropdown__item-ico--cyan {
  background: rgba(0, 204, 255, 0.08);
  border-color: rgba(0, 204, 255, 0.18);
  color: var(--cyan);
}

.nav-dropdown__item-ico--green {
  background: rgba(34, 217, 138, 0.08);
  border-color: rgba(34, 217, 138, 0.18);
  color: var(--green);
}

/* Textos do item */
.nav-dropdown__item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-dropdown__item-text strong {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.nav-dropdown__item-text span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

/* Item pequeno — só ícone inline + texto */
.nav-dropdown__item--sm {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition:
    color var(--duration) var(--ease),
    background var(--duration) var(--ease);
}

.nav-dropdown__item--sm svg {
  color: var(--ghost);
  flex-shrink: 0;
  transition: color var(--duration) var(--ease);
}

.nav-dropdown__item--sm:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-dropdown__item--sm:hover svg {
  color: var(--cyan);
}

/* ══════════════════════════════════════
   MOBILE — submenu expansível
══════════════════════════════════════ */

.mob-section {
  display: flex;
  flex-direction: column;
}

/* Botão de toggle mobile */
.mob-link--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  /* Herda estilos de .mob-link via JS adicionando a classe */
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 1.8rem);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: var(--tracking-tight);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--duration) var(--ease);
}

.mob-link--toggle svg {
  transition: transform var(--duration-md) var(--ease);
  flex-shrink: 0;
  color: var(--ghost);
}

.mob-link--toggle[aria-expanded="true"] {
  color: var(--cyan);
}

.mob-link--toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
  color: var(--cyan);
}

/* Submenu mobile — fechado por padrão */
.mob-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 12px;
}

.mob-submenu.open {
  max-height: 400px;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* Link dentro do submenu */
.mob-sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: color var(--duration) var(--ease);
}

.mob-sublink:hover {
  color: #ffffff;
}

/* Pontos coloridos ao lado do link */
.mob-sublink__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ghost);
  flex-shrink: 0;
}

.mob-sublink__dot--cyan  { background: var(--cyan);  }
.mob-sublink__dot--green { background: var(--green); }

/* ══════════════════════════════════════
   INDICADOR DE PÁGINA ATIVA
══════════════════════════════════════ */

/* Adicione a classe .nav-link--active via JS ou inline na página atual */
.nav-link--active {
  color: #ffffff !important;
}

.nav-link--active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--cyan);
  border-radius: 2px;
}

.nav-item {
  position: relative;
}