/* Card quantity stepper (enhancements plan, item 9). Loaded non-blocking:
 * the "+ Add" state uses the existing .bb-btn styles, and the stepper only
 * appears after JavaScript has read the basket. Same 44px height as the
 * button it replaces, so swapping causes no layout shift. */
.bb-stepper { position: relative; width: 100%; }
.bb-stepper [hidden] { display: none !important; }
.bb-stepper__add { gap: 6px; }
.bb-stepper__add svg { flex: none; }

.bb-stepper__ctrl {
	display: flex; align-items: center; justify-content: space-between;
	min-height: var(--bb-touch); border-radius: var(--bb-r-small);
	background: var(--bb-yellow); color: var(--bb-ink);
}
.bb-stepper__btn {
	display: grid; place-items: center; flex: none;
	width: var(--bb-touch); height: var(--bb-touch); padding: 0;
	border: 0; border-radius: var(--bb-r-small); background: transparent; color: var(--bb-ink);
	cursor: pointer; touch-action: manipulation;
}
.bb-stepper__btn:hover { background: rgba(17, 17, 17, .08); }
.bb-stepper__btn:focus-visible { outline: 3px solid var(--bb-ink); outline-offset: -3px; }
.bb-stepper__btn:disabled { opacity: .35; cursor: not-allowed; background: transparent; }
.bb-stepper__val { flex: 1; text-align: center; font: 800 1rem/1 var(--bb-font-body); font-variant-numeric: tabular-nums; }

/* "Only 3 left" at the stock limit: a small tag above the control (no shift). */
.bb-stepper__max {
	position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%);
	padding: 2px 8px; border-radius: var(--bb-r-pill);
	background: var(--bb-ink); color: #fff; font-size: .6875rem; font-weight: 700; white-space: nowrap;
	pointer-events: none;
}

/* List-row cards and narrow compact cards (mini-cart suggestions). */
.bb-card--row .bb-stepper { max-width: 200px; margin-left: auto; }
.bb-card--compact .bb-stepper__btn { width: 36px; }

/* Quick view: sits where Woo's form was. */
.bb-stepper--quickview { max-width: 240px; margin-bottom: 8px; }

@media (prefers-reduced-motion: no-preference) {
	.bb-stepper__ctrl { animation: bb-stepper-in .16s var(--bb-ease); }
	@keyframes bb-stepper-in { from { transform: scale(.96); opacity: .6; } to { transform: none; opacity: 1; } }
}
