/* ================================================================
   SIPA Mega Menu Prodotti — desktop fixed-overlay
   Visible only on desktop (> 1200px). Mobile uses the off-canvas.
   ================================================================ */

#sipa-products-megamenu {
	position: fixed;
	top: var(--sipa-megamenu-top, 100px); /* JS sets exact value */
	bottom: 0;                             /* sempre fino al fondo del viewport */
	left: 0;
	width: 100%;
	z-index: 9998; /* below header z-index 9999 */
	background: #fff;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
	font-family: "Work Sans", sans-serif;
}

/* Hidden via HTML [hidden] attribute; JS removes it to open */
#sipa-products-megamenu[hidden] {
	display: none;
}

/* Inner wrapper: sempre tre colonne (sinistra + divisore + destra) */
.sipa-megamenu__inner {
	display: grid;
	grid-template-columns: 1fr 1px 1.4fr;
	align-items: stretch;
	height: 100%;
	max-width: 1400px;
	margin: 0;
	padding: 0 100px;
}

/* ----------------------------------------------------------------
   Left panel
   ---------------------------------------------------------------- */

.sipa-megamenu__left {
	overflow-y: auto;
	height: 100%;
	padding: 180px 40px 40px 0;
	-webkit-overflow-scrolling: touch;
}

.sipa-megamenu__parent-group {
	position: relative;
	margin-bottom: 55px;
	width: 100%;
}

.sipa-megamenu__parent-group:last-child {
	margin-bottom: 0;
}

.sipa-megamenu__parent-title {
	display: block;
	position: relative;
	color: #000;
	font-family: "Work Sans", sans-serif;
	font-size: 29px !important;
	font-style: normal;
	font-weight: 600 !important;
	line-height: normal;
	text-decoration: none;
	margin-bottom: 20px;
	width: fit-content;
}

.sipa-megamenu__parent-group::after {
	content: '';
	display: inline-block;
	position: absolute;
	top: 8px;
	right: 0;
	width: 20px;
	height: 20px;
	margin-left: 10px;
	background: url('/wp-content/uploads/2026/04/next-arrow-sipa.svg') center / contain no-repeat;
	opacity: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.sipa-megamenu__parent-group:has(.sipa-megamenu__parent-title:hover)::after {
	opacity: 1;
}

.sipa-megamenu__parent-title::before {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 1px;
	background-color: #000;
	transform: scaleX(0);
	transition: transform 0.2s ease;
	transform-origin: left;
}

.sipa-megamenu__parent-title:hover::before,
.sipa-megamenu__parent-title:focus::before {
	transform: scaleX(1);
}

.sipa-megamenu__children {
	list-style: none;
	margin: 0;
	padding: 0;
	width: fit-content;
}

.sipa-megamenu__children li:not(:last-child) {
	margin-bottom: 0;
}

/* Reset completo: sovrascrive gli stili globali button di tema/WooCommerce/Elementor */
#sipa-products-megamenu .sipa-megamenu__child-link {
	display: block;
	position: relative;
	text-align: left;
	width: fit-content;
	background: none !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	margin: 10px 0 !important;
	padding: unset !important;
	color: #000 !important;
	font-family: "Work Sans", sans-serif !important;
	font-size: 18px !important;
	font-style: normal !important;
	font-weight: 400 !important;
	line-height: normal !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: none !important;
}

#sipa-products-megamenu .sipa-megamenu__child-link::before {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 1px;
	background-color: #000;
	transform: scaleX(0);
	transition: transform 0.2s ease;
	transform-origin: left;
}

#sipa-products-megamenu .sipa-megamenu__child-link:hover,
#sipa-products-megamenu .sipa-megamenu__child-link:focus,
#sipa-products-megamenu .sipa-megamenu__child-link.is-active,
#sipa-products-megamenu .sipa-megamenu__child-link[aria-pressed="true"] {
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	text-decoration: none !important;
	font-weight: 600 !important;
	color: #000 !important;
}

#sipa-products-megamenu .sipa-megamenu__child-link:hover::before,
#sipa-products-megamenu .sipa-megamenu__child-link:focus::before,
#sipa-products-megamenu .sipa-megamenu__child-link.is-active::before,
#sipa-products-megamenu .sipa-megamenu__child-link[aria-pressed="true"]::before {
	transform: scaleX(1) !important;
}

/* ----------------------------------------------------------------
   Vertical divider — nascosto finché pannello destro non è aperto
   ---------------------------------------------------------------- */

.sipa-megamenu__divider {
	display: block;
	background-color: #000;
	width: 1px;
	align-self: stretch;
}

/* ----------------------------------------------------------------
   Right panel — nascosto finché non si clicca su una sottocategoria
   ---------------------------------------------------------------- */

.sipa-megamenu__right {
	display: none;
}

.sipa-megamenu.is-panel-open .sipa-megamenu__right {
	display: block;
	overflow-y: auto;
	height: 100%;
	padding: 180px 0 40px 50px;
	-webkit-overflow-scrolling: touch;
	transition: opacity 0.15s ease;
}

.sipa-megamenu__right.is-loading {
	opacity: 0.4;
	pointer-events: none;
}

.sipa-megamenu__view-all {
	display: block;
	position: relative;
	color: #000;
	font-family: "Work Sans", sans-serif;
	font-size: 23px !important;
	font-style: normal;
	font-weight: 600 !important;
	line-height: normal;
	text-decoration: none;
	margin-bottom: 20px;
	width: fit-content;
}

.sipa-megamenu__view-all::before {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 1px;
	background-color: #000;
	transform: scaleX(0);
	transition: transform 0.2s ease;
	transform-origin: left;
}

.sipa-megamenu__view-all:hover::before,
.sipa-megamenu__view-all:focus::before {
	transform: scaleX(1);
}

.sipa-megamenu__products {
	list-style: none;
	margin: 0;
	padding: 0;
	width: fit-content;
}

.sipa-megamenu__products li {
	width: fit-content;
}

.sipa-megamenu__product-link {
	display: block;
	position: relative;
	color: #000 !important;
	font-family: "Work Sans", sans-serif;
	font-size: 18px !important;
	font-style: normal;
	font-weight: 400 !important;
	line-height: normal !important;
	text-decoration: none;
	padding: 5px 0;
}

.sipa-megamenu__product-link::before {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 1px;
	background-color: #000;
	transform: scaleX(0);
	transition: transform 0.2s ease;
	transform-origin: left;
}

.sipa-megamenu__product-link:hover::before,
.sipa-megamenu__product-link:focus::before {
	transform: scaleX(1);
}

/* ----------------------------------------------------------------
   Tablet / mobile: the desktop overlay is hidden entirely.
   Mobile uses the existing off-canvas [sipa_mega_menu_prodotti].
   ---------------------------------------------------------------- */

@media (max-width: 1200px) {
	#sipa-products-megamenu {
		display: none !important;
	}
}
