/* ═══════════════════════════════════════════════════════════════════
   Topbar pill — FONTE ÚNICA das 5 páginas públicas
   (index.html, viaria.html, artigo.php, blog.php, autor.php)

   Antes este bloco existia em cinco cópias: assets/css/styles.css mais
   um <style> inline em cada página standalone. Isso já causou drift
   real (correção de 2026-07-15, quando diferenças de 1–2px passaram
   despercebidas até o usuário comparar lado a lado) e ia se repetir
   agora, com a lógica do menu mobile.

   Regra: NÃO copiar estas regras para dentro de página nenhuma.
   Qualquer página nova referencia /assets/css/topbar.css.

   Cores em literal, não em var(--…): o arquivo precisa funcionar
   independentemente dos tokens que cada página declara no seu :root.
   ═══════════════════════════════════════════════════════════════════ */

.topbar-pill-wrap {
  padding: 12px 40px;
  background: #f7f7f5;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.topbar-pill {
  background: #111;
  border-radius: 14px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  height: 52px;
  gap: 4px;
  position: relative;   /* âncora do painel mobile */
}

.topbar-pill-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 0 8px;
  border-right: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  text-decoration: none;
}

.topbar-pill-mark {
  width: 28px;
  height: 28px;
  background: #f5a623;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topbar-pill-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
  line-height: 1;
}

.topbar-pill-logo em {
  font-style: normal;
  color: #f5a623;
}

.topbar-pill-logo-img {
  height: 30px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.topbar-pill-nav {
  display: flex;
  gap: 1px;
  flex: 1;
  padding: 0 8px;
  height: 100%;
  align-items: center;
}

.topbar-pill-item {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 6px 13px;
  height: auto;
  border: none;
  border-radius: 0;
  border-bottom: none;
  background: none !important;
  box-shadow: none !important;
  transition: color 0.25s ease, text-shadow 0.25s ease;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.topbar-pill-item.is-active {
  color: #ffd97a;
  font-weight: 600;
  background: none !important;
  border-bottom: none !important;
  text-shadow:
    0 0 10px rgba(255,210,60,1),
    0 0 26px rgba(255,185,30,0.75),
    0 0 52px rgba(255,160,0,0.45),
    0 0 80px rgba(255,140,0,0.2);
}

.topbar-pill-item:hover:not(:disabled) {
  color: #ffe49a;
  background: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  text-shadow:
    0 0 13px rgba(255,228,100,1),
    0 0 29px rgba(255,210,60,1),
    0 0 57px rgba(255,185,30,0.65),
    0 0 91px rgba(255,160,0,0.35);
}

.topbar-pill-static { opacity: 0.5; }

.topbar-pill-actions {
  padding-right: 4px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-entrar-pill {
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 18px;
  background: #f5a623;
  color: #111;
  border: none;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-entrar-pill:hover {
  background: #e09510;
  box-shadow: none;
}

/* ── Botão hambúrguer: só existe no mobile ────────────────────────── */
.topbar-pill-burger {
  display: none;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  color: #fff;
  padding: 0;
  transition: background 0.15s;
}

.topbar-pill-burger:hover { background: rgba(255,255,255,0.08); }

/* Três barras que viram X quando aberto. */
.topbar-pill-burger span {
  display: block;
  position: relative;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: background 0.2s;
}

.topbar-pill-burger span::before,
.topbar-pill-burger span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.2s ease, top 0.2s ease;
}

.topbar-pill-burger span::before { top: -6px; }
.topbar-pill-burger span::after  { top: 6px; }

.topbar-pill-wrap.is-open .topbar-pill-burger { color: #f5a623; }
.topbar-pill-wrap.is-open .topbar-pill-burger span { background: transparent; }
.topbar-pill-wrap.is-open .topbar-pill-burger span::before { top: 0; transform: rotate(45deg); }
.topbar-pill-wrap.is-open .topbar-pill-burger span::after  { top: 0; transform: rotate(-45deg); }

/* ═══ Mobile ══════════════════════════════════════════════════════════
   Em ≤900px a própria .topbar-pill-nav vira o painel — não existe um
   segundo menu duplicado. Isso é deliberado: no index.html os itens
   "Início" e "Fabricantes" são <button> com id (nav-analise-top,
   nav-fabricantes-top) e handlers em app.js; um menu clonado deixaria
   esses handlers ligados aos elementos errados.
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  .topbar-pill-wrap { padding: 10px 16px; }

  /* order:99 põe o hambúrguer na ponta direita sem depender da posição dele
     no HTML — nas 5 páginas ele vem antes de .topbar-pill-actions. */
  .topbar-pill-burger { display: inline-flex; order: 99; }

  .topbar-pill-nav {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    height: auto;
    padding: 8px;
    background: #111;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }

  .topbar-pill-wrap.is-open .topbar-pill-nav { display: flex; }

  .topbar-pill-item {
    font-size: 12px;
    padding: 0 14px;
    min-height: 44px;          /* alvo de toque confortável */
    border-radius: 9px;
    border-left: 2px solid transparent;
    white-space: normal;
  }

  .topbar-pill-item:hover:not(:disabled),
  .topbar-pill-item:active {
    background: rgba(255,255,255,0.06) !important;
  }

  /* No painel, o brilho do item ativo não funciona bem — vira barra âmbar. */
  .topbar-pill-item.is-active {
    border-left-color: #f5a623;
    background: rgba(245,166,35,0.1) !important;
    text-shadow: none;
  }

  /* O Entrar CONTINUA visível na pill: com a nav fora do fluxo sobra espaço
     de sobra (a 320px o conteúdo soma ~223px numa pill de 296px), e esconder
     o único CTA do site atrás de um toque a mais não se justifica. */
  .topbar-pill-actions { margin-left: auto; }

  .topbar-pill-actions .btn-entrar-pill { padding: 8px 14px; }
}

@media (max-width: 600px) {
  .topbar-pill-wrap { padding: 10px 12px; }
  .topbar-pill-logo-img { height: 26px; }
  .topbar-pill-brand { padding: 0 10px 0 6px; }
}
