/**
 * Riemann Systems – Produkt-Popup
 *
 * Dialog-Rahmen (Hintergrund, Box, Schließen-Button) und die Info-Liste
 * „> …“, die auch auf der Produkt-Unterseite gilt. Das Layout des
 * Produktblocks selbst kommt aus Bricks (Template „Produkt“).
 *
 * Farben: --bg, --black, --white, --silver, --tritium (Bricks-Variablen).
 */

/* Info-Liste (Popup und Unterseite) ------------------------------------- */
.ris-product-infos {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1.2rem;
}
.ris-product-infos li {
	display: flex;
	gap: .6em;
	align-items: baseline;
}
.ris-product-infos li::before {
	content: ">";
	flex: 0 0 auto;
}

/* Dialog ---------------------------------------------------------------- */
.ris-popup {
	--ris-popup-gap: 2rem;
	--ris-popup-radius: 3.4rem; /* einheitlich: Popup-Rahmen und Bildfläche */
	position: fixed;
	inset: 0;
	margin: auto;
	width: calc(100vw - 2 * var(--ris-popup-gap));
	width: calc(100dvw - 2 * var(--ris-popup-gap));
	max-width: 190rem;
	max-height: calc(100vh - 2 * var(--ris-popup-gap));
	max-height: calc(100dvh - 2 * var(--ris-popup-gap));
	padding: 0;
	border: 0;
	border-radius: var(--ris-popup-radius, 2.4rem);
	background: var(--bg, #fff);
	color: var(--black, #1d2121);
	overflow: auto;
	overscroll-behavior: contain;
	box-shadow: 0 2rem 6rem rgba(0, 0, 0, .35);
}
.ris-popup::backdrop {
	background: rgba(29, 33, 33, .7);
}
.ris-popup[open] {
	animation: ris-popup-in .25s ease-out;
}
@keyframes ris-popup-in {
	from { opacity: 0; transform: translateY(1.2rem); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.ris-popup[open] { animation: none; }
}

/* Seite hinter dem Dialog nicht scrollen */
html.ris-popup-open,
html.ris-popup-open body {
	overflow: hidden;
}

.ris-popup__close {
	position: absolute;
	top: 3.4rem;
	right: 3.4rem;
	z-index: 2;
	width: 4.8rem;
	height: 4.8rem;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bg, #fff);
	color: var(--black, #1d2121);
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.ris-popup__close:hover {
	background: var(--black, #1d2121);
	color: var(--bg, #fff);
}
.ris-popup__close:focus-visible {
	outline: .2rem solid var(--tritium, #00e68c);
	outline-offset: .2rem;
}

.ris-popup__body {
	min-height: 30rem;
	/* Bezugsbreite für die volle Bildfläche (cqw) */
	container-type: inline-size;
}
.ris-popup__loading {
	display: grid;
	place-items: center;
	min-height: 30rem;
	margin: 0;
	font-size: var(--text-body, 1.8rem);
	color: var(--platinum, #78828f);
}

/* Der geholte Produktblock im Popup: der Section-Abstand der Seite (ris-section)
   entfällt, oben nur ein schmaler Rand um die Bildfläche, unten etwas mehr. */
.ris-popup .ris-popup__product.brxe-section,
.ris-popup .ris-popup__product {
	padding: 2rem 0 8rem;
	margin: 0;
}

/* Bildfläche im Popup über die ganze Breite (seitlich derselbe Rand wie oben).
   Auf der Produkt-Unterseite bleibt sie in der Inhaltsbreite. */
.ris-popup .ris-product__media {
	--ris-popup-media-gap: 2rem;
	width: calc(100cqw - 2 * var(--ris-popup-media-gap));
	max-width: none;
	margin-inline: calc(50% - 50cqw + var(--ris-popup-media-gap));
}

@media (max-width: 767px) {
	.ris-popup {
		--ris-popup-gap: 1rem;
		--ris-popup-radius: 2.4rem;
	}
	.ris-popup .ris-popup__product.brxe-section,
	.ris-popup .ris-popup__product {
		padding-top: 1rem;
	}
	.ris-popup .ris-product__media {
		--ris-popup-media-gap: 1rem;
	}
	.ris-popup__close {
		top: 2.2rem;
		right: 2.2rem;
		width: 3rem;
		height: 3rem;
	}
}

/* Bildfläche, Popup-Rahmen und Button im Popup mit derselben Rundung (2.4rem). Der Button bekommt im Popup das helle Grau
   der Produkt-Labels (--white) und sitzt 5px weiter links-unten. */
.ris-popup .ris-product .ris-product__media {
	border-radius: calc(var(--ris-popup-radius) - var(--ris-popup-media-gap));
}

.ris-popup .ris-product .bricks-button.ris-btn-dark-3 {
	background-color: var(--white);
	border-color: var(--white);
	position: relative;
	left: -5px;
	top: 5px;
}
.ris-popup .ris-product .bricks-button.ris-btn-dark-3:hover,
.ris-popup .ris-product .bricks-button.ris-btn-dark-3:focus-visible {
	background-color: var(--carbon);
	border-color: var(--carbon);
}
