/* mod_my_popup - ป๊อปอัพประชาสัมพันธ์ */

.my-popup {
	--pp-w: 640px;
	--pp-r: 16px;
	--pp-ov: .6;

	position: fixed; inset: 0; z-index: 1200;
	display: flex; align-items: center; justify-content: center;
	padding: 20px;
	opacity: 0; transition: opacity .2s ease;
}
.my-popup.is-open { opacity: 1; }
.my-popup[hidden] { display: none; }

body.my-popup-open { overflow: hidden; }

.my-popup__backdrop {
	position: absolute; inset: 0;
	background: rgba(6, 18, 35, var(--pp-ov));
	backdrop-filter: blur(2px);
}

.my-popup__dialog {
	position: relative; z-index: 2;
	width: 100%; max-width: var(--pp-w);
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	background: #fff; border-radius: var(--pp-r);
	box-shadow: 0 24px 60px rgba(6, 18, 35, .45);
	transform: translateY(14px) scale(.98);
	transition: transform .25s ease;
}
.my-popup.is-open .my-popup__dialog { transform: none; }

.my-popup__close {
	position: absolute; inset-block-start: 10px; inset-inline-end: 10px; z-index: 4;
	width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(6, 18, 35, .55); color: #fff; font-size: 1rem;
	display: inline-flex; align-items: center; justify-content: center;
	transition: background .15s ease;
}
.my-popup__close:hover { background: rgba(6, 18, 35, .8); }

/* --------------------------------------------------------- the banners -- */
.my-popup__slides { position: relative; }
.my-popup__slide { display: none; }
.my-popup__slide.is-active { display: block; }
.my-popup__slide img { display: block; width: 100%; height: auto; border-radius: var(--pp-r) var(--pp-r) 0 0; }
.my-popup__slide:only-child img { border-radius: var(--pp-r) var(--pp-r) 0 0; }

.my-popup__caption {
	margin: 0; padding: 12px 18px 0;
	font-size: .95rem; font-weight: 600; text-align: center; color: #13203a;
}

.my-popup__nav {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
	width: 38px; height: 38px; border: 0; border-radius: 50%; cursor: pointer;
	background: rgba(255, 255, 255, .85); color: #13203a;
	display: inline-flex; align-items: center; justify-content: center;
}
.my-popup__nav:hover { background: #fff; }
.my-popup__nav.is-prev { inset-inline-start: 10px; }
.my-popup__nav.is-next { inset-inline-end: 10px; }

.my-popup__dots { display: flex; gap: 7px; justify-content: center; padding: 12px 0 0; }
.my-popup__dot {
	width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
	background: #c9d4e2;
}
.my-popup__dot.is-active { background: var(--my-primary, #1b5fa8); width: 24px; border-radius: 999px; }

.my-popup__html { padding: 20px 22px 0; line-height: 1.75; }
.my-popup__html > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- footer --- */
.my-popup__foot {
	display: flex; align-items: center; justify-content: space-between; gap: 14px;
	flex-wrap: wrap; padding: 16px 18px 18px;
}

.my-popup__dont {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: .86rem; color: var(--my-muted, #6b7280); cursor: pointer;
}
.my-popup__dont input { width: 16px; height: 16px; accent-color: var(--my-primary, #1b5fa8); }

.my-popup__btn {
	margin-inline-start: auto;
	border: 0; cursor: pointer; border-radius: 999px;
	padding: 9px 24px; font-family: inherit; font-size: .9rem; font-weight: 600;
	background: var(--my-primary, #1b5fa8); color: #fff;
	transition: background .15s ease;
}
.my-popup__btn:hover { background: var(--my-dark, #10427a); }

@media (max-width: 575px) {
	.my-popup { padding: 12px; }
	.my-popup__nav { width: 32px; height: 32px; }
	.my-popup__foot { padding: 12px 14px 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.my-popup, .my-popup__dialog { transition: none; }
}
