/* Header — the Serviços dropdown (desktop) and the services list of the mobile menu (markup: tools/build/build-menu.js).
   Every page loads it, the home included, which does not load mbs.css; so the tokens are local. */

.mnav, .mnav-m {
  --mn-navy: #12324A;
  --mn-ink: #3D4F60;
  --mn-muted: #5A6B7C;
  --mn-line: #D2DBE3;
  --mn-line-soft: #E1E7EC;
  --mn-surface: #F4F6F8;
  --mn-green: #3AAA35;
  --mn-blue: #1B5FA8;
  --mn-blue-line: #A9C2DE;
  --mn-on-dark: #DCE5EC;
  --mn-on-dark-3: #8FA3B6;
  --mn-green-on-dark: #A8DCA4;
  --mn-ease: cubic-bezier(.16, 1, .3, 1);
}
.mnav .ic, .mnav-m .ic { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.mnav :focus-visible, .mnav-m :focus-visible { outline: 2px solid var(--mn-green); outline-offset: 3px; }
.mnav__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Desktop ---------- */
/* The nav item fills the header bar's height, so the pointer never leaves it on the way down to the panel. */
.site-nav, .m3-nav { align-self: stretch; }
.mnav { position: relative; align-self: stretch; display: flex; align-items: center; gap: 2px; }
.mnav__toggle { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-right: -8px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--mn-on-dark); cursor: pointer; transition: color .2s ease; }
.mnav__toggle .ic { width: 16px; height: 16px; transition: transform .25s var(--mn-ease); }
.mnav__toggle:hover, .mnav[data-open] .mnav__toggle { color: #FFFFFF; }
.mnav[data-open] .mnav__toggle .ic { transform: rotate(180deg); }

.mnav__panel {
  position: absolute; top: calc(100% + 6px); left: -28px; z-index: 40;
  width: min(900px, calc(100vw - 48px));
  padding: 26px 28px 0;
  background: #FFFFFF; border: 1px solid var(--mn-line-soft); border-radius: 8px;
  box-shadow: 0 28px 56px -18px rgba(11, 34, 50, .34);
  font-family: 'IBM Plex Sans', sans-serif; font-size: 15px; line-height: 1.4; text-align: left;
  visibility: hidden; opacity: 0; transform: translateY(-6px);
  transition: opacity .18s ease, transform .25s var(--mn-ease), visibility 0s linear .25s;
}
.mnav[data-open] .mnav__panel { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
/* Bridge over the 6px gap above the panel. */
.mnav__panel::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 8px; }

.mnav__cols { display: grid; grid-template-columns: 1fr 1fr .9fr; gap: 0 28px; }
.mnav__title { margin: 0 0 10px; font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--mn-muted); }
.mnav__group ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--mn-line); }
.mnav__group li { border-bottom: 1px solid var(--mn-line-soft); }
.mnav__panel .mnav__group a { display: block; padding: 11px 8px 11px 0; color: var(--mn-navy); text-decoration: none; box-shadow: none; transition: padding .25s var(--mn-ease), background-color .2s ease; }
.mnav__name { display: block; font-weight: 500; }
.mnav__tag { display: block; margin-top: 2px; font-size: 12.5px; color: var(--mn-muted); }
.mnav__panel .mnav__group a:hover { padding-left: 10px; background: var(--mn-surface); color: var(--mn-navy); }
.mnav__panel .mnav__group a:hover .mnav__name { color: var(--mn-blue); }
.mnav__panel .mnav__group a[aria-current="page"] { padding-left: 12px; box-shadow: inset 3px 0 0 var(--mn-green); color: var(--mn-navy); }
.mnav__panel .mnav__group a[aria-current="page"] .mnav__name { font-weight: 600; }

.mnav__foot { margin: 22px -28px 0; padding: 14px 28px; background: var(--mn-surface); border-top: 1px solid var(--mn-line-soft); border-radius: 0 0 8px 8px; }
.mnav__panel .mnav__all { display: inline-flex; align-items: center; gap: 8px; padding: 0; color: var(--mn-blue); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--mn-blue-line); box-shadow: none; transition: color .2s ease, border-color .2s ease; }
.mnav__panel .mnav__all:hover { color: var(--mn-navy); border-color: var(--mn-navy); }
.mnav__all .ic { width: 16px; height: 16px; }

/* ---------- Mobile menu ---------- */
.mnav-m { border-bottom: 1px solid rgba(255, 255, 255, .1); }
.mnav-m > summary { display: flex; align-items: center; justify-content: space-between; min-height: 56px; list-style: none; cursor: pointer; color: var(--mn-on-dark); font-family: 'Poppins', sans-serif; font-size: 20px; font-weight: 500; }
.mnav-m > summary::-webkit-details-marker { display: none; }
.mnav-m > summary .ic { width: 22px; height: 22px; transition: transform .25s var(--mn-ease); }
.mnav-m[open] > summary { color: #FFFFFF; }
.mnav-m[open] > summary .ic { transform: rotate(180deg); }
.mnav-m__body { padding: 0 0 20px; }
.mnav-m__title { margin: 14px 0 4px; font-family: 'IBM Plex Sans', sans-serif; font-size: 13px; font-weight: 600; color: var(--mn-on-dark-3); }
.mnav-m ul { list-style: none; margin: 0; padding: 0; }
.mnav-m .mnav-m__body a.mnav-m__item { display: flex; align-items: center; min-height: 44px; padding: 6px 0 6px 14px; border: 0; border-left: 1px solid rgba(255, 255, 255, .16); color: var(--mn-on-dark); font-family: 'IBM Plex Sans', sans-serif; font-size: 16px; font-weight: 500; line-height: 1.35; text-decoration: none; }
.mnav-m .mnav-m__body a.mnav-m__item:hover { color: #FFFFFF; }
.mnav-m .mnav-m__body a.mnav-m__item[aria-current="page"] { color: #FFFFFF; border-left: 2px solid var(--mn-green); padding-left: 13px; }
.mnav-m .mnav-m__body a.mnav-m__all { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; border: 0; color: var(--mn-green-on-dark); font-family: 'IBM Plex Sans', sans-serif; font-size: 16px; font-weight: 600; text-decoration: none; }
.mnav-m__all .ic { width: 18px; height: 18px; }

/* With the services list open the menu is taller than a phone: it scrolls on its own, within the screen
   (above the bottom action bar on phones). `.m3-head > div + div` is the home's menu panel. */
.menu-mobile, .m3-head > div + div { overflow-y: auto; overscroll-behavior: contain; }
.menu-mobile { max-height: calc(100vh - var(--header-h, 92px)); max-height: calc(100dvh - var(--header-h, 92px)); }
.m3-head > div + div { max-height: calc(100vh - 92px); max-height: calc(100dvh - 92px); }
.site-header.is-fixed .menu-mobile, .m3-head.is-fixed > div + div { max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); }
@media (max-width: 720px) {
  .menu-mobile { max-height: calc(100vh - var(--header-h, 80px) - 76px); max-height: calc(100dvh - var(--header-h, 80px) - 76px); }
  .m3-head > div + div { max-height: calc(100vh - 92px - 76px); max-height: calc(100dvh - 92px - 76px); }
  .site-header.is-fixed .menu-mobile, .m3-head.is-fixed > div + div { max-height: calc(100vh - 72px - 76px); max-height: calc(100dvh - 72px - 76px); }
}

/* No transitions at all (mbs.css's global .01ms one would keep the list hidden for a frame, out of the Tab order). */
@media (prefers-reduced-motion: reduce) {
  .mnav, .mnav *, .mnav-m, .mnav-m * { transition: none !important; }
}
