/**
 * Portale Servizi: etichetta MONDO SERVIZI + ritorno al sito principale.
 */

#masthead .site-header-item[data-section="title_tagline"],
#mobile-header .site-header-item[data-section="title_tagline"] {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 0.55rem 0.72rem;
	min-width: 0;
}

#masthead .site-header-item[data-section="title_tagline"] .site-branding,
#mobile-header .site-header-item[data-section="title_tagline"] .site-branding {
	flex: 0 0 auto;
}

.vc-mondo-servizi {
	display: inline-block;
	flex: 0 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0 0 0 0.72rem;
	border-left: 1px solid rgba(4, 69, 175, 0.28);
	color: #0445af;
	font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	font-weight: 300;
	font-size: clamp(0.68rem, 1.15vw, 0.92rem);
	letter-spacing: 0.16em;
	line-height: 1.15;
	text-transform: uppercase;
	white-space: nowrap;
	-webkit-font-smoothing: antialiased;
}

.vc-header-tools {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	min-height: 0;
	padding-inline: max(0.85rem, env(safe-area-inset-left, 0px)) max(0.75rem, env(safe-area-inset-right, 0px));
	box-sizing: border-box;
}

.vc-header-tools:has(.vc-back-to-main),
.vc-header-tools:has(.vc-mkt-quotes-cart-dock) {
	padding-top: 0.4rem;
	padding-bottom: 0.35rem;
}

.vc-back-to-main {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	margin: 0;
	padding: 0;
	pointer-events: none;
	flex: 1 1 auto;
	min-width: 0;
}

.vc-back-to-main__link {
	pointer-events: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	min-height: 36px;
	padding: 0.2rem 0.7rem 0.2rem 0.2rem;
	border-radius: 999px;
	text-decoration: none !important;
	color: #0445af !important;
	background: transparent;
	transition: background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
	-webkit-tap-highlight-color: rgba(4, 69, 175, 0.12);
}

.vc-back-to-main__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	border: 1.5px solid #0445af;
	border-radius: 12px;
	background: #ffffff;
	color: #0445af;
	box-shadow: 0 2px 8px rgba(4, 69, 175, 0.12);
}

.vc-back-to-main__icon svg {
	display: block;
}

.vc-back-to-main__text {
	font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
	font-weight: 300;
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	line-height: 1.2;
	white-space: nowrap;
	opacity: 0.92;
}

.vc-back-to-main__link:hover,
.vc-back-to-main__link:focus-visible {
	background: rgba(4, 69, 175, 0.05);
	transform: translateY(-1px);
	outline: none;
}

.vc-back-to-main__link:hover .vc-back-to-main__icon,
.vc-back-to-main__link:focus-visible .vc-back-to-main__icon {
	box-shadow: 0 4px 12px rgba(4, 69, 175, 0.18);
}

.vc-back-to-main__link:focus-visible .vc-back-to-main__icon {
	outline: 2px solid #0445af;
	outline-offset: 2px;
}

.vc-back-to-main + .vc-mkt-auth-cta-bar {
	padding-top: 0.2rem;
}

.vc-header-tools .vc-mkt-quotes-cart-dock {
	position: relative !important;
	width: auto;
	margin: 0;
	padding: 0;
	flex: 0 0 auto;
	align-self: center;
	z-index: 40;
}

.vc-header-tools:not(:has(.vc-back-to-main)) {
	justify-content: flex-end;
}

.vc-header-tools:not(:has(.vc-back-to-main)):not(:has(.vc-mkt-quotes-cart-dock)) {
	display: none;
}

@media (min-width: 1025px) {
	.vc-header-tools .vc-mkt-quotes-cart-dock {
		position: relative !important;
		top: auto !important;
		right: auto !important;
		left: auto !important;
		width: auto;
		z-index: 40;
	}

	/* Logo + MONDO SERVIZI: niente titolo sito nero */
	#main-header .site-title-wrap,
	#main-header .site-title {
		display: none !important;
	}

	body.home .vc-header-tools:has(.vc-back-to-main) {
		padding-top: 0.2rem;
		padding-bottom: 0;
	}

	body.home .content-area {
		margin-top: 0 !important;
	}

	body.home .entry-content-wrap {
		padding-top: 0.35rem !important;
	}
}

.vc-header-tools .vc-mkt-quotes-cart.is-compact .vc-mkt-quotes-cart__btn {
	width: 36px;
	min-width: 36px;
	min-height: 36px;
	height: 36px;
}

.vc-header-tools .vc-mkt-quotes-cart.is-compact .vc-mkt-quotes-cart__icon,
.vc-header-tools .vc-mkt-quotes-cart.is-compact .vc-mkt-quotes-cart__icon svg {
	width: 18px;
	height: 18px;
}

@media (max-width: 1024px) {
	#mobile-header .site-header-main-section-left {
		max-width: calc(100% - 52px);
	}

	.vc-mondo-servizi {
		font-size: clamp(0.64rem, 2.8vw, 0.78rem);
		letter-spacing: 0.13em;
		padding-left: 0.5rem;
	}

	.vc-back-to-main__text {
		font-size: 0.72rem;
	}

	.vc-header-tools .vc-mkt-quotes-cart-dock {
		top: auto !important;
		right: auto !important;
		left: auto !important;
	}

	.vc-header-tools .vc-mkt-quotes-cart-dock .vc-mkt-quotes-cart__panel {
		left: auto;
		right: 0;
	}
}

@media (max-width: 420px) {
	.vc-mondo-servizi {
		white-space: normal;
		max-width: 7.2rem;
		letter-spacing: 0.1em;
		line-height: 1.2;
	}

	.vc-back-to-main__text {
		letter-spacing: 0.03em;
		font-size: 0.68rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vc-back-to-main__link {
		transition: none;
	}
}
