/*
 * Language switcher (Kudezign Studio Translate).
 *
 * The switcher lives in the Divi Theme Builder header. Colours, size, flag
 * size and corner radius come from CSS custom properties printed by
 * Kudezign Studio > Translate > Language switcher.
 */

/* Keep the Global Header, and its switcher dropdown, above page sections. */
.et-l--header {
	position: relative;
	z-index: 9999 !important;
}

.kz-lang {
	position: relative;
	z-index: 20;
	display: inline-flex;
	align-items: center;
	margin: 0;
	padding: 0;
	opacity: 1;
	font-family: inherit;
	font-size: var(--kz-lang-size, 14px);
	line-height: 1;
	box-sizing: border-box;
}

/* Header switcher stays above the header mega menu overlay (z-index 9990). */
.kz-lang--header {
	z-index: 10001;
}

.kz-lang *,
.kz-lang *::before,
.kz-lang *::after {
	box-sizing: border-box;
}

.kz-lang--header .kz-lang__menu {
	position: relative;
}

.kz-lang--header .kz-lang__current {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.2em;
	min-height: 0;
	padding: 0.15em 0.1em;
	cursor: pointer;
	list-style: none;
	color: inherit;
	background: transparent;
	border-radius: 4px;
	box-shadow: none;
	user-select: none;
	white-space: nowrap;
	opacity: 0.8;
}

.kz-lang--header .kz-lang__current::-webkit-details-marker {
	display: none;
}

.kz-lang--header .kz-lang__current::after {
	content: "";
	width: 0;
	height: 0;
	border-left: 3.5px solid transparent;
	border-right: 3.5px solid transparent;
	border-top: 5px solid currentColor;
	opacity: 0.7;
}

.kz-lang--header .kz-lang__menu[open] > .kz-lang__current,
.kz-lang--header .kz-lang__current:hover,
.kz-lang--header .kz-lang__current:focus-visible {
	color: inherit;
	background: transparent;
	opacity: 1;
}

.kz-lang--header .kz-lang__list {
	position: absolute;
	top: calc(100% + 0.45em);
	left: 0;
	right: auto;
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	margin: 0;
	padding: 0.35em;
	min-width: max-content;
	list-style: none;
	color: var(--kz-lang-fg, #fff);
	background: var(--kz-lang-bg, #1f1d2b);
	border-radius: var(--kz-lang-radius, 12px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	z-index: 10002;
}

.kz-lang--header .kz-lang__list > li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kz-lang--header .kz-lang__list a {
	display: flex;
	align-items: center;
	gap: 0.5em;
	min-height: 40px;
	padding: 0.45em 0.65em;
	color: inherit;
	text-decoration: none;
	border-radius: calc(var(--kz-lang-radius, 12px) - 4px);
	background: transparent;
	opacity: 0.7;
	white-space: nowrap;
	transition: opacity 0.18s ease, background 0.18s ease;
}

.kz-lang--header .kz-lang__list a:hover,
.kz-lang--header .kz-lang__list a:focus-visible,
.kz-lang--header .kz-lang__list a[aria-current="true"] {
	background: rgba(255, 255, 255, 0.12);
	opacity: 1;
}

.kz-lang--header .kz-lang__list a[aria-current="true"] {
	color: var(--kz-lang-accent, #c7ccea);
	font-weight: 600;
}

.kz-lang--header a:focus-visible,
.kz-lang--header summary:focus-visible {
	outline: 2px solid var(--kz-lang-accent, #c7ccea);
	outline-offset: 2px;
}

.kz-lang--header .kz-lang__flag {
	display: block;
	width: auto;
	height: calc(var(--kz-lang-flag-size, 24px) * 1.05);
	flex: 0 0 auto;
	object-fit: contain;
}

@media (max-width: 600px) {
	.kz-lang {
		font-size: var(--kz-lang-size-mobile, 12px);
	}

	.kz-lang--header .kz-lang__flag {
		height: calc(var(--kz-lang-flag-size-mobile, 20px) * 1.05);
	}

	.kz-lang--header .kz-lang__list a {
		min-height: 38px;
		padding: 0.4em 0.6em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kz-lang,
	.kz-lang * {
		transition: none !important;
	}
}
