/* ==========================================================================
   Offer Popup (Theme Settings → Offer Popup)
   Standalone file — not part of the gulp SCSS build.
   ========================================================================== */

.wps-offer-popup,
.wps-offer-tab {
	--op-blue: #244894;
	--op-orange: #ff7031;
	--op-ink: #1d1d1f;
	--op-muted: #55575c;
	--op-offset: 24px;
	--op-chat-clear: 84px; /* space reserved for the chat bubble in the bottom-right corner */
	box-sizing: border-box;
}

.wps-offer-popup *,
.wps-offer-popup *::before,
.wps-offer-popup *::after {
	box-sizing: border-box;
}

/* ---------- Card ---------- */
.wps-offer-popup {
	position: fixed;
	right: var(--op-offset);
	bottom: calc(var(--op-offset) + var(--op-chat-clear)); /* sit above the chat bubble */
	z-index: 99990; /* below sticky header (99999) and full-screen menu */
	width: 340px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 48px - var(--op-chat-clear));
	max-height: calc(100dvh - 48px - var(--op-chat-clear));
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #ffffff;
	border-top: 4px solid var(--op-orange);
	border-radius: 6px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.12);
	opacity: 0;
	transform: translateY(24px);
	pointer-events: none;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

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

.wps-offer-popup.is-open {
	opacity: 1;
	transform: none;
	pointer-events: auto;
}

/* ---------- Close ---------- */
.wps-offer-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 34px;
	height: 34px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	background: rgba(29, 29, 31, 0.85);
	border: 2px solid #ffffff;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	transition: background 0.2s ease, transform 0.2s ease;
}

.wps-offer-popup__close:hover,
.wps-offer-popup__close:focus-visible {
	background: var(--op-orange);
	transform: rotate(90deg);
}

.wps-offer-popup__close:focus-visible,
.wps-offer-popup__btn:focus-visible,
.wps-offer-tab:focus-visible {
	outline: 3px solid var(--op-blue);
	outline-offset: 2px;
}

/* ---------- Image ---------- */
.wps-offer-popup__media {
	flex: 0 1 auto;
	min-height: 0;
	background: #232323; /* matches the dark offer graphic */
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.wps-offer-popup__media img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center top;
}

.wps-offer-popup--full-image .wps-offer-popup__media {
	aspect-ratio: auto;
	max-height: 46vh;
}

.wps-offer-popup--full-image .wps-offer-popup__media img {
	height: auto;
	max-height: 46vh;
	object-fit: contain;
	object-position: center;
}

/* ---------- Body ---------- */
.wps-offer-popup__body {
	flex: 0 0 auto;
	padding: 20px 24px 24px;
	text-align: center;
	font-family: "Montserrat", sans-serif;
}

.wps-offer-popup .wps-offer-popup__eyebrow {
	margin: 0 0 6px;
	font-family: "Montserrat", sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--op-orange);
}

.wps-offer-popup .wps-offer-popup__title {
	margin: 0 0 10px;
	padding: 0;
	font-family: "Bebas Neue", sans-serif;
	font-size: 34px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.01em;
	text-transform: none;
	color: var(--op-blue);
}

.wps-offer-popup .wps-offer-popup__text {
	margin: 0 0 18px;
	font-family: "Montserrat", sans-serif;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.6;
	color: var(--op-muted);
}

.wps-offer-popup .wps-offer-popup__btn {
	display: inline-block;
	padding: 13px 30px;
	font-family: "Bebas Neue", sans-serif;
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: #ffffff;
	background-color: var(--op-orange);
	border: 3px solid var(--op-orange);
	border-radius: 50px;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.wps-offer-popup .wps-offer-popup__btn:hover,
.wps-offer-popup .wps-offer-popup__btn:focus-visible {
	color: var(--op-orange);
	background-color: transparent;
	text-decoration: none;
}

/* ---------- Side tab ---------- */
.wps-offer-tab {
	position: fixed;
	top: 50%;
	right: 0;
	z-index: 99989;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 18px 11px;
	writing-mode: vertical-rl;
	transform: translate(0, -50%) rotate(180deg);
	font-family: "Montserrat", sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	white-space: nowrap;
	color: #ffffff;
	background: var(--op-orange);
	border: 0;
	border-radius: 0 8px 8px 0; /* rounded on the visible (left) side after rotation */
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	transition: padding 0.2s ease, background 0.2s ease, opacity 0.3s ease;
}

.wps-offer-tab[hidden] {
	display: none;
}

.wps-offer-tab:hover {
	padding-left: 15px;
	background: var(--op-blue);
}

.wps-offer-tab.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.wps-offer-tab__icon {
	flex: none;
	transform: rotate(180deg); /* undo the tab's rotation so the icon stays upright */
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	.wps-offer-popup {
		--op-offset: 16px;
		--op-chat-clear: 140px; /* mobile footer bar (~64px) + chat bubble */
		left: 16px;
		right: 16px;
		width: auto;
		max-width: 380px;
		margin: 0 auto;
		/* leave room for the fixed mobile footer bar */
		/* leave room for the mobile footer bar and the chat bubble */
		bottom: calc(var(--op-offset) + var(--op-chat-clear) + env(safe-area-inset-bottom, 0px));
		max-height: calc(100dvh - 48px - var(--op-chat-clear));
	}

	.wps-offer-popup__media {
		aspect-ratio: 16 / 10;
	}

	.wps-offer-popup__body {
		padding: 16px 18px 20px;
	}

	.wps-offer-popup .wps-offer-popup__title {
		font-size: 28px;
	}

	.wps-offer-popup .wps-offer-popup__text {
		font-size: 13px;
		margin-bottom: 14px;
	}

	.wps-offer-tab {
		padding: 14px 9px;
		font-size: 11px;
	}
}

@media (max-height: 640px) and (min-width: 768px) {
	.wps-offer-popup__media {
		aspect-ratio: 16 / 9;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wps-offer-popup,
	.wps-offer-tab,
	.wps-offer-popup__close {
		transition: none;
	}
}
