/**
 * Header language switcher — flag left, code right, dropdown list.
 */

.main-menu .navigation > li.menu-item-lang-switcher {
	margin-left: 8px;
}

.elpolap-lang-switcher {
	position: relative;
	display: inline-block;
}

.elpolap-lang-switcher__toggle,
.elpolap-lang-switcher__menu a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--text-font);
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	color: var(--title-color);
	text-transform: uppercase;
}

.elpolap-lang-switcher__toggle {
	padding: 27px 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: color 500ms ease;
}

.elpolap-lang-switcher__toggle:hover,
.elpolap-lang-switcher__toggle:focus-visible {
	color: var(--theme-color);
	outline: none;
}

.elpolap-lang-switcher__flag {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 18px;
	overflow: hidden;
	border-radius: 2px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.elpolap-lang-switcher__flag--pl {
	background-image: url(/wp-content/plugins/polylang/flags/pl.png);
}

.elpolap-lang-switcher__flag--en {
	background-image: url(/wp-content/plugins/polylang/flags/gb.png);
}

.elpolap-lang-switcher__flag--de {
	background-image: url(/wp-content/plugins/polylang/flags/de.png);
}

.elpolap-lang-switcher__code {
	min-width: 1.5em;
	text-align: left;
}

.elpolap-lang-switcher__caret {
	width: 0;
	height: 0;
	margin-left: 2px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
	opacity: 0.75;
}

.elpolap-lang-switcher__menu {
	position: absolute;
	top: calc(100% - 8px);
	right: 0;
	left: auto;
	min-width: 120px;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 999;
}

.elpolap-lang-switcher.is-open .elpolap-lang-switcher__menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.elpolap-lang-switcher__item {
	margin: 0;
	padding: 0;
}

.elpolap-lang-switcher__menu a {
	width: 100%;
	padding: 10px 16px;
	text-decoration: none;
	box-sizing: border-box;
}

.elpolap-lang-switcher__menu a:hover,
.elpolap-lang-switcher__menu a:focus-visible {
	background: #f5f5f5;
	color: var(--theme-color);
	outline: none;
}

.elpolap-lang-switcher__item.is-current a {
	background: #f0f9fd;
}

.sticky-header .elpolap-lang-switcher__toggle {
	padding-top: 22px;
	padding-bottom: 22px;
}

.mobile-menu .menu-item-lang-switcher {
	float: none;
	width: 100%;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu .elpolap-lang-switcher,
.mobile-menu .elpolap-lang-switcher__toggle {
	display: block;
	width: 100%;
}

.mobile-menu .elpolap-lang-switcher__toggle {
	padding: 15px 25px;
	color: #fff;
}

.mobile-menu .elpolap-lang-switcher__menu {
	position: static;
	display: none;
	opacity: 1;
	visibility: visible;
	transform: none;
	box-shadow: none;
	background: rgba(0, 0, 0, 0.15);
	border-radius: 0;
	margin: 0;
	padding: 0;
}

.mobile-menu .elpolap-lang-switcher.is-open .elpolap-lang-switcher__menu {
	display: block;
}

.mobile-menu .elpolap-lang-switcher__menu a {
	color: #fff;
	padding-left: 40px;
}

.mobile-menu .elpolap-lang-switcher__menu a:hover,
.mobile-menu .elpolap-lang-switcher__menu a:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
}

.mobile-menu .elpolap-lang-switcher__item.is-current a {
	background: rgba(255, 255, 255, 0.12);
}
