/**
 * Maha Promo Center — popup styles.
 *
 * Everything configurable arrives as a CSS custom property set on the wrapper,
 * so this file is static and cacheable no matter how many popups a site runs.
 */

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

.mpc-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	box-sizing: border-box;
	padding: var(--mpc-offset-y, 24px) var(--mpc-offset-x, 24px);
	font-family: inherit;
	/* The wrapper never swallows clicks; only the panel and overlay do. This is
	   what lets an overlay-less popup leave the page underneath usable. */
	pointer-events: none;
}

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

/* Anchor positions ------------------------------------------------------- */

.mpc-popup--top-left { align-items: flex-start; justify-content: flex-start; }
.mpc-popup--top-center { align-items: flex-start; justify-content: center; }
.mpc-popup--top-right { align-items: flex-start; justify-content: flex-end; }
.mpc-popup--middle-left { align-items: center; justify-content: flex-start; }
.mpc-popup--center { align-items: center; justify-content: center; }
.mpc-popup--middle-right { align-items: center; justify-content: flex-end; }
.mpc-popup--bottom-left { align-items: flex-end; justify-content: flex-start; }
.mpc-popup--bottom-center { align-items: flex-end; justify-content: center; }
.mpc-popup--bottom-right { align-items: flex-end; justify-content: flex-end; }

/* Overlay ---------------------------------------------------------------- */

.mpc-popup__overlay {
	position: absolute;
	inset: 0;
	background: var(--mpc-overlay, rgba(7, 17, 13, 0.78));
	pointer-events: auto;
	opacity: 0;
	transition: opacity var(--mpc-anim-speed, 320ms) ease;
}

@supports (backdrop-filter: blur(1px)) {
	.mpc-popup__overlay {
		backdrop-filter: blur(var(--mpc-overlay-blur, 8px));
	}
}

.mpc-popup.is-open .mpc-popup__overlay {
	opacity: 1;
}

/* Panel ------------------------------------------------------------------ */

/* The panel sizes and positions but never clips, so an outside close button
   stays visible. The frame inside it owns the radius, background and overflow. */
