/* 10-cabecalho: .site-header da V1, portado com escopo em #cabecalho. */
#cabecalho.site-header {
  position: fixed;
  z-index: 1000;
  top: 1.6vw;
  left: 51.95%;
  display: grid;
  grid-template-columns: 10.25vw 1fr 15.35vw;
  align-items: center;
  width: 65%;
  max-width: 63.5rem;
  min-height: min(4.375rem, 4.48vw);
  padding: 0.64vw 1.66vw;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 999px;
  background: #1d1d1d;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 2%);
  font-size: 1rem;
  line-height: normal;
  transform: translateX(-50%);
  transition: border-color 240ms ease, background-color 240ms ease;
}

html.menu-aberto,
html.menu-aberto body { overflow: hidden; }

#cabecalho .skip-link {
  position: fixed;
  z-index: 3000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--white);
  color: var(--black);
  font-size: 0.8125rem;
  text-decoration: none;
  transform: translateY(calc(-100% - 4rem));
  transition: transform 180ms var(--ease-out);
}
#cabecalho .skip-link:focus { transform: translateY(0); }

#cabecalho .brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 0.25rem;
  margin-left: 0.65rem;
}

#cabecalho .brand img {
  display: block;
  width: min(5.25rem, 5.38vw);
  height: auto;
  filter: brightness(0) invert(1);
}

#cabecalho .site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3.42vw;
}

#cabecalho .site-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.56vw;
  color: rgb(248 248 246 / 65%);
  font-size: min(0.9375rem, 0.96vw);
  font-weight: 400;
  letter-spacing: -0.035em;
  text-decoration: none;
  transition: color 180ms var(--ease-out);
}

#cabecalho .site-nav a:hover,
#cabecalho .site-nav a:focus-visible { color: var(--white); }

#cabecalho .site-nav svg {
  width: min(0.75rem, 0.77vw);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

/* Página atual (aria-current, marcado pelo JS): o link fica aceso como no hover. */
#cabecalho .site-nav a[aria-current="page"],
#cabecalho .site-nav__solutions.is-atual { color: var(--white); }

/* Soluções: botão com o desenho dos links da V1 e a lista de soluções num painel da cápsula. */
#cabecalho .site-nav__grupo { position: relative; display: flex; align-items: center; }

#cabecalho .site-nav__solutions {
  display: inline-flex;
  align-items: center;
  gap: 0.56vw;
  padding: 0;
  border: 0;
  background: none;
  color: rgb(248 248 246 / 65%);
  font: inherit;
  font-size: min(0.9375rem, 0.96vw);
  font-weight: 400;
  letter-spacing: -0.035em;
  cursor: pointer;
  transition: color 180ms var(--ease-out);
}

#cabecalho .site-nav__solutions:hover,
#cabecalho .site-nav__solutions:focus-visible,
#cabecalho .site-nav__solutions[aria-expanded="true"] { color: var(--white); }

#cabecalho .site-nav__solutions svg { transition: transform 180ms var(--ease-out); }
#cabecalho .site-nav__solutions[aria-expanded="true"] svg { transform: rotate(180deg); }

#cabecalho .site-nav__lista {
  position: absolute;
  top: calc(100% + min(1.9rem, 1.95vw));
  left: 50%;
  display: grid;
  min-width: 13.5rem;
  margin: 0;
  padding: 0.5rem;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 1.25rem;
  background: rgb(29 29 29 / 98%);
  box-shadow: 0 1rem 3rem rgb(0 0 0 / 35%);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -0.5rem);
  transition:
    opacity 180ms var(--ease-out),
    visibility 180ms step-end,
    transform 180ms var(--ease-out);
}

/* Ponte invisível entre o botão e o painel, para o hover não cair no vão. */
#cabecalho .site-nav__lista::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: min(2rem, 2.05vw);
}

#cabecalho .site-nav__grupo.is-open .site-nav__lista,
#cabecalho:not(.tem-js) .site-nav__grupo:focus-within .site-nav__lista {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}

@media (hover: hover) and (min-width: 1051px) {
  #cabecalho .site-nav__grupo:hover .site-nav__lista {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
  }
  #cabecalho .site-nav__grupo:hover .site-nav__solutions { color: var(--white); }
}

#cabecalho .site-nav .site-nav__lista a {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 0.7rem 1rem;
  border-radius: 0.8rem;
  font-size: 0.9375rem;
  white-space: nowrap;
}

#cabecalho .site-nav .site-nav__lista a:hover,
#cabecalho .site-nav .site-nav__lista a:focus-visible,
#cabecalho .site-nav .site-nav__lista a[aria-current="page"] { background: rgb(255 255 255 / 5%); }

#cabecalho .header-cta {
  justify-self: end;
  display: inline-flex;
  min-height: min(2.75rem, 2.82vw);
  align-items: center;
  justify-content: center;
  padding: 0.66vw 1.23vw;
  border: 1px solid transparent;
  border-radius: 999px;
  /* Pedido 17: CTA do cabeçalho branco com texto preto. */
  background: var(--white);
  color: #0a0a0a;
  font-size: min(0.9375rem, 0.96vw);
  font-weight: 600;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 180ms var(--ease-out), transform 180ms var(--ease-out);
}

#cabecalho .header-cta:hover,
#cabecalho .header-cta:focus-visible {
  background: #fff;
  color: #0a0a0a;
  transform: translateY(-1px);
}

#cabecalho .menu-toggle { display: none; }

