/* Base container for both shortcode and menu item */
.ms-language-switcher {
	position: relative;
	display: inline-block;
}

/* The clickable element */
.ms-language-switcher>.switcher-button,
.ms-language-switcher>a {
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: inherit;
}

/* Arrow inside the button */
.switcher-button .arrow {
	font-size: 10px;
	transition: transform 0.2s ease-in-out;
}

/* The dropdown list */
.switcher-dropdown,
.menu-item .sub-menu.switcher-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background-color: #fff;
	min-width: 100%;
	box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
	z-index: 100;
	list-style: none;
	padding: 0;
	margin: 5px 0 0 0;
	border-radius: 5px;
	border: 1px solid #ddd;
	overflow: hidden;
}

/* --- JS-Controlled Visibility --- */
.ms-language-switcher.open>.switcher-dropdown,
.ms-language-switcher.open>.sub-menu {
	display: block;
}

/* Rotate arrow when the dropdown is open */
.ms-language-switcher.open .arrow {
	transform: rotate(180deg);
}

/* Styling for links inside the dropdown */
.switcher-dropdown a {
	color: black;
	padding: 12px 16px;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}

.switcher-dropdown a:hover {
	background-color: #f1f1f1;
}

/* Specific styling for the shortcode version to make it look like a button */
div.ms-language-switcher>.switcher-button {
	background-color: #f0f0f0;
	color: #333;
	padding: 10px 15px;
	border: 1px solid #ccc;
	border-radius: 5px;
	font-size: 14px;
	min-width: 85px;
	justify-content: center;
}

div.ms-language-switcher>.switcher-button:hover {
	background-color: #e0e0e0;
}