/* Language switcher */
.ar-language-switcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	z-index: 80;
}

.ar-language-switcher__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	height: 38px;
	max-width: 170px;
	padding: 0 12px;
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.84);
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	color: #111827;
	font-size: 13px;
	font-weight: 800;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, background .2s ease;
}

.ar-language-switcher__button:hover,
.ar-language-switcher__button:focus-visible,
.ar-language-switcher.is-open .ar-language-switcher__button {
	border-color: rgba(239, 68, 68, 0.24);
	background: rgba(255, 255, 255, 0.94);
	box-shadow: 0 12px 28px rgba(239, 68, 68, 0.12);
	outline: 0;
}

.ar-language-switcher__icon,
.ar-language-switcher__chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	color: #ef4444;
}

.ar-language-switcher__chevron {
	color: #64748b;
	transition: transform .2s ease;
}

.ar-language-switcher.is-open .ar-language-switcher__chevron {
	transform: rotate(180deg);
}

.ar-language-switcher__current {
	display: inline-block;
	overflow: hidden;
	max-width: 104px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ar-language-switcher__menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: 210px;
	max-width: calc(100vw - 24px);
	max-height: min(60vh, 340px);
	overflow: auto;
	padding: 8px;
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	z-index: 9999;
}

.ar-language-switcher__menu[hidden] {
	display: none;
}

.ar-language-switcher__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	padding: 10px 11px;
	border-radius: 12px;
	color: #111827;
	font-size: 13px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
	transition: background .18s ease, color .18s ease, transform .18s ease;
}

.ar-language-switcher__option:hover,
.ar-language-switcher__option:focus-visible {
	background: rgba(239, 68, 68, 0.08);
	color: #dc2626;
	outline: 0;
}

.ar-language-switcher__option.is-active {
	background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(249, 115, 22, 0.12));
	color: #dc2626;
}

.ar-language-switcher__option-code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	padding: 4px 7px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.06);
	color: #64748b;
	font-size: 10px;
	font-weight: 900;
	letter-spacing: .08em;
}

.ar-language-switcher__option.is-active .ar-language-switcher__option-code {
	background: rgba(239, 68, 68, 0.14);
	color: #dc2626;
}

html.ar-theme-dark .ar-language-switcher__button {
	border-color: rgba(255, 255, 255, 0.1);
	background: rgba(15, 23, 42, 0.82);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
	color: #f8fafc;
}

html.ar-theme-dark .ar-language-switcher__button:hover,
html.ar-theme-dark .ar-language-switcher__button:focus-visible,
html.ar-theme-dark .ar-language-switcher.is-open .ar-language-switcher__button {
	border-color: rgba(251, 146, 60, .28);
	background: rgba(17, 24, 39, 0.94);
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

html.ar-theme-dark .ar-language-switcher__icon {
	color: #fb923c;
}

html.ar-theme-dark .ar-language-switcher__chevron {
	color: #cbd5e1;
}

html.ar-theme-dark .ar-language-switcher__menu {
	border-color: rgba(255, 255, 255, 0.1);
	background: rgba(15, 23, 42, 0.97);
	box-shadow: 0 24px 52px rgba(0, 0, 0, 0.42);
}

html.ar-theme-dark .ar-language-switcher__option {
	color: #f8fafc;
}

html.ar-theme-dark .ar-language-switcher__option:hover,
html.ar-theme-dark .ar-language-switcher__option:focus-visible,
html.ar-theme-dark .ar-language-switcher__option.is-active {
	background: rgba(249, 115, 22, 0.14);
	color: #fed7aa;
}

html.ar-theme-dark .ar-language-switcher__option-code {
	background: rgba(255, 255, 255, 0.08);
	color: #cbd5e1;
}

html.ar-theme-dark .ar-language-switcher__option.is-active .ar-language-switcher__option-code {
	background: rgba(249, 115, 22, 0.18);
	color: #fed7aa;
}

/* Language switcher responsive rules. */
@media (max-width: 900px) {
	.ar-language-switcher__button {
		height: 38px;
		max-width: 128px;
		padding-inline: 10px;
		font-size: 12px;
	}

	.ar-language-switcher__current {
		max-width: 76px;
	}

	.ar-language-switcher__menu {
		right: 0;
		width: 190px;
	}
}

@media (max-width: 768px) {
	.ar-header-actions .ar-language-switcher__button {
		height: 36px;
		width: 36px;
		max-width: 36px;
		padding: 0;
		gap: 0;
	}

	.ar-header-actions .ar-language-switcher__current,
	.ar-header-actions .ar-language-switcher__chevron {
		display: none;
	}

	.ar-language-switcher__menu {
		top: calc(100% + 9px);
		right: 0;
		width: 188px;
		max-width: calc(100vw - 20px);
		padding: 7px;
		border-radius: 16px;
	}

	.ar-language-switcher__option {
		padding: 9px 10px;
		font-size: 12px;
	}
}

@media (max-width: 420px) {
	.ar-language-switcher__menu {
		position: fixed;
		top: 86px;
		right: 10px;
		left: auto;
		width: min(190px, calc(100vw - 20px));
		max-height: min(54vh, 310px);
	}

	body.admin-bar .ar-language-switcher__menu {
		top: 118px;
	}
}
