/* ==========================================================================
   Masthead — cabeçalho FIXO global (sticky) durante toda a rolagem
   Card âmbar com a logo completa (esq.) · bandeira tricolor + menu (dir.)
   ========================================================================== */

/* Altura do cabeçalho no desktop (card da logo + respiro superior) */
@media (min-width: 1024px) {
  :root { --masthead-h: 9.75rem; }
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  min-height: var(--masthead-h);
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 0 var(--gutter) 0;
  /* Sempre transparente, mesmo rolando — sem fundo nem sombra em nenhum momento. */
  background: transparent;
}

/* --- Card âmbar com a logo completa --- */
.masthead__brand {
  flex: 0 0 auto;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.6rem;   /* menos respiro → logo preenche mais o card (ref.) */
}
.masthead__brand img { display: block; height: 7.8rem; width: auto; }

/* --- Bloco de navegação: bandeira tricolor acima, menu abaixo --- */
.masthead__navwrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin-top: 1.5rem;
}
.masthead__flag { display: flex; flex-direction: column; }
.masthead__flag span { display: block; height: 6px; }   /* faixas mais destacadas (ref.) */
.masthead__flag span:nth-child(1) { background: var(--red); }
.masthead__flag span:nth-child(2) { background: var(--blue); }
.masthead__flag span:nth-child(3) { background: var(--amber); }

.masthead__nav {
  margin-top: .65rem;   /* compensa a faixa mais grossa: menu na mesma altura */
  background: var(--cream);
  padding: .55rem .9rem;
}
.masthead__menu { display: flex; align-items: center; gap: 1.4rem; }
.masthead__menu li { display: flex; align-items: center; gap: 1.4rem; }
/* Cunha separadora ENTRE os itens (não após o último) */
.masthead__menu li:not(:last-child)::after {
  content: "";
  flex: 0 0 auto;
  width: 1.15rem;
  height: .8rem;
  background: url("../../assets/icons/wedge-dark.svg") center / contain no-repeat;
}
.masthead__menu a {
  display: block;
  font-weight: 900;
  font-size: var(--fs-nav);
  letter-spacing: .01em;
  color: var(--brown);
  text-transform: uppercase;
  white-space: nowrap;
}
.masthead__menu a:hover { opacity: .7; }

/* O menu (bandeira + links) tem fundo creme fixo — sempre legível — exceto
   sobre o Hero, onde a imagem/logo já se destacam e o fundo não faz falta.
   O botão hambúrguer (mobile) fica sempre sem fundo, sobre o conteúdo da
   página; quando a seção atrás dele é escura (Intro, Mercado), troca para creme. */
.masthead--over-hero .masthead__nav { background: transparent; }
.masthead--on-dark .masthead__toggle { color: var(--cream); }

/* --- Botão hambúrguer (apenas mobile) --- */
.masthead__toggle {
  display: none;
  width: 3rem;
  height: 3rem;
  padding: .7rem;
  border-radius: .5rem;
  flex-direction: column;
  justify-content: space-between;
  color: var(--brown);
}
.masthead__toggle span {
  display: block;
  height: 3px;
  width: 100%;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .2s ease;
}
/* Vira um "X" quando o menu está aberto */
.masthead__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.masthead__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.masthead__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) {
  .masthead__toggle span { transition: none; }
}

/* ==========================================================================
   Plano A — trava as proporções do header acima de 1440px para ele não crescer
   demais em telas grandes. DEVE ficar por último no arquivo para vencer as
   regras-base acima (mesma especificidade).
   ========================================================================== */
@media (min-width: 1441px) {
  :root { --masthead-h: 155px; }
  .masthead { gap: 20px; padding-top: 0; }
  .masthead__brand { padding: 11px 25px; }
  .masthead__brand img { height: 124px; }
  .masthead__navwrap { margin-top: 24px; }
  .masthead__flag span { height: 6px; }
  .masthead__nav { margin-top: 10.4px; padding: 8.8px 14.4px; }
  .masthead__menu, .masthead__menu li { gap: 22.4px; }
  .masthead__menu li:not(:last-child)::after { width: 18.4px; height: 12.8px; }
  .masthead__menu a { font-size: 18.6px; }
}
