/**
 * AXION — Seletor de Idioma
 *
 * Conversão pixel-perfect do seletor de idioma do Navbar.tsx original:
 *   Desktop -> Navbar.tsx:216-249 (botão + dropdown)
 *   Mobile  -> Navbar.tsx:311-332 (bloco "LANGUAGE" com botões lado a lado)
 *
 * Equivalências das classes Tailwind do original:
 *   flex items-center gap-1.5=6px · px-3 py-2=12px/8px · rounded-lg=8px
 *   text-sm=14/20 · font-medium=500 · font-semibold=600
 *   w-3.5 h-3.5=14px (ChevronDown) · w-4 h-4=16px
 *   mt-2=8px · w-36=144px · rounded-xl=12px · shadow-xl · border-gray-100=#f3f4f6
 *   px-4 py-3=16px/12px · bg-orange-50=#fff7ed · text-orange-600=#ea580c
 *   text-gray-700=#374151 · hover:bg-gray-50=#f9fafb
 *   border-gray-200=#e5e7eb · hover:border-orange-300=#fdba74
 *   hover:text-orange-600=#ea580c · border-white/30 · border-white/60 · bg-white/10
 *   text-xs=12/16 · text-gray-400=#9ca3af · uppercase tracking-wider=0.05em
 *   gap-2=8px · border-orange-400=#fb923c · text-gray-600=#4b5563
 *
 * Tudo isolado sob .axion-lang; nenhuma classe global, sem :has(), sem
 * !important, sem depender do tema ou de outro widget.
 */

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

.axion-lang {
	position: relative;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* aviso exibido só no editor quando o TranslatePress não está disponível */
.axion-lang__notice {
	margin: 0;
	padding: 10px 14px;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	background: #f9fafb;
	color: #6b7280;
	font-size: 13px;
	line-height: 1.5;
	font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* =====================================================================
 * BANDEIRAS — comuns aos dois presets
 * ==================================================================== */

.axion-lang__flag {
	display: inline-flex;
	flex: 0 0 auto;
	line-height: 0;
}

.axion-lang__flag-svg {
	display: block;
	width: 20px;
	height: 15px;
	border-radius: 2px; /* rounded-sm do original */
}

.axion-lang__flag-svg--fallback {
	border-radius: 0;
}

/* =====================================================================
 * PRESET DESKTOP — botão + dropdown (Navbar.tsx:216-249)
 * ==================================================================== */

.axion-lang--desktop {
	display: inline-block;
}

.axion-lang__button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background-color: #ffffff;
	color: #374151;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.axion-lang__button:hover,
.axion-lang__button:focus-visible {
	color: #ea580c;
	border-color: #fdba74;
}

.axion-lang__button:focus-visible {
	outline: 2px solid #fdba74;
	outline-offset: 2px;
}

.axion-lang__code {
	font-weight: 600; /* font-semibold no <span> do código, dentro do botão */
}

.axion-lang__chevron {
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

/* seta gira 180° quando o dropdown está aberto */
.axion-lang__button[aria-expanded="true"] .axion-lang__chevron {
	transform: rotate(180deg);
}

/* Variante sobre fundo transparente (hero), espelhando o header original
   antes do scroll: texto branco, borda translúcida. */
.axion-lang--transparent .axion-lang__button {
	background-color: transparent;
	border-color: rgba(255, 255, 255, 0.3);
	color: #ffffff;
}

.axion-lang--transparent .axion-lang__button:hover,
.axion-lang--transparent .axion-lang__button:focus-visible {
	background-color: rgba(255, 255, 255, 0.1);
	border-color: rgba(255, 255, 255, 0.6);
	color: #ffffff;
}

/* ---- dropdown ---------------------------------------------------- */

.axion-lang__dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 50;
	margin-top: 8px;
	width: 144px;
	overflow: hidden;
	background-color: #ffffff;
	border: 1px solid #f3f4f6;
	border-radius: 12px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.axion-lang__dropdown[hidden] {
	display: none;
}

.axion-lang__option {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 12px 16px;
	background: none;
	border: 0;
	color: #374151;
	font-size: 14px;
	line-height: 20px;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.axion-lang__option:hover:not(.axion-lang__option--active) {
	background-color: #f9fafb;
}

.axion-lang__option--active {
	background-color: #fff7ed;
	color: #ea580c;
	font-weight: 600;
}

/* =====================================================================
 * PRESET MOBILE — bloco "LANGUAGE" (Navbar.tsx:311-332)
 * ==================================================================== */

.axion-lang--mobile {
	width: 100%;
}

.axion-lang-mobile__title {
	display: flex;
	align-items: center;
	gap: 6px; /* gap-1.5 */
	margin: 0 0 8px;
	color: #9ca3af;
	font-size: 12px;
	line-height: 16px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.axion-lang-mobile__title svg {
	display: block;
	width: 14px;
	height: 14px;
	flex: 0 0 auto;
}

.axion-lang-mobile__options {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.axion-lang-mobile__option {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background-color: transparent;
	color: #4b5563;
	font-size: 14px;
	line-height: 20px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.axion-lang-mobile__option:hover:not(.axion-lang-mobile__option--active) {
	border-color: #d1d5db;
}

.axion-lang-mobile__option--active {
	border-color: #fb923c;
	background-color: #fff7ed;
	color: #ea580c;
}

/* Respeita quem prefere menos movimento. */
@media (prefers-reduced-motion: reduce) {
	.axion-lang__button,
	.axion-lang__chevron,
	.axion-lang__option,
	.axion-lang-mobile__option {
		transition: none;
	}
}
