/* ══════════════════════════════════════════════════════════════
   MEGA MENU — 3-Level Nested Structure
   Webfamily Tech Solution
   ══════════════════════════════════════════════════════════════ */

/* ─── Desktop Mega Menu Container ─── */
.nx-dropdown {
  position: absolute !important;
  z-index: 99999 !important;
  left: 0;
  right: 0;
  top: 80px;
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: all 0.4s ease;
}
div.custom-nav > ul > li:hover .nx-dropdown {
  opacity: 1;
  height: auto;
  overflow: inherit;
}
.main-header.sticky .nx-dropdown {
  top: 65px;
}

/* ─── Mega panel ─── */
.mega-menu-panel {
  background: #fff;
  border-top: 3px solid #4a00e0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12);
  padding: 30px 0 35px;
  width: 100%;
  display: block;
}

/* ─── 5-column grid ─── */
.mega-menu-grid {
  display: flex;
  gap: 0;
  align-items: flex-start;
}
.mega-col {
  flex: 1;
  padding: 0 18px;
  border-right: 1px solid #f0f0f0;
  min-width: 0;
}
.mega-col:last-child { border-right: none; }

/* ─── Column heading pill ─── */
.mega-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #4a00e0, #8e2de2);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 14px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mega-col-title i { font-size: 13px; opacity: 0.9; }

/* ─── Link list ─── */
.mega-col ul { list-style: none; padding: 0; margin: 0; }
.mega-col ul li { margin-bottom: 6px; }
.mega-col ul li a {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: #2c2c54;
  line-height: 1.5;
  padding: 5px 8px;
  border-radius: 5px;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
  text-decoration: none;
}
.mega-col ul li a::before {
  content: "›";
  font-size: 16px;
  color: #8e2de2;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
.mega-col ul li a:hover {
  background: #f3e8ff;
  color: #4a00e0;
  padding-left: 12px;
}

/* ─── Desktop dark mode ─── */
.dark-mode .mega-menu-panel {
  background: #1a1a2e;
  border-top-color: #8e2de2;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.dark-mode .mega-col { border-right-color: #2d2d44; }
.dark-mode .mega-col ul li a { color: #d0d0f0; }
.dark-mode .mega-col ul li a:hover { background: #2d1b5e; color: #c084fc; }


/* ══════════════════════════════════════════════════════════════
   MOBILE 3-LEVEL ACCORDION NAV — COMPLETE FIX
   ══════════════════════════════════════════════════════════════ */

/* ─── Level-1: Expand Services enough for all nested categories ─── */
.first-nav > li.open > ul {
  max-height: 2000px !important;
}

/* ─── Level-2 wrapper li: must be block, not flex item ─── */
#main-nav .first-nav > li.has-sub > ul > li.has-sub-l2 {
  display: block !important;
  width: 100%;
  padding: 0 10px;
  margin: 0;
  background: transparent;
  border-bottom: none !important;
  min-height: unset;
  height: auto;
}

/* ─── Hide any accidental <a> inside has-sub-l2 (not used; mob-cat-label is the label) ─── */
#main-nav .first-nav > li.has-sub > ul > li.has-sub-l2 > a {
  display: none !important;
}

/* ─── Category pill (gradient header) ─── */
#main-nav .mob-cat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px 9px 14px;
  background: linear-gradient(135deg, #4a00e0, #8e2de2);
  border-radius: 8px;
  margin: 7px 0 0;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  user-select: none;
  cursor: default;
}
#main-nav .mob-cat-label span {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}
#main-nav .mob-cat-label .cat-icon {
  font-size: 12px;
  opacity: 0.9;
  flex-shrink: 0;
}

/* ─── Toggle button inside pill ─── */
#main-nav .sub-toggle-l2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  color: #fff;
  font-size: 9px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
  transition: background 0.25s ease, transform 0.3s ease;
}
#main-nav .sub-toggle-l2:hover {
  background: rgba(255,255,255,0.32);
}
#main-nav .sub-toggle-l2.open {
  transform: rotate(90deg);
  background: rgba(255,255,255,0.28);
}

/* ─── Level-3 nested list — smooth max-height reveal ─── */
#main-nav .nested-sub {
  list-style: none;
  padding: 4px 0 8px 10px;
  margin: 4px 0 4px 8px;
  border-left: 3px solid rgba(142, 45, 226, 0.3);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.38s ease, opacity 0.3s ease;
}
#main-nav .nested-sub.open {
  max-height: 600px;
  opacity: 1;
}

/* ─── Level-3 items ─── */
#main-nav .nested-sub > li {
  display: block !important;
  list-style: none;
  padding: 0;
  margin: 0 0 1px;
  border: none !important;
  background: transparent !important;
  min-height: unset;
  height: auto;
}

/* ─── Level-3 links — override social-pulse.css selectors ─── */
#main-nav .nested-sub > li > a {
  display: flex !important;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 10px !important;
  font-size: 13px !important;
  font-weight: 500;
  color: #2c2c54 !important;
  text-decoration: none;
  border-radius: 6px;
  border-bottom: none !important;
  background: transparent;
  line-height: 1.4;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.22s ease;
}
#main-nav .nested-sub > li > a::before {
  content: "›";
  font-size: 16px;
  color: #8e2de2;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}
#main-nav .nested-sub > li > a:hover {
  background: #f3e8ff !important;
  color: #4a00e0 !important;
  padding-left: 14px !important;
}

/* ─── Bottom spacing after last category ─── */
#main-nav .has-sub-l2:last-child {
  padding-bottom: 8px;
}

/* ─── Dark mode ─── */
.active-dark #main-nav .mob-cat-label {
  background: linear-gradient(135deg, #3b0090, #6517b0);
}
.active-dark #main-nav .nested-sub {
  border-left-color: rgba(160, 80, 220, 0.3);
}
.active-dark #main-nav .nested-sub > li > a {
  color: #d0d0f0 !important;
}
.active-dark #main-nav .nested-sub > li > a:hover {
  background: #2d1b5e !important;
  color: #c084fc !important;
}

/* ─── Hide mobile nav entirely on desktop ─── */
@media (min-width: 992px) {
  #main-nav { display: none !important; }
}
