/* Mobile Navigation v2 - CSS Checkbox Pattern */
/* CSS-only responsive mobile menu without JavaScript */

/* ============================================
   HIDE OLD MOBILE NAV COMPONENTS
   ============================================ */

/* Disable old hamburger button */
.hamburger {
  display: none !important;
}

/* Disable old mobile menu */
.mobile-menu {
  display: none !important;
}

/* ============================================
   NEW CHECKBOX-BASED MOBILE NAVIGATION
   ============================================ */

/* Hide the checkbox input */
.mobile-menu-checkbox {
  display: none;
}

/* Mobile hamburger button (label for checkbox) */
.mobile-hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1001;
}

.mobile-hamburger:hover {
  transform: scale(1.05);
}

.mobile-hamburger:active {
  transform: scale(0.98);
}

/* Hide mobile hamburger on desktop */
@media (min-width: 768px) {
  .mobile-hamburger {
    display: none;
  }
}

/* Hamburger icon - three lines using span and pseudo-elements */
.hamburger-line {
  width: 32px;
  height: 3px;
  background: #1A365D;
  position: relative;
  transition: all 0.3s ease;
  display: block;
}

.hamburger-line::before,
.hamburger-line::after {
  content: '';
  position: absolute;
  width: 32px;
  height: 3px;
  background: #1A365D;
  transition: all 0.3s ease;
}

.hamburger-line::before {
  top: -10px;
}

.hamburger-line::after {
  bottom: -10px;
}

/* Transform hamburger to X when menu is open */
.mobile-menu-checkbox:checked ~ .mobile-hamburger .hamburger-line {
  background: transparent;
}

.mobile-menu-checkbox:checked ~ .mobile-hamburger .hamburger-line::before {
  transform: rotate(45deg);
  top: 0;
  background: #f9f9f9;
}

.mobile-menu-checkbox:checked ~ .mobile-hamburger .hamburger-line::after {
  transform: rotate(-45deg);
  bottom: 0;
  background: #f9f9f9;
}

.mobile-menu-checkbox:checked ~ .mobile-hamburger {
  background: transparent;
}

/* Mobile navigation menu */
.mobile-nav-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 54, 93, 0.98);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  
  /* Hidden by default */
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Show menu when checkbox is checked */
.mobile-menu-checkbox:checked ~ .mobile-nav-menu {
  max-height: 100vh;
  opacity: 1;
  pointer-events: all;
}

/* Lock body scroll when menu is open */
body:has(.mobile-menu-checkbox:checked) {
  overflow: hidden;
}

/* Hide mobile menu on desktop */
@media (min-width: 768px) {
  .mobile-nav-menu {
    display: none;
  }
}

/* Mobile menu list */
.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.mobile-menu-list li {
  margin: 0;
}

.mobile-menu-list a {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 500;
  color: #f9f9f9;
  text-decoration: none;
  padding: 16px 0;
  text-align: center;
  min-height: 48px;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.mobile-menu-list a:hover {
  color: #1F7063;
  background: rgba(45, 155, 135, 0.1);
}

.mobile-menu-list a:active {
  transform: scale(0.98);
}

/* ============================================
   DESKTOP NAVIGATION ADJUSTMENTS
   ============================================ */

/* Show desktop nav at 768px+ (changed from 1024px) */
@media (min-width: 768px) {
  .main-nav {
    display: block;
  }
  
  .nav-cta {
    display: flex;
  }
}

/* Adjust desktop nav spacing for tablet breakpoint */
@media (min-width: 768px) and (max-width: 1023px) {
  .nav-list {
    gap: 12px;
  }
  
  .nav-link {
    font-size: 14px;
  }
  
  .nav-cta {
    padding: 8px 16px;
    font-size: 14px;
    margin-left: 12px;
  }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */

.mobile-hamburger:focus {
  outline: 2px solid #1F7063;
  outline-offset: 2px;
}

.mobile-menu-list a:focus {
  outline: 2px solid #1F7063;
  outline-offset: 4px;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

/* Ensure proper stacking on very small screens */
@media (max-width: 389px) {
  .mobile-hamburger {
    width: 48px;
    height: 48px;
  }
  
  .hamburger-line {
    width: 28px;
  }
  
  .hamburger-line::before,
  .hamburger-line::after {
    width: 28px;
  }
  
  .mobile-menu-list a {
    font-size: 20px;
  }
}

/* ============================================
   MOBILE HEADER LAYOUT REFINEMENTS
   ============================================ */

/* Mobile header 3-column layout: Hamburger (left) | Logo (center) | Free signup (right) */
@media (max-width: 767px) {
  .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }
  
  /* Hamburger on left */
  .mobile-hamburger {
    order: 1;
    background: transparent; /* Remove grey background */
    flex-shrink: 0;
  }
  
  /* Center logo absolutely */
  .logo {
    order: 2;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
  }
  
  /* Increase logo size */
  .logo img {
    height: 64px;
  }
  
  /* Shrink Free signup button on right - DRASTICALLY REDUCED */
  .site-header .nav-cta,
  .header-container .nav-cta {
    order: 3;
    padding: 4px 10px !important;
    font-size: 11px !important;
    margin-left: 0 !important;
    min-width: auto !important;
    width: auto !important;
    white-space: nowrap !important;
    flex-shrink: 0;
  }
  
  .nav-cta .btn-icon {
    width: 12px !important;
    height: 12px !important;
    margin-left: 4px !important;
  }
  
  /* Hide desktop nav on mobile */
  .main-nav {
    display: none;
  }
}

/* Optimize for smallest screens (360px) */
@media (max-width: 389px) {
  .site-header .nav-cta,
  .header-container .nav-cta {
    padding: 4px 8px !important;
    font-size: 10px !important;
  }
  
  .logo img {
    height: 56px;
  }
}
