/* Gesetzliche Gewährleistung – EU-Hinweis Modal
   Prefix: gw-  |  keine Abhängigkeiten, Theme-neutral */

.gw-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

html.gw-modal-lock {
	overflow: hidden;
}

/* --- Dialog-Grundlage ------------------------------------------------- */

dialog.gw-modal {
	padding: 0;
	border: 0;
	background: #fff;
	color: #111;
	box-sizing: border-box;
	max-width: 100%;
	max-height: 100%;
	box-shadow: 0 0 40px rgba(0, 0, 0, .2);
}

dialog.gw-modal::backdrop {
	background: rgba(0, 0, 0, .45);
}

dialog.gw-modal *,
dialog.gw-modal *::before,
dialog.gw-modal *::after {
	box-sizing: border-box;
}

.gw-modal__inner {
	padding: 0 24px 48px;
	overflow-y: auto;
	max-height: 100%;
	-webkit-overflow-scrolling: touch;
}

.gw-modal__bar {
	display: flex;
	justify-content: flex-end;
	position: sticky;
	top: 0;
	background: #fff;
	padding: 12px 0;
	z-index: 2;
}

.gw-modal__close {
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: inherit;
	line-height: 0;
}

.gw-modal__close:hover,
.gw-modal__close:focus-visible {
	background: rgba(0, 0, 0, .06);
}

.gw-modal__label {
	margin: 0;
}

.gw-modal__label img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 640px;
	margin: 0 auto;
}

.gw-modal__text,
.gw-modal__extra {
	font-size: 16px;
	line-height: 1.55;
	max-width: 640px;
	margin: 0 auto;
}

.gw-modal__text p:first-child {
	margin-top: 0;
}

.gw-modal__extra {
	margin-top: 24px;
}

.gw-modal__more {
	max-width: 640px;
	margin: 32px auto 0;
}

.gw-modal__more a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --- Variante: Seitenpanel rechts (wie IKEA) -------------------------- */

dialog.gw-modal--right {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(100%, 560px);
	height: 100%;
	max-height: 100%;
	margin: 0;
	animation: gw-slide-in .28s ease-out;
}

@keyframes gw-slide-in {
	from { transform: translateX(100%); }
	to   { transform: translateX(0); }
}

/* --- Variante: zentriertes Modal -------------------------------------- */

dialog.gw-modal--center {
	width: min(100% - 32px, 680px);
	max-height: calc(100vh - 64px);
	margin: auto;
	border-radius: 8px;
	animation: gw-fade-in .2s ease-out;
}

@keyframes gw-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	dialog.gw-modal--right,
	dialog.gw-modal--center {
		animation: none;
	}
}

/* --- Fallback für Browser ohne <dialog> ------------------------------- */

dialog.gw-modal:not([open]) {
	display: none;
}

dialog.gw-modal--fallback {
	display: block;
	position: fixed;
	z-index: 100000;
}

dialog.gw-modal--fallback.gw-modal--center {
	top: 32px;
	left: 50%;
	transform: translateX(-50%);
}

/* --- Automatisch ausgegebener Link ------------------------------------ */

.gw-auto-link {
	padding: 16px 24px;
	text-align: center;
	font-size: 14px;
}
