/* Custom WordPress Mega Menu */
.cwm-mega-menu-item {
	position: static !important;
}

.cwm-mega-panel {
	display: none;
	position: absolute;
	z-index: 99999;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	width: min(900px, calc(100vw - 32px));
	max-height: min(75vh, 720px);
	overflow: auto;
	padding: 0px;
	background: #fff;
	color: #20242a;
	border: 1px solid rgba(0, 0, 0, .08);
	border-radius: 10px;
	box-shadow: 0 18px 45px rgba(0, 0, 0, .14);
	box-sizing: border-box;
}

.cwm-mega-panel-inner > * {
	min-width: 0;
}
.elementor-nav-menu .cwm-mega-panel  ul {
    display: block !important;
}

.cwm-mega-panel a {
	color: inherit;
	text-decoration: none;
}

.cwm-mega-panel a:hover {
	color: #075696;
}

.cwm-mega-panel ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cwm-mega-panel li {
	margin: 0 0 10px;
}

.cwm-mega-menu-item > .sub-menu {
	display: none !important;
}

.cwm-mega-menu-item.cwm-is-open > .cwm-mega-panel {
	display: block;
}

@media (hover: hover) and (pointer: fine) {
	.cwm-mega-menu-item.cwm-trigger-hover:hover > .cwm-mega-panel,
	.cwm-mega-menu-item.cwm-trigger-hover:focus-within > .cwm-mega-panel {
		display: block;
	}
}

.cwm-mega-menu-item > a[aria-expanded="true"] {
	position: relative;
}

@media (max-width: 1024px) {

	.cwm-mega-menu-item {
		position: relative !important;
	}

	.cwm-mega-panel {
		position: static;
		transform: none;
		width: 100%;
		margin-top: 8px;
		padding: 5px 5px 5px 15px;
		border-radius: 8px;
		box-shadow: none;

		/* The mega panel scrolls inside the menu */
		max-height: 60vh;                  /* fallback */
		max-height: calc(100dvh - 160px);  /* adjust 160px to header + menu bar height */
		overflow-y: auto;
		overflow-x: hidden;
		overscroll-behavior: contain;      /* wheel/touch scroll stays inside the panel */
		-webkit-overflow-scrolling: touch;
		touch-action: pan-y;
	}

	/* Let the Elementor dropdown grow so it doesn't clip or double-scroll */
	.elementor-nav-menu--dropdown.elementor-nav-menu__container {
		max-height: none;
		overflow: visible !important;
	}
}
