/* JDC Special Offers Popup */

.jdc-sop[hidden] {
	display: none;
}

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

.jdc-sop.is-visible {
	opacity: 1;
}

.jdc-sop__overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.62);
	cursor: pointer;
}

.jdc-sop__dialog {
	position: relative;
	width: 100%;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	/* Nothing may stick out sideways, or this box grows a scrollbar. */
	overflow-x: hidden;
	background: transparent;
	border-radius: 8px;
	transform: translateY(14px) scale(0.98);
	transition: transform 0.25s ease;
	-webkit-overflow-scrolling: touch;
}

.jdc-sop.is-visible .jdc-sop__dialog {
	transform: translateY(0) scale(1);
}

.jdc-sop__link,
.jdc-sop__dialog > img {
	display: block;
	line-height: 0;
	box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
	border-radius: 8px;
	overflow: hidden;
}

.jdc-sop__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 8px;
}

/* Close button */
.jdc-sop__close {
	position: absolute;
	/*
	 * Kept inside the dialog rather than overhanging it: the dialog scrolls
	 * tall creatives, and anything outside its box triggers a scrollbar.
	 */
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 38px;
	height: 38px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	color: #1a1a1a;
	border: 0;
	border-radius: 50%;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
}

.jdc-sop__close:hover,
.jdc-sop__close:focus {
	background: #f2f2f2;
	transform: scale(1.06);
}

.jdc-sop__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Mobile / desktop creative swap */
.jdc-sop__img--mobile {
	display: none;
}

@media (max-width: 600px) {
	.jdc-sop {
		padding: 16px;
	}

	.jdc-sop__close {
		top: 8px;
		right: 8px;
		width: 34px;
		height: 34px;
	}

	.jdc-sop--has-mobile .jdc-sop__img--desktop {
		display: none;
	}

	.jdc-sop--has-mobile .jdc-sop__img--mobile {
		display: block;
	}
}

/* Stop the page scrolling behind the popup */
body.jdc-sop-open {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.jdc-sop,
	.jdc-sop__dialog,
	.jdc-sop__close {
		transition: none;
	}
}
