/* Full-width mega menu shell under the header — only #menu-custom (not mobile). */
#menu-custom.elementor-widget-cmsmasters-nav-menu__main.cmsmasters-layout-horizontal,
#menu-custom .elementor-widget-cmsmasters-nav-menu__main.cmsmasters-layout-horizontal {
	position: relative;
}

#menu-custom.elementor-widget-cmsmasters-nav-menu__main.cmsmasters-layout-horizontal > ul > .menu-item,
#menu-custom .elementor-widget-cmsmasters-nav-menu__main.cmsmasters-layout-horizontal > ul > .menu-item {
	position: static !important;
}

#menu-custom.elementor-widget-cmsmasters-nav-menu__main.cmsmasters-layout-horizontal
	.elementor-widget-cmsmasters-nav-menu__megamenu-template-container,
#menu-custom .elementor-widget-cmsmasters-nav-menu__main.cmsmasters-layout-horizontal
	.elementor-widget-cmsmasters-nav-menu__megamenu-template-container {
	position: absolute !important;
	top: 100% !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	max-width: none !important;
	transform: none !important;
	z-index: 9999;
	box-sizing: border-box !important;
}

/*
 * Mirror Elementor .e-con kit vars so content width can resolve.
 */
#menu-custom .cmsmasters-megamenu-container {
	position: relative;
	--container-max-width: 1440px;
	--content-width: min(100%, var(--container-max-width, 1140px));
	--padding-left: 8px;
	--padding-right: 8px;
	padding-left: var(--padding-left);
	padding-right: var(--padding-right);
	box-sizing: border-box !important;
}

/*
 * Same model as .e-con > .e-con-inner.
 */
#menu-custom .cmsmasters-megamenu-container
	> .elementor-widget-cmsmasters-nav-menu__megamenu-template-container-inner {
	gap: var(--row-gap, 20px) var(--column-gap, 20px);
	height: auto;
	margin: 0 auto !important;
	max-width: var(--content-width) !important;
	padding-inline-end: 0 !important;
	padding-inline-start: 0 !important;
	width: 100% !important;
	box-sizing: border-box !important;
	position: relative !important;
}

/*
 * Full-bleed shells (bg). Content width lives on .e-con-boxed > .e-con-inner
 * — same as Viso 32f8653f — never kill that max-width.
 */
#menu-custom .cmsmasters-megamenu-container .elementor-205,
#menu-custom .cmsmasters-megamenu-container .elementor-41219,
#menu-custom .cmsmasters-megamenu-container .elementor-41453,
#menu-custom .cmsmasters-megamenu-container .elementor-element-f1b36d3,
#menu-custom .cmsmasters-megamenu-container .elementor-element-fe3c741,
#menu-custom .cmsmasters-megamenu-container .elementor-element-0a650b5,
#menu-custom .cmsmasters-megamenu-container .elementor-element-32f8653f,
#menu-custom .cmsmasters-megamenu-container .elementor-element-d7be13d,
#menu-custom .cmsmasters-megamenu-container .elementor-element-648413e {
	width: 100% !important;
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	box-sizing: border-box !important;
}

#menu-custom .cmsmasters-megamenu-container .elementor-element-fe3c741,
#menu-custom .cmsmasters-megamenu-container .elementor-element-0a650b5,
#menu-custom .cmsmasters-megamenu-container .elementor-element-d7be13d,
#menu-custom .cmsmasters-megamenu-container .elementor-element-648413e,
#menu-custom .cmsmasters-megamenu-container .elementor-element-32f8653f {
	padding-left: 0 !important;
	padding-right: 0 !important;
	padding-inline-start: 0 !important;
	padding-inline-end: 0 !important;
	--padding-left: 0px !important;
	--padding-right: 0px !important;
}

/* Forced close after clicking the X while the cursor is still on the item. */
#menu-custom .menu-item.xbrain-megamenu-force-closed
	> .elementor-widget-cmsmasters-nav-menu__megamenu-template-container,
#menu-custom .menu-item.xbrain-megamenu-force-closed:hover
	> .elementor-widget-cmsmasters-nav-menu__megamenu-template-container {
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

html.xbrain-megamenu-open,
html.xbrain-megamenu-open body {
	overflow: hidden !important;
	overscroll-behavior: none;
	touch-action: none;
}

body.xbrain-megamenu-open {
	position: fixed !important;
	left: 0;
	right: 0;
	width: 100%;
}

#menu-custom .xbrain-megamenu-close {
	position: absolute;
	top: -20px;
	right: -20px;
	z-index: 30;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #53555a;
	cursor: pointer;
	line-height: 1;
}

