/* =========================================================
   anhqui TierMatrix – Buttons layout
   Colour tokens are set inline on .stpb-wrapper from settings.
   ========================================================= */
.stpb-wrapper {
	--stpb-btn-bg: #faf0dc;
	--stpb-btn-border: #f0e2c6;
	--stpb-btn-text: #2b1a12;
	--stpb-active-bg: #2b1a12;
	--stpb-active-text: #ffffff;
	--stpb-badge-bg: #f2938c;
	--stpb-badge-text: #2b1a12;
	--stpb-radius: 14px;
	margin: 0 0 16px;
}

.stpb-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding-top: 12px; /* room for the badge that overlaps the top edge */
}

.stpb-item {
	position: relative;
	flex: 1 1 110px;
	max-width: 160px;
	min-width: 100px;
}

/* Badge — "Save X" pill sitting on the top edge of the button */
.stpb-badge {
	position: absolute;
	top: -12px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 2;
	white-space: nowrap;
	background: var(--stpb-badge-bg);
	color: var(--stpb-badge-text);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	padding: 6px 10px;
	border-radius: 999px;
	pointer-events: none;
}

.stpb-badge-empty {
	display: none;
}

/* Button */
.stpb-button {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	width: 100%;
	min-height: 66px;
	margin: 0;
	padding: 14px 10px 12px;
	background: var(--stpb-btn-bg);
	color: var(--stpb-btn-text);
	border: 2px solid var(--stpb-btn-border);
	border-radius: var(--stpb-radius);
	box-shadow: none;
	font: inherit;
	line-height: 1.15;
	text-align: center;
	cursor: pointer;
	transition: background-color .15s, color .15s, border-color .15s, transform .12s;
	-webkit-appearance: none;
	appearance: none;
}

.stpb-button:hover,
.stpb-button:focus-visible {
	border-color: var(--stpb-active-bg);
	background: var(--stpb-btn-bg);
	color: var(--stpb-btn-text);
	outline: none;
}

.stpb-button:focus-visible {
	box-shadow: 0 0 0 3px rgba(0, 0, 0, .12);
}

.stpb-item.stp-tier-active .stpb-button,
.stpb-button[aria-pressed="true"] {
	background: var(--stpb-active-bg);
	border-color: var(--stpb-active-bg);
	color: var(--stpb-active-text);
	transform: translateY(-1px);
}

.stpb-qty {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: .02em;
	text-transform: uppercase;
}

.stpb-sub {
	font-size: 12px;
	font-weight: 600;
	opacity: .85;
}

/* Note under the buttons */
.stpb-note {
	margin: 12px 0 0;
	font-size: 13px;
	line-height: 1.45;
	opacity: .75;
}

/* Optional: hide WooCommerce quantity input when buttons drive the quantity */
form.cart.stpb-hide-qty .quantity {
	display: none !important;
}

@media (max-width: 600px) {
	.stpb-item {
		flex-basis: calc(50% - 5px);
		max-width: none;
	}
}
