/* Incredible Popup — frontend styles */

.incpop-overlay {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	background: var(--incpop-overlay, rgba(0, 0, 0, 0.6));
	z-index: 999999;
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.incpop-overlay.incpop-open {
	display: flex;
	opacity: 1;
}

.incpop-box {
	position: relative;
	background: var(--incpop-bg, #fff);
	width: 100%;
	max-width: var(--incpop-max-desktop, 600px);
	max-height: var(--incpop-max-height, 90vh);
	overflow: auto;
	border-radius: var(--incpop-radius, 8px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.25s ease;
	box-sizing: border-box;
}

/*
 * Window-scroll mode: the overlay itself becomes the scroll container, so the
 * whole window scrolls instead of the popup. The box has no inner scrollbar and
 * can grow past the viewport; it aligns to the top so tall content stays reachable.
 */
.incpop-overlay.incpop-scroll-window {
	/*
	 * Absolute (not fixed) positioning makes the overlay part of the page, so the
	 * dark background and the popup scroll together with the rest of the page —
	 * one single scrollbar, the browser's own. The page scroll is left unlocked
	 * (see popup.js) so everything moves at the same time.
	 */
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: auto;
	min-height: 100vh;
	height: auto;
	align-items: flex-start;
	overflow: visible;
}

.incpop-overlay.incpop-scroll-window .incpop-box {
	max-height: none;
	overflow: visible;
	margin: auto; /* centers vertically when it fits, flows with the page when taller */
}

.incpop-overlay.incpop-open .incpop-box {
	transform: translateY(0) scale(1);
}

.incpop-content {
	padding: var(--incpop-pad, 24px);
	box-sizing: border-box;
}

/* Image mode: image should be flush; padding still applies around content wrap.
   Remove default gaps so image + button stack cleanly. */
.incpop-image {
	line-height: 0;
}

.incpop-image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: calc(var(--incpop-radius, 8px) / 2);
}

.incpop-html {
	line-height: 1.5;
	word-wrap: break-word;
}

.incpop-html img {
	max-width: 100%;
	height: auto;
}

.incpop-html :first-child {
	margin-top: 0;
}

.incpop-html :last-child {
	margin-bottom: 0;
}

/* CTA buttons */
.incpop-buttons-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 18px;
}

.incpop-cta {
	display: inline-block;
	padding: 12px 22px;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.incpop-cta:hover {
	filter: brightness(0.92);
}

.incpop-cta-full {
	display: block;
	width: 100%;
}

/* Close X */
.incpop-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 34px;
	height: 34px;
	line-height: 34px;
	padding: 0;
	font-size: 26px;
	background: transparent;
	border: none;
	color: var(--incpop-x-color, #333);
	cursor: pointer;
	z-index: 2;
	border-radius: 50%;
}

.incpop-close:hover {
	background: rgba(0, 0, 0, 0.08);
}

/* Mobile */
@media (max-width: 782px) {
	.incpop-box {
		max-width: var(--incpop-max-mobile, 90%);
	}
}

/* Prevent body scroll while open */
body.incpop-noscroll {
	overflow: hidden;
}
