/* ================== HEADER ================== */

/* ===== Topbar layout ===== */
.topbar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 20px;
  background: #f7f8f8; /* fundo claro */
  border-radius: 12px;
}

.topbar .logo img {
  height: 65px;
  width: auto;
  display: block;
}

/* ===== Search ===== */
.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  padding: 0 54px 0 16px;
}
.searchbar__input {
  appearance: none;
  border: 0;
  outline: 0;
  flex: 1;
  font-size: 14px;
  color: #111;
  background: transparent;
}
.searchbar__btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 0;
  background: #e5e7eb;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.searchbar__btn:hover {
  background: #dfe3e8;
}

/* ===== Right cluster (CEP / Login / Cart) ===== */
.topbar__right {
  display: grid;
  grid-auto-flow: column;
  gap: 18px;
  align-items: center;
}
.mini {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #111;
}
.mini__icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #111;
}
.mini__text {
  display: grid;
  line-height: 1.1;
}
.mini__text em {
  font-size: 12px;
  color: #6b7280;
  font-style: normal;
}
.mini__text strong {
  font-size: 12px;
  color: #111;
  font-weight: 800;
}

/* ===== Cart with badge ===== */
.cart {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #e9ecef;
  color: #111;
  text-decoration: none;
}
.cart__qty {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #12250a; /* verde escuro */
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: grid;
  place-items: center;
}

/* ================== MENU BAR (mainnav) ================== */

/* Linha separadora e preenchimento geral da barra */
.mainnav {
  width: 100%;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}

/* Container central com medidas e espaçamentos idênticos */
.mainnav > .bcat-trigger,
.mainnav > .mainnav__links,
.mainnav > div {
  /* garante que o wrapper flex use o mesmo container */
  box-sizing: border-box;
}

.mainnav {
  /* deixa o conteúdo em um container central */
  display: flex;
  justify-content: center;
}
.mainnav::before,
.mainnav::after {
  content: none;
}

/* wrapper interno alinhado e com alturas específicas */
.mainnav > .inner {
  max-width: 1280px;
  width: 100%;
  padding: 0 24px;
}

/* Usamos o DOM existente: aplica o layout no nível da barra */
.mainnav {
  position: relative;
}
.mainnav {
  /* grid de 2 colunas: categorias à esquerda / links à direita */
}
.mainnav {
  /* altura fixa da barra */
  min-height: 46px;
}

/* Ajusta os filhos diretos da barra */
.mainnav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Lado esquerdo: botão de categorias ===== */
.bcat-trigger {
  display: flex;
  align-items: center;
}
.bcat-trigger .btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #111;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.bcat-trigger .btn-ghost::before {
  content: "≡";
  font-size: 16px;
  margin-right: 6px;
  line-height: 1;
}

/* ===== Lado direito: links com espaçamentos exatos ===== */
.mainnav__links {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px; /* espaço entre “Sobre a Baffa” e “Contato” */
}
.mainnav__links .link {
  text-decoration: none;
  color: #111;
  font-weight: 700;
  font-size: 14px;
  line-height: 46px; /* centraliza verticalmente na barra */
  display: inline-block;
  padding: 0; /* sem preenchimento extra */
}

/* Hover leve para feedback */
.bcat-trigger .btn-ghost:hover,
.mainnav__links .link:hover {
  opacity: 0.85;
}

/* ================== Responsivo ================== */
@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .topbar__right {
    justify-content: end;
  }
  .mainnav {
    grid-template-columns: 1fr auto;
    padding: 0 16px;
  }
  .mainnav__links {
    gap: 18px;
  }
  .bcat-trigger .btn-ghost {
    height: 32px;
  }
}
@media (max-width: 640px) {
  .mainnav {
    grid-template-columns: 1fr auto;
  }
  .mainnav__links {
    gap: 14px;
  }
  .mainnav__links .link {
    font-size: 13px;
  }
}
