/* image_modal + sticky_bottom: banner ảnh dùng chung markup .mxh-ad-banner (core). */

.mxh-popup-image-frame {
	position: relative;
	max-width: 92vw;
	max-height: 80vh;
}

.mxh-popup-image-frame .mxh-ad-img {
	display: block;
	max-width: 92vw;
	max-height: 80vh;
	width: auto;
	height: auto;
	border-radius: 12px;
}

.mxh-popup-close--image {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #111;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.3 );
}

.mxh-popup-close--image:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

/* z-index thấp hơn overlay modal (999999) để 2 tầng không đè lẫn nhau. */
.mxh-sticky-bottom {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99990;
	background: var( --mxh-ad-sticky-bg, #fff );
	border-top: 1px solid var( --mxh-ad-sticky-line, transparent );
	box-shadow: var( --mxh-ad-sticky-shadow, 0 -2px 8px rgba( 0, 0, 0, 0.15 ) );
	padding-bottom: env( safe-area-inset-bottom, 0 );
}

body.mxh-theme-light .mxh-sticky-bottom {
	border-radius: 12px 12px 0 0;
}

.mxh-sticky-bottom .mxh-ad-img {
	display: block;
	width: 100%;
	max-height: 120px;
	object-fit: cover;
}

@media ( min-width: 768px ) {
	.mxh-sticky-bottom .mxh-ad-img {
		max-height: 160px;
		object-fit: contain;
	}
}

.mxh-sticky-close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 44px;
	height: 44px;
	border: 1px solid var( --mxh-ad-close-line, transparent );
	border-radius: 50%;
	background: var( --mxh-ad-close-bg, #fff );
	color: var( --mxh-ad-close-ink, #111 );
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.3 );
}

.mxh-sticky-close:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

@media ( prefers-reduced-motion: no-preference ) {
	.mxh-popup-image-frame {
		animation: mxh-popup-in 0.2s ease-out;
	}

	.mxh-sticky-bottom {
		animation: mxh-sticky-in 0.2s ease-out;
	}
}

@keyframes mxh-sticky-in {
	from { transform: translateY( 100% ); }
	to { transform: translateY( 0 ); }
}

.mxh-popup-close--image.is-waiting {
	opacity: 0;
	pointer-events: none;
}

.mxh-popup-cta {
	display: block;
	margin-top: 10px;
	padding: 16px 20px;
	border-radius: 12px;
	background: #ee4d2d;
	color: #fff;
	font-weight: 800;
	font-size: 18px;
	text-align: center;
	text-decoration: none;
	box-shadow: 0 8px 20px rgba(238, 77, 45, 0.45);
}
