/* Merisign Popups – front end v1.0.2 */

html.msp-locked,
html.msp-locked body {
	overflow: hidden !important;
}
html.msp-locked {
	padding-right: var(--msp-sbw, 0px);
}

.msp-wrap {
	--msp-speed: 0.35s;
	--msp-pad-eff: var(--msp-pad, 32px);
	--msp-close-size: 38px;
	--msp-close-inset: 14px;
	position: fixed;
	inset: 0;
	z-index: 999990;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}
.msp-wrap *,
.msp-wrap *::before,
.msp-wrap *::after {
	box-sizing: border-box;
}
.msp-wrap.is-active {
	display: flex;
}

/* Overlay */
.msp-overlay {
	position: absolute;
	inset: 0;
	background: var(--msp-overlay, rgba(0, 0, 0, 0.6));
	opacity: 0;
	transition: opacity var(--msp-speed) ease;
}
.msp-wrap.is-open .msp-overlay {
	opacity: 1;
}

/* Dialog: sizing + animation; holds the close button so it is never clipped */
.msp-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--msp-width, 600px);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	outline: none;
	opacity: 0;
	transition: opacity var(--msp-speed) ease, transform var(--msp-speed) cubic-bezier(0.2, 0.8, 0.2, 1);
}
.msp-wrap.is-open .msp-dialog {
	opacity: 1;
	transform: none;
}

/* Box: background, padding, scrolling */
.msp-box {
	position: relative;
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: var(--msp-pad-eff);
	border-radius: var(--msp-radius, 12px);
	background-color: var(--msp-bg, #fff);
	color: var(--msp-color, #1a1a1a);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}
.msp-has-image .msp-box {
	background-image: var(--msp-bg-image);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

/* Animations (start states) */
.msp-anim-zoom .msp-dialog { transform: scale(0.88); }
.msp-anim-slide_up .msp-dialog { transform: translateY(48px); }
.msp-anim-slide_down .msp-dialog { transform: translateY(-48px); }
.msp-anim-slide_side .msp-dialog { transform: translateX(64px); }
.msp-type-slide_bl.msp-anim-slide_side .msp-dialog { transform: translateX(-64px); }
.msp-anim-none { --msp-speed: 0s; }

/* Content */
.msp-content {
	position: relative;
}
.msp-content > :first-child { margin-top: 0; }
.msp-content > :last-child { margin-bottom: 0; }
.msp-content img,
.msp-content video,
.msp-content iframe {
	max-width: 100%;
}
.msp-content img { height: auto; }

/* Close button */
.msp-close-btn {
	position: absolute;
	top: var(--msp-close-inset);
	right: var(--msp-close-inset);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--msp-close-size);
	height: var(--msp-close-size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--msp-close, #1a1a1a);
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
	transition: opacity 0.25s ease, background-color 0.2s ease, transform 0.2s ease;
}
.msp-close-btn:hover,
.msp-close-btn:focus-visible {
	background: rgba(127, 127, 127, 0.18);
	color: var(--msp-close, #1a1a1a);
}
.msp-close-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}
.msp-close-btn.is-hidden {
	opacity: 0;
	pointer-events: none;
}
.msp-close-btn svg {
	display: block;
}

/*
 * Inside position: content starts just below the ×, only on the top edge.
 * Clearance = button bottom (inset + size) + 6px gap, minus the existing padding.
 */
.msp-close-inside.msp-type-modal .msp-content,
.msp-close-inside.msp-type-slide_br .msp-content,
.msp-close-inside.msp-type-slide_bl .msp-content {
	padding-top: max(0px, calc(var(--msp-close-inset) + var(--msp-close-size) + 6px - var(--msp-pad-eff)));
}

/* Outside corner: floating circle off the top-right corner */
.msp-close-outside {
	--msp-close-size: 34px;
}
.msp-close-outside .msp-close-btn {
	top: -12px;
	right: -12px;
	background: var(--msp-bg, #fff);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.msp-close-outside .msp-close-btn:hover,
.msp-close-outside .msp-close-btn:focus-visible {
	background: var(--msp-bg, #fff);
	transform: scale(1.08);
}
.msp-close-outside .msp-close-btn svg {
	width: 16px;
	height: 16px;
}

/* Slide-ins (no overlay, page stays usable) */
.msp-type-slide_br,
.msp-type-slide_bl {
	inset: auto 0 0 auto;
	padding: 20px;
	pointer-events: none;
	align-items: flex-end;
}
.msp-type-slide_bl {
	inset: auto auto 0 0;
}
.msp-type-slide_br .msp-dialog,
.msp-type-slide_bl .msp-dialog {
	pointer-events: auto;
	width: calc(100vw - 40px);
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
}

/* Bars */
.msp-type-bar_top,
.msp-type-bar_bottom {
	padding: 0;
	pointer-events: none;
}
.msp-type-bar_top { inset: 0 0 auto 0; }
.msp-type-bar_bottom { inset: auto 0 0 0; }
body.admin-bar .msp-type-bar_top { top: 32px; }
@media (max-width: 782px) {
	body.admin-bar .msp-type-bar_top { top: 46px; }
}
.msp-type-bar_top .msp-dialog,
.msp-type-bar_bottom .msp-dialog {
	pointer-events: auto;
	max-width: none;
	max-height: 60vh;
}
.msp-type-bar_top .msp-box,
.msp-type-bar_bottom .msp-box {
	border-radius: 0;
	padding-right: calc(var(--msp-pad-eff) + 40px);
	padding-left: calc(var(--msp-pad-eff) + 40px);
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}
.msp-type-bar_top .msp-content,
.msp-type-bar_bottom .msp-content {
	max-width: var(--msp-width, 600px);
	margin: 0 auto;
}
.msp-type-bar_top .msp-close-btn,
.msp-type-bar_bottom .msp-close-btn {
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
}
.msp-type-bar_top.msp-anim-slide_up .msp-dialog,
.msp-type-bar_top.msp-anim-slide_side .msp-dialog { transform: translateY(-100%); }
.msp-type-bar_bottom.msp-anim-slide_down .msp-dialog,
.msp-type-bar_bottom.msp-anim-slide_side .msp-dialog { transform: translateY(100%); }

/* Fullscreen */
.msp-type-fullscreen {
	padding: 0;
}
.msp-type-fullscreen .msp-dialog {
	max-width: none;
	width: 100%;
	height: 100%;
	max-height: none;
}
.msp-type-fullscreen .msp-box {
	display: flex;
	flex-direction: column;
	justify-content: center;
	border-radius: 0;
	box-shadow: none;
}
.msp-type-fullscreen .msp-content {
	width: 100%;
	max-width: var(--msp-width, 600px);
	margin: auto;
}
.msp-type-fullscreen .msp-close-btn {
	top: 16px;
	right: 16px;
	width: 46px;
	height: 46px;
}

/* Small screens */
@media (max-width: 600px) {
	.msp-wrap.msp-type-modal {
		--msp-pad-eff: min(var(--msp-pad, 32px), 24px);
		padding: 14px;
	}
	.msp-type-modal .msp-dialog {
		max-height: calc(100dvh - 28px);
	}
	.msp-type-bar_top .msp-box,
	.msp-type-bar_bottom .msp-box {
		padding-left: 16px;
		padding-right: 52px;
	}
}
