/* Mobile Navigation Fix - High Specificity */

@media screen and (max-width: 768px) {
  /* Force proper mobile layout */
  * {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
  }
  
  html {
    width: 100% !important;
    overflow-x: hidden !important;
  }
  
  body {
    width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
  }
  
  /* Header fixes */
  .header {
    width: 100% !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 100 !important;
  }
  
  .header .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 1rem !important;
  }
  
  .header .nav {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative !important;
  }
  
  /* Mobile hamburger menu */
  .menu-toggle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-around !important;
    width: 30px !important;
    height: 25px !important;
    cursor: pointer !important;
    padding: 5px !important;
    border: none !important;
    background: transparent !important;
    position: relative !important;
    z-index: 1001 !important;
  }
  
  .menu-toggle span {
    display: block !important;
    width: 25px !important;
    height: 3px !important;
    background-color: var(--primary, #0f172a) !important;
    transition: all 0.3s ease-in-out !important;
    border-radius: 1px !important;
  }
  
  /* Hide nav links by default on mobile */
  .nav-links {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    width: 100% !important;
    background-color: white !important;
    flex-direction: column !important;
    align-items: center !important;
    padding: 1rem 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    z-index: 1000 !important;
  }
  
  /* Show nav links when menu is active */
  body.menu-active .nav-links {
    display: flex !important;
  }
  
  /* Mobile nav link styles */
  .nav-links li {
    width: 100% !important;
    text-align: center !important;
    display: block !important;
    margin: 0 !important;
  }
  
  .nav-links li a {
    padding: 0.75rem 0 !important;
    width: 100% !important;
    display: block !important;
  }
  
  /* Space button mobile fixes */
  .nav-links .space-btn-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0.75rem 0 !important;
  }
  
  .space-btn {
    width: 8rem !important;
    height: 2.2rem !important;
  }
  
  .space-btn strong {
    font-size: 9px !important;
    letter-spacing: 1px !important;
  }
  
  /* Dropdown fixes */
  .dropdown .dropdown-content {
    position: static !important;
    display: block !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
  }
  
  .dropdown .dropdown-content li {
    width: 100% !important;
    padding-left: 1rem !important;
  }
  
  /* Dark mode toggle mobile */
  .dark-mode-toggle {
    margin: 0.5rem 0 !important;
  }
  
  /* Hamburger animation */
  .menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg) !important;
  }
  
  .menu-toggle.active span:nth-child(2) {
    opacity: 0 !important;
  }
  
  .menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg) !important;
  }
  
  /* Prevent horizontal scroll */
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* Extra small screens */
@media screen and (max-width: 480px) {
  .header .container {
    padding: 0 0.5rem !important;
  }
  
  .logo {
    font-size: 1.2rem !important;
  }
  
  .space-btn {
    width: 7rem !important;
    height: 2rem !important;
  }
  
  .space-btn strong {
    font-size: 8px !important;
  }
}