/**
 * CRS MOBILE NAVIGATION
 * Purpose: Hardware rack mobile menu (slides in from right)
 * Critical Fix: Make site usable on mobile devices
 * 
 * Design: Dark overlay + vertical nav + tap-friendly sizing
 */

/* === DESKTOP: FORCE HIDE MOBILE NAV === */
@media (min-width: 768px) {
  .mobile-nav-overlay {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
  }
  
  .mobile-nav-overlay.active {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* === MOBILE ONLY: SHOW MOBILE NAV === */
@media (max-width: 767px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .mobile-nav-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    z-index: 9999;
    overflow-y: auto;
    
    /* Slide in from right */
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  
  .mobile-nav-overlay.active {
    display: block;
    transform: translateX(0);
  }
}

/* === HAMBURGER MENU BUTTON === */

.mobile-menu-toggle {
  display: none; /* Hidden on desktop */
  background: transparent;
  border: 1px solid #4a4a4a;
  color: #c0c0c0;
  font-size: 1.5rem;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  border-color: #6a6a6a;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* === MOBILE NAV CONTAINER === */

.mobile-nav-container {
  background: #1a1a1a;
  border: 2px solid #3a3a3a;
  border-radius: 4px;
  margin: 20px;
  padding: 20px;
  min-height: calc(100vh - 40px);
}

/* === MOBILE NAV HEADER === */

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #3a3a3a;
}

.mobile-nav-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.1em;
}

.mobile-nav-close {
  background: transparent;
  border: 1px solid #4a4a4a;
  color: #c0c0c0;
  font-size: 1.5rem;
  width: 44px;
  height: 44px;
  cursor: pointer;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.mobile-nav-close:hover {
  border-color: #6a6a6a;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

/* === MOBILE NAV LINKS === */

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.mobile-nav-links .nav-button {
  width: 100%;
  display: block;
  text-align: center;
  padding: 14px 20px !important;
  height: 50px !important;
  font-size: 0.875rem !important;
  
  /* Tap-friendly sizing */
  min-height: 44px;
}

/* === MOBILE BOOK NOW SECTION === */

.mobile-book-section {
  border-top: 2px solid #3a3a3a;
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
}

.mobile-book-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--mustard, #E8A83C);
  margin-bottom: 1rem;
  font-weight: 800;
}

.mobile-book-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mobile-book-links a {
  display: block;
  padding: 12px 16px;
  background: rgba(232, 168, 60, 0.1);
  border: 1px solid rgba(232, 168, 60, 0.3);
  border-radius: 3px;
  color: #c0c0c0;
  text-decoration: none;
  font-size: 0.875rem;
  text-align: center;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-book-links a:hover {
  background: rgba(232, 168, 60, 0.2);
  border-color: rgba(232, 168, 60, 0.5);
  color: #ffffff;
}

/* === MOBILE CONTACT SECTION === */

.mobile-contact-section {
  border-top: 2px solid #3a3a3a;
  padding-top: 1.5rem;
}

.mobile-contact-link {
  display: block;
  padding: 14px 20px;
  background: transparent;
  border: 1px solid #4a4a4a;
  border-radius: 3px;
  color: #c0c0c0;
  text-decoration: none;
  font-size: 0.875rem;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-contact-link:hover {
  border-color: #6a6a6a;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
}

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

/* Tablet and below: Show hamburger, hide desktop nav */
@media (max-width: 1023px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  /* Hide desktop navigation on mobile */
  .header-services {
    display: none;
  }
  
  /* Adjust header layout */
  .crs-header {
    justify-content: space-between;
    padding: 12px 16px;
  }
  
  /* Keep BOOK NOW visible on tablet */
  .header-center-action {
    position: static;
  }
}

/* Mobile only: Also hide BOOK NOW dropdown */
@media (max-width: 767px) {
  .header-center-action {
    display: none;
  }
  
  /* Full mobile layout */
  .mobile-nav-overlay {
    width: 100%;
  }
  
  .mobile-nav-container {
    margin: 10px;
    padding: 16px;
  }
}

/* Prevent body scroll when mobile menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* === ACCESSIBILITY === */

.mobile-menu-toggle:focus,
.mobile-nav-close:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
  outline-offset: 2px;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}