#cabecalho .brand:focus-visible,
#cabecalho .menu-toggle:focus-visible,
#cabecalho .site-nav a:focus-visible,
#cabecalho .site-nav__solutions:focus-visible,
#cabecalho .header-cta:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
}

/* Área de toque ≥ 44 px no desktop sem mudar o desenho: alvo invisível ao redor do texto. */
@media (min-width: 1051px) {
  #cabecalho .site-nav > a,
  #cabecalho .site-nav__solutions,
  #cabecalho .header-cta,
  #cabecalho .brand { position: relative; }
  #cabecalho .site-nav > a::after,
  #cabecalho .site-nav__solutions::after,
  #cabecalho .header-cta::after,
  #cabecalho .brand::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: max(100%, 44px);
    height: 44px;
    transform: translate(-50%, -50%);
  }
}

@media (max-width: 1050px) {
  #cabecalho.site-header {
    grid-template-columns: 1fr auto auto;
    width: calc(100% - 2rem);
    min-height: 4rem;
    padding-inline: 1.35rem;
  }

  #cabecalho .brand { margin-left: 0; min-height: 44px; }
  #cabecalho .brand img { width: 5rem; }

  #cabecalho .header-cta {
    min-height: 2.75rem;
    padding: 0.65rem 1.1rem;
    font-size: 0.875rem;
  }

  #cabecalho .site-nav {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    left: 0;
    display: grid;
    justify-content: stretch; /* linhas na largura do painel, como pedem o space-between e o hover da V1 */
    gap: 0;
    padding: 0.75rem;
    border: 1px solid rgb(255 255 255 / 12%);
    border-radius: 1.5rem;
    background: rgb(29 29 29 / 98%);
    box-shadow: 0 1rem 3rem rgb(0 0 0 / 35%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-0.5rem);
    transition:
      opacity 180ms var(--ease-out),
      visibility 180ms step-end,
      transform 180ms var(--ease-out);
  }

  /* Sem JS o botão fica oculto: os links continuam alcançáveis pelo teclado e o menu abre no foco. */
  #cabecalho:not(.tem-js) .site-nav { visibility: visible; pointer-events: none; }
  #cabecalho:not(.tem-js):focus-within .site-nav { opacity: 1; transform: none; pointer-events: auto; }

  #cabecalho .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
  }

  #cabecalho .site-nav a {
    justify-content: space-between;
    padding: 1rem;
    border-radius: 0.9rem;
    font-size: 1rem;
  }

  #cabecalho .site-nav a:hover,
  #cabecalho .site-nav a:focus-visible { background: rgb(255 255 255 / 5%); }

  #cabecalho .site-nav svg { width: 0.75rem; }

  /* No menu móvel, Soluções vira uma linha do menu que abre a lista logo abaixo, recuada. */
  #cabecalho .site-nav__grupo { display: block; }
  #cabecalho .site-nav__solutions {
    display: flex;
    width: 100%;
    min-height: 44px;
    justify-content: space-between;
    padding: 1rem;
    border-radius: 0.9rem;
    font-size: 1rem;
    text-align: left;
  }
  #cabecalho .site-nav__solutions:hover,
  #cabecalho .site-nav__solutions:focus-visible { background: rgb(255 255 255 / 5%); }

  #cabecalho .site-nav__lista,
  #cabecalho .site-nav__grupo.is-open .site-nav__lista,
  #cabecalho:not(.tem-js) .site-nav__grupo:focus-within .site-nav__lista {
    position: static;
    display: none;
    min-width: 0;
    padding: 0 0 0.35rem 0.75rem;
    border: 0;
    background: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  #cabecalho .site-nav__lista::before { content: none; }
  #cabecalho .site-nav__grupo.is-open .site-nav__lista,
  #cabecalho:not(.tem-js) .site-nav__grupo:focus-within .site-nav__lista { display: grid; }
  #cabecalho .site-nav .site-nav__lista a { padding: 0.85rem 1rem; font-size: 0.975rem; }

  #cabecalho .menu-toggle {
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    margin-left: 0.65rem;
    padding: 0;
    place-content: center;
    gap: 0.36rem;
    border: 1px solid rgb(255 255 255 / 20%);
    border-radius: 50%;
    background: transparent;
    color: var(--white);
    cursor: pointer;
  }
  #cabecalho .menu-toggle[hidden] { display: none; }

  #cabecalho .menu-toggle span {
    display: block;
    width: 1rem;
    height: 1px;
    background: currentColor;
    transition: transform 180ms var(--ease-out);
  }

  #cabecalho .menu-toggle[aria-expanded="true"] span:first-child { transform: translateY(0.21rem) rotate(45deg); }
  #cabecalho .menu-toggle[aria-expanded="true"] span:last-child { transform: translateY(-0.21rem) rotate(-45deg); }
}

@media (max-width: 700px) {
  #cabecalho.site-header {
    top: max(0.75rem, env(safe-area-inset-top));
    min-height: 3.75rem;
    width: calc(100% - 1.5rem);
    padding: 0.45rem 0.7rem 0.45rem 1rem;
  }

  #cabecalho .brand img { width: 4.75rem; }

  #cabecalho .header-cta {
    min-height: 2.75rem;
    padding-inline: 0.9rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 470px) {
  #cabecalho .header-cta { display: none; }
}

@media (max-height: 640px) and (min-width: 701px) {
  #cabecalho.site-header { top: 1rem; }
}
