/* Place Astra navigation above page cards and section links.
   Low specificity preserves the theme's fixed and transparent header modes. */
:where(#masthead) { position: relative; }
html #masthead { z-index: 1000; }

/* APS: menu principal discreto e submenus acessíveis. */
html #masthead .main-header-menu .sub-menu{
  background:#F6F0EA!important;
  border:1px solid #E8E0D6!important;
  border-top:1px solid #E8E0D6!important;
  border-radius:8px;
  padding:6px;
  box-shadow:0 6px 18px rgba(47,38,31,.08);
  z-index:1000;
}
html #masthead .main-header-menu .sub-menu .menu-link{
  color:#7A522C!important;
  padding:10px 14px!important;
  min-height:44px;
  line-height:1.45;
  white-space:normal;
  overflow-wrap:break-word;
  border:0!important;
  border-radius:5px;
  font-size:14px;
  font-weight:400;
  transition:background-color .15s ease,color .15s ease;
}
html #masthead .main-header-menu .sub-menu .menu-item:hover>.menu-link,
html #masthead .main-header-menu .sub-menu .menu-link:focus-visible,
html #masthead .main-header-menu .sub-menu .current-menu-item>.menu-link{
  background:#EDE5DC!important;
  color:#7A522C!important;
  box-shadow:none;
}
html #masthead .main-header-menu .menu-link:focus-visible,
html #masthead .ast-menu-toggle:focus-visible,
html #masthead .menu-toggle:focus-visible{
  outline:2px solid #7A522C;
  outline-offset:-2px;
}
body:not(.ast-header-break-point) #masthead .main-header-menu .sub-menu{
  width:240px;
  max-width:calc(100vw - 32px);
}
body:not(.ast-header-break-point) #masthead .main-header-menu>.menu-item-has-children{
  position:relative;
}
body:not(.ast-header-break-point) #masthead .main-header-menu>.menu-item-has-children>.sub-menu{
  top:100%!important;
  margin-top:0!important;
  transform:none!important;
}
body.ast-header-break-point #masthead .main-header-menu .sub-menu{
  width:auto;
  min-width:0;
  max-width:none;
  margin:0 12px 8px;
  padding:0 0 0 12px;
  background:transparent!important;
  border:0!important;
  border-left:1px solid #DDD1C1!important;
  box-shadow:none;
  border-radius:0;
}
body.ast-header-break-point #masthead .main-header-menu{
  margin:10px 12px 16px;
  padding:6px 8px;
  background:#F6F0EA;
  border:1px solid #E8E0D6;
  border-radius:12px;
  box-shadow:none;
  overflow:visible;
}
body.ast-header-break-point #masthead .main-header-menu>.menu-item{
  border-bottom:1px solid #E8E0D6;
}
body.ast-header-break-point #masthead .main-header-menu>.menu-item:last-child{
  border-bottom:0;
}
body.ast-header-break-point #masthead .main-header-menu .menu-link{
  display:flex;
  align-items:center;
  min-height:48px;
  padding:12px 14px!important;
  font-size:16px;
  line-height:1.45;
  white-space:normal;
  overflow-wrap:break-word;
}
body.ast-header-break-point #masthead .main-header-menu .sub-menu .menu-link{
  font-size:15px;
  font-weight:400;
}
body.ast-header-break-point #masthead .main-header-menu .menu-item-has-children{
  position:relative;
}
body.ast-header-break-point #masthead .main-header-menu .menu-item-has-children>.menu-link{
  padding-right:64px!important;
}
body.ast-header-break-point #masthead .main-header-menu .ast-menu-toggle{
  position:absolute!important;
  top:2px!important;
  right:8px!important;
  bottom:auto!important;
  left:auto!important;
  width:44px!important;
  max-width:44px!important;
  height:44px!important;
  max-height:44px!important;
  z-index:2;
}
body.ast-header-break-point #masthead .ast-mobile-header-content{
  max-height:70vh;
  max-height:70dvh;
  overflow-y:auto;
  overscroll-behavior:contain;
  background:transparent;
}
@media(prefers-reduced-motion:reduce){
  html #masthead .main-header-menu .sub-menu .menu-link{transition:none;}
}

/* O Astra controla a abertura dos itens. Libere apenas os ancestrais
   do menu principal para a lista poder ultrapassar a borda do cabeçalho. */
body:not(.ast-header-break-point) #masthead,
body:not(.ast-header-break-point) #masthead :has(.main-header-menu),
body:not(.ast-header-break-point) #masthead .main-header-menu,
body:not(.ast-header-break-point) #masthead .main-header-menu .menu-item-has-children {
  overflow: visible !important;
}

/* Prioridade temporária enquanto o dropdown está sendo usado. */
body:not(.ast-header-break-point) #masthead:has(.menu-item-has-children:is(:hover, :focus-within)) {
  z-index: 99990 !important;
}
