.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;

  background: rgba(245, 241, 232, 0.16);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);

  overflow: visible;
}

.header-container {
  width: 100%;
  min-height: 76px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 0 64px;

  box-sizing: border-box;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;

  overflow: visible;
}

.logo img {
  height: 68px;
  width: auto;

  display: block;

  transform: translateY(8px);
}

.menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.menu a {
  position: relative;
  display: inline-block;
  color: #647a6f;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 550;
  letter-spacing: 0.03em;

  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu a:hover {
  transform: scale(1.07);
  opacity: 0.82;
}

.cta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  color: #31303094;
  text-decoration: none;

  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;

  padding: 10px 18px;

  font-size: 0.9rem;
  font-weight: 500;

  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.cta a:hover {
  background: #ffffff;
  color: #3A506B;

  transform: translateY(-2px);
}

.hamburger {
  width: 34px;
  height: 34px;

  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;

  cursor: pointer;

  position: relative;
  z-index: 1200;
}

.hamburger span {
  width: 26px;
  height: 2px;

  display: block;

  background: #ffffff;
  border-radius: 999px;

  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu {
  display: none;
}

body.menu-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .header-container {
    min-height: 72px;
    padding: 0 24px;
  }

  .logo img {
    height: 64px;
    transform: translateY(7px);
  }

  .menu {
    display: none;
  }

  .cta {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;

    width: 100%;
    height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;

    background: rgba(58, 80, 107, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    transition: right 0.35s ease;

    z-index: 1100;
  }

  .mobile-menu.active {
    right: 0;
  }

  .mobile-menu a {
    color: #F5F1E8;
    text-decoration: none;

    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.04em;

    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .mobile-menu a:hover {
    transform: scale(1.06);
    opacity: 0.82;
  }
}

/* ACTIVE LINK NO MENU DO HEADER */
.menu a.active-link,
.mobile-menu a.active-link {
  opacity: 0.78;
}

.menu a.active-link::after {
  content: "";

  position: absolute;
  left: 50%;
  bottom: -8px;

  width: 18px;
  height: 1px;

  transform: translateX(-50%);

  background: rgba(255, 255, 255, 0.82);
}

/* =========================================================
   HEADER MOBILE - CORREÇÃO DE LARGURA
========================================================= */

.header {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}

.header-container {
  width: min(100%, 1180px);
  max-width: calc(100vw - 28px);

  margin-left: auto;
  margin-right: auto;

  box-sizing: border-box;
}

.logo,
.logo a {
  min-width: 0;
}

.logo img {
  max-width: 150px;
  height: auto;
  margin-bottom:18px;
  margin-left:10px;
}

.menu {
  min-width: 0;
}

.cta {
  min-width: 0;
}

.cta a {
  max-width: 100%;
  white-space: nowrap;
}

.mobile-menu {
  width: 100%;
  max-width: 100vw;

  left: 0;
  right: 0;

  box-sizing: border-box;
  overflow-x: hidden;
}

.mobile-menu a {
  max-width: 100%;

  overflow-wrap: break-word;
  word-break: normal;
}

@media (max-width: 920px) {
  .header-container {
    max-width: calc(100vw - 24px);
    padding-left: 0;
    padding-right: 0;
  }

  .logo img {
    max-width: 132px;
    margin-left:10px;
  }

  .cta {
    display: none;
  }

  .hamburger {
    flex: 0 0 auto;
  }
}

@media (max-width: 420px) {
  .header-container {
    max-width: calc(100vw - 20px);
  }

  .logo img {
    max-width: 118px;
    margin-left: 10px;
  }
}

/* =========================================================
   CORREÇÃO MENU MOBILE - FECHADO POR PADRÃO
========================================================= */

.mobile-menu {
  display: none;
}

.mobile-menu.active {
  display: flex;
}

@media (max-width: 920px) {
  .mobile-menu {
    width: 100%;
    max-width: 100vw;

    position: fixed;
    top: var(--header-height, 78px);
    left: 0;
    right: 0;

    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0;

    padding: 18px 20px 24px;

    background: rgba(58, 80, 107, 0.96);
    border-bottom: 1px solid rgba(107, 112, 92, 0.16);

    box-shadow: 0 18px 44px rgba(58, 80, 107, 0.14);

    z-index: 999;

    box-sizing: border-box;
    overflow-x: hidden;
  }

  .mobile-menu.active {
    display: flex;
  }

  .mobile-menu a {
    width: 100%;

    padding: 14px 8px;

    color: white;

    text-align: center;
    text-decoration: none;

    border-bottom: 1px solid rgba(107, 112, 92, 0.1);

    font-size: 0.96rem;
    font-weight: 800;
  }

  .mobile-menu a:last-child {
    border-bottom: none;
  }
}

@media (min-width: 921px) {
  .mobile-menu {
    display: none !important;
  }
}

/* =========================================================
   HEADER DINÂMICO SOBRE HERO / BANNER
========================================================= */

.header {
  transition:
    background 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

/* Header sobre banner/foto com texto claro */
.header.header-over-hero.header-light {
  background: rgba(12, 18, 24, 0.12);
  border-bottom: 1px solid rgba(245, 241, 232, 0.08);
}

.header.header-over-hero.header-light .menu a {
  color: rgba(245, 241, 232, 0.92);
}

.header.header-over-hero.header-light .cta a {
  color: #F5F1E8;
  border-color: rgba(245, 241, 232, 0.72);
}

.header.header-over-hero.header-light .cta a:hover {
  background: #F5F1E8;
  color: #3A506B;
}

.header.header-over-hero.header-light .hamburger span {
  background: #F5F1E8;
}

/* Header sobre banner/foto clara com texto escuro */
.header.header-over-hero.header-dark {
  background: rgba(245, 241, 232, 0.2);
  border-bottom: 1px solid rgba(58, 80, 107, 0.08);
}

.header.header-over-hero.header-dark .menu a {
  color: #30352d;
}

.header.header-over-hero.header-dark .cta a {
  color: #30352d;
  border-color: rgba(48, 53, 45, 0.34);
}

.header.header-over-hero.header-dark .cta a:hover {
  background: #30352d;
  color: #F5F1E8;
}

.header.header-over-hero.header-dark .hamburger span {
  background: #30352d;
}

/* Header depois que sai do banner */
.header.header-solid {
  background: rgba(245, 241, 232, 0.94);
  border-bottom: 1px solid rgba(107, 112, 92, 0.14);
  box-shadow: 0 14px 34px rgba(58, 80, 107, 0.08);
}

.header.header-solid .menu a {
  color: #3A506B;
}

.header.header-solid .cta a {
  color: #3A506B;
  border-color: rgba(58, 80, 107, 0.28);
}

.header.header-solid .cta a:hover {
  background: #3A506B;
  color: #F5F1E8;
}

.header.header-solid .hamburger span {
  background: #3A506B;
}

/* Logo agora troca por imagem real via JS */
.header .logo img {
  filter: none !important;
  transition: opacity 0.2s ease;
}