/**
 * WP Location Switcher — public styles.
 *
 * Designed for a dark/black navigation background.
 * Override variables in your theme CSS to customise appearance.
 */

/* ── Custom properties ─────────────────────────────────────────────────────── */
.wls-switcher {
	--wls-border-radius: 6px;
	--wls-dropdown-bg: #1a1a1a;
	--wls-dropdown-border: #333333;
	--wls-dropdown-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
	--wls-option-hover-bg: #2a2a2a;
	--wls-option-text: #f0f0f0;
	--wls-active-text: #ffffff;
	--wls-font-size: 0.875em;
	--wls-gap: 10px;
	--wls-badge-size: 28px;
}

/* ── Nav item wrapper ──────────────────────────────────────────────────────── */
li.wls-switcher-nav-item {
	display: flex;
	align-items: center;
	margin-left: auto; /* Pushes switcher to the right edge of a flex nav */
	list-style: none;
}

/* ── Switcher container ────────────────────────────────────────────────────── */
.wls-switcher {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-size: var(--wls-font-size);
}

/* ── Trigger button ────────────────────────────────────────────────────────── */
.wls-switcher__trigger {
	display: inline-flex;
	align-items: center;
	background: transparent;
	border: none;
	padding: 6px 4px 4px;
	cursor: pointer;
	border-radius: 50%;
	transition: opacity 0.15s ease;
	line-height: 0;
}

.wls-switcher__trigger:hover {
	opacity: 0.75;
}

.wls-switcher__trigger:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.6);
	outline-offset: 2px;
}

/* ── Dropdown ──────────────────────────────────────────────────────────────── */
.wls-switcher__dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: 170px;
	background: var(--wls-dropdown-bg);
	border: 1px solid var(--wls-dropdown-border);
	border-radius: var(--wls-border-radius);
	box-shadow: var(--wls-dropdown-shadow);
	list-style: none;
	margin: 0;
	padding: 6px 0;
	z-index: 9999;
}

.wls-switcher__dropdown--open {
	display: block;
	list-style: none !important;
	padding: 0 !important;
}

/* ── Options ───────────────────────────────────────────────────────────────── */
.wls-switcher__option {
	margin: 0;
	padding: 0;
}

.wls-switcher__link,
.wls-switcher__current {
	display: flex;
	align-items: center;
	gap: var(--wls-gap);
	padding: 9px 14px;
	color: var(--wls-option-text);
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.1s ease;
}

.wls-switcher__link:hover {
	background: var(--wls-option-hover-bg);
	color: var(--wls-active-text);
	text-decoration: none;
}

.wls-switcher__link:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.5);
	outline-offset: -2px;
	background: var(--wls-option-hover-bg);
}

.wls-switcher__option--active .wls-switcher__current {
	font-weight: 600;
	color: var(--wls-active-text);
	cursor: default;
}

/* ── Location name ─────────────────────────────────────────────────────────── */
.wls-switcher__name {
	font-size: 0.9em;
	letter-spacing: 0.01em;
}

/* ── Circular flag badge ───────────────────────────────────────────────────── */
.wls-flag-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--wls-badge-size);
	height: var(--wls-badge-size);
	border-radius: 50%;
	overflow: hidden;
	flex-shrink: 0;
	background: #333333; /* visible while image loads */
}

.wls-flag-badge .wls-flag-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
    border: 3px solid #FFF;
}

/* Emoji/text fallback inside the badge */
.wls-flag-badge .wls-flag-emoji {
	font-size: 1.1em;
	line-height: 1;
}

/* Trigger badge is slightly larger for easier tap target */
.wls-switcher__trigger .wls-flag-badge {
	--wls-badge-size: 30px;
}
