@charset "utf-8";
/**
 * Header — dropdowns do menu principal (.menuNav)
 * Escopo: header .menuNav (portal www-new)
 */

header .menuNav > li > ul {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

/* —— Desktop —— */
@media (min-width: 1025px) {
  /* Ponte invisível para não perder hover entre item e painel */
  header .menuNav > li:has(> ul)::after {
    content: "";
    position: absolute;
    left: -8px;
    right: -8px;
    top: 100%;
    height: 14px;
    z-index: 99998;
  }

  header .menuNav > li:has(> ul) > a.dropdown-toggle::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 6px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    vertical-align: middle;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  header .menuNav > li:has(> ul):hover > a,
  header .menuNav > li:has(> ul):focus-within > a {
    color: var(--gold);
  }

  header .menuNav > li:has(> ul):hover > a.dropdown-toggle::after,
  header .menuNav > li:has(> ul):focus-within > a.dropdown-toggle::after {
    transform: rotate(180deg);
    opacity: 1;
  }

  header .menuNav > li > ul {
    top: calc(100% + 10px);
    left: 0;
    min-width: 240px;
    width: max-content;
    max-width: 300px;
    max-height: min(70vh, 440px);
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--blue);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 2px solid var(--gold);
    border-radius: 0 0 12px 12px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
    transition:
      opacity 0.22s ease,
      visibility 0.22s ease,
      transform 0.22s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) rgba(255, 255, 255, 0.12);
  }

  header .menuNav > li > ul::-webkit-scrollbar {
    width: 6px;
  }

  header .menuNav > li > ul::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 3px;
  }

  header .menuNav > li > ul::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
  }

  header .menuNav > li:hover > ul,
  header .menuNav > li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    border-bottom: none;
  }

  header .menuNav > li > ul > li > a {
    display: block;
    padding: 10px 18px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    text-transform: none;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.9);
    border-left: 3px solid transparent;
    transition:
      background-color 0.15s ease,
      color 0.15s ease,
      border-color 0.15s ease;
  }

  header .menuNav > li > ul > li > a:hover,
  header .menuNav > li > ul > li > a:focus {
    color: var(--gold);
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: var(--gold);
    outline: none;
  }

  header .menuNav > li > ul > li + li > a {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }
}

/* —— Mobile (menu fullscreen) —— */
@media (max-width: 1024px) {
  header .menuNav.menu-mobile > li:has(> ul) > a.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  header .menuNav.menu-mobile > li:has(> ul) > a.dropdown-toggle::after {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform 0.25s ease;
    opacity: 0.9;
  }

  header .menuNav.menu-mobile > li.submenu-open > a.dropdown-toggle::after {
    transform: rotate(180deg);
  }

  header .menuNav.menu-mobile > li > ul {
    position: static;
    width: 100%;
    max-width: 320px;
    margin: 0.5rem auto 0;
    padding: 0;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 0;
    overflow: hidden;
    opacity: 1;
    visibility: hidden;
    transform: none;
    transition: max-height 0.35s ease, visibility 0.25s ease, margin 0.25s ease;
  }

  header .menuNav.menu-mobile > li > ul > li > a {
    padding: 12px 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
    text-transform: none;
  }

  header .menuNav.menu-mobile > li > ul > li > a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--gold);
  }

  /* No touch, abre só com .submenu-open (JS), não com :hover */
  header .menuNav.menu-mobile > li:hover > ul {
    visibility: hidden;
    max-height: 0;
  }

  header .menuNav.menu-mobile > li.submenu-open > ul {
    visibility: visible;
    max-height: 420px;
    overflow-y: auto;
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold);
    border-radius: 0 0 10px 10px;
  }
}
