.ag-popup {
	position: fixed !important;
	inset: 0 !important;
	z-index: 999999 !important;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 40px 24px 24px;
	box-sizing: border-box;
}

.ag-popup.is-visible {
	display: flex !important;
}

.ag-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.ag-popup__dialog {
	position: relative;
	z-index: 1;
	width: auto;
	max-width: min(640px, 82vw);
	max-height: 82vh;
	box-sizing: border-box;
	padding-top: 40px;
}

.ag-popup__close {
	position: absolute;
	top: 0;
	right: 0;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #4d0018;
	color: #fff;
	line-height: 0;
	cursor: pointer;
}

.ag-popup__close svg {
	display: block;
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

.ag-popup__close:hover,
.ag-popup__close:focus {
	background: #87082f;
	color: #fff;
	outline: none;
}

.ag-popup__content {
	display: block;
	line-height: 0;
}

.ag-popup__link {
	display: block;
	line-height: 0;
}

.ag-popup__image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(68vh - 40px);
	object-fit: contain;
	margin: 0 auto;
}

@media (max-width: 1024px) {
	.ag-popup {
		padding: 32px 16px 16px;
	}

	.ag-popup__dialog {
		max-width: min(95vw, 360px);
		max-height: 95vh;
	}

	.ag-popup__image {
		max-height: calc(95vh - 40px);
	}
}
