/* SAMECOM popup banners — image only, centred, responsive. */
.samecom-popup-banner {
	position: fixed; inset: 0; z-index: 9998;
	display: flex; align-items: center; justify-content: center;
	padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
}
.samecom-popup-banner[hidden] { display: none; }
.samecom-popup-banner__overlay {
	position: absolute; inset: 0; cursor: pointer;
	background: rgba(0, 0, 0, var(--samecom-popup-overlay, .6));
	opacity: 0; transition: opacity .22s ease;
}
.samecom-popup-banner__content {
	position: relative; max-width: min(92vw, 1100px); max-height: 88vh;
	opacity: 0; transform: scale(.96); transition: opacity .22s ease, transform .22s ease;
}
.samecom-popup-banner.is-open .samecom-popup-banner__overlay { opacity: 1; }
.samecom-popup-banner.is-open .samecom-popup-banner__content { opacity: 1; transform: scale(1); }
.samecom-popup-banner.is-closing .samecom-popup-banner__overlay { opacity: 0; }
.samecom-popup-banner.is-closing .samecom-popup-banner__content { opacity: 0; transform: scale(.96); }

.samecom-popup-banner__link { display: block; line-height: 0; }
.samecom-popup-banner__link:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.samecom-popup-banner__image {
	display: block; width: auto; height: auto;
	max-width: min(92vw, 1100px); max-height: 88vh;
	object-fit: contain; border-radius: 12px;
	box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
}
.samecom-popup-banner__close {
	position: absolute; inset-block-start: -14px; inset-inline-end: -14px;
	width: 44px; height: 44px; min-width: 44px; min-height: 44px; padding: 0;
	display: grid; place-items: center; cursor: pointer;
	border: 0; border-radius: 50%; background: #fff; color: #111;
	font-size: 1.4rem; line-height: 1; box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.samecom-popup-banner__close:hover { background: #f3f4f6; }
.samecom-popup-banner__close:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* On a phone the close button sits inside the frame so it is never off-screen. */
@media (max-width: 640px) {
	.samecom-popup-banner__content { max-width: 94vw; max-height: 84vh; }
	.samecom-popup-banner__image { max-width: 94vw; max-height: 84vh; }
	.samecom-popup-banner__close { inset-block-start: 8px; inset-inline-end: 8px; width: 46px; height: 46px; }
}
/* Short landscape screens: keep the image inside the viewport. */
@media (max-height: 520px) {
	.samecom-popup-banner__content, .samecom-popup-banner__image { max-height: 82vh; }
}

/* Admin preview: mobile mode shows the popup at phone width. */
.samecom-popup-banner.is-preview { z-index: 100001; }
.samecom-popup-banner.is-preview-mobile .samecom-popup-banner__content,
.samecom-popup-banner.is-preview-mobile .samecom-popup-banner__image { max-width: 390px; }

@media (prefers-reduced-motion: reduce) {
	.samecom-popup-banner__overlay, .samecom-popup-banner__content { transition-duration: .01ms; transform: none; }
	.samecom-popup-banner.is-open .samecom-popup-banner__content { transform: none; }
}
