/* =====================================================================
   MEGA MENU STYLES (Services / Products) — FINAL, FIXED VERSION
 */

.main-menu .mega-menu-parent {
	position: static;
}

.main-menu .mega-menu-parent .mega-menu-wrap {
	position: absolute;
	top: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(8px);
	width: calc(100% - 40px);
	max-width: 1180px;
	margin: 0 auto;

	background: #fff;
	border-radius: 16px;
	box-shadow: 0 25px 60px rgb(20 10 40 / .18);
	border: 1px solid rgba(131, 66, 246, .08);

	display: flex !important;
	flex-direction: row !important;
	align-items: stretch;
	flex-wrap: nowrap !important;

	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .28s ease, transform .28s ease, visibility .28s ease;
	z-index: 9999;
	overflow: hidden;
}

/* Visibility*/
.main-menu .mega-menu-parent.mega-open .mega-menu-wrap {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

/* Fallback: still support plain :hover for keyboard/no-JS cases */
.main-menu .mega-menu-parent:hover .mega-menu-wrap {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

/* small pointer arrow so it visually connects to the nav item */
.main-menu .mega-menu-parent .mega-menu-wrap::before {
	content: '';
}
/* ---------- Hard reset: kill any inherited theme list/flex rules ---------- */
.mega-menu-wrap,
.mega-menu-wrap * {
	box-sizing: border-box;
}

.mega-menu-wrap ul,
.mega-menu-wrap ol {
	display: block !important;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
}

.mega-menu-wrap ul li,
.mega-menu-wrap ol li {
	display: block !important;
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	list-style: none !important;
}

.mega-menu-wrap a {
	text-decoration: none !important;
}

/* ---------- Column 1: category list ---------- */
.mega-menu-categories {
	flex: 0 0 280px;
	max-width: 280px;
	background: var(--smoke-color, #f7f5ff);
	padding: 20px 0;
	max-height: 500px;
	overflow-y: auto;
	overflow-x: auto; /* safety net for this plain single-column list — scrolls if ever needed, never hides content */
	border-right: 1px solid var(--th-border-color, #ece7fb);
}


.mega-cat-list li a {
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	padding: 13px 24px !important;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--title-color, #17012c);
	transition: all .22s ease;
	white-space: nowrap;
}

.mega-cat-list li a i {
	font-size: 12px;
	opacity: .55;
	flex-shrink: 0;
	margin-left: 12px;
}

.mega-cat-list li:hover a,
.mega-cat-list li.active a {
	background: var(--theme-color, #8342f6);
	background-image: linear-gradient(90deg, var(--theme-color, #8342f6) 0%, var(--theme-color3, #ff5fa2) 100%);
	color: #fff !important;
}

.mega-cat-list li:hover a i,
.mega-cat-list li.active a i {
	opacity: 1;
	color: #fff;
}

/* ---------- Column 2: active item panel ---------- */
.mega-menu-items {
	position: relative;
	flex: 1 1 auto;
	padding: 30px 20px;
	max-height: 500px;
	overflow-y: auto;
	overflow-x: hidden;

}

.mega-item-panel {
	display: none !important;
}

.mega-item-panel.active {
	display: block !important;
	animation: megaFadeIn .25s ease;
}

@keyframes megaFadeIn {
	from { opacity: 0; transform: translateX(6px); }
	to   { opacity: 1; transform: translateX(0); }
}

.mega-item-panel h4 {
	font-size: 21px;
	font-weight: 700;
	color: var(--title-color, #17012c);
	margin: 0 0 20px !important;
	padding-bottom: 14px;
	border-bottom: 1px solid var(--th-border-color, #ece7fb);
	display: flex !important;
	align-items: center;
	gap: 10px;
}

.mega-item-panel h4 i {
	font-size: 14px;
	color: var(--theme-color, #8342f6);
}

/* single column list */
.mega-links {
	display: block !important;
}

.mega-links li a {
	display: flex !important;
	align-items: center;
	gap: 12px;
	padding: 9px 0px 9px 6px !important;
	font-size: 16px;
	color: #4b4657;
	border-bottom: 1px dashed transparent;
	transition: color .2s ease;
	position: relative;
}

.mega-links li a:hover {
	color: var(--theme-color, #8342f6);
}


.mega-links li a i {
	flex-shrink: 0;
	width: 20px;
	text-align: center;
	font-size: 16px;
	color: var(--theme-color, #8342f6);
	opacity: .75;
	transition: all .25s ease;
}

.mega-links li a:hover i {
	opacity: 1;
	transform: translateX(3px) scale(1.12);
}
.mega-links li a svg {
	flex-shrink: 0;
	width: 20px;
	text-align: center;
	font-size: 26px;
	color: var(--theme-color, #8342f6);
	opacity: .75;
	transition: all .25s ease;
}

.mega-links li a:hover svg {
	opacity: 1;
	transform: translateX(3px) scale(1.12);
}
/* ---------- Promo panel: fills leftover empty space with a banner ---------- */

.mega-menu-promo {
	flex: 0 0 260px;
	max-width: 260px;
	align-self: flex-start;
}

.mega-menu-promo-card {
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 15px 35px rgb(131 66 246 / .18);
	background: #fff;
	border: 1px solid var(--th-border-color, #ece7fb);
}

/* image on top — fixed height, never changes size */
.mega-menu-promo-card img {
	display: block;
	width: 100%;
	height: 160px;
	object-fit: cover;
}

/* content below the image — plain background, no dark overlay */
.mega-menu-promo-content {
	padding: 22px 20px;
	background: #fff;
}

.mega-menu-promo-badge {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--smoke-color, #f7f5ff);
	border: 1px solid var(--th-border-color, #ece7fb);
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--theme-color, #8342f6);
	font-size: 15px;
	margin-bottom: 14px;
}

.mega-menu-promo-badge i {
	color: var(--theme-color, #8342f6);
}

.mega-menu-promo-content h5 {
	color: var(--title-color, #17012c) !important;
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 8px !important;
}

.mega-menu-promo-content p {
	color: #6b6775;
	font-size: 13px;
	line-height: 1.55;
	margin: 0 0 16px !important;
}

.mega-menu-promo-btn {
	display: inline-flex !important;
	align-items: center;
	gap: 8px;
	background: var(--theme-color, #8342f6);
	background-image: linear-gradient(90deg, var(--theme-color, #8342f6) 0%, var(--theme-color3, #ff5fa2) 100%);
	color: #fff !important;
	padding: 10px 18px !important;
	border-radius: 30px;
	font-size: 13px;
	font-weight: 600;
	width: fit-content;
	transition: all .25s ease;
}

.mega-menu-promo-btn:hover {
	gap: 12px;
	box-shadow: 0 10px 22px rgb(131 66 246 / .35);
}

/* ---------- AUTOMATIC COLUMN SPLIT: max 6 items per column ---------- */


.mega-links.auto-two-col {
	column-count: 2; 
	column-gap: 40px;

}

.mega-links.auto-two-col li {
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
}

.mega-links.auto-two-col li a {
	white-space: normal;
}
.abt-col-3.auto-three-col {
	column-count: 3;
	/* always exactly 3 columns, evenly split (like 6-6) */
	column-gap: 40px;
	
}

.mega-menu-wrap-flat {
	max-width: 900px !important;
	justify-content: space-between;
}

/* .mega-menu-wrap-flat .mega-menu-items {
	flex: 0 0 480px;
	max-width: 480px;
} */

/* ---------- Scrollbars inside mega menu columns ---------- */
.mega-menu-categories::-webkit-scrollbar,
.mega-menu-items::-webkit-scrollbar {
	width: 5px;
}

.mega-menu-categories::-webkit-scrollbar-thumb,
.mega-menu-items::-webkit-scrollbar-thumb {
	background: var(--theme-color, #8342f6);
	border-radius: 10px;
}

/* ---------- Mobile: nested level2 / level3 accordion ---------- */
.th-mobile-menu .level3 > li > a {
	padding-left: 20px !important;
	font-size: 14px;
	color: #5c5867;
}

.th-mobile-menu li.th-active > a {
	color: var(--theme-color, #8342f6);
}

/* ---------- Responsive scaling for smaller desktop widths ---------- */
@media (max-width: 1400px) {
.main-menu .mega-menu-parent .mega-menu-wrap {
		max-width: 100%;
		
	}
}

@media (max-width: 1200px) {
	.main-menu .mega-menu-parent .mega-menu-wrap {
		width: calc(100% - 24px);
		max-width: 900px;
	}
	.mega-menu-categories {
		flex: 0 0 240px;
		max-width: 240px;
	}
	.mega-menu-items {
		padding: 26px 28px;
	}
	.mega-links.auto-two-col {
		column-gap: 28px;
	}
	/* not enough room for the promo banner at this width — hide it and
	   let the links panel use the freed-up space instead */
	.mega-menu-promo {
		display: none;
	}
}
