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

.rb-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.rb-popup.is-open {
	opacity: 1;
}

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

.rb-popup__box {
	position: relative;
	width: 100%;
	max-width: var(--rb-popup-max, 600px);
	transform: translateY(12px) scale(0.98);
	transition: transform 0.25s ease;
}

.rb-popup.is-open .rb-popup__box {
	transform: none;
}

.rb-popup__img,
.rb-popup picture,
.rb-popup__link {
	display: block;
	width: 100%;
}

.rb-popup__img {
	height: auto;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.rb-popup__close {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #111;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease;
}

.rb-popup__close:hover {
	transform: scale(1.08);
}

.rb-popup__close:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 3px;
}

@media (max-width: 767px) {
	.rb-popup__close {
		top: 8px;
		right: 8px;
	}
}

html.rb-popup-lock,
html.rb-popup-lock body {
	overflow: hidden;
}

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