/* =========================================================
   MENU.CSS
   Associação Jardins Berlim

   Responsabilidade:
   - Menu Mobile
   - Botão Hambúrguer
   - Overlay
   - Drawer lateral
   - Animações

   Depende do header.css
=========================================================*/

/* =========================================================
   HAMBÚRGUER
=========================================================*/

.menu-toggle {
  display: none;

  position: relative;
  z-index: 1200;

  width: 48px;
  height: 48px;

  padding: 0;
  margin: 0;

  border: none;
  border-radius: 12px;

  background: transparent;

  cursor: pointer;

  transition:
    background 0.25s ease,
    transform 0.25s ease;
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu-toggle:active {
  transform: scale(0.96);
}

.menu-toggle:focus-visible {
  outline: 2px solid #d4af37;
  outline-offset: 3px;
}

/* =========================================================
   ÍCONE
=========================================================*/

.menu-toggle span {
  position: absolute;
  left: 12px;

  width: 24px;
  height: 2px;

  border-radius: 20px;

  background: #ffffff;

  transition:
    transform 0.3s ease,
    opacity 0.25s ease,
    top 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  top: 15px;
}

.menu-toggle span:nth-child(2) {
  top: 23px;
}

.menu-toggle span:nth-child(3) {
  top: 31px;
}

/* =========================================================
   ANIMAÇÃO X
=========================================================*/

.menu-toggle.active span:nth-child(1) {
  top: 23px;
  transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  top: 23px;
  transform: rotate(-45deg);
}

/* =========================================================
   OVERLAY
=========================================================*/

.menu-overlay {
  position: fixed;

  inset: 0;

  z-index: 1090;

  opacity: 0;
  visibility: hidden;

  background: rgba(0, 0, 0, 0.45);

  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* =========================================================
   MENU LATERAL
=========================================================*/

.mobile-menu {
  position: fixed;

  top: 0;
  right: -320px;

  z-index: 1100;

  width: 300px;
  max-width: 85vw;

  height: 100vh;

  overflow: auto;

  background: #06160c;

  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.35);

  transition: right 0.35s ease;
}

.mobile-menu.active {
  right: 0;
}

/* =========================================================
   CABEÇALHO MENU
=========================================================*/

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 24px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-header img {
  max-width: 90px;
  height: auto;
}

.mobile-menu-close {
  width: 40px;
  height: 40px;

  border: none;
  border-radius: 10px;

  background: transparent;

  color: #fff;

  font-size: 28px;

  cursor: pointer;

  transition: background 0.25s ease;
}

.mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* =========================================================
   LINKS
=========================================================*/

.mobile-menu nav {
  padding: 18px;
}

.mobile-menu ul {
  list-style: none;

  margin: 0;
  padding: 0;
}

.mobile-menu li {
  margin-bottom: 6px;
}

.mobile-menu a {
  display: flex;
  align-items: center;

  min-height: 48px;

  padding: 14px 16px;

  border-radius: 12px;

  color: #fff;

  text-decoration: none;

  font-weight: 600;

  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.2s ease;
}

.mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.08);

  color: #d4af37;

  transform: translateX(3px);
}

.mobile-menu a.active {
  background: rgba(212, 175, 55, 0.15);

  color: #d4af37;
}

/* =========================================================
   SUBMENU
=========================================================*/

.mobile-menu .submenu {
  margin-left: 16px;

  margin-top: 6px;

  display: none;
}

.mobile-menu .submenu.open {
  display: block;
}

.mobile-menu .submenu a {
  min-height: 42px;

  font-size: 0.92rem;

  opacity: 0.92;
}

/* =========================================================
   SCROLL
=========================================================*/

.mobile-menu::-webkit-scrollbar {
  width: 8px;
}

.mobile-menu::-webkit-scrollbar-thumb {
  background: #29402f;

  border-radius: 30px;
}

.mobile-menu::-webkit-scrollbar-track {
  background: #06160c;
}

/* =========================================================
   MOBILE
=========================================================*/

@media (max-width: 900px) {
  .menu-toggle {
    display: flex;

    align-items: center;
    justify-content: center;
  }

  .topo nav {
    display: none;
  }
}

/* =========================================================
   DESKTOP
=========================================================*/

@media (min-width: 901px) {
  .mobile-menu,
  .menu-overlay,
  .menu-toggle {
    display: none !important;
  }
}

/* =========================================================
   ANIMAÇÃO
=========================================================*/

.mobile-menu nav li {
  opacity: 0;

  transform: translateX(20px);

  animation: menuFade 0.35s forwards;
}

.mobile-menu nav li:nth-child(1) {
  animation-delay: 0.05s;
}
.mobile-menu nav li:nth-child(2) {
  animation-delay: 0.1s;
}
.mobile-menu nav li:nth-child(3) {
  animation-delay: 0.15s;
}
.mobile-menu nav li:nth-child(4) {
  animation-delay: 0.2s;
}
.mobile-menu nav li:nth-child(5) {
  animation-delay: 0.25s;
}
.mobile-menu nav li:nth-child(6) {
  animation-delay: 0.3s;
}
.mobile-menu nav li:nth-child(7) {
  animation-delay: 0.35s;
}
.mobile-menu nav li:nth-child(8) {
  animation-delay: 0.4s;
}

@keyframes menuFade {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* =========================================================
   ACESSIBILIDADE
=========================================================*/

@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .menu-overlay,
  .menu-toggle,
  .menu-toggle span,
  .mobile-menu a {
    transition: none !important;
    animation: none !important;
  }
}
