/* ============================
   GESTAG — NAVBAR / HEADER
   (menu mobile + dropdowns)
============================ */

/* Dropdown wrapper */
header #menu .nav-dd {
  position: relative;
}

/* Botão do dropdown */
header #menu .nav-dd__toggle {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  padding: 11px 15px;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

header #menu .nav-dd__toggle i {
  font-size: 0.85em;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

header #menu .nav-dd.open > .nav-dd__toggle i {
  transform: rotate(180deg);
}

/* Dropdown base (DESKTOP: flutuante) */
header #menu .nav-dd__menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 230px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  padding: 8px;
  z-index: 999;
  display: none;

  /* ✅ coluna (lista para baixo) */
  flex-direction: column;
  gap: 0;
}

header #menu .nav-dd__menu li {
  width: 100%;
}

header #menu .nav-dd__menu a {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
}

header #menu .nav-dd__menu a:hover {
  background: var(--primary-color);
}

header #menu .nav-dd.open > .nav-dd__menu {
  height: auto;
  display: flex;
}

/* MENU MOBILE - BOTÃO HAMBÚRGUER */
.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  padding: 0;
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 3px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--primary-color);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* RESPONSIVO HEADER */
@media (max-width: 820px) {
  header#scrollheader {
    position: relative !important;
    z-index: 9999 !important;
    overflow: visible !important;
  }

  header#scrollheader .wrapper,
  header#scrollheader .navbar-mobile {
    overflow: visible !important;
  }

  /* caso algum css externo esconda o menu */
  header #menu {
    display: block !important;
  }

  .navbar-mobile {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between;
    padding: 0 20px;
  }

  .menu-toggle {
    display: flex;
  }

  /* Container do menu mobile */
  header #menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 10px 20px 20px;
    transform-origin: top;
    transform: scaleY(0.8);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 998;

    border-radius: 0 0 18px 18px;
    max-height: calc(100vh - 140px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  header #menu.open {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
  }

  /* ✅ MENU MOBILE EM COLUNA */
  header #menu ul {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0 !important;
    width: 100% !important;

    list-style: none;
    margin: 0;
    padding: 0;
  }

  header #menu li {
    width: 100%;
  }

  header #menu li + li {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  header #menu a {
    width: 100%;
    text-align: left;
    padding: 12px 0;
    display: block;
  }

  /* Dropdown no mobile (continua em coluna) */
  header #menu .nav-dd__menu {
position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 230px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    padding: 8px;
    z-index: 999;
  }

  header #menu .nav-dd.open > .nav-dd__menu {
    display: flex;
  }

  header #menu .nav-dd__menu a {
    padding: 10px 0;
    border-radius: 0;
  }
}
