/* ===================================
   MOBILE MENU - Hamburger Navigation (Optimized)
   =================================== */

/* Hamburger Button - DESKTOP HIDDEN BY DEFAULT */
.hamburger-menu {
  display: none;
  position: fixed;
  top: 0.25rem;
  right: 1.5rem;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 100002;
  padding: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  mix-blend-mode: difference;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease 0.2s, visibility 0.5s ease 0.2s, transform 0.5s ease 0.2s;
  contain: layout style;
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background-color: #ffffff;
  transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  transform-origin: center;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  will-change: opacity;
}

.mobile-nav-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Navigation Menu */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100001;
  padding: 6rem 2rem 2rem;
  overflow-y: auto;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  -webkit-overflow-scrolling: touch;
  contain: layout style;
}

.mobile-nav.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-content {
  max-width: 400px;
  margin: 0 auto;
}

/* Mobile Nav Items */
.mobile-nav-item {
  margin-bottom: 3rem;
  opacity: 0;
}

.mobile-nav-item:last-child {
  margin-bottom: 0;
}

.mobile-nav-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 1rem;
  display: block;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-nav-link {
  font-family: var(--font-primary);
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
  display: inline-block;
  position: relative;
  will-change: transform;
}

.mobile-nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #ffffff;
  transition: width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.mobile-nav-link:hover {
  color: #ffffff;
  transform: translateX(8px);
}

.mobile-nav-link:hover::after {
  width: 100%;
}

/* Social Links in Mobile Menu */
.mobile-nav-socials {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.mobile-nav-social-link {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mobile-nav-social-link:hover {
  color: #ffffff;
}

/* Contact in Mobile Menu */
.mobile-nav-contact {
  margin-top: 1rem;
}

.mobile-nav-contact a {
  font-family: var(--font-primary);
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.mobile-nav-contact a:hover {
  color: #ffffff;
}

/* Prevent scrolling when menu is open */
body.menu-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}

.project-page.menu-open {
  overflow: hidden !important;
}

/* ========================================
   MOBILE ONLY - CRITICAL DISPLAY RULES
   ======================================== */
@media (max-width: 768px) {
  .hamburger-menu,
  button.hamburger-menu {
    display: flex !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: fixed !important;
    top: 0.25rem !important;
    right: 1.5rem !important;
    z-index: 100002 !important;
    pointer-events: auto !important;
  }
  
  body.loaded .hamburger-menu {
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  body.project-page .hamburger-menu {
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  .mobile-nav-overlay,
  .mobile-nav {
    display: block !important;
  }
  
  .header .values-section,
  .header .location-section,
  .header .contact-section,
  .header .social-section,
  .header .header-dropdown,
  .header .dropdown-toggle,
  .header .dropdown-content,
  .values-section,
  .location-section,
  .contact-section,
  .social-section,
  .header-dropdown,
  .dropdown-toggle,
  .dropdown-content {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
  }
  
  .header .nav-section {
    grid-column: 1 / -1;
  }
}