/*
 * Steinlightbox.
 *
 * Farben kommen aus den globalen Farben des Design Systems. Die Werte hinter
 * dem Komma greifen nur, wenn ein Global einmal fehlt.
 *
 * Wie beim Kalkulator steht vor jedem Selektor noch einmal der Container.
 * Auf der Seite liegen Stylesheets, die nach diesem geladen werden und unter
 * anderem "*, ::before, ::after { background: transparent }" setzen. Mit dem
 * Container davor setzt sich jede Regel durch, ohne !important.
 */

.mrk-lb {
	--mrk-lb-primaer: var(--e-global-color-primary, #003770);
	--mrk-lb-hover: var(--e-global-color-msblauhover, #002F61);
	--mrk-lb-press: var(--e-global-color-msblaupress, #002850);
	--mrk-lb-linie: var(--e-global-color-mslinie, #E6E6E6);
	--mrk-lb-text: var(--e-global-color-text, #1F242A);
	--mrk-lb-gedaempft: var(--e-global-color-mstextmuted, #6F7276);
	--mrk-lb-weiss: var(--e-global-color-msweiss, #FFFFFF);
	--mrk-lb-bildgrund: var(--e-global-color-msbildgrund, #F0F0F0);
	--mrk-lb-radius: 4px;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	font-family: inherit;
}

.mrk-lb[hidden] { display: none; }

.mrk-lb .mrk-lb__hinter {
	position: absolute;
	inset: 0;
	background: rgba(15, 20, 28, .72);
	cursor: pointer;
	animation: mrk-lb-ein .18s ease-out;
}

.mrk-lb .mrk-lb__fenster {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(760px, 100%);
	max-height: min(88vh, 900px);
	background: var(--mrk-lb-weiss);
	border-radius: var(--mrk-lb-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .34);
	overflow: hidden;
	animation: mrk-lb-auf .22s cubic-bezier(.22, .61, .36, 1);
}

.mrk-lb .mrk-lb__fenster:focus { outline: none; }
.mrk-lb .mrk-lb__fenster:focus-visible { outline: 2px solid var(--mrk-lb-primaer); outline-offset: 2px; }

/* Der Schliessen-Knopf bleibt stehen, auch wenn der Inhalt rollt. */

.mrk-lb .mrk-lb__zu,
.mrk-lb .mrk-lb__zu:hover,
.mrk-lb .mrk-lb__zu:focus,
.mrk-lb .mrk-lb__zu:focus-visible,
.mrk-lb .mrk-lb__zu:active {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 0;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
	transition: background-color .2s ease, color .2s ease;
}

.mrk-lb .mrk-lb__zu { background: rgba(255, 255, 255, .92); color: var(--mrk-lb-primaer); }

.mrk-lb .mrk-lb__zu:hover,
.mrk-lb .mrk-lb__zu:focus,
.mrk-lb .mrk-lb__zu:focus-visible { background: var(--mrk-lb-primaer); color: var(--mrk-lb-weiss); }

.mrk-lb .mrk-lb__zu:active { background: var(--mrk-lb-press); color: var(--mrk-lb-weiss); }
.mrk-lb .mrk-lb__zu:focus-visible { outline: 2px solid var(--mrk-lb-weiss); outline-offset: -3px; }
.mrk-lb .mrk-lb__zu svg { width: 20px; height: 20px; }

/* --- Blaettern ---
   Die Pfeile sitzen ausserhalb des Fensters am Rand des Bildschirms, wie in
   der Galerie. Auf schmalen Geraeten rutschen sie unter das Fenster, weil
   daneben kein Platz mehr ist. */

.mrk-lb .mrk-lb__pfeil,
.mrk-lb .mrk-lb__pfeil:hover,
.mrk-lb .mrk-lb__pfeil:focus,
.mrk-lb .mrk-lb__pfeil:focus-visible,
.mrk-lb .mrk-lb__pfeil:active {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 52px;
	height: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 0;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.mrk-lb .mrk-lb__pfeil { background: rgba(255, 255, 255, .16); color: var(--mrk-lb-weiss); }

.mrk-lb .mrk-lb__pfeil:hover,
.mrk-lb .mrk-lb__pfeil:focus,
.mrk-lb .mrk-lb__pfeil:focus-visible { background: var(--mrk-lb-weiss); color: var(--mrk-lb-primaer); }

.mrk-lb .mrk-lb__pfeil:active { background: var(--mrk-lb-weiss); color: var(--mrk-lb-press); }
.mrk-lb .mrk-lb__pfeil:focus-visible { outline: 2px solid var(--mrk-lb-weiss); outline-offset: 3px; }
.mrk-lb .mrk-lb__pfeil[hidden] { display: none; }
.mrk-lb .mrk-lb__pfeil svg { width: 26px; height: 26px; }

.mrk-lb .mrk-lb__pfeil--zurueck { left: max(16px, calc(50% - min(760px, 100%) / 2 - 68px)); }
.mrk-lb .mrk-lb__pfeil--weiter { right: max(16px, calc(50% - min(760px, 100%) / 2 - 68px)); }

/* Zaehler unter dem Fenster. */

.mrk-lb .mrk-lb__zaehler {
	position: absolute;
	left: 0;
	right: 0;
	bottom: max(10px, env(safe-area-inset-bottom, 10px));
	z-index: 1;
	margin: 0;
	text-align: center;
	font-size: .8125rem;
	letter-spacing: .04em;
	color: rgba(255, 255, 255, .82);
	pointer-events: none;
}

.mrk-lb .mrk-lb__zaehler[hidden] { display: none; }

/* Gerollt wird hier, nicht am Fenster: so bleibt der Knopf an seinem Platz. */

.mrk-lb .mrk-lb__rollbereich {
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.mrk-lb .mrk-lb__bild {
	margin: 0;
	background: var(--mrk-lb-bildgrund);
	position: relative;
}

.mrk-lb .mrk-lb__bild img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 56vh;
	object-fit: cover;
}

.mrk-lb .mrk-lb__fotohinweis {
	position: absolute;
	left: 16px;
	bottom: 16px;
	padding: 5px 10px;
	border-radius: 3px;
	background: rgba(255, 255, 255, .92);
	font-size: .75rem;
	color: var(--mrk-lb-gedaempft);
}

.mrk-lb .mrk-lb__fotohinweis[hidden] { display: none; }

/* Bild-Copyright unten links, weiss auf schwarz (15.10.2026) */
.mrk-lb .mrk-lb__copyright {
	position: absolute;
	left: 16px;
	bottom: 16px;
	padding: 5px 10px;
	background: #000;
	font-size: .75rem;
	line-height: 1.3;
	color: #fff;
}

.mrk-lb .mrk-lb__copyright[hidden] { display: none; }
.mrk-lb .mrk-lb__text { padding: 24px 28px 28px; background: var(--mrk-lb-weiss); }

.mrk-lb .mrk-lb__titel {
	margin: 0 0 10px;
	font-size: clamp(1.25rem, 3vw, 1.625rem);
	line-height: 1.2;
	color: var(--mrk-lb-primaer);
}

.mrk-lb .mrk-lb__beschreibung {
	margin: 0;
	line-height: 1.6;
	color: var(--mrk-lb-text);
}

.mrk-lb .mrk-lb__beschreibung[hidden] { display: none; }

/* --- Eckdaten unter der Beschreibung (02.10.2026) ---
   Trennlinie, darunter Preisklasse | Anwendungsbereiche | Verwendung.
   Desktop nebeneinander, linksbuendig mit festem Abstand, ab Tablet untereinander. */

.mrk-lb .mrk-lb__raster {
	display: flex;
	justify-content: flex-start;
	align-items: flex-start;
	gap: 64px;
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid var(--mrk-lb-linie);
}

.mrk-lb .mrk-lb__raster[hidden],
.mrk-lb .mrk-lb__feld[hidden] { display: none; }

.mrk-lb .mrk-lb__feld {
	display: grid;
	gap: 12px;
	align-content: start;
	flex: 0 0 auto;
}

.mrk-lb .mrk-lb__feldtitel {
	margin: 0;
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-size: 1.0625rem;
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	color: var(--mrk-lb-primaer);
}

.mrk-lb .mrk-lb__euro {
	display: flex;
	gap: 8px;
	margin: 0;
	font-family: var(--e-global-typography-primary-font-family, inherit);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.2;
}

.mrk-lb .mrk-lb__euro span { color: var(--e-global-color-secondary, #C6C6C6); }
.mrk-lb .mrk-lb__euro span.is-an { color: var(--mrk-lb-primaer); }

.mrk-lb .mrk-lb__liste {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.mrk-lb .mrk-lb__liste li {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 24px;
	margin: 0;
	font-size: .9375rem;
	line-height: 1.2;
	color: var(--mrk-lb-text);
	white-space: nowrap;
}

.mrk-lb .mrk-lb__ico {
	display: inline-block;
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
	background: var(--mrk-lb-primaer);
	-webkit-mask: var(--mrk-ico) center / contain no-repeat;
	mask: var(--mrk-ico) center / contain no-repeat;
}

@media (max-width: 1024px) {
	.mrk-lb .mrk-lb__raster { flex-direction: column; gap: 20px; }
	.mrk-lb .mrk-lb__liste li { white-space: normal; }
}

/* --- Unter 1024 px: Pfeile links oben im Fenster (02.10.2026) ---
   Das Skript haengt die Pfeile dafuer ins Fenster um. Gleiche Groesse und
   Hoehe wie der Schliessen-Knopf, links statt rechts. */

@media (max-width: 1024px) {
	.mrk-lb { padding: 16px 12px 48px; }

	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil,
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:hover,
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:focus,
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:focus-visible,
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:active {
		top: 12px;
		bottom: auto;
		right: auto;
		transform: none;
		width: 40px;
		height: 40px;
		box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
	}

	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil { background: rgba(255, 255, 255, .92); color: var(--mrk-lb-primaer); }

	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:hover,
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:focus,
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:focus-visible { background: var(--mrk-lb-primaer); color: var(--mrk-lb-weiss); }

	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:active { background: var(--mrk-lb-press); color: var(--mrk-lb-weiss); }
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil:focus-visible { outline: 2px solid var(--mrk-lb-weiss); outline-offset: -3px; }
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil svg { width: 20px; height: 20px; }
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil--zurueck { left: 12px; }
	.mrk-lb .mrk-lb__fenster .mrk-lb__pfeil--weiter { left: 60px; }
	.mrk-lb .mrk-lb__zaehler { bottom: 16px; }
	.mrk-lb .mrk-lb__fenster { max-height: calc(100vh - 80px); }
}

/* Die Seite dahinter soll nicht mitrollen. */
html.mrk-lb-offen { overflow: hidden; }

/* Eine Listing-Kachel, die die Lightbox oeffnet. */
.jet-listing-grid__item.mrk-lb-ausloeser { cursor: pointer; }
.jet-listing-grid__item.mrk-lb-ausloeser:focus-visible { outline: 2px solid var(--e-global-color-primary, #003770); outline-offset: 3px; }
.jet-listing-grid__item.mrk-lb-ausloeser .jet-listing-dynamic-image__link { pointer-events: none; }

@keyframes mrk-lb-ein {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes mrk-lb-auf {
	from { opacity: 0; transform: translateY(12px) scale(.985); }
	to { opacity: 1; transform: none; }
}

/* Kein Platz mehr neben dem Fenster: Pfeile nach unten. */
@media (max-width: 900px) {
	.mrk-lb { padding: 16px 12px 76px; }

	.mrk-lb .mrk-lb__pfeil,
	.mrk-lb .mrk-lb__pfeil:hover,
	.mrk-lb .mrk-lb__pfeil:focus,
	.mrk-lb .mrk-lb__pfeil:focus-visible,
	.mrk-lb .mrk-lb__pfeil:active {
		top: auto;
		bottom: 12px;
		transform: none;
		width: 46px;
		height: 46px;
	}

	.mrk-lb .mrk-lb__pfeil--zurueck { left: calc(50% - 72px); }
	.mrk-lb .mrk-lb__pfeil--weiter { right: calc(50% - 72px); }
	.mrk-lb .mrk-lb__zaehler { bottom: 28px; }
	.mrk-lb .mrk-lb__fenster { max-height: calc(100vh - 150px); }
	.mrk-lb .mrk-lb__bild img { max-height: 42vh; }
	.mrk-lb .mrk-lb__text { padding: 20px 20px 24px; }
}

@media (prefers-reduced-motion: reduce) {
	.mrk-lb .mrk-lb__hinter,
	.mrk-lb .mrk-lb__fenster { animation: none; }
}

/* --- Unter 767 px: Bild quadratisch, damit man mehr vom Stein sieht (Wunsch Raphael 15.10.2026) --- */
@media (max-width: 767px) {
	.mrk-lb .mrk-lb__bild img {
		aspect-ratio: 1 / 1;
		height: auto;
		max-height: none;
		object-fit: cover;
	}
}
