/**
 * Weighted Items Dynamic Pricing — front-end styles.
 *
 * The price "pulse" that used to be applied via inline jQuery .css() calls now
 * lives here as a class toggle, which keeps the transition smooth and lets a
 * theme override it.
 */

.widp-selector {
	margin: 0 0 1.25em;
}

.widp-selector__label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.4em;
}

.widp-amount {
	font-size: 1rem;
	max-width: 320px;
	padding: 0.6em 0.7em;
	width: 100%;
}

.widp-hint {
	color: currentColor;
	font-size: 0.82em;
	margin: 0.45em 0 0;
	opacity: 0.65;
}

/* Stepper --------------------------------------------------------------- */

.widp-stepper {
	align-items: stretch;
	display: flex;
	gap: 0.4em;
	max-width: 320px;
}

.widp-stepper__btn {
	border: 1px solid currentColor;
	border-radius: 4px;
	cursor: pointer;
	flex: 0 0 2.75em;
	font-size: 1.1rem;
	line-height: 1;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.widp-stepper__btn:hover,
.widp-stepper__btn:focus-visible {
	opacity: 1;
}

.widp-stepper .widp-amount {
	flex: 1 1 auto;
	text-align: center;
}

.widp-stepper__unit {
	align-self: center;
	font-size: 0.9em;
	opacity: 0.75;
}

.widp-stepper__readout {
	font-size: 0.9em;
	margin: 0.4em 0 0;
	opacity: 0.8;
}

/* Live total ------------------------------------------------------------ */

.widp-total {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
	margin-top: 0.9em;
	transform: scale(1);
	transform-origin: left center;
	transition: transform 0.3s ease-in-out, color 0.3s ease-in-out;
}

.widp-total__label {
	font-size: 0.85em;
	letter-spacing: 0.04em;
	opacity: 0.7;
	text-transform: uppercase;
}

.widp-total__value {
	font-size: 1.35em;
	font-weight: 700;
}

.widp-total--pulse {
	color: #c9302c;
	transform: scale(1.06);
}

@media ( prefers-reduced-motion: reduce ) {
	.widp-total,
	.widp-stepper__btn {
		transition: none;
	}

	.widp-total--pulse {
		transform: none;
	}
}

/* Misc ------------------------------------------------------------------ */

.widp-unit-suffix {
	font-size: 0.8em;
	opacity: 0.7;
}

.quantity.widp-qty-locked {
	display: none !important;
}


/* Archive "Choose amount" link ------------------------------------------ */

.woocommerce-loop-product__link + .widp-choose-button,
.product-small .widp-choose-button,
.add-to-cart-button a.widp-choose-button,
.widp-choose-button {
	box-sizing: border-box;
	display: block;
	text-align: center;
	white-space: nowrap;
	width: 100%;
}

.product-small .add-to-cart-button {
	display: block;
	width: 100%;
}

@media (max-width: 480px) {
	.widp-choose-button {
		font-size: 0.7rem;
		padding-left: 0.4em;
		padding-right: 0.4em;
	}
}

@media (max-width: 388px) {
	.product-small .add-to-cart-button a.widp-choose-button,
	.add-to-cart-button a.widp-choose-button,
	.widp-choose-button {
		font-size: 11px;
		padding: 8px 6px;
		line-height: 1.8;
		white-space: normal;
	}
}