/* Compass Translate — Language Switcher */

.ct-switcher {
	position: relative;
	display: inline-block;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.4;
	z-index: 9999;
}

/* Floating switcher (bottom-right corner) */
.ct-switcher-floating {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 99999;
}

/* Current language button */
.ct-switcher-current {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	background: #ffffff;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	cursor: pointer;
	color: #1e1e1e;
	font-size: 14px;
	line-height: 1.4;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ct-switcher-current:hover {
	border-color: #2271b1;
	box-shadow: 0 1px 4px rgba(34, 113, 177, 0.15);
}

.ct-switcher-current[aria-expanded="true"] {
	border-color: #2271b1;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.ct-switcher-arrow {
	font-size: 10px;
	transition: transform 0.2s ease;
}

.ct-switcher-current[aria-expanded="true"] .ct-switcher-arrow {
	transform: rotate(180deg);
}

.ct-switcher-name {
	flex: 1;
}

/* Dropdown list */
.ct-switcher-list {
	display: none;
	position: absolute;
	bottom: 100%;
	right: 0;
	min-width: 160px;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #ffffff;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
	max-height: 300px;
	overflow-y: auto;
}

/* When floating, dropdown opens upward */
.ct-switcher-floating .ct-switcher-list {
	bottom: 100%;
	top: auto;
	margin-bottom: -1px;
	border-radius: 6px 6px 0 0;
}

/* When inline, dropdown opens downward */
.ct-switcher-inline .ct-switcher-list {
	bottom: auto;
	top: 100%;
	margin-top: -1px;
	border-radius: 0 0 6px 6px;
}

.ct-switcher-inline .ct-switcher-current[aria-expanded="true"] {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	border-top-left-radius: 6px;
	border-top-right-radius: 6px;
}

.ct-switcher[data-open="true"] .ct-switcher-list {
	display: block;
}

/* List items */
.ct-switcher-item {
	margin: 0;
	padding: 0;
}

.ct-switcher-item a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	color: #1e1e1e;
	text-decoration: none;
	transition: background-color 0.1s ease;
}

.ct-switcher-item a:hover {
	background-color: #f0f0f1;
}

.ct-switcher-item.ct-switcher-active a {
	background-color: #e8f0fe;
	color: #2271b1;
	font-weight: 500;
}

/* Flag styles */
.ct-flag {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 15px;
	flex-shrink: 0;
	border-radius: 2px;
}

.ct-flag-emoji {
	font-size: 16px;
	width: auto;
	height: auto;
}

img.ct-flag {
	object-fit: cover;
}

/* Nav menu integration */
.ct-menu-switcher-parent > a {
	display: flex !important;
	align-items: center;
	gap: 6px;
}

.ct-menu-lang-active > a {
	font-weight: 600;
}

.ct-menu-switcher-parent .ct-flag,
.ct-menu-lang-active .ct-flag {
	vertical-align: middle;
}

/* Responsive */
@media (max-width: 480px) {
	.ct-switcher-floating {
		bottom: 12px;
		right: 12px;
	}

	.ct-switcher-current {
		padding: 6px 10px;
		font-size: 13px;
	}

	/* Hide language name on mobile, show flag only */
	.ct-switcher-floating .ct-switcher-name {
		display: none;
	}
}
