/*
 * Product-page image gallery ("Polert klassiker"): fixed-ratio stage with
 * overlay arrows and counter, thumbnail row with an active ring, and a
 * fullscreen lightbox. Markup in products/product_detail.html, behavior
 * in js/epla-gallery.js.
 */

.epla-pg { max-width: 100%; }

/* Stage: fixed image area so the page never jumps between photos of
   different heights; whole photo always visible on a quiet canvas. */
.epla-pg-stage {
	position: relative;
	background: #f4f2ee;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	cursor: zoom-in;
}
.epla-pg-stage:focus-visible { outline: 2px solid #1abc9c; outline-offset: 2px; }
.epla-pg-img {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
	object-fit: contain;
	transition: opacity .16s ease;
}
.epla-pg-img.is-fading { opacity: 0; }

.epla-pg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 42px; height: 42px;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	background: #fff;
	color: #2b363d;
	box-shadow: 0 2px 12px rgba(29, 37, 41, .22);
	display: flex; align-items: center; justify-content: center;
	padding: 0;
	opacity: 0;
	transition: opacity .18s ease;
}
.epla-pg-arrow svg { display: block; }
.epla-pg-arrow--prev { left: 12px; }
.epla-pg-arrow--next { right: 12px; }
.epla-pg-stage:hover .epla-pg-arrow,
.epla-pg-arrow:focus-visible { opacity: 1; }
.epla-pg-arrow:focus-visible { outline: 2px solid #1abc9c; outline-offset: 2px; }
@media (hover: none) {
	.epla-pg-arrow { opacity: .92; width: 36px; height: 36px; }
}

.epla-pg-count {
	position: absolute;
	top: 12px; right: 12px;
	z-index: 2;
	background: rgba(29, 37, 41, .62);
	color: #fff;
	border-radius: 20px;
	font-size: 12.5px;
	line-height: 1.4;
	padding: 4px 11px;
	letter-spacing: .04em;
}

/* Thumbnails: row under the stage, active one ringed in green. */
.epla-pg-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}
.epla-pg-thumb {
	width: 64px; height: 64px;
	border-radius: 6px;
	overflow: hidden;
	background: #f4f2ee;
	box-shadow: 0 0 0 1px #e8e5df;
	opacity: .62;
	transition: opacity .15s ease;
	display: block;
}
.epla-pg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.epla-pg-thumb:hover { opacity: 1; }
.epla-pg-thumb.is-active { opacity: 1; box-shadow: 0 0 0 2px #1abc9c; }
.epla-pg-thumb:focus-visible { outline: 2px solid #1abc9c; outline-offset: 2px; }

/* Lightbox */
.epla-pg-lb {
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	z-index: 1050;
	background: rgba(24, 30, 33, .95);
	display: flex;
	align-items: center;
	justify-content: center;
}
.epla-pg-lb-img {
	max-width: min(92vw, 900px);
	max-height: 84vh;
	object-fit: contain;
	border-radius: 4px;
}
.epla-pg-lb .epla-pg-arrow {
	opacity: 1;
	background: rgba(255, 255, 255, .14);
	color: #fff;
	box-shadow: none;
}
.epla-pg-lb .epla-pg-arrow:hover { background: rgba(255, 255, 255, .26); }
.epla-pg-lb .epla-pg-arrow--prev { left: max(14px, calc(50vw - 500px)); }
.epla-pg-lb .epla-pg-arrow--next { right: max(14px, calc(50vw - 500px)); }
.epla-pg-lb-count {
	position: absolute;
	top: 18px; left: 50%;
	transform: translateX(-50%);
	color: #cfd6d3;
	font-size: 13.5px;
	letter-spacing: .06em;
}
.epla-pg-lb-close {
	position: absolute;
	top: 12px; right: 14px;
	width: 44px; height: 44px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}
.epla-pg-lb-close:hover { background: rgba(255, 255, 255, .14); }
.epla-pg-lb-close:focus-visible { outline: 2px solid #1abc9c; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.epla-pg-img, .epla-pg-arrow, .epla-pg-thumb { transition: none; }
}
