/*
 * STX Promotions storefront polish (0.6.29): the owner's UI checklist applied to the plugin's own pieces.
 * Loads after the theme's polish.css so these win. Contrast targets WCAG AA (4.5:1 for body text).
 */

/* Bundle detail page: its section is dark, but the light storefront turned these lines near-black (1.14:1). */
.stx-promo-single .stx-bundle .stx-bundle__title,
.stx-promo-single .stx-bundle .stx-bundle-included h2 {
	color: #f8fafc !important;
}
.stx-promo-single .stx-bundle .stx-bundle-pricing__save,
.stx-promo-single .stx-bundle .stx-bundle-included__lede {
	color: #cbd5e1 !important;
}
/* The FFL notice must be readable: light text on the amber-tinted box. */
.stx-promo-single .stx-bundle .stx-bundle__compliance,
.stx-promo-single .stx-bundle .stx-bundle__compliance strong {
	color: #f8fafc !important;
}
/* "Add Bundle to Cart": white on the orange button (was #111 at 3.65:1). */
.stx-bundle .stx-bundle__atc {
	color: #fff !important;
}
/* "Included with this bundle" sits on white item cards: amber #fbbf24 was 1.67:1; #b45309 is 5:1. */
.stx-bundle .stx-bundle-item__included,
.stx-bundle .stx-bundle-item__included strong {
	color: #b45309 !important;
}

/* Bundle cards: price labels and the contents line were 10-11px. */
.stx-bundle-card .stx-bundle-card__price-label {
	font-size: 0.75rem !important;
}
.stx-bundle-card .stx-bundle-card__contents-label,
.stx-bundle-card .stx-bundle-card__contents {
	font-size: max(0.75rem, 1em) !important;
}

/* Busy state: a pressed bundle or sign-up button shows a spinner and ignores a second press. */
.stx-fb__add.is-busy,
.stx-signup button.is-busy {
	position: relative;
	color: transparent !important;
	pointer-events: none;
}
.stx-fb__add.is-busy::after,
.stx-signup button.is-busy::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 1em;
	height: 1em;
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 50%;
	animation: stx-promo-busy 0.7s linear infinite;
}
@keyframes stx-promo-busy {
	to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
	.stx-fb__add.is-busy::after,
	.stx-signup button.is-busy::after {
		animation: none;
		border-top-color: rgba(255, 255, 255, 0.45);
	}
}

/* Press: 0.97 at once while held, eased back on release (the theme covers .stx-btn; these are the plugin's own buttons). */
.stx-spin__open,
.stx-spin__go,
.stx-spin__close,
.stx-signup button,
.stx-bundle .stx-bundle__atc {
	transition: transform var(--stx-exit, 160ms) var(--stx-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.stx-spin__open:active,
.stx-spin__go:active,
.stx-spin__close:active,
.stx-signup button:active,
.stx-bundle .stx-bundle__atc:active {
	transform: scale(0.97);
	transition-duration: 0s;
}
@media (prefers-reduced-motion: reduce) {
	.stx-spin__open:active,
	.stx-spin__go:active,
	.stx-spin__close:active,
	.stx-signup button:active,
	.stx-bundle .stx-bundle__atc:active {
		transform: none;
	}
}

/* Footer sign-up button was 11.8px. */
.stx-signup button {
	font-size: 0.8125rem;
}

/*
 * 0.6.32: ammo quantity ladder, bulk pricing tiers and the cart nudge. These used dark-theme colors
 * (#9aa4b2 labels at 2.5:1, an amber "Save" badge at 1.4:1) on the storefront's light buy box and cart.
 * Light card, AA text, tabular prices, a 12px floor.
 */
.stx-ammo-ladder {
	margin: 14px 0 16px !important;
	padding: 14px 14px 12px !important;
	border: 1px solid #d8dde3 !important;
	border-left: 3px solid #c9a66b !important;
	border-radius: 6px !important;
	background: #fff !important;
	color: #111827 !important;
}
.stx-ammo-ladder h3 {
	margin: 0 0 10px !important;
	font-size: 0.98rem !important;
	font-weight: 700;
	color: #111827 !important;
	text-wrap: balance;
}
.stx-ammo-ladder__steps {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
	gap: 8px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}
.stx-ammo-ladder__steps li {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0 !important;
	padding: 10px 10px 9px;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	background: #f9fafb;
}
.stx-ammo-ladder__steps li.is-current {
	border-color: #d97706;
	background: #fffbeb;
	box-shadow: inset 0 0 0 1px #d97706;
}
.stx-ammo-ladder__stack {
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 18px;
	margin-bottom: 6px;
}
.stx-ammo-ladder__stack i {
	display: block;
	width: 9px;
	height: 12px;
	border-radius: 1px;
	background: #c9a66b;
}
.stx-ammo-ladder__stack i:nth-child(even) { height: 15px; }
.stx-ammo-ladder__qty {
	font-size: 0.8rem;
	color: #4b5563 !important;
	font-variant-numeric: tabular-nums;
}
.stx-ammo-ladder__each {
	font-size: 1.05rem;
	font-weight: 700;
	color: #111827 !important;
	font-variant-numeric: tabular-nums;
}
.stx-ammo-ladder__each small {
	font-size: 0.75rem;
	font-weight: 400;
	color: #4b5563;
}
.stx-ammo-ladder__save {
	align-self: flex-start;
	margin-top: 4px;
	padding: 1px 7px;
	border-radius: 3px;
	background: #fef3c7;
	color: #92400e !important;
	font-size: 0.75rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.stx-ammo-ladder__note {
	margin: 10px 0 0 !important;
	font-size: 0.82rem !important;
	color: #4b5563 !important;
	text-wrap: pretty;
}

.stx-ammo-nudge {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 16px;
	padding: 12px 14px;
	border: 1px solid #d8dde3;
	border-left: 3px solid #c9a66b;
	border-radius: 6px;
	background: #fffbeb;
	color: #111827;
	font-size: 0.92rem;
	font-variant-numeric: tabular-nums;
}
.stx-ammo-nudge a {
	color: #92400e;
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.stx-ammo-nudge a:focus-visible {
	outline: 2px solid #1e5a8a;
	outline-offset: 2px;
}
.stx-ammo-nudge__boxes { display: flex; gap: 2px; flex: none; }
.stx-ammo-nudge__boxes i {
	display: block;
	width: 8px;
	height: 14px;
	border-radius: 1px;
	border: 1px dashed #9ca3af;
}
.stx-ammo-nudge__boxes i.is-in { border: 0; background: #c9a66b; }

@media (max-width: 480px) {
	.stx-ammo-ladder__steps { grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 6px; }
	.stx-ammo-ladder__steps li { padding: 8px 8px 7px; }
	.stx-ammo-ladder__each { font-size: 0.98rem; }
	.stx-ammo-nudge { align-items: flex-start; flex-direction: column; gap: 8px; }
}

/* Prize ticket: the Copy button presses like the other plugin buttons. */
.stx-spin__ticket-copy {
	transition: transform var(--stx-exit, 160ms) var(--stx-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
}
.stx-spin__ticket-copy:active { transform: scale(0.97); transition-duration: 0s; }
.stx-spin__ticket-copy:focus-visible { outline: 2px solid #facc15; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.stx-spin__ticket-copy:active { transform: none; }
}
