/*==================================
  MOBILE DRAWER MENU
  Modern slide-in menu with accordion submenu system
  Based on WION theme design pattern
==================================*/

/* Prevent horizontal scroll on mobile */
html, body {
  overflow-x: hidden;
  max-width: 100%;
  position: relative;
  width: 100%;
}

body {
  touch-action: pan-y pinch-zoom;
  -webkit-text-size-adjust: 100%;
}

/* Hamburger Menu Toggle Button */
.mobile-menu-drawer-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
  transition: all 0.3s ease;
}

.mobile-menu-drawer-toggle span {
  width: 100%;
  height: 3px;
  background-color: #1f2937;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mobile-menu-drawer-toggle:hover span {
  background-color: #2563eb;
}

/* Show hamburger only on mobile */
@media (max-width: 991px) {
  .mobile-menu-drawer-toggle {
    display: flex;
  }
}

/* Mobile Menu Wrapper - Full Screen Overlay */
.mobile-menu-drawer-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999999;
  width: 100%;
  height: 100%;
  transition: all ease 0.4s;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Active State */
.mobile-menu-drawer-wrapper.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

/* Mobile Menu Area - Slide Panel */
.mobile-menu-drawer-area {
  width: 100%;
  max-width: 380px;
  background-color: #ffffff;
  height: 100%;
  position: relative;
  left: -100%;
  opacity: 0;
  visibility: hidden;
  transition: all ease 0.5s;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* Active State */
.mobile-menu-drawer-wrapper.active .mobile-menu-drawer-area {
  left: 0;
  opacity: 1;
  visibility: visible;
}

/* Mobile Menu Top - Logo & Close Button */
.mobile-menu-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background-color: #ffffff;
  border-bottom: 1px solid #e5e7eb;
}

.mobile-menu-drawer-logo {
  max-width: 140px;
}

.mobile-menu-drawer-logo img {
  max-height: 50px;
  width: auto;
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mobile-menu-drawer-close {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 24px;
  color: #1f2937;
}

.mobile-menu-drawer-close:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

/* Mobile Menu Content */
.mobile-menu-drawer-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 0;
}

/* Custom Scrollbar */
.mobile-menu-drawer-content::-webkit-scrollbar {
  width: 4px;
}

.mobile-menu-drawer-content::-webkit-scrollbar-track {
  background: #f3f4f6;
}

.mobile-menu-drawer-content::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 10px;
}

.mobile-menu-drawer-content::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Menu List */
.mobile-drawer-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mobile-drawer-menu > li {
  border-bottom: 1px solid #e5e7eb;
}

.mobile-drawer-menu > li:first-child {
  border-top: none;
}

/* Menu Item Link */
.mobile-drawer-menu > li > a {
  display: block;
  padding: 16px 20px;
  color: #1f2937;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.mobile-drawer-menu > li > a:hover {
  color: #2563eb;
  background-color: #f9fafb;
}

/* Menu Item with Children */
.mobile-drawer-menu .menu-item-has-children {
  position: relative;
}

/* Expand Icon */
.mobile-drawer-expand {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: #6b7280;
  transition: all 0.3s ease;
  border-radius: 6px;
}

.mobile-drawer-expand:hover {
  background-color: #f3f4f6;
  color: #2563eb;
}

/* Active State */
.mobile-drawer-menu .menu-item-has-children.active > a .mobile-drawer-expand {
  transform: translateY(-50%) rotate(180deg);
  color: #2563eb;
}

/* Submenu */
.mobile-drawer-submenu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background-color: #f9fafb;
  border-top: 1px solid #e5e7eb;
}

.mobile-drawer-submenu li {
  border-bottom: 1px solid #e5e7eb;
}

.mobile-drawer-submenu li:last-child {
  border-bottom: none;
}

.mobile-drawer-submenu li a {
  display: block;
  padding: 12px 20px 12px 40px;
  color: #4b5563;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
}

.mobile-drawer-submenu li a::before {
  content: "→";
  position: absolute;
  left: 20px;
  color: #9ca3af;
  transition: all 0.3s ease;
}

.mobile-drawer-submenu li a:hover {
  color: #2563eb;
  background-color: #ffffff;
  padding-left: 45px;
}

.mobile-drawer-submenu li a:hover::before {
  color: #2563eb;
  left: 25px;
}

/* Nested Submenu (3rd level) */
.mobile-drawer-submenu .mobile-drawer-submenu {
  background-color: #ffffff;
}

.mobile-drawer-submenu .mobile-drawer-submenu li a {
  padding-left: 60px;
}

.mobile-drawer-submenu .mobile-drawer-submenu li a::before {
  left: 40px;
}

.mobile-drawer-submenu .mobile-drawer-submenu li a:hover {
  padding-left: 65px;
}

.mobile-drawer-submenu .mobile-drawer-submenu li a:hover::before {
  left: 45px;
}

/* Mobile Menu Footer */
.mobile-menu-drawer-footer {
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background-color: #f9fafb;
}

.mobile-menu-drawer-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  color: #ffffff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.mobile-menu-drawer-btn:hover {
  background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
  transform: translateY(-2px);
  color: #ffffff;
}

.mobile-menu-drawer-btn i {
  margin-left: 8px;
  transition: transform 0.3s ease;
}

.mobile-menu-drawer-btn:hover i {
  transform: translateX(4px);
}

/* Mobile Menu Social */
.mobile-menu-drawer-social {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.mobile-menu-drawer-social a {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  font-size: 16px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.mobile-menu-drawer-social a:hover {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Responsive Adjustments */
@media (max-width: 480px) {
  .mobile-menu-drawer-area {
    max-width: 280px;
  }
  
  .mobile-drawer-menu > li > a {
    font-size: 15px;
    padding: 14px 18px;
  }
  
  .mobile-drawer-submenu li a {
    font-size: 14px;
    padding: 10px 18px 10px 38px;
  }
}

/* Animation Enhancements */
@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.mobile-menu-drawer-wrapper.active .mobile-menu-drawer-area {
  animation: slideInLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Overlay Click to Close */
.mobile-menu-drawer-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.mobile-menu-drawer-area {
  position: relative;
  z-index: 1;
}
