/* ==========================================
   BOTTOM NAV — mobile only (≤ 767px)
   ========================================== */

.bottom-nav {
  display: none;
}

@media (max-width: 767px) {

  /* Oculta o header no mobile — bottom nav assume a navegação */
  .site-header {
    display: none;
  }

  /* Remove o padding-top reservado para o header */
  .main-content {
    padding-top: 16px;
  }

  /* ── Barra ── */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 110;
    height: 58px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
    align-items: stretch;
    justify-content: space-around;
  }

  [data-theme="light"] .bottom-nav {
    background: rgba(255, 255, 255, 0.92);
    border-top-color: #e5e5e5;
  }

  /* ── Item ── */
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 6px 8px;
    color: var(--text-muted);
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.18s ease;
    cursor: pointer;
  }

  .bottom-nav-item:active {
    opacity: 0.55;
  }

  /* ícone */
  .bottom-nav-icon {
    font-size: 21px;
    line-height: 1;
    display: block;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  /* label */
  .bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
    font-family: var(--font-display);
  }

  /* ── Ativo ── */
  .bottom-nav-item.active {
    color: var(--accent);
  }

  .bottom-nav-item.active .bottom-nav-icon {
    transform: scale(1.18) translateY(-1px);
  }

  /* Traço superior no item ativo */
  .bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent);
    border-radius: 0 0 3px 3px;
  }

  /* ── Compensar o conteúdo oculto atrás da barra ── */
  .main-content {
    padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  }

  .site-footer {
    margin-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  }

  /* Esconde nav links do header no mobile (bottom nav assume) */
  .header-nav {
    display: none;
  }

  /* ── Botão de tema no bottom nav ── */
  .bottom-nav .theme-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    flex: 1;
    padding: 6px 8px;
    color: var(--text-muted);
    position: relative;
    background: none;
    border: none;
    border-radius: 0;
    width: auto;
    height: auto;
    overflow: visible;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.18s ease;
  }

  .bottom-nav .theme-toggle:hover { transform: none !important; }
  .bottom-nav .theme-toggle:active { opacity: 0.55; }

  /* Ícone dinâmico — usa ::before para trocar emoji sem posição absoluta */
  .bottom-nav .theme-toggle .bn-theme-icon {
    font-size: 21px;
    line-height: 1;
    display: block;
  }

  .bottom-nav .theme-toggle .bn-theme-icon::before {
    content: '🌙';
  }

  [data-theme="light"] .bottom-nav .theme-toggle .bn-theme-icon::before {
    content: '☀️';
  }

  .bottom-nav .theme-toggle .bottom-nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1;
    font-family: var(--font-display);
  }
}
