/* EDS Popups — front-end */
.eds-popup-wrap {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
}
.eds-popup-wrap.is-open {
	display: flex;
}
.eds-popup-wrap * {
	box-sizing: border-box;
}

.eds-popup__overlay {
	position: absolute;
	inset: 0;
	background: var(--eds-pop-overlay, rgba(11, 30, 58, 0.6));
}

.eds-popup {
	position: relative;
	width: 100%;
	max-width: var(--eds-pop-width, 600px);
	max-height: calc(100vh - 40px);
	overflow: auto;
	background: var(--eds-pop-bg, #ffffff);
	border-radius: var(--eds-pop-radius, 12px);
	padding: var(--eds-pop-pad, 40px);
	box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
}
/* Image popups: the box hugs the image — no padding, so the shadow and the
   close button align to the image itself rather than a wider phantom box. */
.eds-popup.eds-popup--image {
	padding: 0;
	overflow: hidden;
	background: transparent;
}
.eds-popup.eds-popup--image .eds-popup__content > a,
.eds-popup.eds-popup--image .eds-popup__content > img,
.eds-popup.eds-popup--image .eds-popup__content > a > img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	margin: 0;
	border-radius: inherit;
}

/* Close button — fully reset so the theme's global <button> styles can't
   distort it into an oval or offset the glyph. */
.eds-popup-wrap .eds-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	min-width: 0;
	min-height: 0;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 22px;
	line-height: 1;
	font-family: inherit;
	font-weight: 400;
	letter-spacing: 0;
	text-align: center;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.eds-popup-wrap .eds-popup__close:hover {
	background: rgba(0, 0, 0, 0.55);
	transform: scale(1.06);
}

/* ---- Positions ---- */
.eds-popup--top { align-items: flex-start; }
.eds-popup--bottom { align-items: flex-end; }
.eds-popup--top-left { align-items: flex-start; justify-content: flex-start; }
.eds-popup--top-right { align-items: flex-start; justify-content: flex-end; }
.eds-popup--bottom-left { align-items: flex-end; justify-content: flex-start; }
.eds-popup--bottom-right { align-items: flex-end; justify-content: flex-end; }

/* ---- Animations (applied to .eds-popup when open) ---- */
.eds-popup-wrap.is-open .eds-popup__overlay {
	animation: eds-fade 0.25s ease both;
}
.eds-anim-fade.is-open .eds-popup { animation: eds-fade 0.3s ease both; }
.eds-anim-zoom.is-open .eds-popup { animation: eds-zoom 0.3s ease both; }
.eds-anim-slide-up.is-open .eds-popup { animation: eds-slide-up 0.35s ease both; }
.eds-anim-slide-down.is-open .eds-popup { animation: eds-slide-down 0.35s ease both; }

@keyframes eds-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes eds-zoom { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes eds-slide-up { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes eds-slide-down { from { opacity: 0; transform: translateY(-40px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
	.eds-popup-wrap.is-open .eds-popup,
	.eds-popup-wrap.is-open .eds-popup__overlay {
		animation: none;
	}
}

@media (max-width: 600px) {
	.eds-popup {
		padding: 24px;
	}
	.eds-popup__content > a > img,
	.eds-popup__content > img {
		margin: -24px;
		width: calc(100% + 48px);
	}
}
