/* Spec 140 — cabeçalho público; breakpoints oficiais LG ≤991px, XL/XXL ≥992px */

.public-header.site-header {
  position: sticky;
  isolation: isolate;
}

/* XS–LG: menu compacto (hambúrguer à direita) */
@media (max-width: 991px) {
  .public-header.site-header {
    justify-content: flex-start;
    gap: 0.5rem;
  }

  .public-header .tools {
    display: none;
  }

  .public-header .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: auto;
    flex-shrink: 0;
  }

  .public-header .header-cta {
    display: none;
  }

  .public-header .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 45;
    background: var(--vr-navy);
    color: var(--vr-white);
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    padding: 1rem;
    max-height: min(85svh, calc(100svh - 7rem));
    overflow: auto;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }

  .public-header .main-nav.open {
    display: flex;
  }

  .public-header .main-nav a {
    display: block !important;
    padding: 0.65rem;
    font-size: 0.78rem;
  }

  .public-header .main-nav .nav-apply {
    display: flex !important;
    order: -1;
  }

  .public-header .main-nav .mobile-only {
    display: block !important;
  }
}

/* XL–XXL: navegação horizontal */
@media (min-width: 992px) {
  .utility-nav {
    display: flex;
  }

  .public-header .menu-toggle {
    display: none;
  }

  .public-header .header-cta {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }

  .public-header.site-header {
    justify-content: space-between;
    gap: clamp(0.5rem, 1.2vw, 1.25rem);
  }

  .public-header .brand {
    flex-shrink: 0;
  }

  .public-header .tools {
    display: flex;
    flex-shrink: 0;
  }

  .public-header .main-nav {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    min-width: 0;
    gap: clamp(0.35rem, 0.9vw, 1rem);
    background: transparent;
    color: inherit;
    padding: 0;
    max-height: none;
    overflow: visible;
    z-index: auto;
  }

  .public-header .main-nav a {
    display: inline-flex;
    align-items: center;
    padding: 0;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.78rem;
  }

  .public-header .main-nav .mobile-only,
  .public-header .main-nav .nav-apply {
    display: none !important;
  }
}

/* Faixa XL (992–1199): distribuição horizontal sem reduzir tipografia do menu */
@media (min-width: 992px) and (max-width: 1199px) {
  .public-header.site-header {
    gap: clamp(0.35rem, 0.85vw, 0.9rem);
    padding-inline: clamp(0.65rem, 1.8vw, 1.25rem);
  }

  .public-header .main-nav {
    gap: clamp(0.2rem, 0.45vw, 0.5rem);
    justify-content: flex-end;
  }

  .public-header .header-cta {
    font-size: 0.58rem;
    padding: 0.5rem 0.6rem;
  }

  .public-header .brand {
    font-size: clamp(1.05rem, 2vw, 1.28rem);
  }
}
