/* =============================================================================
   8. UTILITY CLASSES - Consistent Spacing & Layout
   ============================================================================= */

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-white { color: var(--color-white); }
.text-gray { color: var(--color-gray-700); }

/* Spacing Utilities */
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* Responsive Utilities */
.hidden-mobile { display: block; }
.visible-mobile { display: none; }

/* Hamburger Menu Styles */
.nav__toggle {
  display: none;
  background: transparent;
  border: none;
  padding: var(--space-2);
  cursor: pointer;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 10;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
}

.nav__toggle-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-primary);
  transition: all var(--transition-fast);
  position: relative;
}

.nav__toggle--active .nav__toggle-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav__toggle--active .nav__toggle-line:nth-child(2) {
  opacity: 0;
}

.nav__toggle--active .nav__toggle-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* Mobile Navigation Styles */
@media (max-width: 767px) {
  .hidden-mobile { display: none; }
  .visible-mobile { display: block; }
  
  /* Show hamburger menu on mobile */
  .nav__toggle {
    display: flex;
  }
  
  /* Navigation responsive adjustments */
  .nav {
    height: auto;
    min-height: 56px;
    position: relative !important; /* Prevent sticky nav from interfering with scroll */
  }
  
  .nav__container {
    flex-wrap: nowrap;
    padding: var(--space-2) var(--space-3);
    justify-content: space-between;
    align-items: center;
    height: 56px;
    position: relative;
  }
  
  /* Fix logo/text alignment */
  .nav__brand {
    font-size: var(--font-size-md);
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex: 0 1 auto;
  }
  
  .nav__brand picture,
  .nav__brand img {
    height: 32px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
    /* Ensure proper vertical alignment */
    display: block;
  }
  
  .nav__brand span {
    line-height: 1;
    /* Ensure proper vertical centering */
    display: inline-flex;
    align-items: center;
    height: 32px; /* Match logo height for perfect alignment */
  }
  
  .nav__links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-white) !important;
    background-color: #ffffff !important; /* Fallback for any CSS variable issues */
    width: 100%;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3);
    border-top: 1px solid var(--color-gray-200);
    display: none; /* Hidden by default on mobile */
    box-shadow: var(--shadow-lg);
    z-index: 1000; /* Increased z-index to ensure menu appears above all content */
  }
  
  .nav__links.nav__links--open {
    display: flex;
  }
  
  .nav__item {
    width: 100%;
    background: var(--color-white) !important;
    background-color: #ffffff !important; /* Ensure white background for all items */
  }
  
  .nav__link {
    width: 100%;
    justify-content: space-between;
    padding: var(--space-3) 0;
    height: auto;
    min-height: 44px;
    background: transparent; /* Links themselves are transparent */
    color: var(--color-gray-700) !important; /* Ensure readable text color */
  }
  
  .nav__dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin-left: var(--space-4);
    padding: 0;
    display: none;
    pointer-events: auto;
  }
  
  .nav__item--dropdown.nav__item--open .nav__dropdown {
    display: block;
  }
  
  .nav__dropdown-link {
    padding: var(--space-3) 0;
    font-size: var(--font-size-sm);
    min-height: 44px;
    display: flex;
    align-items: center;
    background: var(--color-white) !important;
    background-color: #ffffff !important; /* Ensure white background */
    color: var(--color-gray-700) !important; /* Ensure readable text color */
  }
  
  .nav__links .btn {
    width: 100%;
    margin-top: var(--space-2);
    min-height: 44px;
  }
  
  /* Ensure dropdown arrow is visible on mobile */
  .nav__dropdown-arrow {
    color: var(--color-gray-700) !important;
  }
  
  /* Override any hover effects that might break mobile */
  .nav__item--dropdown:hover .nav__dropdown {
    display: none; /* Disable hover dropdown on mobile */
  }
}