.mpc-popup__panel {
	position: relative;
	z-index: 1;
	width: min(var(--mpc-width, 620px), 100%);
	max-height: var(--mpc-max-height, 90vh);
	height: var(--mpc-height, auto);
	pointer-events: auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.mpc-popup__frame {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
	border: var(--mpc-border-width, 1px) solid var(--mpc-border-color, #2b4136);
	border-radius: var(--mpc-radius, 24px);
	background: var(--mpc-bg, #10251d);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
	color: var(--mpc-text-color, #dbe6df);
}

.mpc-popup--bg-image .mpc-popup__frame::before,
.mpc-popup--bg-image .mpc-popup__frame::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

.mpc-popup--bg-image .mpc-popup__frame::before {
	background-image: var(--mpc-bg-image);
	background-position: var(--mpc-bg-pos, center center);
	background-size: cover;
	background-repeat: no-repeat;
	opacity: var(--mpc-bg-opacity, 1);
}

.mpc-popup--bg-image .mpc-popup__frame::after {
	background: var(--mpc-tint, transparent);
}

.mpc-popup--clickable .mpc-popup__panel {
	cursor: pointer;
}

.mpc-popup__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: var(--mpc-padding, 40px);
	text-align: var(--mpc-align, center);
	min-height: 0;
}

.mpc-popup--scrollable .mpc-popup__inner {
	overflow-y: auto;
	overscroll-behavior: contain;
}

/* An image or video popup fills the panel edge to edge. */
.mpc-popup--image .mpc-popup__inner,
.mpc-popup--video .mpc-popup__inner {
	padding: 0;
	gap: 0;
}

.mpc-popup--image .mpc-cta,
.mpc-popup--video .mpc-cta {
	padding: 0 var(--mpc-padding, 40px) var(--mpc-padding, 40px);
}

/* ------------------------------------------------------------------------
   Theme reset armour

   Themes routinely style bare `button` elements site-wide. Hello Elementor's
   reset, for instance, sets a border, a padding, `width: auto` and — the one
   that really bites — a `button:hover` background colour. Anything this plugin
   renders as a <button> inherits all of it, which is why the close controls
   arrived stretched into ellipses and turned crimson on hover while the admin
   preview looked correct.

   Rather than chase individual themes, every property such a reset touches is
   declared here explicitly, for the resting *and* hover states, so nothing is
   left for a theme rule to win by default. The !important flags stay confined
   to this chrome: geometry a theme forces onto it is always a bug.
   ------------------------------------------------------------------------ */

.mpc-popup .mpc-popup__close,
.mpc-floating,
.mpc-trigger {
	box-sizing: border-box !important;
	margin: 0 !important;
	min-width: 0 !important;
	max-width: none !important;
	min-height: 0 !important;
	max-height: none !important;
	font-family: inherit !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-indent: 0 !important;
	text-shadow: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
}

/* Close button ----------------------------------------------------------- */

.mpc-popup .mpc-popup__close {
	position: absolute;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--mpc-close-size, 36px);
	height: var(--mpc-close-size, 36px);
	padding: 0;
	border: 0;
	background-color: var(--mpc-close-bg, rgba(13, 31, 24, 0.55)) !important;
	background-image: none !important;
	color: var(--mpc-close-color, #fff) !important;
	border: 0 !important;
	padding: 0 !important;
	width: var(--mpc-close-size, 36px) !important;
	height: var(--mpc-close-size, 36px) !important;
	line-height: 1 !important;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.mpc-popup .mpc-popup__close svg {
	display: block;
	width: 52%;
	height: 52%;
}

.mpc-popup__close[hidden] {
	display: none;
}

.mpc-popup.mpc-popup--close-circle .mpc-popup__close { border-radius: 50% !important; }
.mpc-popup.mpc-popup--close-square .mpc-popup__close { border-radius: 10px !important; }

.mpc-popup.mpc-popup--close-plain .mpc-popup__close {
	background-color: transparent !important;
	border-radius: 6px !important;
	backdrop-filter: none;
}

/* Inside: tucked into the frame's top right corner. */
.mpc-popup.mpc-popup--close-inside .mpc-popup__close {
	top: 12px;
	right: 12px;
}

/* Outside: straddling the corner. The panel no longer clips, so it survives.
   The ring is drawn in the panel's own background colour, which reads as the
   button being cut out of the popup rather than floating loose beside it. */
.mpc-popup.mpc-popup--close-outside .mpc-popup__close {
	top: calc(var(--mpc-close-size, 36px) / -2);
	right: calc(var(--mpc-close-size, 36px) / -2);
	box-shadow:
		0 0 0 3px var(--mpc-bg, #10251d),
		0 6px 18px rgba(0, 0, 0, 0.4);
}

.mpc-popup .mpc-popup__close:hover,
.mpc-popup .mpc-popup__close:focus-visible {
	/* Restated so a theme's `button:hover { background-color }` has nothing to
	   win by default — that rule is what turned this control crimson. The huge
	   inset spread lightens whatever background colour is configured without
	   needing to know what it is. */
	background-color: var(--mpc-close-bg, rgba(13, 31, 24, 0.55)) !important;
	color: var(--mpc-close-color, #fff) !important;
	transform: scale(1.07);
	box-shadow:
		inset 0 0 0 999px rgba(255, 255, 255, 0.16),
		0 0 0 3px rgba(255, 255, 255, 0.16);
	outline: none;
}

.mpc-popup.mpc-popup--close-outside .mpc-popup__close:hover,
.mpc-popup.mpc-popup--close-outside .mpc-popup__close:focus-visible {
	box-shadow:
		inset 0 0 0 999px rgba(255, 255, 255, 0.16),
		0 0 0 3px var(--mpc-bg, #10251d),
		0 6px 18px rgba(0, 0, 0, 0.4);
}

.mpc-popup .mpc-popup__close:focus-visible {
	outline: 2px solid var(--mpc-close-color, #fff);
	outline-offset: 3px;
}

/* Keep the popup padded away from an outside close button on small screens,
   where a negative offset would otherwise push it past the viewport edge. */
@media (max-width: 600px) {
	.mpc-popup.mpc-popup--close-outside .mpc-popup__close {
		top: 10px;
		right: 10px;
	}
}

/* Content ---------------------------------------------------------------- */

.mpc-popup__title {
	margin: 0;
	color: var(--mpc-title-color, #fff);
	font-size: clamp(24px, 3.4vw, 38px);
	line-height: 1.15;
}

.mpc-popup__content {
	color: var(--mpc-text-color, #dbe6df);
	font-size: 16px;
	line-height: 1.6;
}

.mpc-popup__content > *:first-child { margin-top: 0; }
.mpc-popup__content > *:last-child { margin-bottom: 0; }

.mpc-popup__content a {
	color: inherit;
}

.mpc-popup__content img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.mpc-popup__media {
	margin: 0;
	line-height: 0;
}

.mpc-popup__media img {
	display: block;
	width: 100%;
	height: auto;
}

.mpc-popup__media a {
	display: block;
}

/* Video ------------------------------------------------------------------ */

.mpc-popup__video {
	position: relative;
	width: 100%;
	aspect-ratio: var(--mpc-video-ratio, 16 / 9);
	background: #000;
}

.mpc-popup__video-el {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	object-fit: contain;
}

/* Call to action --------------------------------------------------------- */

.mpc-cta {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: var(--mpc-cta-align, center);
}


.mpc-popup .mpc-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 26px;
	border: 1px solid transparent;
	border-radius: var(--mpc-btn-radius, 9px);
	font-weight: 700;
	font-size: 16px;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Resting state carries a thin glass rim and a tight glow rather than the wide
   halo the first build used, which bled far past the button edge. */
.mpc-popup .mpc-button--solid {
	background: var(--mpc-btn-bg, #f3c94f);
	color: var(--mpc-btn-text, #10251d);
	border-color: rgba(255, 255, 255, 0.55);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.5),
		inset 0 -1px 0 rgba(0, 0, 0, 0.12),
		0 2px 6px rgba(0, 0, 0, 0.28);
}

.mpc-popup .mpc-button--outline {
	background: rgba(255, 255, 255, 0.06);
	border-color: var(--mpc-btn-border, #f3c94f);
	color: var(--mpc-btn-border, #f3c94f);
	backdrop-filter: blur(3px);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.14),
		0 0 10px -3px var(--mpc-btn-border, #f3c94f);
}

.mpc-popup .mpc-button--full {
	width: 100%;
}

.mpc-popup .mpc-button:hover,
.mpc-popup .mpc-button:focus-visible {
	transform: translateY(-1px);
	outline: none;
}

.mpc-popup .mpc-button--solid:hover,
.mpc-popup .mpc-button--solid:focus-visible {
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.55),
		0 4px 12px -2px rgba(0, 0, 0, 0.45),
		0 0 16px -4px var(--mpc-btn-border, #f3c94f);
}

.mpc-popup .mpc-button--outline:hover,
.mpc-popup .mpc-button--outline:focus-visible {
	background: rgba(255, 255, 255, 0.12);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.2),
		0 0 16px -3px var(--mpc-btn-border, #f3c94f);
}

.mpc-popup .mpc-button:focus-visible {
	outline: 2px solid var(--mpc-btn-border, #f3c94f);
	outline-offset: 3px;
}

.mpc-cta__note {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	color: var(--mpc-note-color, #9fb3a8);
	font-size: 13px;
	line-height: 1.3;
}

.mpc-cta__icon {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

/* Countdown -------------------------------------------------------------- */

/* Scoped to the popup for the same reason the bar's copy is scoped to the bar:
   both stylesheets describe this block, and unscoped they would collide at equal
   specificity whenever a page loads both. The digit size drives every dimension
   here so one control resizes the whole timer coherently. */
.mpc-popup .mpc-countdown {
	display: flex;
	gap: calc(var(--mpc-cd-size, 30px) * 0.26);
	justify-content: center;
}

.mpc-popup .mpc-countdown--wide {
	width: 100%;
}

.mpc-popup .mpc-countdown--wide .mpc-countdown__unit {
	flex: 1;
}

.mpc-popup .mpc-countdown__unit {
	display: grid;
	gap: 2px;
	min-width: calc(var(--mpc-cd-size, 30px) * 2);
	padding: calc(var(--mpc-cd-size, 30px) * 0.32) calc(var(--mpc-cd-size, 30px) * 0.26);
	border-radius: 12px;
	background: var(--mpc-cd-box, rgba(255, 255, 255, 0.1));
	text-align: center;
}

.mpc-popup .mpc-countdown__value {
	color: var(--mpc-cd-digit, #fff);
	font-size: var(--mpc-cd-size, 30px);
	font-weight: 800;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.mpc-popup .mpc-countdown__label {
	color: var(--mpc-cd-label, #f3c94f);
	font-size: calc(var(--mpc-cd-size, 30px) * 0.36);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mpc-popup .mpc-countdown--expired {
	display: block;
	color: var(--mpc-cd-label, #f3c94f);
	font-size: calc(var(--mpc-cd-size, 30px) * 0.6);
	font-weight: 700;
	text-align: center;
}

/* Floating button -------------------------------------------------------- */

.mpc-floating {
	position: fixed;
	z-index: 99998;
	padding: 12px 18px !important;
	border: var(--mpc-float-border-w, 0) solid var(--mpc-float-border, #4f46e5) !important;
	border-radius: var(--mpc-float-radius, 6px) !important;
	background-color: var(--mpc-float-bg, #4f46e5) !important;
	background-image: none !important;
	color: var(--mpc-float-text, #fff) !important;
	font-size: var(--mpc-float-size, 16px) !important;
	font-weight: 700;
	line-height: 1.2 !important;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.mpc-floating:hover,
.mpc-floating:focus-visible {
	background-color: var(--mpc-float-bg, #4f46e5) !important;
	color: var(--mpc-float-text, #fff) !important;
	transform: scale(1.04);
}

.mpc-floating.is-hidden {
	opacity: 0;
	pointer-events: none;
	transform: scale(0.9);
}

.mpc-floating--top-left { top: var(--mpc-float-y, 0); left: var(--mpc-float-x, 0); }
.mpc-floating--top-center { top: var(--mpc-float-y, 0); left: 50%; transform: translateX(-50%); }
.mpc-floating--top-right { top: var(--mpc-float-y, 0); right: var(--mpc-float-x, 0); }
.mpc-floating--middle-left { top: 50%; left: var(--mpc-float-x, 0); transform: translateY(-50%); }
.mpc-floating--center { top: 50%; left: 50%; transform: translate(-50%, -50%); }
.mpc-floating--middle-right { top: 50%; right: var(--mpc-float-x, 0); transform: translateY(-50%); }
.mpc-floating--bottom-left { bottom: var(--mpc-float-y, 0); left: var(--mpc-float-x, 0); }
.mpc-floating--bottom-center { bottom: var(--mpc-float-y, 0); left: 50%; transform: translateX(-50%); }
.mpc-floating--bottom-right { bottom: var(--mpc-float-y, 0); right: var(--mpc-float-x, 0); }

/* The corner style hugs the viewport edge with vertical text. */
.mpc-floating--corner.mpc-floating--middle-left,
.mpc-floating--corner.mpc-floating--middle-right {
	writing-mode: vertical-rl;
	padding: 18px 12px;
}

.mpc-floating--corner.mpc-floating--middle-left {
	border-radius: 0 var(--mpc-float-radius, 6px) var(--mpc-float-radius, 6px) 0;
	rotate: 180deg;
}

.mpc-floating--corner.mpc-floating--middle-right {
	border-radius: var(--mpc-float-radius, 6px) 0 0 var(--mpc-float-radius, 6px);
}

/* Shortcode trigger ------------------------------------------------------ */

.mpc-trigger {
	cursor: pointer;
	font: inherit;
}

.mpc-trigger--button,
.mpc-trigger--button:hover,
.mpc-trigger--button:focus-visible {
	display: inline-flex;
	align-items: center;
	padding: 12px 22px !important;
	border: 0 !important;
	border-radius: 8px !important;
	background-color: var(--mpc-btn-bg, #f3c94f) !important;
	background-image: none !important;
	color: var(--mpc-btn-text, #10251d) !important;
	font-weight: 700;
}

.mpc-trigger--link,
.mpc-trigger--link:hover,
.mpc-trigger--link:focus-visible {
	padding: 0 !important;
	border: 0 !important;
	background-color: transparent !important;
	color: inherit !important;
	text-decoration: underline;
}

/* Copy confirmation toast ------------------------------------------------ */

.mpc-toast {
	position: fixed;
	left: 50%;
	bottom: 32px;
	z-index: 100001;
	transform: translateX(-50%);
	padding: 10px 18px;
	border-radius: 999px;
	background: #111;
	color: #fff;
	font-size: 14px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
	animation: mpc-toast 2.4s ease forwards;
}

@keyframes mpc-toast {
	0% { opacity: 0; transform: translate(-50%, 10px); }
	12%, 80% { opacity: 1; transform: translate(-50%, 0); }
	100% { opacity: 0; transform: translate(-50%, 10px); }
}

/* Page scroll lock ------------------------------------------------------- */

html.mpc-scroll-locked,
html.mpc-scroll-locked body {
	overflow: hidden;
}

/* Opening animations ----------------------------------------------------- */

.mpc-popup.is-open .mpc-popup__panel {
	animation-duration: var(--mpc-anim-speed, 320ms);
	animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
	animation-fill-mode: both;
}

.mpc-popup--anim-fade.is-open .mpc-popup__panel { animation-name: mpc-fade; }
.mpc-popup--anim-zoom.is-open .mpc-popup__panel { animation-name: mpc-zoom; }
.mpc-popup--anim-slide-up.is-open .mpc-popup__panel { animation-name: mpc-slide-up; }
.mpc-popup--anim-slide-down.is-open .mpc-popup__panel { animation-name: mpc-slide-down; }
.mpc-popup--anim-slide-left.is-open .mpc-popup__panel { animation-name: mpc-slide-left; }
.mpc-popup--anim-slide-right.is-open .mpc-popup__panel { animation-name: mpc-slide-right; }

.mpc-popup.is-closing .mpc-popup__panel {
	animation: mpc-fade var(--mpc-anim-speed, 320ms) ease reverse both;
}

.mpc-popup.is-closing .mpc-popup__overlay {
	opacity: 0;
}

@keyframes mpc-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes mpc-zoom {
	from { opacity: 0; transform: scale(0.9); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes mpc-slide-up {
	from { opacity: 0; transform: translateY(40px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes mpc-slide-down {
	from { opacity: 0; transform: translateY(-40px); }
	to { opacity: 1; transform: translateY(0); }
}

@keyframes mpc-slide-left {
	from { opacity: 0; transform: translateX(48px); }
	to { opacity: 1; transform: translateX(0); }
}

@keyframes mpc-slide-right {
	from { opacity: 0; transform: translateX(-48px); }
	to { opacity: 1; transform: translateX(0); }
}

/* Small screens ---------------------------------------------------------- */

@media (max-width: 600px) {
	.mpc-popup {
		padding: 14px;
		align-items: center;
		justify-content: center;
	}

	.mpc-popup__panel {
		width: 100%;
		max-height: 88vh;
		height: auto;
	}

	.mpc-popup__inner {
		padding: clamp(20px, 6vw, 32px);
		gap: 14px;
	}

	.mpc-popup .mpc-countdown__unit {
		min-width: 0;
	}

	.mpc-floating--corner.mpc-floating--middle-left,
	.mpc-floating--corner.mpc-floating--middle-right {
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mpc-popup.is-open .mpc-popup__panel,
	.mpc-popup.is-closing .mpc-popup__panel {
		animation: none;
	}

	.mpc-popup__overlay,
	.mpc-popup .mpc-button,
	.mpc-floating {
		transition: none;
	}
}
