/* =====================================================================
   COMPONENTE: BARRA DE NAVEGAÇÃO INFERIOR (.bottom-nav)
   8 itens. Oculta na Home. No mobile vira scroll horizontal.
   ===================================================================== */

.bottom-nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 8;
  display: grid;
  height: 76px;
  grid-template-columns: repeat(8, 1fr);
  align-items: center;
  background: #ffffff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px rgba(0, 41, 84, 0.08);
}

/* Esconde a barra quando a Home está ativa */
.screen-home.active ~ .bottom-nav {
  display: none;
}

.bottom-nav button,
.bottom-nav .nav-powerbi,
.bottom-nav .nav-external {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
  padding: 6px 0 5px;
  text-decoration: none;
}

.bottom-nav .nav-icon {
  width: 34px;
  height: 34px;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform 0.15s ease;
}

.bottom-nav button.active .nav-icon {
  transform: scale(1.12);
}

.bottom-nav span {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.58rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav button.active {
  color: var(--navy);
}

.bottom-nav button.active span {
  color: #0a5bb0;
}

/* ===== Mobile: barra inferior com scroll horizontal ===== */
@media (max-width: 780px) {
  /* Mantém a barra escondida na Home mesmo com o !important abaixo */
  .screen-home.active ~ .bottom-nav {
    display: none !important;
  }

  .bottom-nav {
    display: flex !important;
    height: 84px;
    grid-template-columns: none !important;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    padding: 0 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .bottom-nav::-webkit-scrollbar {
    display: none;
  }

  .bottom-nav button,
  .bottom-nav .nav-powerbi,
  .bottom-nav .nav-external {
    flex: 0 0 auto !important;
    width: 72px !important;
    min-width: 72px;
    justify-content: center;
    padding: 8px 4px 6px;
  }

  .bottom-nav .nav-icon {
    width: 32px;
    height: 32px;
  }

  .bottom-nav span {
    font-size: 0.6rem;
  }
}

@media (min-width: 781px) {
  .bottom-nav {
    height: 96px;
    padding-inline: max(0px, calc((100vw - 860px) / 2));
  }

  .bottom-nav span {
    font-size: 0.68rem;
  }
}
