/**
 * EHERO Woo Multilang — front-end language switcher.
 * Self-contained styles. Does not depend on the active theme.
 */

.ehero-lang-switcher {
	position: relative !important;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.4;
	margin: 0;
	padding: 0;
	vertical-align: middle;
}

.ehero-lang-switcher * {
	box-sizing: border-box;
}

.ehero-lang-switcher__menu {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.ehero-lang-switcher__item {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.ehero-lang-switcher__item a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	text-decoration: none !important;
	color: inherit;
	border: 1px solid transparent;
	border-radius: 4px;
	transition: background-color 0.15s ease, border-color 0.15s ease;
	line-height: 1.2;
}

.ehero-lang-switcher__item a:hover,
.ehero-lang-switcher__item a:focus {
	background-color: rgba(0, 0, 0, 0.05);
	border-color: rgba(0, 0, 0, 0.08);
	text-decoration: none !important;
}

.ehero-lang-switcher__item.is-current a {
	font-weight: 600;
	background-color: rgba(0, 124, 186, 0.1);
	border-color: rgba(0, 124, 186, 0.25);
}

.ehero-lang-switcher__flag {
	font-size: 16px;
	line-height: 1;
	display: inline-block;
	font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji",
		"Segoe UI Symbol", sans-serif;
	flex-shrink: 0;
}

.ehero-lang-switcher__label {
	white-space: nowrap;
}

/* ==================== Dropdown ==================== */
.ehero-lang-switcher--dropdown .ehero-lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	font: inherit;
	color: inherit;
	cursor: pointer;
	line-height: 1.2;
}

.ehero-lang-switcher--dropdown .ehero-lang-switcher__toggle:hover,
.ehero-lang-switcher--dropdown .ehero-lang-switcher__toggle:focus {
	border-color: rgba(0, 0, 0, 0.3);
	outline: none;
}

.ehero-lang-switcher--dropdown .ehero-lang-switcher__toggle::after {
	content: "";
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid currentColor;
	margin-left: 4px;
	opacity: 0.6;
}

.ehero-lang-switcher--dropdown .ehero-lang-switcher__menu {
	position: absolute !important;
	top: 100% !important;
	left: 0;
	right: auto;
	z-index: 999999;
	display: none;
	flex-direction: column;
	gap: 0;
	margin-top: 4px !important;
	min-width: 180px;
	max-height: 70vh;
	overflow-y: auto;
	padding: 4px !important;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 6px;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
	color: #1d2327;
}

/* When the switcher is near the right edge of the viewport, flip the
 * dropdown so it opens aligned to the right — avoids cropping off-screen. */
.ehero-lang-switcher--dropdown[data-align="right"] .ehero-lang-switcher__menu,
.ehero-lang-switcher--dropdown.is-right-edge .ehero-lang-switcher__menu {
	left: auto;
	right: 0;
}

.ehero-lang-switcher--dropdown.is-open .ehero-lang-switcher__menu {
	display: flex;
}

.ehero-lang-switcher--dropdown .ehero-lang-switcher__item {
	width: 100%;
}

.ehero-lang-switcher--dropdown .ehero-lang-switcher__item a {
	width: 100%;
	padding: 6px 10px;
	color: #1d2327;
}

/* ==================== List ==================== */
.ehero-lang-switcher--list .ehero-lang-switcher__menu {
	flex-wrap: wrap;
	gap: 6px;
}

/* ==================== Flags only ==================== */
.ehero-lang-switcher--flags_only .ehero-lang-switcher__label,
.ehero-lang-switcher--flags-only .ehero-lang-switcher__label {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.ehero-lang-switcher--flags_only .ehero-lang-switcher__item a,
.ehero-lang-switcher--flags-only .ehero-lang-switcher__item a {
	padding: 4px 8px;
}

.ehero-lang-switcher--flags_only .ehero-lang-switcher__flag,
.ehero-lang-switcher--flags-only .ehero-lang-switcher__flag {
	font-size: 20px;
}

/* ==================== Menu context ==================== */
.ehero-ml-menu-item {
	list-style: none !important;
}

.ehero-ml-menu-item .ehero-lang-switcher {
	margin: 0;
}

/* Inside a nav menu, remove theme padding/underline artifacts. */
.menu-item.ehero-ml-menu-item > .ehero-lang-switcher {
	display: inline-flex;
	vertical-align: middle;
}

/* Responsive */
@media (max-width: 480px) {
	.ehero-lang-switcher--list .ehero-lang-switcher__menu {
		flex-wrap: wrap;
	}
	.ehero-lang-switcher__item a {
		padding: 6px 8px;
	}
}
