.granvet-popup-open {
	overflow: hidden !important;
}

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

.granvet-popup-overlay {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(10, 18, 28, 0.72);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.granvet-popup-overlay.is-visible {
	opacity: 1;
}

.granvet-popup-dialog {
	position: relative;
	width: min(100%, var(--granvet-popup-width, 720px));
	max-height: calc(100vh - 48px);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.2s ease;
}

.granvet-popup-overlay.is-visible .granvet-popup-dialog {
	transform: translateY(0) scale(1);
}

.granvet-popup-media {
	display: block;
	line-height: 0;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
	background: #fff;
}

.granvet-popup-image,
.granvet-popup-video {
	display: block;
	width: 100%;
	height: auto;
	max-height: calc(100vh - 48px);
	object-fit: contain;
}

.granvet-popup-video {
	background: #000;
}

.granvet-popup-close {
	position: absolute;
	z-index: 2;
	top: -14px;
	right: -14px;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 2px solid #fff;
	border-radius: 999px;
	background: #111827;
	color: #fff;
	font: 700 28px/1 Arial, sans-serif;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.granvet-popup-close:hover,
.granvet-popup-close:focus-visible {
	background: #000;
	transform: scale(1.05);
	outline: 3px solid rgba(255, 255, 255, 0.75);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.granvet-popup-overlay {
		padding: 18px;
	}

	.granvet-popup-dialog {
		max-height: calc(100vh - 36px);
	}

	.granvet-popup-image,
	.granvet-popup-video {
		max-height: calc(100vh - 36px);
	}

	.granvet-popup-close {
		top: -12px;
		right: -8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.granvet-popup-overlay,
	.granvet-popup-dialog {
		transition: none;
	}
}
