/**
 * Keep the header above page content that carries its own high z-index
 * (for example the absolute yellow card on the Custom Service page).
 */
header.mxp-hdr {
	z-index: 1000 !important;
}

/**
 * Header fixes for user-added custom content (shortcodes / templates).
 *
 * GTranslate's floating switcher renders its language list in normal flow.
 * Inside the header's flex row that grows the widget and re-centres it, so
 * the trigger jumps up and the list opens over the header instead of below
 * the trigger. Anchor the list below the switcher as an overlay instead.
 */

.mxp-hdr .gtranslate_wrapper .gt_float_switcher {
	position: relative;
}

.mxp-hdr .gtranslate_wrapper .gt_float_switcher .gt_options {
	position: absolute !important;
	top: 100% !important;
	left: auto !important;
	right: 0 !important;
	width: max-content !important;
	min-width: 100% !important;
	z-index: 9999 !important;
	background: #fff !important;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18) !important;
}

.mxp-hdr .gtranslate_wrapper .gt_float_switcher .gt_options a {
	white-space: nowrap;
}

@media (max-width: 900px) {
	/* Keep the language and currency switchers compact in the free header area. */
	header.mxp-hdr .mxp-hdr__custom--after_icons {
		position: absolute;
		left: calc(50% - 4px);
		top: 50%;
		z-index: 5;
		display: flex !important;
		align-items: center;
		gap: 2px;
		margin: 0;
		transform: translate(-50%, -50%);
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .gtranslate_wrapper,
	header.mxp-hdr .mxp-hdr__custom--after_icons .divisero-switcher {
		margin: 0;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .gt_float_switcher {
		width: auto !important;
		background: transparent !important;
		box-shadow: none !important;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .gt-selected {
		background: transparent !important;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .gt-current-lang {
		padding: 4px 3px !important;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .gt-lang-code,
	header.mxp-hdr .mxp-hdr__custom--after_icons .gt_float_switcher-arrow {
		display: none !important;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .gt_float_switcher img {
		width: 22px !important;
		margin: 0 !important;
	}

	/* Keep option labels readable inside the compact trigger. */
	header.mxp-hdr .mxp-hdr__custom--after_icons .gt_float_switcher .gt_options a,
	header.mxp-hdr .mxp-hdr__custom--after_icons .gt_float_switcher .gt_options a:visited {
		color: #222 !important;
		font-size: 14px !important;
		line-height: 1.4 !important;
		text-decoration: none !important;
	}

	/* Compact trigger: centre the language list instead of right-aligning it
	   off the left edge of the screen. */
	header.mxp-hdr .mxp-hdr__custom--after_icons .gt_float_switcher .gt_options {
		left: 50% !important;
		right: auto !important;
		width: 258px !important;
		max-width: calc(100vw - 24px) !important;
		margin-left: -129px !important;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .divisero-switcher {
		display: flex;
		align-items: center;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .divisero-switcher__select {
		width: 54px !important;
		min-width: 54px !important;
		max-width: 54px !important;
		height: 26px !important;
		padding: 0 12px 0 3px !important;
		border: 0 !important;
		background-color: transparent !important;
		background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
		background-repeat: no-repeat !important;
		background-position: right 1px center !important;
		background-size: 8px 5px !important;
		color: #fff !important;
		font-size: 10px !important;
	}

	/* The currency plugin prints an ID-based !important arrow; match its
	   specificity so the compact transparent select gets a white arrow. */
	body #page header.mxp-hdr .mxp-hdr__custom--after_icons .divisero-switcher__select {
		background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .divisero-switcher__select option {
		background: #fff !important;
		color: #111 !important;
	}

	header.mxp-hdr .mxp-hdr__custom--after_icons .divisero-switcher__go {
		display: none !important;
	}
}

@media (max-width: 600px) {
	header.mxp-hdr .mxp-hdr__right {
		gap: 6px;
	}
}

@media (max-width: 420px) {
	header.mxp-hdr .mxp-hdr__logo img {
		width: 95px !important;
	}
}
