/* ========== 1024px ========== */
@media (max-width: 1024px) {
  .navbar-brand img,
  .logo-navbar {
    height: 44px;
  }

  .navbar-nav .nav-link {
    font-size: 14px;
    padding: 0.4rem 0.6rem;
  }

  .btn-language {
    font-size: 13px;
    padding: 4px 10px;
  }

  .nav-language {
    margin-left: 8px;
  }
}

/* ========== 768px ========== */
@media (max-width: 768px) {
  .navbar-collapse {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #fff !important;
    padding: 12px 20px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    border-top: 1px solid #f0f0f0 !important;
    max-height: 70vh !important;
    overflow-y: auto !important;
    z-index: 9998 !important;
  }

  .navbar-nav .nav-link {
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .nav-language {
    margin-left: 0;
  }

  .btn-language {
    margin-left: 0 !important;
  }

  .mega-menu {
    position: static !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }

  .mega-menu .container {
    padding: 8px 0 !important;
  }

  .mega-menu .row {
    flex-direction: column !important;
  }

  .mega-sidebar-col {
    width: 100% !important;
  }

  .mega-divider {
    display: none !important;
  }

  .mega-link {
    padding: 6px 0 !important;
    font-size: 13px;
  }

  .mega-link .small {
    font-size: 11px;
  }
}

/* ========== 480px ========== */
@media (max-width: 480px) {
  .navbar-collapse {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background-color: #fff !important;
    padding: 8px 16px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1) !important;
    border-top: 1px solid #f0f0f0 !important;
    max-height: 65vh !important;
    overflow-y: auto !important;
    z-index: 9998 !important;
  }

  .navbar-nav .nav-link {
    font-size: 13px;
    padding: 9px 0;
    border-bottom: 1px solid #f3f4f6;
  }

  .nav-language {
    margin-left: 0;
  }

  .btn-language {
    font-size: 12px;
    margin-left: 0 !important;
  }

  .mega-menu {
    position: static !important;
    box-shadow: none !important;
    padding: 0 !important;
  }

  .mega-menu .container {
    padding: 6px 0 !important;
  }

  .mega-sidebar-col {
    width: 100% !important;
  }

  .mega-divider {
    display: none !important;
  }

  .mega-link {
    padding: 5px 0 !important;
    font-size: 12px;
  }

  .mega-link .small {
    font-size: 10px;
  }
}

/* ========== MOBILE MODUL MENU ========== */
/* Reorder navbar items on mobile - put modul menu first */
@media (max-width: 991px) {
  .navbar-nav {
    display: flex;
    flex-direction: column;
  }

  /* Move modul mobile menu to top
    .navbar-nav .nav-item.d-lg-none {
        order: -1;
    } */

  /* Desktop modul should be hidden properly */
  .navbar-nav .nav-item.d-none.d-lg-flex {
    display: none !important;
  }
}

.modul-mobile-menu {
  padding: 0 !important;
  background: white;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  max-width: 100%;
  overflow: hidden;
  margin-top: 0;
  margin-bottom: 12px;
}

.modul-main-menu,
.modul-submenu {
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.4s ease;
  transform: translateX(0);
  opacity: 1;
  width: 100%;
  position: relative;
}

.modul-main-menu.slide-out,
.modul-submenu.slide-out {
  transform: translateX(-100%);
  opacity: 0;
  position: absolute;
  width: 100%;
  left: 0;
  z-index: 1;
}

.modul-submenu.slide-in {
  transform: translateX(100%);
  opacity: 0;
  position: absolute;
  width: 100%;
  left: 0;
  z-index: 0;
}

.modul-submenu.slide-in.show {
  transform: translateX(0);
  opacity: 1;
  position: relative;
  z-index: 2;
}

.modul-menu-item {
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #fafbfc;
  margin: 0;
}

.modul-menu-item:first-child {
  border-top: 1px solid #f3f4f6;
}

.modul-menu-item:hover {
  background: #eef2ff;
}

.modul-menu-item .menu-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modul-menu-item strong {
  font-size: 15px;
  font-weight: 700;
  color: #111;
}

.modul-menu-item i {
  color: #2d56c8;
  font-size: 16px;
}

.modul-menu-item .menu-desc {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.3;
}

.submenu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 0;
  background: #f9fafb;
  margin-top: 0;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #eef2ff;
  border: none;
  border-radius: 8px;
  color: #2d56c8;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.back-btn:hover {
  background: #2d56c8;
  color: white;
}

.submenu-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  margin: 0;
  flex-grow: 1;
}

.submenu-items {
  display: flex;
  flex-direction: column;
  background: white;
}

.submenu-link {
  padding: 12px 20px;
  padding-left: 15px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid #f3f4f6;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.submenu-link:first-child {
  border-top: 1px solid #f3f4f6;
}

.submenu-link:hover {
  background: #eef2ff;
  padding-left: 52px;
}

.submenu-link strong {
  font-size: 14px;
  font-weight: 700;
  color: #111;
}

.submenu-link .small {
  font-size: 12px;
  color: #666;
  line-height: 1.3;
}
