/* AvalosCPA Language Switcher — custom dropdown + hidden Google combo */

.avaloscpa-lang-switcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	box-sizing: border-box;
	max-width: 100%;
	/* Fallback readable bg if Elementor bg is empty (dark headers) */
	background-color: #ffffff;
	font: inherit;
	color: #10243a;
}

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

/* Hide Google's gadget UI (branding + native select); keep in DOM for JS.
   display:none is safe: combo.value + change still work. */
.avaloscpa-lang-switcher .avaloscpa-lang-switcher__target {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

.avaloscpa-lang-switcher .goog-te-gadget,
.avaloscpa-lang-switcher .goog-te-gadget-simple,
.avaloscpa-lang-switcher .skiptranslate {
	display: none !important;
	font: inherit;
	color: inherit;
}

/* Custom toggle */
.avaloscpa-lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	line-height: 1.2;
	cursor: pointer;
	text-align: left;
	appearance: none;
	-webkit-appearance: none;
}

.avaloscpa-lang-switcher__toggle:focus {
	outline: none;
}

.avaloscpa-lang-switcher__toggle:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.avaloscpa-lang-switcher__flag,
.avaloscpa-lang-switcher__caret {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	line-height: 1;
	user-select: none;
	-webkit-user-select: none;
}

.avaloscpa-lang-switcher__label {
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.avaloscpa-lang-switcher__caret {
	transition: transform 0.15s ease;
	font-size: 0.65em;
	opacity: 0.75;
}

.avaloscpa-lang-switcher.is-open .avaloscpa-lang-switcher__caret {
	transform: rotate(180deg);
}

/* Dropdown panel */
.avaloscpa-lang-switcher__menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 30;
	min-width: 100%;
	margin: 0;
	padding: 4px;
	list-style: none;
	background-color: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(16, 36, 58, 0.12);
	display: none;
	/* "all languages" mode can be 100+ entries */
	max-height: min(60vh, 420px);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.avaloscpa-lang-switcher.is-open .avaloscpa-lang-switcher__menu {
	display: block;
}

.avaloscpa-lang-switcher__option {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 6px;
	color: #10243a;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
}

.avaloscpa-lang-switcher__option:hover,
.avaloscpa-lang-switcher__option:focus {
	background-color: #f3f4f6;
	outline: none;
}

.avaloscpa-lang-switcher__option.is-active {
	font-weight: 600;
	background-color: #eef2f7;
}

.avaloscpa-lang-switcher__option-flag {
	flex-shrink: 0;
	line-height: 1;
}

/* Editor placeholder select (no Google) */
.avaloscpa-lang-switcher--preview .avaloscpa-lang-switcher__target {
	position: static !important;
	width: auto !important;
	height: auto !important;
	margin: 0 !important;
	overflow: visible !important;
	clip: auto !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

.avaloscpa-lang-switcher--preview .goog-te-combo {
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
	border: none !important;
	outline: none;
	background: transparent;
	font: inherit;
	color: inherit;
	cursor: default;
	padding: 0;
	margin: 0;
	max-width: 100%;
	height: auto;
}

.avaloscpa-lang-switcher--preview .avaloscpa-lang-switcher__toggle,
.avaloscpa-lang-switcher--preview .avaloscpa-lang-switcher__menu {
	display: none !important;
}

/* Legacy: if an old SIMPLE link gadget ever appears, keep it readable */
.avaloscpa-lang-switcher .goog-te-gadget-simple > a,
.avaloscpa-lang-switcher a.VIpgJd-ZVi9od-xl07Ob-lTBxed {
	color: inherit;
	font: inherit;
	text-decoration: none;
}
