/* menu.css - responsive menu + submenu styles */

/* Base nav list */
.nav {
  display: flex;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-list li {
  position: relative;
}

.nav-link {
  color: white;
  text-decoration: none;
  padding: 6px 4px;
  display: inline-block;
}

.nav-link.active {
  font-weight: 700;
}

.submenu-caret {
  margin-left: 6px;
  font-size: 12px;
  opacity: 0.8
}

/* Submenu base (desktop hidden until hover) */
.submenu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  background: var(--panel-bg, #fff);
  border-radius: 8px;
  padding: 8px 8px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.12);
  min-width: 270px;
  z-index: 200;
}

.submenu li {
  margin: 0;
}

.submenu a {
  display: block;
  padding: 8px 12px;
  color: var(--text);
}

.submenu a:hover {
  color: rgb(12, 12, 12);
  font-weight: 700;
}

/* Show submenu on hover (desktop) */
@media(min-width:900px) {
  .has-submenu:hover>.submenu {
    display: block;
  }

  .mobile-menu-toggle {
    display: none;
  }

  .nav-close {
    display: none;
  }

  .submenu-toggle {
    display: none;
  }

  .fa-chevron-down {
    display: none !important;
  }
}

.submenu {
  list-style: none;
  /* remove os marcadores */
  padding-left: 0;
  /* remove o recuo padrão */
  margin: 0;
  /* remove espaçamento vertical extra */
}


/* Mobile styles: off-canvas nav */
@media(max-width:899px) {

  /* Full-screen overlay menu that opens from top (por cima) */
  .nav {
    position: fixed;
    inset: 0;
    height: 100vh;
    width: 100%;
    transform: translateY(-100%);
    transition: transform .28s ease;
    background: var(--cor-header);
    padding: 72px 24px 5px 5px;
    box-shadow: 0 6px 30px rgba(2, 6, 23, 0.2);
    z-index: 1200;
  }

  .nav.nav-active {
    transform: translateY(0);
  }

  .nav-list {
    flex-direction: column;
    gap: 8px;
  }

  /* remove bullets / list markers and separators */
  .nav-list,
  .nav-list li {
    list-style: none;
  }

  /* Center list vertically and horizontally inside overlay */
  .nav.nav-active .nav-list {
    height: calc(100% - 120px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px
  }

  .nav-link {
    color: white !important;
    font-size: 20px;
    padding: 12px 8px;
    display: block;
    text-align: center;
    font-weight: 700
  }

  .nav-link.active {
    color: var(--white);
  }

  .submenu {
    display: none;
    position: relative;
    top: 0;
    left: 0;
    box-shadow: none;
    background: transparent;
    padding-left: 12px;
  }

  .submenu.open {
    display: block;
  }

  /* Mobile-only submenu open animation */
  .submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height 360ms cubic-bezier(.2, .9, .2, 1), opacity 220ms ease, transform 300ms ease;
    display: block;
    /* keep display block so height transition works; hidden by max-height */
  }

  .submenu.open {
    max-height: 480px;
    /* large enough to contain items */
    opacity: 1;
    transform: translateY(0);
  }

  .submenu li {
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 280ms ease, transform 280ms ease;
  }

  .submenu.open li {
    opacity: 1;
    transform: translateY(0);
  }

  /* small stagger for items */
  .submenu.open li:nth-child(1) {
    transition-delay: 0.04s
  }

  .submenu.open li:nth-child(2) {
    transition-delay: 0.08s
  }

  .submenu.open li:nth-child(3) {
    transition-delay: 0.12s
  }

  .submenu.open li:nth-child(4) {
    transition-delay: 0.16s
  }

  .submenu.open li:nth-child(5) {
    transition-delay: 0.2s
  }

  /* Close button inside overlay */
  .nav-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center
  }

  .nav-close:focus {
    outline: 3px solid rgba(255, 255, 255, 0.16);
  }

  .mobile-menu-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--white);
    font-size: 20px
  }

  .mobile-menu-toggle i {
    transition: transform .2s ease;
  }

  .mobile-menu-toggle.active i {
    transform: rotate(90deg);
  }

  .submenu-toggle {
    background: transparent;
    border: none;
    padding: 6px;
    margin-left: 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--white);
    display: inline-flex;
    align-items: center
  }

  .submenu-caret {
    margin-left: 8px;
    transition: transform .18s ease;
  }

  .submenu.open+.submenu-caret,
  .has-submenu .submenu.open~.submenu-caret {
    transform: rotate(180deg);
  }

  /* rotate caret when submenu open via class on submenu element */
  .submenu.open~.submenu-caret {
    transform: rotate(180deg);
  }

  .submenu-toggle {
    display: none !important;
  }
}

/* small visual improvements */
.nav a {
  transition: color .12s ease, background .12s ease
}