/* QCX Currency Display: the price estimate and the checkout note. */

/*
 * The estimate: a bit smaller than the price (never below 12px), no brackets. As an inline-block it stays
 * on the price's line and moves to the next line as a whole only when the line is full. The gap is a
 * margin, not a space character, so it survives inside flex layouts.
 */
.qcx-approx {
	display: inline-block;
	margin-left: 0.35em;
	color: inherit;
	font-size: max(12px, 0.8em);
	white-space: nowrap;
}

/*
 * Product options totals (Single Piece Price, Configured Total): Advanced Product Fields floats the last span of
 * each row right ("div span:last-child"), which is our estimate; floated, it lines up by its top edge and sits high.
 */
.wapf-product-totals div > span.qcx-approx:last-child {
	float: none;
}

/* Side cart and checkout: the estimate on its own line under the price. */
.qcx-approx.qcx-approx--stacked {
	display: block;
	margin-left: 0;
	margin-top: 2px;
	font-weight: 400;
	line-height: 1.3;
}

/*
 * Checkout shipping step: the child theme lays each option out as a grid (name and delivery badge on the left,
 * price on the right, spanning both rows). Keep the estimate in the price column: price on row 1, estimate
 * under it on row 2. The extra classes outrank the theme's "label:has(.qdt-eta) > .amount" rule.
 */
#cfw ul.cfw-shipping-methods-list li .cfw-shipping-method-inner label > .woocommerce-Price-amount.amount[data-qcx-done] {
	grid-row: 1;
	align-self: end;
	justify-self: end;
}

#cfw ul.cfw-shipping-methods-list li .cfw-shipping-method-inner label > .qcx-approx.qcx-approx--stacked {
	grid-column: 2;
	grid-row: 2;
	align-self: start;
	justify-self: end;
	margin-top: 0;
	white-space: nowrap;
}

.qcx-checkout-note {
	font-size: 0.85em;
	color: #1d2327;
	margin: 0.5em 0 0;
}

/*
 * Currency switcher: same look as the YayCurrency one it replaces (120px wide, 30px trigger,
 * 31px rows, 11px Montserrat, 20x15 flags), plus a search box. Text is #1d2327 (the operator's
 * lightest allowed text colour); the old switcher used a slightly lighter grey.
 */
.qcx-switcher {
	position: relative;
	display: inline-block;
	width: 120px;
	font: 400 11px/1.2 Montserrat, sans-serif;
	color: #1d2327;
	text-align: left;
}

.qcx-switcher[hidden] {
	display: none;
}

/* Desktop header: the cart icon sits right before the switcher; keep them apart when the header narrows. */
.quadica-header-search-main + .gb-container > .qcx-switcher {
	margin-left: 16px;
}

.qcx-switcher .qcx-switcher__trigger {
	display: flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	width: 120px;
	height: 30px;
	margin: 0;
	padding: 0 8px;
	background: #fff;
	color: #1d2327;
	border: 1px solid #dcdfe6;
	border-radius: 4px;
	box-shadow: none;
	font: inherit;
	text-align: left;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.qcx-switcher .qcx-switcher__trigger:hover,
.qcx-switcher .qcx-switcher__trigger:focus {
	background: #fff;
	color: #1d2327;
	border-color: #dcdfe6;
	box-shadow: none;
}

.qcx-switcher .qcx-switcher__trigger:focus-visible,
.qcx-switcher.qcx-switcher--open .qcx-switcher__trigger {
	border-color: #2271b1;
}

.qcx-switcher__flag {
	flex: 0 0 20px;
	width: 20px;
	height: 15px;
}

.qcx-switcher__flag img {
	display: block;
	width: 20px;
	height: 15px;
	border-radius: 2px;
	object-fit: cover;
}

.qcx-switcher__text {
	flex: 1 1 auto;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.qcx-switcher__arrow {
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	margin: -3px 4px 0 0;
	border-right: 2px solid #ccc;
	border-bottom: 2px solid #ccc;
	transform: rotate(45deg);
}

.qcx-switcher--open .qcx-switcher__arrow {
	margin-top: 3px;
	transform: rotate(-135deg);
}

.qcx-switcher__panel {
	position: absolute;
	z-index: 9999;
	top: 100%;
	left: 0;
	box-sizing: border-box;
	width: 120px;
	background: #fff;
	border: 1px solid #dcdfe6;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.qcx-switcher__panel[hidden] {
	display: none;
}

.qcx-switcher .qcx-switcher__search {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 30px;
	margin: 0;
	padding: 0 8px;
	background: #fff;
	color: #1d2327;
	border: 0;
	border-bottom: 1px solid #dcdfe6;
	border-radius: 4px 4px 0 0;
	box-shadow: none;
	font: inherit;
}

.qcx-switcher .qcx-switcher__search::placeholder {
	color: #1d2327;
	opacity: 1;
}

.qcx-switcher .qcx-switcher__search:focus {
	outline: none;
	border-bottom-color: #2271b1;
	box-shadow: none;
}

.qcx-switcher__list {
	max-height: 250px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
}

.qcx-switcher__row {
	display: flex;
	align-items: center;
	gap: 8px;
	box-sizing: border-box;
	height: 31px;
	margin: 0;
	padding: 0 8px;
	color: #1d2327;
	cursor: pointer;
}

.qcx-switcher__row[hidden] {
	display: none;
}

.qcx-switcher__row:hover {
	background: #eef3f8;
}

.qcx-switcher .qcx-switcher__row--selected,
.qcx-switcher .qcx-switcher__row--selected:hover {
	background: #2271b1;
	color: #fff;
}
