/* ---- BUY MORE, SAVE MORE table (product page) ---- */
/* .product-price-group is a wrapping flexbox; the price-wrapper is its first item. Give the table a
   full-row basis so it wraps onto its own line *under* the price and spans the whole details column —
   the same width as the add-to-cart row below it. */
.route-product-product:not(.popup) .product-price-group > div.qty-discount-table {
	flex-basis: 100% !important;
	margin-top: 8px;
}

.qty-discount-table__sr-only,
.qty-discount-table .sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.qty-discount-table {
	margin-bottom: 16px;
	border: 1px solid #e2e5ea;
	border-radius: 8px;
	overflow: hidden;
	/* The theme sets pointer-events:none on the product-price area; re-enable it so the rows are clickable. */
	pointer-events: auto;
	width: 100%;
}

.qty-discount-table__head {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 14px;
	background: #f5f6f8;
	color: #2b59c3;
	font-weight: 700;
	border-bottom: 1px solid #e2e5ea;
}

.qty-discount-table__grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: auto;
	font-size: 14px;
}

.qty-discount-table__grid th,
.qty-discount-table__grid td {
	padding: 10px 14px;
	text-align: left;
	vertical-align: middle;
	border: 0;
}

.qty-discount-table__grid thead th {
	background: #f5f6f8;
	color: #6b7280;
	font-weight: 600;
	font-size: 13px;
	border-bottom: 1px solid #e2e5ea;
}

.qty-discount-table__grid tbody tr + tr th,
.qty-discount-table__grid tbody tr + tr td {
	border-top: 1px solid #eef0f3;
}

/* No sequential/cumulative highlight: only the row whose radio is selected is shaded, so it is clear a
   specific quantity is chosen — not a range. */
.qty-discount-table__row {
	cursor: pointer;
}

.qty-discount-table__row:hover th,
.qty-discount-table__row:hover td {
	background: #f7f8fa;
}

.qty-discount-table__row:has(.qty-discount-table__radio:checked) th,
.qty-discount-table__row:has(.qty-discount-table__radio:checked) td {
	background: #eef0f3;
}

.qty-discount-table__radio-col {
	width: 40px;
	text-align: center !important;
	padding-right: 0 !important;
}

.qty-discount-table__radio {
	margin: 0;
	cursor: pointer;
	accent-color: #2b59c3;
}

.qty-discount-table__col-qty {
	font-weight: 700;
	white-space: nowrap;
}

.qty-discount-table__col-qty label {
	margin: 0;
	cursor: pointer;
	font-weight: inherit;
}

.qty-discount-table__price {
	color: #2b59c3;
	font-weight: 700;
	white-space: nowrap;
}

.qty-discount-table__col-total,
.qty-discount-table__col-save {
	text-align: right !important;
	white-space: nowrap;
}

.qty-discount-table__total {
	font-weight: 700;
	color: #1f2937;
}

.qty-discount-table__save {
	display: inline-block;
	padding: 2px 10px;
	background: #fdecea;
	border-radius: 12px;
	color: #d9534f;
	font-size: 12px;
	white-space: nowrap;
}

@media (max-width: 575.98px) {
	.qty-discount-table__grid th,
	.qty-discount-table__grid td {
		padding: 9px 8px;
	}

	.qty-discount-table__grid,
	.qty-discount-table__grid thead th {
		font-size: 12.5px;
	}
}

/* ---- reward preflight banner ---- */

.qty-discount-table-reward {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	margin-bottom: 16px;
	background: #e6f4ea;
	border: 1px solid #b7e0c4;
	border-radius: 4px;
	color: #1c5b32;
}

.qty-discount-table-reward__text {
	flex: 1 1 auto;
}

.qty-discount-table-reward__info {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	line-height: 18px;
	padding: 0;
	border: 1px solid currentColor;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-weight: 700;
	cursor: pointer;
}

.qty-discount-table-reward__info:focus-visible {
	outline: 2px solid #1c5b32;
	outline-offset: 2px;
}

/* ---- modal ---- */

.qty-discount-table-modal[hidden] {
	display: none;
}

.qty-discount-table-modal {
	position: fixed;
	inset: 0;
	z-index: 2050;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.qty-discount-table-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .5);
}

.qty-discount-table-modal__dialog {
	position: relative;
	max-width: 520px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 6px;
	padding: 24px;
}

.qty-discount-table-modal__x {
	position: absolute;
	top: 8px;
	right: 12px;
	border: 0;
	background: transparent;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.qty-discount-table-modal__title {
	margin: 0 0 16px;
	font-size: 20px;
}

.qty-discount-table-modal__note {
	padding: 12px;
	border: 1px solid #f0c2c2;
	border-radius: 4px;
	color: #a12f2f;
}

.qty-discount-table-modal__footer {
	margin-top: 16px;
	text-align: right;
}

@media (prefers-reduced-motion: reduce) {
	.qty-discount-table-modal {
		transition: none;
	}
}

/* ---- reward banner as the first item of the mini-cart slider list  ---- */

.cart-reward {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ---- cart page: the banner lives inside the flex .cart-total ---- */

.cart-total:has(.qty-discount-table-reward) {
	flex-wrap: wrap;
}

.cart-total .qty-discount-table-reward {
	flex: 0 0 100%;
}
