/* ============================================
   CRITICAL Z-INDEX FIX
   Ensures dropdowns appear above ALL content
   ============================================ */

/* Force all page content below navbar layer */
@media (min-width: 992px) {
  /* Navbar layer - highest */
  .navbar {
    position: sticky !important;
    top: 0 !important;
    z-index: 999999 !important;
  }

  /* Dropdown menus - absolute highest */
  .unified-dropdown-portal,
  .dropdown-menu,
  .dropdown-portal,
  .dropdown-portal-container {
    position: fixed !important;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
  }

  /* Hero section and all children - low z-index */
  .hero-section,
  .hero-slider-section,
  .carousel,
  .carousel-inner,
  .carousel-item {
    position: relative !important;
    z-index: 1 !important;
  }

  /* Hero pseudo elements - below content */
  .hero-section::before,
  .hero-section::after,
  .hero-slider-section::before,
  .hero-slider-section::after,
  .hero-slide-overlay {
    z-index: 0 !important;
    pointer-events: none !important;
  }

  /* SVG waves and decorations - below everything */
  .hero-section svg,
  .hero-slider-section svg,
  .wave-decoration {
    position: absolute !important;
    z-index: 0 !important;
    pointer-events: none !important;
  }

  /* All sections - below navbar */
  section,
  .section,
  main,
  .main-content,
  .content-section {
    position: relative !important;
    z-index: 1 !important;
  }

  /* Ensure no overflow clipping */
  body,
  html,
  .navbar,
  .navbar .container,
  .navbar-collapse,
  .navbar-nav {
    overflow: visible !important;
  }

  /* Reset any conflicting positioning */
  .container:has(.navbar) {
    overflow: visible !important;
  }
}

/* Additional specificity for problematic elements */
@media (min-width: 992px) {
  nav.navbar {
    z-index: 999999 !important;
  }

  nav.navbar .unified-dropdown-portal {
    z-index: 2147483647 !important;
  }

  .hero-section *:not(.navbar):not(.unified-dropdown-portal),
  .hero-slider-section *:not(.navbar):not(.unified-dropdown-portal) {
    z-index: auto !important;
  }

  /* Carousel controls should stay visible but below dropdowns */
  .carousel-control-prev,
  .carousel-control-next {
    z-index: 10 !important;
  }

  /* Carousel indicators */
  .carousel-indicators {
    z-index: 10 !important;
  }
}

/* Debug helper - uncomment to visualize layers */
/*
@media (min-width: 992px) {
  .navbar {
    background: rgba(255, 0, 0, 0.3) !important;
  }

  .unified-dropdown-portal {
    background: rgba(0, 255, 0, 0.9) !important;
    border: 5px solid red !important;
  }

  .hero-section {
    background: rgba(0, 0, 255, 0.3) !important;
  }
}
*/