/* ==========================================================================
   Custom Elementor Mega Menu Pro — v1.0.4
   FIX: Global overflow override hataya — sirf .cxmmx-mega-enabled pe apply
   FIX: homepage1-menu hardcoded class hataya
   FIX: z-index 99999 → 9999
   ========================================================================== */

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

/* ==========================================================================
   FIX: Pehle yahan 7 broad Elementor selectors pe overflow: visible !important
   globally apply hota tha — ye sabhi themes ko tod deta tha.
   Ab sirf mega-enabled items pe overflow visible karo.
   ========================================================================== */
.cxmmx-mega-enabled,
.elementor-nav-menu--main .cxmmx-mega-enabled {
  position: relative;
  overflow: visible !important;
}

.cxmmx-mega-enabled > a[data-cxmmx-trigger] {
  position: relative;
  z-index: 3;
}

/* ==========================================================================
   Mega submenu panel
   ========================================================================== */
.cxmmx-mega-enabled > .sub-menu.cxmmx-mega-sub-menu {
  position: absolute !important;
  top: 100%;
  left: 0;
  display: block !important;
  min-width: 18rem;
  width: min(100vw - 2rem, 72rem);
  margin: 0 !important;
  padding: 8px 0 0 !important;
  list-style: none;
  background: transparent !important;
  border: 0 !important;
  border-top: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 10px, 0);
  transition:
    opacity 0.24s ease,
    transform 0.24s ease,
    visibility 0s linear 0.24s;
  /* FIX: 99999 → 9999 — chatbots/modals ke upar nahi jaana chahiye */
  z-index: 9999 !important;
}

.cxmmx-mega-enabled > .sub-menu.cxmmx-mega-sub-menu > .cxmmx-mega-sub-menu-item {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-top: 0 !important;
  box-shadow: none !important;
}

/* Full-width panel */
.cxmmx-width-full > .sub-menu.cxmmx-mega-sub-menu {
  left: 50%;
  width: calc(100vw - 32px);
  max-width: calc(100vw - 32px);
  min-width: calc(100vw - 32px);
  transform: translate3d(-50%, 10px, 0);
}

/* Open states */
.cxmmx-mega-enabled:hover > .sub-menu.cxmmx-mega-sub-menu,
.cxmmx-mega-enabled:focus-within > .sub-menu.cxmmx-mega-sub-menu,
.cxmmx-mega-enabled.cxmmx-is-open > .sub-menu.cxmmx-mega-sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0);
  transition-delay: 0s;
}

.cxmmx-width-full:hover > .sub-menu.cxmmx-mega-sub-menu,
.cxmmx-width-full:focus-within > .sub-menu.cxmmx-mega-sub-menu,
.cxmmx-width-full.cxmmx-is-open > .sub-menu.cxmmx-mega-sub-menu {
  transform: translate3d(-50%, 0, 0);
}

/* ==========================================================================
   Animations
   ========================================================================== */
.cxmmx-animation-slide > .sub-menu.cxmmx-mega-sub-menu {
  transform: translate3d(0, 18px, 0);
}

.cxmmx-width-full.cxmmx-animation-slide > .sub-menu.cxmmx-mega-sub-menu {
  transform: translate3d(-50%, 18px, 0);
}

.cxmmx-animation-slide:hover > .sub-menu.cxmmx-mega-sub-menu,
.cxmmx-animation-slide:focus-within > .sub-menu.cxmmx-mega-sub-menu,
.cxmmx-animation-slide.cxmmx-is-open > .sub-menu.cxmmx-mega-sub-menu {
  transform: translate3d(0, 0, 0);
}

.cxmmx-width-full.cxmmx-animation-slide:hover > .sub-menu.cxmmx-mega-sub-menu,
.cxmmx-width-full.cxmmx-animation-slide:focus-within > .sub-menu.cxmmx-mega-sub-menu,
.cxmmx-width-full.cxmmx-animation-slide.cxmmx-is-open > .sub-menu.cxmmx-mega-sub-menu {
  transform: translate3d(-50%, 0, 0);
}

/* ==========================================================================
   Panel inner styles
   ========================================================================== */
