/*
 * "Ecoswap is now Wayvo" modal (Paul, 2026-10-24).
 * functions/ecoswapRedirectModal.php. Loads site-wide; opens on ?ref=ecoswap.
 *
 * Desktop: centred card. Phones: a bottom sheet, so it doesn't cover the
 * page on arrival (Google's mobile interstitial guidance).
 */

.wv-esm {
	width: calc(100% - 32px);
	max-width: 440px;
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 24px;
	background: var(--wv-white, #fff);
	color: var(--wv-ink, #101011);
	font-family: var(--wv-btn-font, sans-serif);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
	overflow: auto;
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition: opacity 220ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.wv-esm[open].is-visible {
	opacity: 1;
	transform: none;
}

.wv-esm::backdrop {
	background: rgba(16, 16, 17, 0.45);
	opacity: 0;
	transition: opacity 220ms ease;
}

.wv-esm.is-visible::backdrop {
	opacity: 1;
}

.wv-esm__panel {
	position: relative;
}

/* ── Close ──────────────────────────────────────────────────────────────── */

.wv-esm__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: var(--wv-ink, #101011);
	cursor: pointer;
	transition: background 150ms ease;
}

.wv-esm__close:hover,
.wv-esm__close:focus-visible {
	background: var(--wv-white, #fff);
}

/* ── Card art ───────────────────────────────────────────────────────────── */

.wv-esm__art {
	position: relative;
	height: 200px;
	background: var(--wv-grey-200, #f5f5f5);
	overflow: hidden;
}

.wv-esm__card {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 200px;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.wv-esm__card--back {
	transform: translate(-72%, -58%) rotate(-9deg);
}

.wv-esm__card--front {
	transform: translate(-30%, -40%) rotate(6deg);
}

/* ── Body ───────────────────────────────────────────────────────────────── */

.wv-esm__body {
	padding: 26px 32px 30px;
	text-align: center;
}

.wv-esm__swap {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 14px;
	padding: 6px 12px;
	border-radius: 9999px;
	background: var(--wv-grey-200, #f5f5f5);
	font-size: 13px;
	line-height: 1;
	font-weight: 500;
}

.wv-esm__old {
	color: var(--wv-grey-500, #8d8b8b);
	text-decoration: line-through;
}

.wv-esm__arrow {
	color: var(--wv-grey-500, #8d8b8b);
}

.wv-esm__title {
	margin: 0 0 10px;
	font-family: inherit;
	font-size: 30px;
	line-height: 1.1;
	font-weight: 500;
	letter-spacing: -0.03em;
	color: inherit;
}

.wv-esm__text {
	max-width: 34ch;
	margin: 0 auto 24px;
	font-size: 15px;
	line-height: 1.5;
	color: #4a4a4c;
}

.wv-esm__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.wv-esm__cta {
	width: 100%;
	justify-content: center;
}

/* ── Phones: bottom sheet ───────────────────────────────────────────────── */

@media (max-width: 767px) {

	.wv-esm {
		width: 100%;
		max-width: none;
		max-height: 85dvh;
		margin: auto 0 0;
		border-radius: 24px 24px 0 0;
		transform: translateY(100%);
		transition: opacity 220ms ease, transform 380ms cubic-bezier(0.22, 1, 0.36, 1);
	}

	.wv-esm__art {
		height: 150px;
	}

	.wv-esm__card {
		width: 150px;
	}

	.wv-esm__body {
		padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
	}

	.wv-esm__title {
		font-size: 26px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wv-esm,
	.wv-esm::backdrop {
		transition: opacity 150ms ease;
		transform: none;
	}
}

