/* Legacy product page video lightbox. See video-modal.js. */
html.legacy-video-open { overflow: hidden; }

.legacy-video-modal {
	position: fixed;
	inset: 0;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 8px;
	width: min(1200px, calc(100vw - 32px), calc((100dvh - 120px) * 16 / 9)); /* leaves room above for the close button */
	max-width: none;
	max-height: none;
	height: fit-content; /* with inset: 0, auto would stretch to the viewport */
	background: #000;
	overflow: visible;
	box-shadow: 0 24px 64px rgba(0, 0, 0, .45);
}
.legacy-video-modal::backdrop { background: rgba(0, 0, 0, .75); }
.legacy-video-modal[open] { animation: legacy-video-in .25s ease-out; }
@keyframes legacy-video-in { from { opacity: 0; transform: translateY(16px); } }

.legacy-video-modal__stage {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	border-radius: inherit;
	overflow: hidden;
}
.legacy-video-modal__stage iframe,
.legacy-video-modal__stage video {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	border: 0;
}

.legacy-video-modal__close {
	position: absolute;
	top: -52px;
	right: 0;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}
.legacy-video-modal__close::before,
.legacy-video-modal__close::after {
	content: "";
	position: absolute;
	left: 12px;
	top: 21px;
	width: 20px;
	height: 2px;
	background: #231f20;
	transform: rotate(45deg);
}
.legacy-video-modal__close::after { transform: rotate(-45deg); }
.legacy-video-modal__close:hover { background: #cf0a2c; }
.legacy-video-modal__close:hover::before,
.legacy-video-modal__close:hover::after { background: #fff; }
.legacy-video-modal__close:focus-visible { outline: 3px solid #cf0a2c; outline-offset: 3px; }

@media (max-width: 600px) {
	.legacy-video-modal { width: calc(100vw - 16px); }
}

@media (prefers-reduced-motion: reduce) {
	.legacy-video-modal[open] { animation: none; }
}
