.wgml-switcher {
	--wgml-bg: #fff;
	--wgml-fg: #111;
	--wgml-border: rgba(0, 0, 0, 0.15);
	--wgml-hover: rgba(0, 0, 0, 0.06);
	font-size: 14px;
	line-height: 1.3;
	position: relative;
	display: inline-block;
}
.wgml-switcher ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Dropdown */
.wgml-dd > summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border: 1px solid var(--wgml-border);
	border-radius: 999px;
	background: var(--wgml-bg);
	color: var(--wgml-fg);
	cursor: pointer;
	list-style: none;
	user-select: none;
	white-space: nowrap;
}
.wgml-dd > summary::-webkit-details-marker { display: none; }
.wgml-dd > summary::marker { content: ''; }
.wgml-dd > summary:hover { background: var(--wgml-hover); }
.wgml-dd > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.wgml-dd .wgml-code { font-weight: 700; letter-spacing: 0.03em; }
.wgml-dd .wgml-caret { transition: transform 0.15s ease; opacity: 0.7; }
.wgml-dd[open] .wgml-caret { transform: rotate(180deg); }

.wgml-dd__menu {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 160px;
	padding: 6px !important;
	background: var(--wgml-bg);
	border: 1px solid var(--wgml-border);
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	z-index: 99999;
}
.wgml-up .wgml-dd__menu {
	top: auto;
	bottom: calc(100% + 6px);
}
.wgml-dd__menu a {
	display: flex;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 6px;
	color: var(--wgml-fg);
	text-decoration: none;
}
.wgml-dd__menu a:hover,
.wgml-dd__menu a:focus { background: var(--wgml-hover); }
.wgml-dd__menu .is-current a { font-weight: 700; }
.wgml-dd__menu .is-current a::after { content: '✓'; margin-left: auto; }

/* List */
.wgml-switcher--list ul { display: flex; gap: 4px; flex-wrap: wrap; }
.wgml-switcher--list a {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 4px;
	color: inherit;
	text-decoration: none;
	opacity: 0.7;
}
.wgml-switcher--list a:hover { opacity: 1; background: var(--wgml-hover); }
.wgml-switcher--list .is-current a { opacity: 1; font-weight: 700; }

/* Floating */
.wgml-floating {
	position: fixed;
	z-index: 99998;
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.12));
}
.wgml-floating--bottom-right { right: 20px; bottom: 20px; }
.wgml-floating--bottom-left { left: 20px; bottom: 20px; }
.wgml-floating--top-right { right: 20px; top: 20px; }
.wgml-floating--top-left { left: 20px; top: 20px; }
.admin-bar .wgml-floating--top-right,
.admin-bar .wgml-floating--top-left { top: 52px; }
.wgml-floating--bottom-left .wgml-dd__menu,
.wgml-floating--top-left .wgml-dd__menu { right: auto; left: 0; }

/* Block alignment */
.wp-block-wgml-language-switcher.alignright { float: none; display: flex; justify-content: flex-end; }
.wp-block-wgml-language-switcher.aligncenter { display: flex; justify-content: center; }
