/* Cart Rescue — capture popup
   Inherits the store's own font so it never looks bolted on. */

.crs-popup {
	--crs-accent: #5B4BE1;
	--crs-ink: #12141D;
	--crs-radius: 20px;
	--crs-muted: #6B7080;
	--crs-line: #E6E7EE;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	font-family: inherit;
}

.crs-popup[hidden] { display: none; }

.crs-popup__scrim {
	position: absolute;
	inset: 0;
	background: rgba(12, 14, 24, .48);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity .28s ease;
}

.crs-popup.is-open .crs-popup__scrim { opacity: 1; }

.crs-popup__card {
	position: relative;
	display: flex;
	width: 100%;
	max-width: 880px;
	max-height: calc(100vh - 40px);
	overflow: hidden;
	background: #fff;
	border-radius: var(--crs-radius);
	box-shadow: 0 32px 80px -20px rgba(12, 14, 24, .35);
	opacity: 0;
	transform: translateY(14px) scale(.985);
	transition: opacity .3s ease, transform .3s cubic-bezier(.2, .8, .3, 1);
}

.crs-popup.is-open .crs-popup__card {
	opacity: 1;
	transform: none;
}

.crs-popup[data-layout="centered"] .crs-popup__card { max-width: 460px; }

.crs-popup__media {
	flex: 0 0 42%;
	background: #EFEFF4 center / cover no-repeat;
}

.crs-popup__body {
	flex: 1 1 auto;
	padding: 44px 40px 38px;
	overflow-y: auto;
}

.crs-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	padding: 0;
	color: var(--crs-ink);
	background: rgba(255, 255, 255, .82);
	border: 1px solid var(--crs-line);
	border-radius: 50%;
	cursor: pointer;
	transition: background .18s ease, transform .18s ease;
}

.crs-popup__close:hover { background: #fff; transform: scale(1.05); }

/* --- Type ---------------------------------------------------------- */

.crs-popup .crs-eyebrow {
	display: inline-block;
	margin-bottom: 14px;
	padding: 5px 10px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--crs-accent);
	background: rgba(91, 75, 225, .09);
	background: color-mix(in srgb, var(--crs-accent) 10%, transparent);
	border-radius: 100px;
}

.crs-popup .crs-heading {
	margin: 0 0 10px;
	font-size: clamp(24px, 3.4vw, 31px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -.02em;
	color: var(--crs-ink);
}

.crs-popup .crs-sub {
	margin: 0 0 22px;
	font-size: 15px;
	line-height: 1.6;
	color: var(--crs-muted);
}

.crs-popup .crs-note {
	margin: 14px 0 0;
	font-size: 12.5px;
	line-height: 1.55;
	color: var(--crs-muted);
	opacity: .85;
}

/* --- Form ---------------------------------------------------------- */

.crs-popup .crs-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.crs-popup .crs-inputrow {
	display: flex;
	gap: 8px;
	align-items: stretch;
}

.crs-popup .crs-email {
	flex: 1 1 auto;
	min-width: 0;
	height: 50px;
	margin: 0;
	padding: 0 15px;
	font-size: 15px;
	font-family: inherit;
	color: var(--crs-ink);
	background: #fff;
	border: 1.5px solid var(--crs-line);
	border-radius: 11px;
	outline: none;
	transition: border-color .16s ease, box-shadow .16s ease;
}

.crs-popup .crs-email:focus {
	border-color: var(--crs-accent);
	box-shadow: 0 0 0 3px rgba(91, 75, 225, .16);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--crs-accent) 18%, transparent);
}

.crs-popup .crs-email::placeholder { color: #A3A7B4; }

.crs-popup .crs-submit,
.crs-popup .crs-btn-primary {
	position: relative;
	flex: 0 0 auto;
	height: 50px;
	padding: 0 22px;
	font-size: 15px;
	font-weight: 600;
	font-family: inherit;
	color: #fff;
	background: var(--crs-accent);
	border: 0;
	border-radius: 11px;
	cursor: pointer;
	transition: filter .16s ease, transform .16s ease;
}

.crs-popup .crs-submit:hover,
.crs-popup .crs-btn-primary:hover { filter: brightness(1.08); }

.crs-popup .crs-submit:active { transform: translateY(1px); }

.crs-popup .crs-btn-primary {
	width: 100%;
	margin-top: 20px;
}

.crs-popup .crs-submit.is-busy .crs-submit__label { visibility: hidden; }

.crs-popup .crs-spinner {
	display: none;
	position: absolute;
	top: 50%;
	left: 50%;
	width: 17px;
	height: 17px;
	margin: -8.5px 0 0 -8.5px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: crs-spin .7s linear infinite;
}

.crs-popup .crs-submit.is-busy .crs-spinner { display: block; }

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

.crs-popup .crs-consent {
	display: flex;
	gap: 9px;
	align-items: flex-start;
	margin-top: 14px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--crs-muted);
	cursor: pointer;
}

.crs-popup .crs-consent input { margin: 2px 0 0; accent-color: var(--crs-accent); }

.crs-popup .crs-error {
	margin: 12px 0 0;
	font-size: 13.5px;
	font-weight: 500;
	color: #D33A22;
}

/* --- Success ticket (the signature moment) -------------------------- */

.crs-popup .crs-ticket {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0 0 24px;
	padding: 24px 22px 22px;
	text-align: center;
	background: #FBFBFD;
	border: 2px dashed var(--crs-line);
	border-radius: 14px;
}

/* Perforated notches */
.crs-popup .crs-ticket::before,
.crs-popup .crs-ticket::after {
	content: "";
	position: absolute;
	top: 50%;
	width: 20px;
	height: 20px;
	background: #fff;
	border: 2px dashed var(--crs-line);
	border-radius: 50%;
	transform: translateY(-50%);
	clip-path: inset(0 0 0 50%);
}

.crs-popup .crs-ticket::before { left: -11px; }
.crs-popup .crs-ticket::after  { right: -11px; transform: translateY(-50%) rotate(180deg); }

.crs-popup .crs-ticket__label {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--crs-muted);
}

.crs-popup .crs-ticket__code {
	margin: 9px 0 14px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 25px;
	font-weight: 700;
	letter-spacing: .06em;
	color: var(--crs-ink);
	word-break: break-all;
}

.crs-popup .crs-ticket__copy {
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	color: var(--crs-ink);
	background: #fff;
	border: 1.5px solid var(--crs-line);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color .16s ease, color .16s ease;
}

.crs-popup .crs-ticket__copy:hover { border-color: var(--crs-accent); color: var(--crs-accent); }
.crs-popup .crs-ticket__copy.is-done { border-color: #0E9F6E; color: #0E9F6E; }

/* --- Mobile: bottom sheet ------------------------------------------- */

@media (max-width: 720px) {
	.crs-popup { align-items: flex-end; padding: 0; }

	.crs-popup__card {
		max-width: none;
		max-height: 92vh;
		border-radius: var(--crs-radius) var(--crs-radius) 0 0;
		transform: translateY(28px);
	}

	.crs-popup__media { display: none; }
	.crs-popup__body { padding: 34px 22px 30px; }
	.crs-popup .crs-inputrow { flex-direction: column; }
	.crs-popup .crs-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.crs-popup__card,
	.crs-popup__scrim { transition: none; }
	.crs-popup .crs-spinner { animation-duration: 2s; }
}
