/* ============================================
   MOBILE MENU - CONSOLIDATED FIX
   This file should be loaded LAST to override all conflicts
   ============================================ */

/* ==================== HEADER NAV - PADDING FIX ==================== */

.header-nav {
  width: 100%;
  padding: 0;
  margin: 0;
}

.header .nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  min-height: 90px;
  max-width: 1400px;
  margin: 0 auto;
}

@media (max-width: 1024px) {
  .header .nav-wrapper {
    padding: 0.5rem 1.5rem;
    min-height: 80px;
  }
}

@media (max-width: 640px) {
  .header .nav-wrapper {
    padding: 0.5rem 1rem;
    min-height: 70px;
  }
}

/* ==================== MOBILE MENU BUTTON ==================== */

.mobile-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1002;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.hamburger-line {
  display: block;
  width: 28px;
  height: 3px;
  background-color: #1f2937;
  border-radius: 3px;
  position: absolute;
  left: 50%;
  margin-left: -14px;
  transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease;
}

/* Use specific classes instead of nth-child */
.hamburger-line.line-1,
.hamburger-line:first-child {
  top: 10px;
}

.hamburger-line.line-2,
.hamburger-line:nth-child(2) {
  top: 20px;
}

.hamburger-line.line-3,
.hamburger-line:last-child {
  top: 30px;
}

/* X animation when menu is open */
.mobile-menu-btn.active .hamburger-line.line-1,
.mobile-menu-btn.active .hamburger-line:first-child {
  top: 20px;
  transform: rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line.line-2,
.mobile-menu-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active .hamburger-line.line-3,
.mobile-menu-btn.active .hamburger-line:last-child {
  top: 20px;
  transform: rotate(-45deg);
}

/* ==================== MOBILE MENU PANEL ==================== */

.mobile-menu {
  position: fixed !important;
  top: 90px;
  left: 0;
  width: 100%;
  height: calc(100vh - 90px);
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  z-index: 999;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  
  /* Default hidden state */
  display: block !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  pointer-events: none;
  
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* VISIBLE STATE - Using .open class */
.mobile-menu.open {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

/* Override old .hidden system - REMOVE hidden behavior */
.mobile-menu.hidden {
  /* Don't use display:none - let opacity handle it */
  display: block !important;
}

/* ==================== MOBILE MENU INNER ==================== */

.mobile-menu-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1rem 0;
}

.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem 2rem;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
  background: none;
  border: none;
  width: 100%;
  cursor: pointer;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.mobile-nav-link.active {
  color: #f59e0b;
}

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

.mobile-dropdown-icon {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

.mobile-dropdown-toggle.active .mobile-dropdown-icon {
  transform: rotate(180deg);
}

.mobile-dropdown-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  transition: max-height 0.3s ease;
}

.mobile-dropdown-menu.open,
.mobile-dropdown-menu.active {
  max-height: 400px;
}

.mobile-dropdown-link {
  display: block;
  padding: 1rem 2rem;
  color: #d1d5db;
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-dropdown-link:hover,
.mobile-dropdown-link:focus {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.mobile-dropdown-link.active {
  color: #f59e0b;
}

/* ==================== MOBILE CTA BUTTON ==================== */

.mobile-nav-cta {
  background: linear-gradient(135deg, var(--primary-color, #7c3aed), var(--secondary-color, #06b6d4)) !important;
  color: white !important;
  margin: 1.5rem auto 0;
  max-width: 280px;
  border-radius: 12px;
}

.mobile-nav-cta:hover {
  transform: scale(1.02);
  opacity: 0.95;
}

/* ==================== MOBILE MENU FOOTER ==================== */

.mobile-menu-footer {
  padding: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  margin-top: auto;
}

.mobile-menu-footer-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.mobile-social-icons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.mobile-social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: white;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.mobile-social-link.linkedin { background: #0077b5; }
.mobile-social-link.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.mobile-social-link.facebook { background: #1877f2; }
.mobile-social-link.twitter { background: #1da1f2; }
.mobile-social-link.youtube { background: #ff0000; }
.mobile-social-link.tiktok { background: #000000; }

.mobile-social-link:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* ==================== BODY SCROLL LOCK ==================== */

body.mobile-menu-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */

/* Desktop - Hide mobile elements */
@media (min-width: 1025px) {
  .mobile-menu-btn {
    display: none !important;
  }
  
  .mobile-menu {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .mobile-menu-btn {
    display: flex !important;
  }
  
  .mobile-menu {
    display: block !important;
    top: 80px;
    height: calc(100vh - 80px);
  }
  
  /* Hide desktop nav */
  .nav-center,
  .desktop-nav-menu,
  .menu-cta-btn {
    display: none !important;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .mobile-menu {
    top: 70px;
    height: calc(100vh - 70px);
  }
  
  .mobile-nav-link {
    font-size: 1.15rem;
    padding: 1rem 1.5rem;
  }
  
  .mobile-dropdown-link {
    font-size: 1rem;
    padding: 0.85rem 1.5rem;
  }
  
  .mobile-social-link {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
  }
}

/* ==================== ACCESSIBILITY ==================== */

@media (prefers-reduced-motion: reduce) {
  .mobile-menu,
  .hamburger-line,
  .mobile-dropdown-menu {
    transition: none;
  }
}
