/*
 * Galerie der Buch-Detailseite und der Produktseite.
 *
 * Werte aus den Prototypen »Detailseite Buch« und »Shop – Produktdetail«. Grundgerüst und Bedienelemente sind
 * gemeinsam, das Aussehen von Bildfläche, Lupe und Thumbnails hängt an der Variante (`--book`, `--product`).
 */

.as-gallery {
	--as-g-ink: var(--awb-color4, #0f1450);
	--as-g-muted: #4a4e57;
	--as-g-accent: var(--as-theme-dark, #4b6ec8);
	--as-g-line: var(--as-theme-lighter, #c3eeee);
	--as-g-surface: var(--as-theme-pale, #eef9f9);

	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	box-sizing: border-box;
	color: var(--as-g-ink);
}

.as-gallery *,
.as-gallery *::before,
.as-gallery *::after {
	box-sizing: border-box;
}

.as-gallery :focus-visible {
	outline: 2px solid var(--as-g-accent);
	outline-offset: 2px;
}

.as-gallery__stage {
	position: relative;
	overflow: hidden;
	border-radius: 12px;
}

.as-gallery__zoom {
	position: absolute;
	bottom: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: var(--as-g-ink);
	cursor: pointer;
	background: #fff;
	border-radius: 999px;
}

.as-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.as-gallery__thumb {
	flex: 0 0 auto;
	cursor: pointer;
	background: #fff;
	border-radius: 8px;
}

.as-gallery__thumb[aria-pressed="true"] {
	border: 2px solid var(--as-g-accent);
}

.as-gallery__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.as-gallery__count {
	margin: 0;
	font-size: 13px;
	color: var(--as-g-muted);
}

/* ---------- Variante Buch: Cover auf heller Fläche ---------- */

.as-gallery--book .as-gallery__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 440px;
	padding: 24px;
	background: var(--as-g-surface);
	border: 1px solid var(--as-g-line);
}

.as-gallery--book .as-gallery__img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 10px 26px rgba(15, 20, 80, 0.18);
}

.as-gallery--book .as-gallery__zoom {
	left: 12px;
	border: 1px solid var(--as-g-ink);
}

.as-gallery--book .as-gallery__thumb {
	width: 72px;
	height: 96px;
	padding: 4px;
	border: 1px solid var(--as-g-line);
}

.as-gallery--book .as-gallery__thumb img {
	border-radius: 4px;
}

@media (max-width: 480px) {
	.as-gallery--book .as-gallery__stage {
		height: 360px;
		padding: 16px;
	}
}

/* ---------- Variante Produkt: Foto 3:4 ---------- */

.as-gallery--product .as-gallery__stage {
	aspect-ratio: 3 / 4;
	background: linear-gradient(160deg, var(--as-theme-light, #5a7fd0) 0%, var(--as-theme, #7cceda) 100%);
}

.as-gallery--product .as-gallery__img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
}

.as-gallery--product .as-gallery__zoom {
	right: 12px;
	border: 0;
}

.as-gallery--product .as-gallery__thumb {
	width: 76px;
	height: 100px;
	padding: 3px;
	border: 1px solid var(--as-g-line);
}

.as-gallery--product .as-gallery__thumb[aria-pressed="true"] {
	border-width: 2px;
}

.as-gallery--product .as-gallery__thumb img {
	border-radius: 5px;
}
