/**
 * Pill currency switcher (see inc/currency-switcher-ui.php and
 * assets/js/currency-switcher-ui.js).
 *
 * The floating pill position comes from the --bwfc-fab-* CSS variables, which
 * are generated from the documented constants at the top of the PHP file -
 * edit the constants, not this file.
 */

/* ---------- Pill (trigger) ---------- */

.bwfc-switcher {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
	font-size: 14px;
	line-height: 1.2;
}

.bwfc-switcher__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 14px;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 999px; /* 椭圆形 / full pill */
	background: #fff;
	color: #1f1f1f;
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.bwfc-switcher__btn:hover,
.bwfc-switcher.is-open .bwfc-switcher__btn {
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.14);
}

.bwfc-switcher__flag {
	width: 22px;
	height: 15px;
	object-fit: cover;
	border-radius: 2px;
	flex: none;
}

.bwfc-switcher__chev {
	flex: none;
	opacity: 0.55;
	transition: transform 0.15s ease;
}

.bwfc-switcher.is-open .bwfc-switcher__chev {
	transform: rotate(180deg);
}

/* ---------- Dropdown panel ---------- */

.bwfc-switcher__panel {
	position: absolute;
	z-index: 99999;
	top: calc(100% + 8px);
	left: 0;
	display: none;
	min-width: 190px;
	padding: 6px;
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}

.bwfc-switcher.is-open .bwfc-switcher__panel {
	display: block;
}

.bwfc-switcher__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 8px 10px;
	border: 0;
	border-radius: 11px;
	background: none;
	color: #1f1f1f;
	font: inherit;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.bwfc-switcher__opt + .bwfc-switcher__opt {
	margin-top: 2px;
}

.bwfc-switcher__opt:hover {
	background: #f4f5f7;
	/* 主题的全局 button:hover 会把文字变白，这里统一改回绿色 */
	color: #24AE4D;
}

.bwfc-switcher__opt:hover .bwfc-switcher__opt-code,
.bwfc-switcher__opt:hover .bwfc-switcher__opt-desc {
	color: #24AE4D;
}

.bwfc-switcher__opt.is-current {
	background: rgba(0, 0, 0, 0.05);
}

.bwfc-switcher__opt-desc {
	margin-left: auto;
	color: #8a8a8a;
	font-size: 12px;
	font-weight: 400;
	white-space: nowrap;
}

/* ---------- Next to the product price (attach="price") ---------- */

/* The pill is moved INSIDE the .price element, so amount and switcher share
   one flex row: left-aligned with the price, vertically centred, never
   pushed to the right edge. */
.summary .price.bwfc-price-row,
.price.bwfc-price-row {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 14px;
}

.bwfc-price-row .bwfc-switcher {
	margin-left: 2px;
}

/* Slot pill hidden when the price already ships its own server-side copy. */
.bwfc-switcher.is-hidden {
	display: none;
}

/* ---------- Floating pill (bottom right corner) ---------- */

.bwfc-float {
	position: fixed;
	right: var(--bwfc-fab-right, 24px);    /* 距屏幕右侧 / offset from the right edge */
	bottom: var(--bwfc-fab-bottom, 24px); /* 距屏幕底部 / offset from the bottom edge (raise it above the sticky add-to-cart bar if needed) */
	z-index: var(--bwfc-fab-z, 9990);      /* 层级 / stacking order */
}

/* The panel opens upwards near the bottom edge. */
.bwfc-switcher--float .bwfc-switcher__panel {
	top: auto;
	right: 0;
	bottom: calc(100% + 8px);
	left: auto;
}

.bwfc-switcher--float .bwfc-switcher__btn {
	padding: 9px 16px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

@media (max-width: 480px) {
	.bwfc-float {
		--bwfc-fab-bottom: 16px;
		--bwfc-fab-right: 16px;
	}

	.bwfc-switcher--float .bwfc-switcher__panel {
		min-width: 170px;
	}
}
