/* Rejuven8 — Promotions (Mixed Kits + Free Gifts): cart badges and nudges.
 * Tiny and global so the side cart, cart and checkout all render the same. */

/* Line badges — one tidy chip on its own line under the product name, so a
 * long name never pushes it around; sentence case at 11px so it reads as a
 * label, not a second product title. Checkout's review table keeps it
 * inline because the quantity follows the name there. */
.r8wp-kit-badge,
.r8wp-gift-badge {
	display: block !important;
	width: max-content;
	max-width: 100%;
	margin: 6px 0 0 !important;
	padding: 3px 9px !important;
	border: 0 !important;
	border-radius: 6px !important;
	font-family: inherit !important;
	font-size: 11px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	white-space: nowrap;
	vertical-align: middle;
}
.r8wp-kit-badge { background: #e8eef8 !important; color: #1a44a1 !important; }
.r8wp-kit-badge--single { background: #15803d !important; color: #ffffff !important; }
.r8wp-gift-badge { background: #e3f3e6 !important; color: #166534 !important; }
.woocommerce-checkout-review-order-table .r8wp-kit-badge,
.woocommerce-checkout-review-order-table .r8wp-gift-badge { display: inline-block !important; margin: 0 6px 0 0 !important; }
.woocommerce-checkout-review-order-table .product-name .r8wp-kit-badge + .product-quantity,
.woocommerce-checkout-review-order-table .product-name .r8wp-gift-badge + .product-quantity { margin-left: 2px; }

.r8wp-gift-qty { display: inline-block; min-width: 2em; text-align: center; }

/* ── Progress nudge (cart + checkout) ─────────────────────────────────── */
.r8wp-nudge {
	--r8n-accent: #1a44a1;
	--r8n-text: #1d283a;
	--r8n-muted: #64748b;
	margin: 0 0 18px;
	padding: 12px 14px;
	border: 1px solid rgba(29, 40, 58, .15);
	border-radius: 10px;
	background: #f9fafa;
	color: var(--r8n-text);
	font-size: 13.5px;
	line-height: 1.45;
	box-sizing: border-box;
}
.r8wp-nudge__row {
	display: flex;
	align-items: center;
	gap: 10px;
}
.r8wp-nudge__icon {
	display: inline-flex;
	width: 18px;
	height: 18px;
	flex: none;
	color: var(--r8n-accent);
}
.r8wp-nudge__icon svg { width: 100%; height: 100%; }
.r8wp-nudge__text { flex: 1; min-width: 0; }
.r8wp-nudge__link {
	margin-left: 6px;
	font-weight: 600;
	color: var(--r8n-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
}
.r8wp-nudge__count {
	font-variant-numeric: tabular-nums;
	font-weight: 600;
	color: var(--r8n-muted);
	white-space: nowrap;
}
.r8wp-nudge__bar {
	height: 6px;
	margin-top: 9px;
	border-radius: 999px;
	background: rgba(29, 40, 58, .08);
	overflow: hidden;
}
.r8wp-nudge__bar span {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--r8n-accent);
	transition: width .3s ease;
}
.r8wp-nudge.is-complete {
	--r8n-accent: #15803d;
	border-color: rgba(21, 128, 61, .3);
	background: #f4f9f6;
}
.r8wp-nudge--gift { --r8n-accent: #15803d; }
.r8wp-nudge--gift:not(.is-complete) { border-color: rgba(21, 128, 61, .25); }

@media (prefers-reduced-motion: reduce) {
	.r8wp-nudge__bar span { transition: none; }
}

/* ── Kit price on cart lines (4.16.2) ────────────────────────────────── */
/* woocommerce_cart_item_price / _subtotal show "retail → kit price" for
 * lines inside a complete kit (cart, checkout review, mini / side cart). */
.r8wp-kit-price { white-space: nowrap; }
.r8wp-kit-price del { opacity: .55; text-decoration: line-through; margin-right: 4px; font-weight: 400; }
.r8wp-kit-price ins { text-decoration: none; font-weight: 600; }
.r8wp-kit-price ins .woocommerce-Price-amount { color: #15803d; }


/* ── Coupon errors (4.16.4) ──────────────────────────────────────────── */
/* R8WP_Kits::error_chip() wraps every coupon error (ours and WooCommerce's
 * own) in this chip. The <i> is Font Awesome; when the font is not on the
 * page promotions.js adds html.r8wp-nofa and the ::before draws the icon. */
.r8wp-coupon-error {
	display: inline-flex;
	align-items: flex-start;
	gap: 9px;
	max-width: 100%;
	padding: 9px 13px 9px 11px;
	border: 1px solid #f3b4b4;
	border-radius: 10px;
	background: #fdecec;
	color: #9f1d1d;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.4;
	text-align: left;
	box-shadow: 0 1px 2px rgba(159, 29, 29, .06);
	animation: r8wp-chip-in .18s ease-out;
}
@keyframes r8wp-chip-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.r8wp-coupon-error__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 18px; height: 18px; margin-top: 1px; color: #dc2626; font-size: 16px; line-height: 1; }
.r8wp-coupon-error__icon i { display: inline-block; width: 1em; text-align: center; }
html.r8wp-nofa .r8wp-coupon-error__icon i { display: none; }
html.r8wp-nofa .r8wp-coupon-error__icon::before { content: "!"; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.r8wp-coupon-error__text { min-width: 0; }
.r8wp-coupon-error__text a { color: inherit; text-decoration: underline; }
/* strip WooCommerce's / the theme's notice box around the chip */
.woocommerce-error:has(> li > .r8wp-coupon-error),
.woocommerce-error:has(> .r8wp-coupon-error) {
	display: block;
	margin: 0 0 14px !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	list-style: none !important;
	color: inherit;
}
.woocommerce-error:has(.r8wp-coupon-error)::before,
.woocommerce-error li:has(> .r8wp-coupon-error)::before { display: none !important; content: none !important; }
.woocommerce-error li:has(> .r8wp-coupon-error) { margin: 0 !important; padding: 0 !important; list-style: none !important; }
/* the classic cart's inline coupon error (rebuilt by promotions.js) */
.coupon-error-notice:has(> .r8wp-coupon-error) { display: block; margin: 10px 0 0 !important; color: inherit !important; font-size: 1em !important; }
.woocommerce form .form-row input.input-text.has-error, .woocommerce-cart #coupon_code.has-error { border-color: #dc2626 !important; }