.cxmmx-mega-panel {
  position: relative;
  display: block !important;
  width: 100%;
  min-width: 18rem;
}

.cxmmx-width-full .cxmmx-mega-panel {
  width: 100%;
  min-width: 0;
}

.cxmmx-mega-panel__inner {
  background: #ffffff;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-top: 0 !important;
  border-radius: 20px;
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

/* Remove any pseudo-elements that themes inject into sub-menus */
.cxmmx-mega-enabled > .sub-menu.cxmmx-mega-sub-menu::before,
.cxmmx-mega-enabled > .sub-menu.cxmmx-mega-sub-menu::after {
  display: none !important;
  content: none !important;
}

/* ==========================================================================
   FIX: homepage1-menu / vl-main-menu hardcoded selectors HATA DIYE.
   Ye sirf ek specific theme ke liye tha — doosri themes pe conflict karta tha.
   Agar theme-specific fix chahiye toh user apne custom CSS mein kare.
   ========================================================================== */

/* Full-width Elementor containers inside panel */
.cxmmx-width-full .cxmmx-mega-panel__inner {
  width: 100%;
}

.cxmmx-width-full .cxmmx-mega-panel .elementor,
.cxmmx-width-full .cxmmx-mega-panel .elementor-section,
.cxmmx-width-full .cxmmx-mega-panel .elementor-container,
.cxmmx-width-full .cxmmx-mega-panel .e-con,
.cxmmx-width-full .cxmmx-mega-panel .e-parent {
  width: 100% !important;
  max-width: 100% !important;
}

.cxmmx-width-full .cxmmx-mega-panel .elementor-section.elementor-section-boxed > .elementor-container,
.cxmmx-width-full .cxmmx-mega-panel .elementor-section.elementor-section-boxed > .e-con-inner,
.cxmmx-width-full .cxmmx-mega-panel .elementor-top-section > .elementor-container {
  max-width: 100% !important;
}

/* ==========================================================================
   Lazy / AJAX state messages
   ========================================================================== */
.cxmmx-mega-panel.cxmmx-is-lazy .cxmmx-mega-panel__inner {
  min-height: 5rem;
}

.cxmmx-mega-loading,
.cxmmx-mega-error {
  padding: 1.25rem 1.5rem;
  color: #475467;
  font-size: 0.95rem;
}

/* ==========================================================================
   Mobile toggle button
   ========================================================================== */
.cxmmx-submenu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.cxmmx-toggle-icon,
.cxmmx-toggle-icon::before,
.cxmmx-toggle-icon::after {
  display: block;
  width: 0.75rem;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
  content: "";
}

.cxmmx-toggle-icon {
  position: relative;
}

.cxmmx-toggle-icon::before {
  position: absolute;
  top: -0.3rem;
  left: 0;
}

.cxmmx-toggle-icon::after {
  position: absolute;
  top: 0.3rem;
  left: 0;
}

.cxmmx-submenu-toggle[aria-expanded="true"] .cxmmx-toggle-icon {
  background: transparent;
}

.cxmmx-submenu-toggle[aria-expanded="true"] .cxmmx-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.cxmmx-submenu-toggle[aria-expanded="true"] .cxmmx-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ==========================================================================
   Mobile responsive (below 1024px)
   ========================================================================== */
@media (max-width: 1023px) {
  .cxmmx-mega-enabled {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }

  .cxmmx-mega-enabled > a[data-cxmmx-trigger] {
    flex: 1 1 auto;
  }

  .cxmmx-submenu-toggle {
    display: inline-flex;
    flex: 0 0 auto;
  }

  .cxmmx-mega-enabled > .sub-menu.cxmmx-mega-sub-menu,
  .cxmmx-width-full > .sub-menu.cxmmx-mega-sub-menu {
    position: static !important;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-top: 0.75rem !important;
    padding-top: 0 !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none !important;
    display: none !important;
    transition: none;
    z-index: auto !important;
  }

  .cxmmx-mega-enabled.cxmmx-is-open > .sub-menu.cxmmx-mega-sub-menu {
    display: block !important;
  }

  .cxmmx-mega-panel {
    min-width: 0;
  }

  .cxmmx-mega-panel__inner {
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.1);
  }
}
