.kontakt-popup {
	--kp-bg: var(--theme-palette-color-6, #ffffff);
	--kp-color: var(--theme-selection-text-color, #1f1f1f);
	--kp-radius: 8px;
	width: min(var(--kp-width, 560px), 100% - 2rem);
	max-width: none;
	max-height: calc(100dvh - 2rem);
	padding: 0;
	border: 0;
	border-radius: var(--kp-radius);
	background: var(--kp-bg);
	color: var(--kp-color);
	box-shadow: 0 20px 60px rgb(0 0 0 / 0.35);
	overflow: hidden;
}

.kontakt-popup[open] {
	display: flex;
	flex-direction: column;
}

.kontakt-popup::backdrop {
	background: rgb(0 0 0 / 0.6);
}

.kontakt-popup__inner {
	padding: 0.25rem 1.5rem 1.5rem;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.kontakt-popup__inner > :first-child {
	margin-top: 0;
}

.kontakt-popup__inner > :last-child {
	margin-bottom: 0;
}

.kontakt-popup__inner :is(h1, h2, h3, h4, h5, h6) {
	color: inherit;
}

.kontakt-popup__inner :is(img, video, iframe) {
	max-width: 100%;
}

.kontakt-popup__close {
	flex: none;
	align-self: flex-end;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	margin: 0.75rem 0.75rem 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgb(127 127 127 / 0.15);
	box-shadow: none;
	color: inherit;
	cursor: pointer;
	transition: background-color 0.15s;
}

.kontakt-popup__close:hover {
	background: rgb(127 127 127 / 0.3);
}

.kontakt-popup__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.kontakt-popup__close svg {
	width: 20px;
	height: 20px;
}

.kontakt-popup :is(input:not([type="checkbox"], [type="radio"], [type="submit"]), textarea, select) {
	width: 100%;
	max-width: 100%;
	font-size: 16px;
}

.kontakt-popup textarea {
	height: 8rem;
	resize: vertical;
}

html:has(.kontakt-popup[open]) {
	overflow: hidden;
}

@media (max-width: 600px) {
	.kontakt-popup {
		width: 100%;
		height: 100dvh;
		max-height: 100dvh;
		margin: 0;
		border-radius: 0;
	}

	.kontakt-popup__inner {
		flex: 1;
		padding: 0.25rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom));
	}

	.kontakt-popup .wpcf7-submit {
		width: 100%;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.kontakt-popup[open] {
		animation: kontakt-popup-in 0.2s ease-out;
	}
}

@keyframes kontakt-popup-in {
	from {
		opacity: 0;
		translate: 0 1rem;
	}
}
