/* ==========================================================================
   Popup / Modal Overlay
   Jewelry Studio
   ========================================================================== */

/* ── Popup wrapper — fixed full-screen overlay ────────────────────────────── */
.popup {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

/* Native [hidden] suppresses display; JS removes the attribute to open. */
.popup[hidden] {
	display: none;
}

/* ── Semi-transparent backdrop ────────────────────────────────────────────── */
.popup__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.6);
	cursor: pointer;
}

/* ── Popup container ──────────────────────────────────────────────────────── */
.popup__container {
	position: relative;
	background-color: var(--wp--preset--color--white);
	border-radius: 6px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
	max-width: 640px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	padding: 2rem;
}

/* ── Close button ─────────────────────────────────────────────────────────── */
.popup__close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--wp--preset--color--black);
	width: 2rem;
	height: 2rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.popup__close:hover,
.popup__close:focus {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	outline: none;
}

/* ── Optional title ───────────────────────────────────────────────────────── */
.popup__title {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--wp--preset--color--black);
	margin: 0 0 1rem;
	/* clearance so title doesn't overlap close button on narrow screens */
	padding-right: 2.5rem;
}

/* ── Content area ─────────────────────────────────────────────────────────── */
.popup__content iframe {
	max-width: 100%;
	display: block;
}

/* ── Body scroll lock (applied by JS when any popup is open) ──────────────── */
body.popup-open {
	overflow: hidden;
}

/* ── Entrance animation ───────────────────────────────────────────────────── */
@keyframes popup-in {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.popup:not([hidden]) .popup__container {
	animation: popup-in 0.22s ease forwards;
}

/* ── Reduce motion: disable animation ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.popup:not([hidden]) .popup__container {
		animation: none;
	}
}

@media (max-width: 600px) {
	.popup__container {
		padding: 1rem 15px;
	}
}