/* MANA – product gallery for MANA Builder: video dialog and the module's lightbox (loaded only when used).
   The dialogs are moved to <body>, so they cannot be prefixed with .mb-root; the classes are the module's own. */

.mana-product-video-dialog,
.mana-gallery-lightbox {
	padding: 0;
	border: 0;
	overflow: visible;
	background: transparent;
	color: var(--color-bg, #fff);
}

.mana-product-video-dialog { width: min(920px, calc(100vw - 32px)); }

.mana-product-video-dialog::backdrop,
.mana-gallery-lightbox::backdrop {
	background: color-mix(in srgb, var(--color-heading, #000) 88%, transparent);
}

.mana-product-video-dialog > :is(iframe, video) {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
}

.mana-gallery-lightbox {
	direction: ltr; /* previous on the left, next on the right, like the arrows of the galleries */
	width: 100vw;
	max-width: 100vw;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
}

.mana-gallery-lightbox__image {
	display: block;
	width: 100%;
	height: 100%;
	padding: var(--space-lg, 48px) var(--space-md, 16px);
	object-fit: contain;
	box-sizing: border-box;
	user-select: none;
}

.mana-product-video-dialog > button,
.mana-gallery-lightbox :is(.mana-gallery-lightbox__close, .mana-gallery-lightbox__prev, .mana-gallery-lightbox__next) {
	position: absolute;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

.mana-product-video-dialog > button { top: -44px; right: 0; }
.mana-gallery-lightbox__close { top: var(--space-xs, 8px); right: var(--space-xs, 8px); }
.mana-gallery-lightbox :is(.mana-gallery-lightbox__prev, .mana-gallery-lightbox__next) { top: 50%; translate: 0 -50%; font-size: 44px; }
.mana-gallery-lightbox__prev { left: var(--space-xs, 8px); }
.mana-gallery-lightbox__next { right: var(--space-xs, 8px); }

.mana-gallery-lightbox__count {
	position: absolute;
	bottom: var(--space-sm, 12px);
	left: 50%;
	translate: -50% 0;
	font-size: var(--text-small, .875rem);
	opacity: .8;
}

.mana-gallery-lightbox button:focus-visible {
	outline: 2px solid var(--color-primary, currentColor);
	outline-offset: 2px;
}
