/**
 * Vemax Company - Addon — Seletor de Idioma.
 * Replica o LanguageSelector.tsx do site original.
 */

.vemax-lang {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 16px;
	width: 100%;
}

/* ---------- Separadores ---------- */

.vemax-lang__separator {
	display: block;
	flex: 0 0 auto;
	width: 1px;
	height: 20px;
	background-color: rgba(255, 255, 255, 0.15);
}

.vemax-lang__wrap {
	position: relative;
	display: inline-block;
}

/* ---------- Botão (bandeira atual + seta) ---------- */

.vemax-lang__toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 64px;
	height: 40px;
	min-width: 64px;
	min-height: 40px;
	max-width: 64px;
	max-height: 40px;
	/* O reset do tema aplica padding/border em <button>: controlamos
	   aqui para que o botão fique exatamente 64x40 com 6px à direita. */
	padding: 0 6px 0 0;
	border: 0;
	flex: 0 0 auto;
	box-sizing: border-box;
	line-height: 0;
	font-size: 0;
	border-radius: 6px;
	background-color: transparent;
	overflow: hidden;
	cursor: pointer;
	transition-property: background-color;
	transition-duration: 200ms;
	transition-timing-function: ease;
	-webkit-tap-highlight-color: transparent;
}

.vemax-lang__toggle:hover,
.vemax-lang__toggle:focus-visible {
	background-color: rgba(255, 255, 255, 0.1);
}

/* Nada pode cobrir a bandeira do botão. */
.vemax-lang__toggle::before,
.vemax-lang__toggle::after {
	content: none !important;
	display: none !important;
}

/* A bandeira do idioma atual. As dimensões também são emitidas pelo
   controle "Tamanho do botão" do Elementor, cujo CSS carrega depois
   deste arquivo e precisa vencer o reset img{height:auto} do tema. */
.vemax-lang__toggle img,
.vemax-lang__current-flag {
	width: 40px;
	height: 40px;
	object-fit: cover;
	object-position: center center;
	border-radius: 6px;
	display: block;
	position: relative;
	z-index: 1;
	/* Exibida no tamanho nativo de 40x40 do arquivo original,
	   sem compressão, filtro ou blur de qualquer tipo. */
	max-width: none;
	max-height: none;
	min-width: 0;
	min-height: 0;
	filter: none;
	opacity: 1;
	flex: 0 0 auto;
}

/* ---------- Seta (Chevron Down) ---------- */

.vemax-lang__chevron {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	color: rgba(255, 255, 255, 0.7);
	line-height: 0;
	transition: transform 200ms ease;
}

.vemax-lang__chevron svg {
	width: 14px;
	height: 14px;
	display: block;
}

/* Gira 180 graus quando o dropdown está aberto. */
.vemax-lang__toggle[aria-expanded="true"] .vemax-lang__chevron {
	transform: rotate(180deg);
}

/* ---------- Dropdown ---------- */

.vemax-lang__menu {
	position: absolute;
	top: 100%;
	margin-top: 8px;
	min-width: 140px;
	background-color: #071123;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 8px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	z-index: 50;
}

.vemax-lang__menu[hidden] {
	display: none;
}

.vemax-lang__menu--right {
	right: 0;
}

.vemax-lang__menu--left {
	left: 0;
}

/* ---------- Itens ---------- */

.vemax-lang__item {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	background-color: transparent;
	transition-property: background-color, color;
	transition-duration: 150ms;
	transition-timing-function: ease;
}

.vemax-lang__item:hover,
.vemax-lang__item:focus-visible {
	background-color: rgba(255, 255, 255, 0.05);
	color: #ffffff;
}

.vemax-lang__item--current {
	background-color: rgba(255, 194, 0, 0.15);
	color: #ffc200;
}

.vemax-lang__flag {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center center;
	flex: 0 0 auto;
	display: block;
	max-width: none;
	filter: none;
}

.vemax-lang__label {
	white-space: nowrap;
}

/* ---------- Acessibilidade ---------- */

.vemax-lang .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.vemax-lang__toggle:focus-visible,
.vemax-lang__item:focus-visible {
	outline: 2px solid #ffc200;
	outline-offset: -2px;
}

@media (prefers-reduced-motion: reduce) {
	.vemax-lang__toggle,
	.vemax-lang__item,
	.vemax-lang__chevron {
		transition: none;
	}
}

/* ---------- Sticky do Elementor ----------
   O Elementor clona o cabeçalho dentro de .elementor-sticky__spacer para
   reservar a altura. Essa cópia não pode exibir uma segunda bandeira nem
   capturar cliques. O spacer e sua altura são preservados. */

.elementor-sticky__spacer .vemax-lang,
.elementor-sticky__spacer .vemax-lang * {
	visibility: hidden !important;
	pointer-events: none !important;
}
