/*
 * Header language switcher — self-contained on purpose (not part of the
 * theme's webpack/SCSS build, which needs `npm install` first here and
 * isn't built in this environment).
 *
 * Colors/type deliberately reuse the theme's own existing header language
 * instead of inventing a new one:
 *  - trigger matches .header__nav-list a (plain, white, 500 weight, 1rem)
 *  - dropdown panel matches .side_menu's own recipe (dark-purple bg,
 *    purple text, white for the "current" item)
 *  - hover accent is $purple (#bd92f8), same variable the rest of the
 *    header already hovers/accents with (buttons, .side_menu__nav a, the
 *    bottom nav line)
 *  - radius (0.5rem) matches .button's border-radius
 */
.lang-switcher {
	position: relative;
	font-family: "Inter", sans-serif;
	flex-shrink: 0; /* never let .header__menu's flex row squeeze this — a longer code (EN_US) needs its full width */
}

.lang-switcher__current {
	display: flex;
	align-items: center;
	gap: 0.375rem;
	background: none;
	border: none;
	padding: 0;
	color: #fff;
	font-weight: 500;
	font-size: 1rem;
	line-height: 1.5rem;
	cursor: pointer;
	transition: color 0.3s ease;
	white-space: nowrap;
}

.lang-switcher__current:hover,
.lang-switcher.is-open .lang-switcher__current {
	color: #bd92f8;
}

.lang-switcher__flag {
	flex-shrink: 0;
}

.lang-switcher__flag img {
	display: block;
	width: 1.125rem;
	height: auto;
	border-radius: 2px;
}

.lang-switcher__code {
	letter-spacing: 0.02em;
	flex-shrink: 0;
}

.lang-switcher__arrow {
	transition: transform 0.3s ease;
	flex-shrink: 0;
}

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

.lang-switcher__list {
	position: absolute;
	top: calc(100% + 0.75rem);
	right: 0;
	min-width: 6.5rem;
	margin: 0;
	padding: 0.5rem;
	list-style: none;
	background: #292a39; /* $dark-purple */
	border-radius: 0.5rem;
	box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
	z-index: 200;
}

.lang-switcher.is-open .lang-switcher__list {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.lang-switcher__link {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.625rem;
	border-radius: 0.375rem;
	color: #fff;
	font-size: 0.875rem;
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.3s ease;
}

.lang-switcher__link:hover {
	color: #bd92f8; /* $purple — matches .side_menu__nav a hover */
}

.lang-switcher__item.is-current .lang-switcher__link {
	color: #fff; /* matches .side_menu li.current-menu-item a */
	font-weight: 500;
}

.lang-switcher__link[data-no-translation="1"] {
	opacity: 0.55;
}

@media (max-width: 767px) {
	.lang-switcher__code {
		display: none;
	}
}
