/* Bio Nutrientes Language Switcher
 * Round flags + brand-blue chevron dropdown for Polylang.
 */

.bn-ls {
	--bn-ls-size: 28px;          /* flag diameter, overridden inline by the shortcode */
	--bn-ls-gap: 8px;            /* gap between flag and chevron (matches the design) */
	--bn-ls-chevron: #005095;    /* brand blue from Frame 53 */
	--bn-ls-text: #1f2b45;
	--bn-ls-menu-bg: #ffffff;
	--bn-ls-menu-hover: #f2f5fa;

	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: inherit;
	line-height: normal;
}

.bn-ls * {
	box-sizing: border-box;
}

/* Trigger ------------------------------------------------------------------ */
.bn-ls__toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--bn-ls-gap);
	margin: 0;
	padding: 4px;
	background: none;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	line-height: 0;
	color: var(--bn-ls-text);
	-webkit-appearance: none;
	appearance: none;
}

.bn-ls__toggle:focus-visible {
	outline: 2px solid var(--bn-ls-chevron);
	outline-offset: 2px;
}

/* Flags -------------------------------------------------------------------- */
.bn-ls__flag {
	flex: none;
	display: block;
	width: var(--bn-ls-size);
	height: var(--bn-ls-size);
	border-radius: 50%;
	object-fit: cover;
	/* subtle ring so the white parts of the US flag stay visible on white headers */
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.bn-ls__flag--text {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: calc(var(--bn-ls-size) * 0.38);
	font-weight: 700;
	color: #fff;
	background: var(--bn-ls-chevron);
	line-height: 1;
}

/* Chevron ------------------------------------------------------------------ */
.bn-ls__chevron {
	display: inline-flex;
	line-height: 0;
	transition: transform 0.2s ease;
}

.bn-ls__chevron-svg {
	width: 14px;
	height: auto;
	display: block;
}

.bn-ls__chevron-svg path {
	fill: var(--bn-ls-chevron);
}

.bn-ls.is-open .bn-ls__chevron {
	transform: rotate(180deg);
}

/* Dropdown menu ------------------------------------------------------------ */
.bn-ls__menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 9999;
	min-width: max-content;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: var(--bn-ls-menu-bg);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);

	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

.bn-ls.is-open .bn-ls__menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* No-JS fallback: reveal on keyboard/hover focus when the script is absent */
.bn-ls:not(.bn-ls--js):focus-within .bn-ls__menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* Menu items --------------------------------------------------------------- */
.bn-ls__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px 8px 8px;
	border-radius: 8px;
	text-decoration: none;
	white-space: nowrap;
	color: var(--bn-ls-text);
}

.bn-ls__item:hover,
.bn-ls__item:focus {
	background: var(--bn-ls-menu-hover);
}

.bn-ls__name {
	font-size: 15px;
	font-weight: 500;
}

/* Visually-hidden label (self-contained; does not rely on the theme) -------- */
.bn-ls__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