#menu-custom .xbrain-megamenu-close:hover,
#menu-custom .xbrain-megamenu-close:focus {
	color: #85754e;
	outline: none;
}

#menu-custom .xbrain-megamenu-close svg {
	width: 18px;
	height: 18px;
	display: block;
}

/*
 * Content row = .e-con-boxed > .e-con-inner
 * Viso 32f8653f / Corpo d7be13d / Tecnologie 648413e.
 */
#menu-custom .cmsmasters-megamenu-container .elementor-element-32f8653f > .e-con-inner,
#menu-custom .cmsmasters-megamenu-container .elementor-element-d7be13d > .e-con-inner,
#menu-custom .cmsmasters-megamenu-container .elementor-element-648413e > .e-con-inner {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	justify-content: space-between !important;
	align-items: flex-start !important;
	align-content: flex-start !important;
	gap: 40px !important;
	width: 100% !important;
	max-width: var(--content-width) !important;
	margin-left: auto !important;
	margin-right: auto !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	padding-inline-start: 0 !important;
	padding-inline-end: 0 !important;
	box-sizing: border-box !important;
}

/* Left column: Viso 055a913 / Corpo e2eb3c7 / Tecnologie 8f82515 */
#menu-custom .cmsmasters-megamenu-container .elementor-element-055a913,
#menu-custom .cmsmasters-megamenu-container .elementor-element-e2eb3c7,
#menu-custom .cmsmasters-megamenu-container .elementor-element-8f82515 {
	--width: 50% !important;
	flex: 0 0 50% !important;
	width: 50% !important;
	max-width: 50% !important;
	min-width: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	text-align: left;
}

#menu-custom .cmsmasters-megamenu-container .elementor-element-055a913 .e-n-tabs-heading,
#menu-custom .cmsmasters-megamenu-container .elementor-element-e2eb3c7 .e-n-tabs-heading {
	justify-content: flex-start !important;
}

#menu-custom .cmsmasters-megamenu-container .elementor-element-055a913 .e-n-tabs,
#menu-custom .cmsmasters-megamenu-container .elementor-element-055a913 .e-n-tabs-content,
#menu-custom .cmsmasters-megamenu-container .elementor-element-055a913 .elementor-widget-cmsmasters-nav-menu,
#menu-custom .cmsmasters-megamenu-container .elementor-element-e2eb3c7 .e-n-tabs,
#menu-custom .cmsmasters-megamenu-container .elementor-element-e2eb3c7 .e-n-tabs-content,
#menu-custom .cmsmasters-megamenu-container .elementor-element-e2eb3c7 .elementor-widget-cmsmasters-nav-menu {
	text-align: left;
}

/* Promo column: Viso 35c43a7 / Corpo a82a183 / Tecnologie 4443d3b */
#menu-custom .cmsmasters-megamenu-container .elementor-element-35c43a7,
#menu-custom .cmsmasters-megamenu-container .elementor-element-a82a183,
#menu-custom .cmsmasters-megamenu-container .elementor-element-4443d3b {
	position: relative !important;
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: calc(50% - 40px) !important;
	min-width: 0 !important;
	margin-left: auto !important;
	align-self: flex-start !important;
}

#menu-custom .cmsmasters-megamenu-container .elementor-element-35c43a7 img,
#menu-custom .cmsmasters-megamenu-container .elementor-element-a82a183 img,
#menu-custom .cmsmasters-megamenu-container .elementor-element-4443d3b img {
	display: block;
	max-width: 100%;
	height: auto;
	margin-bottom: 26px;
}

/*
 * Nested tabs inside megamenu:
 * 1) all tab titles flush left
 * 2) no gap between titles column and content column
 * 3) titles column flex-basis 35%
 */
#menu-custom .cmsmasters-megamenu-container .elementor-widget-n-tabs .e-n-tab-title {
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	width: fit-content !important;
}

#menu-custom .cmsmasters-megamenu-container .elementor-widget-n-tabs .e-n-tabs {
	gap: 0 !important;
}

#menu-custom .cmsmasters-megamenu-container .elementor-widget-n-tabs .e-n-tabs-heading {
	flex-basis: 35% !important;
}

#menu-custom .cmsmasters-megamenu-container .elementor-element-35c43a7 > .xbrain-megamenu-close,
#menu-custom .cmsmasters-megamenu-container .elementor-element-a82a183 > .xbrain-megamenu-close,
#menu-custom .cmsmasters-megamenu-container .elementor-element-4443d3b > .xbrain-megamenu-close,
#menu-custom .cmsmasters-megamenu-container
	> .elementor-widget-cmsmasters-nav-menu__megamenu-template-container-inner
	> .xbrain-megamenu-close {
	top: -20px;
	right: -20px;
}
