/*
 * First-time offer ticket on the cart and checkout (inc/intro-offer.php).
 * Champsera website pages: design tokens with plain fallbacks.
 */
.ch-offer {
	--offer-accent: var(--brand-purple, #8b5cf6);
	--offer-accent-2: var(--brand-cyan, #22d3ee);
	--offer-surface: var(--surface-elevated, #111827);
	--offer-text: var(--text-primary, #f8fafc);
	--offer-muted: var(--text-secondary, #cbd5e1);
	--offer-line: var(--border-primary, rgba(255, 255, 255, .16));
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px 24px;
	flex-wrap: wrap;
	margin: 0 0 24px;
	padding: 20px 22px;
	border: 1px solid var(--offer-line);
	border-radius: 18px;
	background: var(--offer-surface);
	color: var(--offer-text);
	overflow: hidden;
	animation: ch-offer-in .5s ease-out both;
}
.ch-offer::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	padding: 1px;
	background: linear-gradient(120deg, var(--offer-accent), var(--offer-accent-2), var(--offer-accent));
	background-size: 200% 100%;
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	animation: ch-offer-border 4s linear infinite;
	pointer-events: none;
}
.ch-offer__text { flex: 1 1 320px; min-width: 0; }
.ch-offer__text strong { display: block; font-size: 1.12rem; line-height: 1.35; color: var(--offer-text); }
.ch-offer__text p { margin: 6px 0 0; font-size: .92rem; line-height: 1.55; color: var(--offer-muted); }
.ch-offer__text b { color: var(--offer-text); letter-spacing: .04em; }
.ch-offer__badge {
	display: inline-block;
	margin-bottom: 8px;
	padding: 4px 10px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--offer-accent) 22%, transparent);
	color: var(--offer-text);
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .08em;
}
.ch-offer__side { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* The coupon ticket */
.ch-offer__ticket {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 2px;
	min-width: 150px;
	padding: 12px 22px;
	border: 2px dashed color-mix(in srgb, var(--offer-text) 55%, transparent);
	border-radius: 12px;
	background: linear-gradient(135deg, var(--offer-accent), var(--offer-accent-2));
	color: #fff;
	font: inherit;
	cursor: pointer;
	overflow: hidden;
	animation: ch-offer-float 3.2s ease-in-out infinite;
}
.ch-offer__ticket strong { font-size: 1.25rem; font-weight: 900; letter-spacing: .12em; color: #fff; }
.ch-offer__ticket small { font-size: .72rem; font-weight: 700; opacity: .92; color: #fff; }
.ch-offer__ticket::after {
	content: "";
	position: absolute;
	top: -50%;
	left: -60%;
	width: 40%;
	height: 200%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
	transform: rotate(20deg);
	animation: ch-offer-shine 2.8s ease-in-out infinite;
}
.ch-offer__cut,
.ch-offer__ticket::before {
	position: absolute;
	top: 50%;
	width: 16px;
	height: 16px;
	margin-top: -8px;
	border-radius: 50%;
	background: var(--offer-surface);
}
.ch-offer__cut { left: -10px; }
.ch-offer__ticket::before { content: ""; right: -10px; }
.ch-offer__ticket:focus-visible { outline: 3px solid var(--focus-color, #22d3ee); outline-offset: 3px; }

/* Apply button */
.ch-offer__apply {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 46px;
	padding: 12px 22px;
	border-radius: 999px;
	background: var(--offer-text);
	color: var(--offer-surface) !important;
	font-weight: 800;
	text-decoration: none !important;
	animation: ch-offer-pulse 2s ease-out infinite;
}
.ch-offer__apply:hover,
.ch-offer__apply:focus-visible { transform: translateY(-1px); }
.ch-offer__apply:focus-visible { outline: 3px solid var(--focus-color, #22d3ee); outline-offset: 3px; }

/* Applied state */
.ch-offer--applied .ch-offer__ticket { cursor: default; animation: none; }
.ch-offer--applied .ch-offer__ticket::after { animation-duration: 5s; }

@keyframes ch-offer-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ch-offer-border { to { background-position: 200% 0; } }
@keyframes ch-offer-float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-4px) rotate(1.5deg); } }
@keyframes ch-offer-shine { 0% { left: -60%; } 60%, 100% { left: 130%; } }
@keyframes ch-offer-pulse {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--offer-accent) 55%, transparent); }
	70% { box-shadow: 0 0 0 14px transparent; }
	100% { box-shadow: 0 0 0 0 transparent; }
}

@media (max-width: 600px) {
	.ch-offer { padding: 18px 16px; }
	.ch-offer__side { width: 100%; justify-content: space-between; }
	.ch-offer__ticket { flex: 1 1 auto; }
	.ch-offer__apply { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
	.ch-offer, .ch-offer::before, .ch-offer__ticket, .ch-offer__ticket::after, .ch-offer__apply { animation: none; }
}
