/*
 * upsello – Checkout Order Bump.
 * Eigenständig gestylte Box im BlockBande-Look (dunkle Card, grüner Akzent),
 * unabhängig vom Theme-Hintergrund. Mobile-first.
 */

.upsello-bump {
	--upsello-bg: #0f1f3a;
	--upsello-border: #1a3058;
	--upsello-accent: #2ecc71;
	--upsello-text: #ffffff;
	--upsello-muted: #8aa4c8;

	margin: 0 0 20px;
}

.upsello-bump__inner {
	position: relative;
	display: grid;
	grid-template-columns: 26px 56px minmax(0, 1fr);
	gap: 12px;
	align-items: center;
	padding: 14px 14px 14px 16px;
	background:
		radial-gradient(circle at top right, rgba(46, 204, 113, 0.16), transparent 40%),
		linear-gradient(135deg, var(--upsello-bg) 0%, #0a1628 100%);
	border: 2px dashed rgba(46, 204, 113, 0.55);
	border-radius: 12px;
	cursor: pointer;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.upsello-bump__inner:hover {
	border-color: var(--upsello-accent);
	box-shadow: 0 6px 24px rgba(46, 204, 113, 0.18);
}

.upsello-bump--active .upsello-bump__inner {
	border-style: solid;
	border-color: var(--upsello-accent);
	box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.35), 0 6px 24px rgba(46, 204, 113, 0.22);
}

/* Native Checkbox visuell ersetzen, aber zugänglich halten. */
.upsello-bump__checkbox {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.upsello-bump__check {
	width: 24px;
	height: 24px;
	border: 2px solid var(--upsello-muted);
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.05);
	transition: all 0.15s ease;
	flex-shrink: 0;
	position: relative;
}

.upsello-bump__checkbox:checked ~ .upsello-bump__check {
	background: var(--upsello-accent);
	border-color: var(--upsello-accent);
}

.upsello-bump__checkbox:checked ~ .upsello-bump__check::after {
	content: '';
	position: absolute;
	left: 7px;
	top: 2px;
	width: 6px;
	height: 12px;
	border: solid #ffffff;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

.upsello-bump__checkbox:focus-visible ~ .upsello-bump__check {
	outline: 2px solid rgba(46, 204, 113, 0.7);
	outline-offset: 2px;
}

.upsello-bump__media {
	width: 56px;
	height: 56px;
	border-radius: 8px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.06);
	display: flex;
	align-items: center;
	justify-content: center;
}

.upsello-bump__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.upsello-bump__content {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

/* Countdown-Pill: baut Kaufdruck auf, wird unter 60 s rot und pulsiert. */
.upsello-bump__timer {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	padding: 3px 10px;
	border-radius: 999px;
	background: linear-gradient(135deg, #ff9800, #e65100);
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	white-space: nowrap;
}

.upsello-bump__timer-value {
	font-variant-numeric: tabular-nums;
	font-size: 13px;
}

.upsello-bump__timer--urgent {
	background: linear-gradient(135deg, #e74c3c, #b71c1c);
	animation: upsello-timer-pulse 1s ease-in-out infinite;
}

.upsello-bump__timer--expired {
	background: linear-gradient(135deg, #2ecc71, #1e8e4f);
	animation: none;
}

@keyframes upsello-timer-pulse {
	0%,
	100% {
		box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.55);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(231, 76, 60, 0);
	}
}

.upsello-bump__headline {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.35;
	color: var(--upsello-text);
}

.upsello-bump__headline del {
	color: var(--upsello-muted);
	font-weight: 500;
}

.upsello-bump__plus {
	margin-right: 2px;
}

.upsello-bump__pricing {
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
}

.upsello-bump__price {
	font-size: 17px;
	font-weight: 800;
	color: var(--upsello-accent);
}

.upsello-bump__regular {
	font-size: 13px;
	color: var(--upsello-muted);
}

.upsello-bump__badge {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #ffffff;
	background: linear-gradient(135deg, #e040fb, #ff9800);
	padding: 2px 8px;
	border-radius: 999px;
	white-space: nowrap;
}

.upsello-bump__desc {
	font-size: 12px;
	color: var(--upsello-muted);
	line-height: 1.4;
}

/* Lade-Zustand: Interaktion sperren, Spinner zeigen. */
.upsello-bump--busy .upsello-bump__inner {
	pointer-events: none;
	opacity: 0.65;
}

.upsello-bump__spinner {
	display: none;
	position: absolute;
	top: 12px;
	right: 12px;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.25);
	border-top-color: var(--upsello-accent);
	border-radius: 50%;
	animation: upsello-spin 0.7s linear infinite;
}

.upsello-bump--busy .upsello-bump__spinner {
	display: block;
}

@keyframes upsello-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Gesperrtes Mengenfeld der Bump-Position auf der Warenkorbseite. */
.upsello-qty-locked {
	display: inline-block;
	min-width: 32px;
	text-align: center;
	font-weight: 700;
}

/* Mobile: kompaktere Box, größere Touch-Fläche. */
@media (max-width: 480px) {
	.upsello-bump__inner {
		grid-template-columns: 24px 48px minmax(0, 1fr);
		gap: 10px;
		padding: 12px;
	}

	.upsello-bump__media {
		width: 48px;
		height: 48px;
	}

	.upsello-bump__headline {
		font-size: 13px;
	}

	.upsello-bump__price {
		font-size: 16px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.upsello-bump__spinner,
	.upsello-bump__timer--urgent {
		animation: none;
	}
}

/* ---------------------------------------------------------------------
 * Phase 2: Post-Purchase Upsell (Thank-You-Page)
 * ------------------------------------------------------------------- */

.upsello-postpurchase {
	margin: 28px 0 36px;
	max-width: none;
	width: 100%;
}

.upsello-postpurchase__card {
	position: relative;
	padding: 28px 32px;
	border-radius: 16px;
	background:
		radial-gradient(circle at top right, rgba(46, 204, 113, 0.22), transparent 45%),
		radial-gradient(circle at bottom left, rgba(224, 64, 251, 0.12), transparent 40%),
		linear-gradient(135deg, #0f1f3a 0%, #0a1628 100%);
	border: 2px solid rgba(46, 204, 113, 0.55);
	box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.2), 0 14px 48px rgba(0, 0, 0, 0.35);
	color: #ffffff;
	animation: upsello-pp-glow 2.4s ease-in-out infinite;
}

@keyframes upsello-pp-glow {
	0%,
	100% {
		box-shadow: 0 0 0 1px rgba(46, 204, 113, 0.2), 0 14px 48px rgba(0, 0, 0, 0.35);
	}
	50% {
		box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.28), 0 14px 48px rgba(0, 0, 0, 0.35);
	}
}

.upsello-postpurchase__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.upsello-postpurchase__badge {
	display: inline-block;
	padding: 6px 16px;
	border-radius: 999px;
	background: linear-gradient(135deg, #e040fb, #ff9800);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.6px;
	text-transform: uppercase;
}

/* Großer, prominenter Countdown – der Timer soll sofort ins Auge fallen. */
.upsello-postpurchase__timer {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
	padding: 8px 18px;
	border-radius: 999px;
	background: linear-gradient(135deg, #ff9800, #e65100);
	color: #ffffff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	white-space: nowrap;
}

.upsello-postpurchase__timer.upsello-bump__timer--urgent {
	background: linear-gradient(135deg, #e74c3c, #b71c1c);
	animation: upsello-timer-pulse 1s ease-in-out infinite;
}

.upsello-postpurchase__timer .upsello-bump__timer-value {
	font-size: 22px;
	line-height: 1;
}

.upsello-postpurchase__timer .upsello-bump__timer-icon {
	font-size: 16px;
}

.upsello-postpurchase__body {
	display: grid;
	grid-template-columns: 110px minmax(0, 1fr);
	gap: 24px;
	align-items: center;
	margin-bottom: 22px;
}

.upsello-postpurchase__media {
	width: 110px;
	height: 110px;
	border-radius: 12px;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.06);
}

.upsello-postpurchase__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.upsello-postpurchase__headline {
	margin: 0 0 10px;
	font-size: 24px;
	font-weight: 800;
	line-height: 1.3;
	color: #ffffff;
}

.upsello-postpurchase__headline del {
	color: #8aa4c8;
	font-weight: 500;
}

.upsello-postpurchase__pricing {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 10px;
}

.upsello-postpurchase__price {
	font-size: 30px;
	font-weight: 800;
	color: #2ecc71;
}

.upsello-postpurchase__regular {
	font-size: 17px;
	color: #8aa4c8;
}

.upsello-postpurchase__pricing .upsello-bump__badge {
	font-size: 13px;
	padding: 4px 12px;
}

.upsello-postpurchase__desc,
.upsello-postpurchase__hint {
	margin: 0;
	font-size: 15px;
	line-height: 1.5;
	color: #8aa4c8;
}

.upsello-postpurchase__hint {
	margin-top: 6px;
	color: #2ecc71;
	font-weight: 600;
}

.upsello-postpurchase__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.upsello-postpurchase__accept.button.alt {
	background: #2ecc71 !important;
	border-color: #2ecc71 !important;
	color: #0a1628 !important;
	font-weight: 800;
	font-size: 17px;
	padding: 16px 36px;
	height: auto;
	line-height: 1.2;
	flex: 1 1 auto;
	text-align: center;
}

.upsello-postpurchase__decline.button {
	background: transparent !important;
	border: 1px solid rgba(255, 255, 255, 0.25) !important;
	color: #8aa4c8 !important;
	font-size: 14px;
	padding: 16px 22px;
	height: auto;
	line-height: 1.2;
}

.upsello-postpurchase__status {
	margin-top: 14px;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
}

.upsello-postpurchase__status--success {
	background: rgba(46, 204, 113, 0.15);
	color: #2ecc71;
}

.upsello-postpurchase__status--error {
	background: rgba(231, 76, 60, 0.15);
	color: #e74c3c;
}

.upsello-postpurchase--busy .upsello-postpurchase__card {
	opacity: 0.7;
	pointer-events: none;
}

.upsello-postpurchase--busy .upsello-postpurchase__spinner {
	display: block;
}

@media (max-width: 600px) {
	.upsello-postpurchase__card {
		padding: 18px;
	}

	.upsello-postpurchase__header {
		justify-content: flex-start;
	}

	.upsello-postpurchase__body {
		grid-template-columns: 72px minmax(0, 1fr);
		gap: 14px;
	}

	.upsello-postpurchase__media {
		width: 72px;
		height: 72px;
	}

	.upsello-postpurchase__headline {
		font-size: 18px;
	}

	.upsello-postpurchase__price {
		font-size: 24px;
	}

	.upsello-postpurchase__timer .upsello-bump__timer-value {
		font-size: 18px;
	}

	.upsello-postpurchase__actions {
		flex-direction: column;
	}

	.upsello-postpurchase__accept.button.alt,
	.upsello-postpurchase__decline.button {
		width: 100%;
		text-align: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	.upsello-postpurchase__card {
		animation: none;
	}
}
