.thk-popup {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: calc(var(--thk-popup-screen-gap, 100px) / 2);
	box-sizing: border-box;
}

.thk-popup[hidden] {
	display: none !important;
}

.thk-popup-overlay {
	position: absolute;
	inset: 0;
	background: var(--thk-popup-overlay, rgba(15, 23, 42, 0.55));
}

.thk-popup-dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 440px);
	max-height: calc(100vh - 40px);
	overflow: auto;
	background: var(--thk-popup-card, #fff);
	color: var(--thk-popup-fg, #0f172a);
	border-radius: var(--thk-popup-radius, 16px);
	padding: var(--thk-popup-pad-top, 36px) var(--thk-popup-pad, 28px) 28px;
	box-sizing: border-box;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.28);
	text-align: center;
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.thk-popup .thk-popup-dialog:focus,
.thk-popup .thk-popup-dialog:focus-visible {
	outline: none;
	border: none;
}

.thk-popup .thk-popup-x,
.thk-popup .thk-popup-x:hover,
.thk-popup .thk-popup-x:focus,
.thk-popup .thk-popup-x:focus-visible,
.thk-popup .thk-popup-x:active {
	position: absolute;
	top: 10px;
	right: 10px;
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	background: none;
	background-color: transparent;
	box-shadow: none;
	outline: none;
	color: inherit;
	font-size: 28px;
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	padding: 4px 8px;
	margin: 0;
	min-width: 0;
	min-height: 0;
	border-radius: 0;
	text-decoration: none;
	text-shadow: none;
	opacity: 0.45;
}

.thk-popup .thk-popup-x:hover,
.thk-popup .thk-popup-x:focus,
.thk-popup .thk-popup-x:focus-visible {
	opacity: 1;
	background: none;
	background-color: transparent;
	box-shadow: none;
	color: inherit;
}

.thk-popup-img-wrap {
	margin-top: calc(-1 * var(--thk-popup-pad-top, 36px));
	margin-left: calc(-1 * var(--thk-popup-pad, 28px));
	margin-right: calc(-1 * var(--thk-popup-pad, 28px));
	padding: var(--thk-popup-img-pad, 28px) var(--thk-popup-img-pad, 28px) 0;
}

.thk-popup-dialog--img-only {
	padding: 0;
}

.thk-popup-dialog--img-only .thk-popup-img-wrap {
	margin: 0;
	padding: var(--thk-popup-img-pad, 28px);
}

.thk-popup-dialog--has-img {
	display: flex;
	flex-direction: column;
	width: fit-content;
	max-width: 100%;
	max-height: 100%;
	min-height: 0;
	overflow: hidden;
}

.thk-popup-dialog--has-img .thk-popup-img-wrap {
	flex: 0 1 auto;
	min-height: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.thk-popup-dialog--has-img .thk-popup-img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	margin: 0 auto;
	object-fit: contain;
	border-radius: 8px;
}

.thk-popup-dialog--has-img .thk-popup-title,
.thk-popup-dialog--has-img .thk-popup-tresc,
.thk-popup-dialog--has-img .thk-popup-actions {
	flex: 0 0 auto;
	position: relative;
	z-index: 1;
}

.thk-popup-title {
	margin: 0 0 12px;
	font-size: 1.45rem;
	line-height: 1.25;
	color: var(--thk-popup-fg, #0f172a);
}

.thk-popup-img-wrap + .thk-popup-title {
	margin-top: 16px;
}

.thk-popup-tresc {
	margin: 0 0 20px;
	font-size: 1rem;
	line-height: 1.55;
	color: var(--thk-popup-fg, #0f172a);
}

.thk-popup-tresc a {
	color: var(--thk-popup-accent, #2563eb);
}

.thk-popup-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}

.thk-popup-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: auto;
	max-width: 100%;
	margin: 0;
	padding: 10px 22px;
	border: 0;
	cursor: pointer;
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	text-align: center;
	appearance: none;
	-webkit-appearance: none;
}

.thk-popup-btn--cta {
	background: var(--thk-popup-cta-bg, #2563eb);
	color: var(--thk-popup-cta-fg, #fff);
	border-radius: var(--thk-popup-cta-radius, 50px);
}

.thk-popup-btn--dismiss {
	background: var(--thk-popup-dismiss-bg, #e2e8f0);
	color: var(--thk-popup-dismiss-fg, #0f172a);
	border-radius: var(--thk-popup-dismiss-radius, 50px);
}

.thk-popup-btn:hover,
.thk-popup-btn:focus {
	filter: brightness(1.05);
}

.thk-popup-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

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

@media (prefers-reduced-motion: no-preference) {
	.thk-popup:not([hidden]) .thk-popup-overlay {
		animation: thk-popup-fade 0.2s ease;
	}
	.thk-popup:not([hidden]) .thk-popup-dialog {
		animation: thk-popup-in 0.22s ease;
	}
}

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

@keyframes thk-popup-in {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: none; }
}
