/* 选品页：免单券配送方式全屏层打开时隐藏语言开关 */
body.lbb-fc-ship-open .lbb-lang-switcher {
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
	transition: opacity 0.18s ease, visibility 0.18s ease;
}

/* 左下角语言切换：下拉式（图标 + 文案） */
.lbb-lang-switcher {
	position: fixed;
	left: 12px;
	bottom: 12px;
	z-index: 10000100;
	display: block;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
	font-size: 14px;
	line-height: 1.3;
}

/* CheckoutWC / 结账：顶栏与浮层较多，抬高并略上移避免与底部条重叠 */
body.woocommerce-checkout .lbb-lang-switcher,
body.woocommerce-page.checkout .lbb-lang-switcher,
body.checkout-wc .lbb-lang-switcher {
	z-index: 10000200;
	bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

@media (max-width: 600px) {
	.lbb-lang-switcher {
		left: 8px;
		bottom: max(8px, env(safe-area-inset-bottom, 0px));
	}
}

.lbb-lang-switcher__toggle {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	width: auto;
	min-width: 148px;
	margin: 0;
	padding: 8px 12px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	cursor: pointer;
	backdrop-filter: blur(8px);
	color: #1a1a1a;
	text-align: left;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.lbb-lang-switcher__toggle:hover {
	border-color: rgba(0, 0, 0, 0.2);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

.lbb-lang-switcher__toggle:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.lbb-lang-switcher.is-open .lbb-lang-switcher__toggle {
	border-color: rgba(0, 0, 0, 0.22);
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.lbb-lang-switcher__toggle img {
	display: block;
	width: 28px;
	height: auto;
	border-radius: 4px;
	flex-shrink: 0;
	pointer-events: none;
}

.lbb-lang-switcher__toggle-text {
	flex: 1 1 auto;
	font-weight: 600;
	white-space: nowrap;
}

.lbb-lang-switcher__caret {
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 2px;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #4b5563;
	flex-shrink: 0;
	transition: transform 0.18s ease;
}

.lbb-lang-switcher.is-open .lbb-lang-switcher__caret {
	transform: rotate(180deg);
}

.lbb-lang-switcher__panel {
	position: absolute;
	left: 0;
	bottom: calc(100% + 8px);
	min-width: 100%;
	width: max-content;
	padding: 6px;
	margin: 0;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.98);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.06);
	backdrop-filter: blur(10px);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	pointer-events: none;
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.lbb-lang-switcher.is-open .lbb-lang-switcher__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}

.lbb-lang-switcher__option {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 10px 12px;
	border: none;
	border-radius: 8px;
	background: transparent;
	cursor: pointer;
	color: #1a1a1a;
	text-align: left;
	font: inherit;
	transition: background 0.12s ease;
}

.lbb-lang-switcher__option:hover {
	background: rgba(0, 0, 0, 0.05);
}

.lbb-lang-switcher__option:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: -2px;
}

.lbb-lang-switcher__option.is-current {
	background: rgba(34, 113, 177, 0.08);
	font-weight: 600;
}

.lbb-lang-switcher__option img {
	display: block;
	width: 28px;
	height: auto;
	border-radius: 4px;
	flex-shrink: 0;
	pointer-events: none;
}

.lbb-lang-switcher__option span {
	white-space: nowrap;
}
