/* GeoFinance GPS — navbar global com dropdowns */
.gfm-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h, 44px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 12px 0 16px;
  background: rgba(10, 10, 15, 0.98);
  border-bottom: 1px solid var(--border, #2a2a3a);
  backdrop-filter: blur(8px);
  flex-shrink: 0;
}

.gfm-nav-logo,
.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 0;
}

.gfm-nav-logo img,
.nav-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.gfm-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: visible;
}

.gfm-nav-link,
.gfm-nav-drop-btn {
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 10px;
  color: var(--muted, #555570);
  text-decoration: none;
  padding: 5px 9px;
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  background: transparent;
  cursor: pointer;
  line-height: 1.2;
}

.gfm-nav-link:hover,
.gfm-nav-drop-btn:hover,
.gfm-nav-link.active,
.gfm-nav-drop-btn.active,
.gfm-nav-drop.is-open .gfm-nav-drop-btn {
  color: #00ff88;
  border-color: rgba(0, 255, 136, 0.4);
  background: rgba(0, 255, 136, 0.06);
}

.gfm-nav-drop {
  position: relative;
  flex-shrink: 0;
}

.gfm-nav-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.gfm-nav-drop-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 148px;
  padding: 4px;
  margin-top: 2px;
  background: rgba(14, 14, 22, 0.98);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 5100;
}

.gfm-nav-drop-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.gfm-nav-drop.is-open .gfm-nav-drop-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.gfm-nav-drop-item {
  display: block;
  position: relative;
  z-index: 1;
  font-family: var(--mono, 'Space Mono', monospace);
  font-size: 10px;
  color: var(--muted, #555570);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
  pointer-events: auto;
  cursor: pointer;
}

.gfm-nav-drop-item:hover,
.gfm-nav-drop-item.active {
  color: #00ff88;
  background: rgba(0, 255, 136, 0.08);
}

.gfm-nav-burger { display: none; }

@media (max-width: 768px) {
  .gfm-nav {
    padding: 0 8px 0 10px;
    gap: 6px;
  }

  .gfm-nav-map-mobile {
    display: inline-flex !important;
    flex-shrink: 0;
    margin-left: 6px;
    font-family: var(--mono, 'Space Mono', monospace);
    font-size: 10px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid rgba(0, 255, 136, 0.55);
    border-radius: 4px;
    background: rgba(22, 163, 74, 0.35);
    white-space: nowrap;
  }

  .gfm-nav-map-mobile:hover,
  .gfm-nav-map-mobile.active {
    background: rgba(22, 163, 74, 0.55);
    border-color: #00ff88;
    color: #fff !important;
  }

  /* botão hambúrguer */
  .gfm-nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 32px;
    margin-left: auto;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
    color: #e8e8f0;
    background: transparent;
    border: 1px solid var(--border, #2a2a3a);
    border-radius: 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .gfm-nav.menu-open .gfm-nav-burger {
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.06);
  }

  /* fileira de links escondida; vira painel vertical quando o menu abre */
  .gfm-nav-links {
    display: none;
  }

  .gfm-nav.menu-open .gfm-nav-links {
    display: flex;
    position: fixed;
    top: var(--nav-h, 44px);
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--nav-h, 44px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 10px 12px calc(18px + env(safe-area-inset-bottom, 0px));
    background: rgba(10, 10, 15, 0.99);
    border-bottom: 1px solid var(--border, #2a2a3a);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.5);
    z-index: 5050;
  }

  .gfm-nav.menu-open .gfm-nav-link,
  .gfm-nav.menu-open .gfm-nav-drop-btn {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    padding: 12px 12px;
    flex-shrink: 0;
  }

  .gfm-nav.menu-open .gfm-nav-link[data-gfm-path="/mapa"] {
    display: flex !important;
  }

  .gfm-nav.menu-open .gfm-nav-drop {
    width: 100%;
    flex-shrink: 0;
  }

  /* dropdowns viram acordeões inline */
  .gfm-nav-drop-menu {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    border: none;
    border-left: 2px solid rgba(0, 255, 136, 0.25);
    border-radius: 0;
    margin: 2px 0 4px 10px;
    padding: 2px 0 2px 8px;
    background: transparent;
    display: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: none;
  }

  .gfm-nav-drop-menu::before {
    display: none;
  }

  .gfm-nav-drop.is-open .gfm-nav-drop-menu {
    display: block;
    transform: none;
  }

  .gfm-nav-drop-item {
    font-size: 12px;
    padding: 11px 10px;
  }
}

.gfm-nav-map-mobile {
  display: none;
}
