/* Header flutuante e independente — fiel ao Harmonizada */

.header-anchor {
  max-width: var(--max-w);
  width: 100%;
  margin: 0 auto;
  position: relative;
  padding: 0 var(--header-pad);
  box-sizing: border-box;
}

.header-float {
  position: absolute;
  top: 22px;
  left: 0;
  right: 0;
  z-index: 100;
  transition: top 0.3s ease;
}

.header-float.is-scrolled {
  position: fixed;
  top: var(--header-top-fixed);
}

.header-inner {
  padding: 0 var(--header-pad);
  position: relative;
}

.header-position {
  position: relative;
}

.site-header {
  width: 100%;
  box-sizing: border-box;
  height: var(--header-height);
  border-radius: var(--radius-float);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 34px);
  transition: background 0.35s ease, backdrop-filter 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.4) 0px, rgba(255, 255, 255, 0) 1px, rgba(20, 26, 25, 0.028) 2px, rgba(20, 26, 25, 0) 3px), linear-gradient(180deg, #EEF0ED 0%, #E2E6E3 48%, #E9ECE9 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 22px 48px rgba(14, 22, 20, 0.16), 0 2px 8px rgba(14, 22, 20, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(14, 22, 20, 0.05);
}

.header-float.is-scrolled .site-header {
  background: rgba(244, 247, 246, 0.6);
  background-image: none;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 28px 64px rgba(14, 22, 20, 0.24), 0 6px 18px rgba(14, 22, 20, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.site-header__left {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 40px);
  min-width: 0;
}

.site-header__logo {
  height: 29px;
  width: auto;
  display: block;
  flex: none;
  /* Suporta o estado temporário de entrada da intro (brand-loader.css). */
  transition: opacity 750ms cubic-bezier(0.22, 1, 0.36, 1), transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header__nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 36px);
  /* Suporta o estado temporário de entrada da intro (brand-loader.css). */
  transition: opacity 750ms cubic-bezier(0.22, 1, 0.36, 1), transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header__link {
  position: relative;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 500;
  color: var(--text-nav-inactive);
  white-space: nowrap;
  padding-bottom: 4px;
  text-decoration: none;
  transition: color 0.2s ease;
}

/*
  Três estados: normal (regra base acima), hover/focus-visible (temporário,
  não mexe no item realmente ativo) e --active (persistente, controlado por
  nav-active.js via IntersectionObserver). Hover funciona normalmente mesmo
  quando outro item já está ativo — são independentes.
*/
.site-header__link:hover,
.site-header__link:focus-visible {
  font-weight: 600;
  color: var(--text-heading-alt);
  text-decoration: none;
}

.site-header__link--active {
  font-weight: 600;
  color: var(--text-heading-alt);
}

.site-header__link:hover::after,
.site-header__link:focus-visible::after,
.site-header__link--active::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -2px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.site-header__right {
  display: flex;
  align-items: center;
  gap: clamp(10px, 2vw, 22px);
  flex: none;
  /* Suporta o estado temporário de entrada da intro (brand-loader.css). */
  transition: opacity 750ms cubic-bezier(0.22, 1, 0.36, 1), transform 750ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-header__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--radius-control);
  background: var(--green);
  color: #FFFFFF;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: var(--shadow-cta);
  text-decoration: none;
}

.site-header__cta:hover {
  color: #FFFFFF;
  text-decoration: none;
}

.site-header__hamburger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  flex: none;
  padding: 0;
}

.site-header__hamburger span {
  width: 20px;
  height: 2px;
  background: var(--text-heading-alt);
  display: block;
  margin: 2.5px 0;
}

.mobile-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius-float);
  box-shadow: 0 20px 50px rgba(14, 22, 20, 0.18);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 99;
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu__link {
  display: block;
  padding: 12px 14px;
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading-alt);
  text-decoration: none;
}

.mobile-menu__link:hover {
  background: var(--field-bg);
  text-decoration: none;
}

.mobile-menu__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  height: 48px;
  border-radius: var(--radius-control);
  background: var(--green);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}

.mobile-menu__cta:hover {
  color: #fff;
  text-decoration: none;
}

/* Breakpoint de nav (--bp-nav: 1080px, ver tokens.css) */
@media (min-width: 1080px) {
  .mobile-menu {
    display: none !important;
  }
}

@media (max-width: 1079.98px) {
  .site-header__nav,
  .site-header__cta {
    display: none;
  }
  .site-header__hamburger {
    display: flex;
  }
}
