/* Eigene Produktgalerie ([lgm_product_gallery])
 *
 * Design-Tokens aus dem Theme abgeleitet:
 *   Akzent  = Marken-Grün (#417B65, wie der Warenkorb-Button)
 *   Rahmen  = Hairline #e4e4e4 (verwandt mit dem Swatch-Rand #F2F2F2)
 *   Kanten  = eckig (border-radius: 0, wie Buttons & Swatches)
 */

.lgm-gallery {
	--lgm-accent: #417B65;
	--lgm-frame: #e4e4e4;
	--lgm-muted: #6d6d6d;
	--lgm-gap: 8px;
	margin: 0 0 var(--lgm-gap);
}

/* Hauptbild: feste 16:9-Bühne verhindert Layout-Shift beim Varianten-/Bildwechsel */
.lgm-gallery-main {
	position: relative;
	margin-bottom: var(--lgm-gap);
}

.lgm-gallery-main-link {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	background: #fff;
	cursor: zoom-in;
	line-height: 0;
	overflow: hidden;
}

.lgm-gallery-main-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	transition: opacity 0.18s ease;
}

/* Fallback ohne Bild (Platzhalter) */
.lgm-gallery-main > .lgm-gallery-main-image {
	aspect-ratio: 16 / 9;
}

/* Video ohne Poster-Bild (lgm_video-Meta): graue Abspielfläche */
.lgm-gallery-main-video {
	background: #f2f2f2;
	cursor: pointer;
}

/* Inline-Video (kein Overlay) */
.lgm-gallery-video {
	width: 100%;
	background: #000;
}

.lgm-gallery-video video,
.lgm-gallery-video iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Thumbnails: 3 nebeneinander, dann Umbruch */
.lgm-gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--lgm-gap);
}

.lgm-gallery-thumbs-hidden {
	display: none;
}

/* Thumbnails bewusst rahmenlos (auch aktiv/hover keine Border) */
.lgm-gallery-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	background: #fff;
	cursor: pointer;
	line-height: 0;
}

.lgm-gallery-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* Eigenständiges Video-Thumbnail: neutraler Kachel-Hintergrund, kein Produktbild darunter */
.lgm-gallery-thumb-video {
	background: #f2f2f2;
}

.lgm-gallery-thumb:focus-visible,
.lgm-gallery-main-link:focus-visible {
	outline: 2px solid var(--lgm-accent);
	outline-offset: 2px;
}

/* Abspielpfeil-Overlays für Videos */
.lgm-gallery-play,
.lgm-gallery-thumb-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.lgm-gallery-play svg {
	width: 60px;
	height: 60px;
}

.lgm-gallery-thumb-play svg {
	width: 26px;
	height: 26px;
}

.lgm-gallery-thumb-video .lgm-gallery-thumb-play svg {
	width: 34px;
	height: 34px;
}

@media (prefers-reduced-motion: reduce) {
	.lgm-gallery-main-image {
		transition: none;
	}
}
