.pvu-wrap {
	--pvu-border: #e4e4e7;
	--pvu-bg: #fafafa;
	--pvu-text: #18181b;
	--pvu-muted: #71717a;
	--pvu-accent: #18181b;
	--pvu-radius: 10px;

	margin: 20px 0;
}

/* Hide WooCommerce's native quantity input; we drive it programmatically. */
.pvu-wrap .quantity {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

.pvu-stepper {
	background: var( --pvu-bg );
	border: 1px solid var( --pvu-border );
	border-radius: var( --pvu-radius );
	padding: 18px;
	max-width: 420px;
	font-family: inherit;
}

.pvu-group-title {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var( --pvu-text );
	margin: 14px 0 8px;
}

.pvu-group-title:first-child {
	margin-top: 0;
}

.pvu-field-row {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
}

.pvu-field-row + .pvu-field-row {
	margin-top: 4px;
}

.pvu-field {
	flex: 1 1 140px;
}

.pvu-field--wide {
	flex-basis: 100%;
}

.pvu-field__label {
	display: block;
	font-size: 12.5px;
	color: var( --pvu-muted );
	margin-bottom: 6px;
}

.pvu-field__control {
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid var( --pvu-border );
	border-radius: 8px;
	overflow: hidden;
}

.pvu-btn {
	appearance: none;
	border: none;
	background: transparent;
	width: 38px;
	height: 40px;
	font-size: 18px;
	line-height: 1;
	color: var( --pvu-text );
	cursor: pointer;
	transition: background-color 0.15s ease;
	flex-shrink: 0;
}

.pvu-btn:hover {
	background: var( --pvu-bg );
}

.pvu-btn:active {
	background: var( --pvu-border );
}

/* Small, snappy press feedback — reset via JS on every click so it can replay on rapid taps. */
@keyframes pvuBtnPop {
	0% {
		transform: scale( 1 );
	}
	45% {
		transform: scale( 0.82 );
	}
	100% {
		transform: scale( 1 );
	}
}

.pvu-btn.pvu-pop {
	animation: pvuBtnPop 220ms cubic-bezier( 0.34, 1.56, 0.64, 1 );
}

/* Highlight a meter/cm pair right after it auto-snaps to the minimum length. */
@keyframes pvuPairPulse {
	0% {
		box-shadow: 0 0 0 0 rgba( 24, 24, 27, 0.12 );
	}
	60% {
		box-shadow: 0 0 0 6px rgba( 24, 24, 27, 0 );
	}
	100% {
		box-shadow: 0 0 0 0 rgba( 24, 24, 27, 0 );
	}
}

.pvu-pair--pulse .pvu-field__control {
	animation: pvuPairPulse 600ms ease-out;
}

/* Minimum-purchase confirmation modal. */
.pvu-modal-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba( 24, 24, 27, 0.45 );
	align-items: center;
	justify-content: center;
	z-index: 100000;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.pvu-modal-overlay.is-visible {
	display: flex;
}

.pvu-modal-overlay.is-open {
	opacity: 1;
}

.pvu-modal {
	background: #fff;
	border-radius: 14px;
	padding: 24px 22px;
	max-width: 320px;
	width: calc( 100% - 40px );
	text-align: center;
	transform: scale( 0.9 ) translateY( 6px );
	opacity: 0;
	transition: transform 0.22s cubic-bezier( 0.34, 1.56, 0.64, 1 ), opacity 0.2s ease;
	box-shadow: 0 20px 40px rgba( 0, 0, 0, 0.18 );
}

.pvu-modal-overlay.is-open .pvu-modal {
	transform: scale( 1 ) translateY( 0 );
	opacity: 1;
}

.pvu-modal__text {
	margin: 0 0 18px;
	font-size: 14.5px;
	line-height: 1.7;
	color: var( --pvu-text );
}

.pvu-modal__btn {
	appearance: none;
	border: none;
	background: var( --pvu-accent );
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	padding: 10px 28px;
	border-radius: 8px;
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.pvu-modal__btn:hover {
	opacity: 0.9;
}

.pvu-modal__btn:active {
	transform: scale( 0.95 );
}

.pvu-input {
	flex: 1;
	border: none;
	text-align: center;
	font-size: 15px;
	font-weight: 500;
	color: var( --pvu-text );
	background: transparent;
	padding: 0;
	width: 100%;
	pointer-events: none;
}

.pvu-input:focus {
	outline: none;
}

.pvu-total {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px dashed var( --pvu-border );
	display: flex;
	align-items: baseline;
	justify-content: space-between;
}

.pvu-total__label {
	font-size: 13px;
	color: var( --pvu-muted );
}

.pvu-total__value {
	font-size: 19px;
	font-weight: 700;
	color: var( --pvu-accent );
}

@media ( max-width: 480px ) {
	.pvu-stepper {
		max-width: 100%;
	}
}
