/*
Version: 1.21.0
Version date: 06-10-2026
*/

/**
 * Asty Booking — `[astyb_languages]`, the language switcher.
 *
 * Colours come from where it sits (the header's text colour); only the open
 * dropdown panel has its own light background. Override any of the custom
 * properties on `.astyb-langs` from the theme.
 */

.astyb-langs {
	--astyb-langs-panel-bg: #fff;
	--astyb-langs-panel-fg: #1d2327;
	--astyb-langs-hover-bg: #f0f0f1;
	--astyb-langs-focus: #2271b1;

	/* ⚠ Avada underlines links through an id-weight rule; its own custom
	   properties are the way past it (never !important). */
	--awb-link_decoration_line: none;
	--awb-link_decoration_line_hover: none;

	position: relative;
	display: inline-block;
	vertical-align: middle;
	font-size: 14px;
	line-height: 1.4;
}

.astyb-langs .astyb-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.astyb-langs__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.astyb-langs__link,
.astyb-langs__current {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: inherit;
	text-decoration: none;
}

.astyb-langs__flag {
	display: block;
	flex: 0 0 16px;
	width: 16px;
	height: 11px;
	background: center / contain no-repeat;
}

.astyb-langs__code {
	font-weight: 600;
	letter-spacing: 0.04em;
}

.astyb-langs a:focus-visible,
.astyb-langs summary:focus-visible {
	outline: 2px solid var(--astyb-langs-focus);
	outline-offset: 2px;
}

/* --- inline: all languages side by side ------------------------------- */

.astyb-langs--inline .astyb-langs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.astyb-langs--inline .astyb-langs__item.is-current .astyb-langs__link {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --- dropdown: the current language, the others under it --------------- */

.astyb-langs__current {
	padding: 6px 8px;
	border-radius: 4px;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.astyb-langs__current::-webkit-details-marker {
	display: none;
}

.astyb-langs__caret {
	width: 6px;
	height: 6px;
	margin-left: 2px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.15s;
}

.astyb-langs__menu[open] .astyb-langs__caret {
	transform: translateY(1px) rotate(-135deg);
}

.astyb-langs--dropdown .astyb-langs__list {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 100000;
	min-width: 170px;
	margin-top: 4px;
	padding: 6px 0;
	border-radius: 6px;
	background: var(--astyb-langs-panel-bg);
	color: var(--astyb-langs-panel-fg);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
}

.astyb-langs--left .astyb-langs__list {
	right: auto;
	left: 0;
}

.astyb-langs--dropdown .astyb-langs__link {
	display: flex;
	padding: 8px 16px;
	color: var(--astyb-langs-panel-fg);
}

.astyb-langs--dropdown .astyb-langs__link:hover,
.astyb-langs--dropdown .astyb-langs__link:focus-visible {
	background: var(--astyb-langs-hover-bg);
}

.astyb-langs--dropdown .astyb-langs__item.is-current .astyb-langs__link {
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.astyb-langs__caret {
		transition: none;
	}
}
