/* Promo Popup – front end
   Colours and width come from the plugin settings as CSS variables.
   Override anything here from Promo Popup > Design > Custom CSS. */

.fhpp-modal {
	--fhpp-box-bg: #0e345b;
	--fhpp-max-w: 560px;
	--fhpp-b1-bg: #22b8c9;
	--fhpp-b1-fg: #0e345b;
	--fhpp-b2-bg: #ffffff;
	--fhpp-b2-fg: #0e345b;
	--fhpp-radius: 14px;
	--fhpp-ring: #22b8c9;

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}
.fhpp-modal[hidden] { display: none; }
.fhpp-modal *, .fhpp-modal *::before, .fhpp-modal *::after { box-sizing: border-box; }

.fhpp-modal__bg {
	position: absolute;
	inset: 0;
	background: rgba(7, 22, 38, 0.72);
	animation: fhppFade 0.25s ease;
}

.fhpp-modal__box {
	position: relative;
	width: min(var(--fhpp-max-w), 100%);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--fhpp-box-bg);
	border-radius: var(--fhpp-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	animation: fhppPop 0.3s ease;
}

.fhpp-modal__title {
	margin: 0;
	padding: 22px 60px 14px 22px;
	color: #fff;
	font-size: 22px;
	line-height: 1.3;
	font-weight: 700;
	text-align: center;
}

.fhpp-modal__imglink { display: block; }
.fhpp-modal__img {
	display: block;
	width: 100%;
	height: auto;
	max-width: none;
	margin: 0;
	border-radius: var(--fhpp-radius) var(--fhpp-radius) 0 0;
}
.fhpp-modal__title:not(.fhpp-sr) ~ .fhpp-modal__img,
.fhpp-modal__title:not(.fhpp-sr) ~ .fhpp-modal__imglink .fhpp-modal__img { border-radius: 0; }
.fhpp-modal__box > .fhpp-modal__img:last-child,
.fhpp-modal__box > .fhpp-modal__imglink:last-child .fhpp-modal__img { border-radius: var(--fhpp-radius); }

.fhpp-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 14px;
}
.fhpp-btn {
	flex: 1 1 200px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 18px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none !important;
	transition: filter 0.2s ease, transform 0.2s ease;
}
.fhpp-btn--1 { background: var(--fhpp-b1-bg); color: var(--fhpp-b1-fg) !important; }
.fhpp-btn--2 { background: var(--fhpp-b2-bg); color: var(--fhpp-b2-fg) !important; }
.fhpp-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
.fhpp-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.fhpp-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--fhpp-box-bg);
	box-shadow: 0 0 0 3px var(--fhpp-ring), 0 4px 12px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	transition: transform 0.2s ease;
}
.fhpp-modal__close:hover { transform: scale(1.06); }
.fhpp-modal__close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.fhpp-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* While open: stop the page behind from scrolling. overflow-x: clip also stops
   themes whose content is wider than a phone screen from pushing the popup off-centre. */
html.fhpp-open,
html.fhpp-open body {
	overflow: hidden;
	overflow-x: clip;
}

@keyframes fhppFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fhppPop { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.fhpp-modal__bg, .fhpp-modal__box { animation: none; }
	.fhpp-btn, .fhpp-modal__close { transition: none; }
}
@media (max-width: 480px) {
	.fhpp-modal { padding: 12px; }
	.fhpp-modal__actions { padding: 12px; gap: 8px; }
	.fhpp-btn { flex-basis: 100%; }
	.fhpp-modal__close { top: 8px; right: 8px; width: 36px; height: 36px; }
}
