/* Componente navbar: estensione separata per mantenere intatto style.css. */
html.theme-sc .site-header-nav {
	position: relative;
	z-index: 2;
}

html.theme-sc .sc-header {
	position: relative;
	z-index: 1080;
	overflow: visible;
	/* Un filtro sull'antenato trasformerebbe il fixed dell'offcanvas in un
	   elemento alto quanto l'header anziche quanto la viewport. */
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
}

html.theme-sc .site-header-offcanvas {
	position: fixed !important;
	inset: 0 0 0 auto !important;
	display: flex;
	flex-direction: column;
	width: min(88vw, 420px);
	height: 100vh !important;
	height: 100dvh !important;
	max-height: none !important;
	background-color: #fff !important;
	z-index: 1080;
}

html.theme-sc .site-header-offcanvas-header {
	flex: 0 0 auto;
}

html.theme-sc .site-header-offcanvas + .offcanvas-backdrop,
html.theme-sc .offcanvas-backdrop {
	z-index: 1070;
}

html.theme-sc .site-header-offcanvas-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

html.theme-sc .site-header-mobile-menu {
	width: 100%;
	padding-bottom: 2rem;
}

html.theme-sc .site-header-mobile-menu-link {
	display: block;
	width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
}

@media (min-width: 992px) {
	html.theme-sc .site-header-desktop,
	html.theme-sc .site-header-container,
	html.theme-sc .site-header-inner {
		position: static;
	}

	html.theme-sc .header-dropdown {
		position: static;
	}

	html.theme-sc .header-mega-menu {
		left: 50% !important;
		right: auto !important;
		top: 100%;
		width: 100vw;
		max-width: 100vw;
		margin: 0 !important;
		padding: clamp(1.25rem, 3vw, 2.5rem) max(1.5rem, calc((100vw - 1320px) / 2));
		border: 0;
		border-top: 1px solid rgba(19, 68, 133, 0.1);
		border-radius: 0 !important;
		box-shadow: 0 18px 36px rgba(13, 32, 56, 0.14);
		transform: translateX(-50%) !important;
		max-height: calc(100vh - 90px);
		overflow-x: hidden;
		overflow-y: auto;
		z-index: 1075;
	}

	html.theme-sc .header-mega-menu.show {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
		align-items: start;
		gap: 0.5rem 1.5rem;
	}

	html.theme-sc .header-mega-menu > li {
		min-width: 0;
	}

	html.theme-sc .header-mega-menu > li > a {
		width: 100%;
		padding: 0.8rem 1rem;
		border-radius: 0.65rem;
		white-space: normal;
		line-height: 1.3;
	}

	html.theme-sc .header-mega-menu > li > a:hover,
	html.theme-sc .header-mega-menu > li > a:focus,
	html.theme-sc .header-mega-menu > li > a.active {
		background: rgba(19, 68, 133, 0.08);
	}
}

@media (max-width: 991.98px) {
	html.theme-sc .header-mega-menu,
	html.theme-sc .header-mega-panel,
	html.theme-sc .header-flyout-menu {
		position: static !important;
		width: 100%;
		max-width: 100%;
		margin: 0;
		transform: none !important;
		box-shadow: none;
		border: 0;
		overflow-wrap: anywhere;
	}
}
