/**
 * IW Popup — overlay popup do admin tạo (CPT iw_popup).
 *
 * Scope toàn bộ dưới .iw-popup* để không bleed global. Cấu trúc + cơ chế
 * open/close mượn từ lead-popup.css nhưng tách riêng (popup tổng quát, không
 * dính form). Mở/đóng qua class .iw-popup__overlay--open (JS toggle).
 */

.iw-popup__overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
	background: rgba(17, 17, 17, .6);
	opacity: 0;
	visibility: hidden;
	transition: opacity .25s ease, visibility .25s ease;
	-webkit-overflow-scrolling: touch;
}
.iw-popup__overlay[hidden] {
	display: none;
}
.iw-popup__overlay--open {
	opacity: 1;
	visibility: visible;
}

.iw-popup__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	margin: auto;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
	transform: translateY(-16px);
	transition: transform .25s ease;
	overflow: hidden;
}
.iw-popup__overlay--open .iw-popup__dialog {
	transform: translateY(0);
}

/* Size variants. */
.iw-popup--size-small  .iw-popup__dialog { max-width: 420px; }
.iw-popup--size-medium .iw-popup__dialog { max-width: 560px; }
.iw-popup--size-large  .iw-popup__dialog { max-width: 760px; }

.iw-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 40px;
	height: 40px;
	min-height: unset;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	font-size: 28px;
	line-height: 1;
	color: #555;
	background: rgba(255, 255, 255, .85);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}
.iw-popup__close:hover {
	background: #fff;
	color: #111;
}

/* ─────────────── Content ─────────────── */
.iw-popup__content {
	font-family: inherit;
}
.iw-popup__content--rich {
	padding: 32px 28px 28px;
}
.iw-popup__content--form {
	padding: 16px;
}
.iw-popup__content--image {
	padding: 0;
}

.iw-popup__heading {
	margin: 0 0 14px;
	font-family: inherit;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1a1a;
}
.iw-popup__rich {
	font-size: 15px;
	line-height: 1.6;
	color: #444;
}
.iw-popup__rich > :first-child { margin-top: 0; }
.iw-popup__rich > :last-child  { margin-bottom: 0; }

.iw-popup__image {
	display: block;
	width: 100%;
	height: auto;
}

/* CTA button. */
.iw-popup__cta-wrap {
	margin-top: 20px;
	text-align: center;
}
.iw-popup__content--image .iw-popup__cta-wrap {
	margin: 0;
	padding: 18px 24px 24px;
}
.iw-popup__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 32px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	background: #ff6b17;
	border: 2px solid #ff6b17;
	border-radius: 999px;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .2s ease, border-color .2s ease;
}
.iw-popup__cta:hover {
	background: #e85d0c;
	border-color: #e85d0c;
	color: #fff;
}

/* Form-only bên trong: bỏ giới hạn max-width của card. */
.iw-popup__content--form .iw-banner-cta-form {
	max-width: none;
}

/* Khoá scroll nền khi popup mở (chung với lead popup lock). */
body.iw-popup-lock {
	overflow: hidden;
}

@media (min-width: 850px) {
	.iw-popup__overlay {
		align-items: center;
	}
}
