/* BHB Kontakt-Widget – Frontend */

.bhb-kw {
	position: fixed;
	z-index: var(--bhb-kw-z, 9999);
	box-sizing: border-box;
	font-family: inherit;
	line-height: 1;
	-webkit-tap-highlight-color: transparent;
	animation: bhb-kw-in .5s ease both;
}

.bhb-kw *,
.bhb-kw *::before,
.bhb-kw *::after {
	box-sizing: border-box;
}

.bhb-kw ul,
.bhb-kw li {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bhb-kw li[hidden] {
	display: none !important;
}

.bhb-kw button {
	font: inherit;
}

@keyframes bhb-kw-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

/* ---------- Gemeinsame Item-Styles ---------- */

.bhb-kw__item {
	position: relative;
	display: flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
	outline: none;
	cursor: pointer;
}

.bhb-kw__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--bhb-kw-btn, 44px);
	height: var(--bhb-kw-btn, 44px);
	border-radius: var(--bhb-kw-btn-radius, 32%);
	background: var(--t, #eee);
	color: var(--c, #333);
	transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.bhb-kw__svg {
	display: block;
	width: var(--bhb-kw-icon, 24px);
	height: var(--bhb-kw-icon, 24px);
}

.bhb-kw__item.is-solid .bhb-kw__icon {
	background: var(--c);
	color: #fff;
	box-shadow: 0 6px 14px -6px var(--c);
}

.bhb-kw--ic-mono .bhb-kw__icon {
	background: transparent;
	color: var(--bhb-kw-icon-color, #1b2438);
	box-shadow: none;
}

.bhb-kw--ic-mono .bhb-kw__item:hover .bhb-kw__icon,
.bhb-kw--ic-mono .bhb-kw__item:focus-visible .bhb-kw__icon {
	background: rgba(0, 0, 0, .07);
}

.bhb-kw__item:hover .bhb-kw__icon,
.bhb-kw__item:focus-visible .bhb-kw__icon {
	transform: translateY(-2px) scale(1.06);
}

.bhb-kw__item:focus-visible .bhb-kw__icon {
	outline: 2px solid var(--c, #333);
	outline-offset: 2px;
}

.bhb-kw__label {
	white-space: nowrap;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	padding: 9px 14px;
	border-radius: 999px;
	background: #1b2438;
	color: #fff;
	box-shadow: 0 8px 20px rgba(20, 30, 60, .25);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}

/* ---------- Variante A: Seitenleiste ---------- */

.bhb-kw--bar {
	top: var(--bhb-kw-top, 50%);
	transform: translateY(-50%);
}

.bhb-kw--bar.bhb-kw--right { right: 0; }
.bhb-kw--bar.bhb-kw--left { left: 0; }

.bhb-kw__bar {
	position: relative;
	padding: max(12px, calc(var(--bhb-kw-radius, 20px) * .6)) 8px;
	background: var(--bhb-kw-bg, rgba(255, 255, 255, .8));
	border: 1px solid rgba(255, 255, 255, .7);
	transition: transform .5s cubic-bezier(.22, .9, .28, 1);
}

.bhb-kw--right .bhb-kw__bar {
	border-right: 0;
	border-radius: var(--bhb-kw-radius, 20px) 0 0 var(--bhb-kw-radius, 20px);
}

.bhb-kw--left .bhb-kw__bar {
	border-left: 0;
	border-radius: 0 var(--bhb-kw-radius, 20px) var(--bhb-kw-radius, 20px) 0;
}

.bhb-kw--bar.has-blur .bhb-kw__bar {
	-webkit-backdrop-filter: blur(14px) saturate(1.4);
	backdrop-filter: blur(14px) saturate(1.4);
}

.bhb-kw--bar.has-shadow .bhb-kw__bar {
	box-shadow: 0 12px 34px rgba(20, 30, 60, .2);
}

.bhb-kw--bar .bhb-kw__list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bhb-kw--bar .bhb-kw__label {
	position: absolute;
	top: 50%;
}

.bhb-kw--bar.bhb-kw--right .bhb-kw__label {
	right: calc(100% + 14px);
	transform: translate(6px, -50%);
}

.bhb-kw--bar.bhb-kw--left .bhb-kw__label {
	left: calc(100% + 14px);
	transform: translate(-6px, -50%);
}

.bhb-kw--bar .bhb-kw__item:hover .bhb-kw__label,
.bhb-kw--bar .bhb-kw__item:focus-visible .bhb-kw__label {
	opacity: 1;
	transform: translate(0, -50%);
}

.bhb-kw--bar:not(.has-tooltips) .bhb-kw__label {
	display: none;
}

@media (hover: none) {
	.bhb-kw--bar .bhb-kw__label {
		display: none;
	}
}

/* Einfahren */

.bhb-kw__handle {
	display: none;
	position: absolute;
	top: 50%;
	width: 22px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 0;
	align-items: center;
	justify-content: center;
	background: var(--bhb-kw-bg, rgba(255, 255, 255, .8));
	color: var(--bhb-kw-peek-color, #5b6cf6);
	cursor: pointer;
	transform: translateY(-50%);
	transition: opacity .25s ease;
}

.bhb-kw--bar.has-blur .bhb-kw__handle {
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

.bhb-kw--bar.has-shadow .bhb-kw__handle {
	box-shadow: 0 8px 22px rgba(20, 30, 60, .18);
}

.bhb-kw--right .bhb-kw__handle {
	right: 100%;
	border-radius: 12px 0 0 12px;
}

.bhb-kw--left .bhb-kw__handle {
	left: 100%;
	border-radius: 0 12px 12px 0;
}

.bhb-kw--left .bhb-kw__handle .bhb-kw__svg {
	transform: scaleX(-1);
}

.bhb-kw__handle .bhb-kw__svg {
	width: 16px;
	height: 16px;
	stroke-width: 2.4;
}

.bhb-kw.is-retract-on .bhb-kw__handle {
	display: flex;
}

.bhb-kw__bar::after {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	background: var(--bhb-kw-peek-color, #5b6cf6);
	opacity: 0;
	pointer-events: none;
	transition: opacity .3s ease;
}

.bhb-kw--bar.is-retracted.bhb-kw--right .bhb-kw__bar {
	transform: translateX(calc(100% - var(--bhb-kw-peek, 8px)));
}

.bhb-kw--bar.is-retracted.bhb-kw--left .bhb-kw__bar {
	transform: translateX(calc(-100% + var(--bhb-kw-peek, 8px)));
}

.bhb-kw--bar.is-retracted .bhb-kw__bar {
	cursor: pointer;
	box-shadow: 0 0 14px -2px var(--bhb-kw-peek-color, #5b6cf6);
}

.bhb-kw--bar.is-retracted .bhb-kw__bar::after {
	opacity: 1;
}

/* Größere Tipp-Fläche für den eingefahrenen Streifen */
.bhb-kw--bar.is-retracted .bhb-kw__bar::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	width: 28px;
}

.bhb-kw--bar.is-retracted.bhb-kw--right .bhb-kw__bar::before { right: 100%; }
.bhb-kw--bar.is-retracted.bhb-kw--left .bhb-kw__bar::before { left: 100%; }

.bhb-kw--bar.is-retracted .bhb-kw__list {
	pointer-events: none;
}

.bhb-kw--bar.is-retracted .bhb-kw__handle {
	opacity: 0;
	pointer-events: none;
}

/* ---------- Variante B: Kreis-Button ---------- */

.bhb-kw--circle {
	bottom: calc(var(--bhb-kw-bottom, 28px) + env(safe-area-inset-bottom, 0px));
}

.bhb-kw--circle.bhb-kw--right { right: calc(var(--bhb-kw-side, 28px) + env(safe-area-inset-right, 0px)); }
.bhb-kw--circle.bhb-kw--left { left: calc(var(--bhb-kw-side, 28px) + env(safe-area-inset-left, 0px)); }

.bhb-kw__fab {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.bhb-kw--right .bhb-kw__fab { align-items: flex-end; }
.bhb-kw--left .bhb-kw__fab { align-items: flex-start; }

.bhb-kw--circle .bhb-kw__list {
	display: flex;
	flex-direction: column;
	gap: 12px;
	visibility: hidden;
	transition: visibility 0s linear .35s;
}

.bhb-kw--circle.bhb-kw--right .bhb-kw__list { align-items: flex-end; }
.bhb-kw--circle.bhb-kw--left .bhb-kw__list { align-items: flex-start; }

.bhb-kw--circle.is-open .bhb-kw__list {
	visibility: visible;
	transition-delay: 0s;
}

.bhb-kw--circle .bhb-kw__list li {
	opacity: 0;
	transform: translateY(14px) scale(.9);
	transition: opacity .25s ease, transform .3s cubic-bezier(.22, .9, .28, 1);
	transition-delay: calc(var(--i, 0) * 35ms);
}

.bhb-kw--circle.is-open .bhb-kw__list li {
	opacity: 1;
	transform: none;
}

.bhb-kw--circle .bhb-kw__item {
	gap: 12px;
}

.bhb-kw--circle.bhb-kw--left .bhb-kw__item {
	flex-direction: row-reverse;
}

.bhb-kw--circle .bhb-kw__icon {
	width: calc(var(--bhb-kw-fab, 60px) * .85);
	height: calc(var(--bhb-kw-fab, 60px) * .85);
	border-radius: 50%;
	box-shadow: 0 8px 20px rgba(20, 30, 60, .2);
}

.bhb-kw--circle.bhb-kw--ic-mono .bhb-kw__icon {
	background: #fff;
}

.bhb-kw--circle .bhb-kw__label {
	opacity: 1;
	background: rgba(255, 255, 255, .92);
	color: #1b2438;
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	box-shadow: 0 6px 18px rgba(20, 30, 60, .14);
}

.bhb-kw--circle:not(.has-tooltips) .bhb-kw__label {
	display: none;
}

.bhb-kw__toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--bhb-kw-fab, 60px);
	height: var(--bhb-kw-fab, 60px);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: var(--bhb-kw-fab-ic, #fff);
	background: linear-gradient(135deg, var(--bhb-kw-fab-c1, #6d5efc), var(--bhb-kw-fab-c2, #3b82f6));
	box-shadow: 0 14px 30px -8px var(--bhb-kw-fab-c1, #6d5efc);
	opacity: var(--bhb-kw-fab-op, 1);
	transition: transform .25s ease, opacity .25s ease;
}

.bhb-kw__toggle:hover,
.bhb-kw__toggle:focus-visible {
	opacity: 1;
	transform: scale(1.05);
}

.bhb-kw__toggle:focus-visible {
	outline: 2px solid var(--bhb-kw-fab-c1, #6d5efc);
	outline-offset: 3px;
}

.bhb-kw__toggle .bhb-kw__svg {
	position: absolute;
	width: calc(var(--bhb-kw-fab, 60px) * .42);
	height: calc(var(--bhb-kw-fab, 60px) * .42);
	stroke-width: 2;
	transition: transform .35s cubic-bezier(.22, .9, .28, 1), opacity .2s ease;
}

.bhb-kw__toggle .is-close {
	opacity: 0;
	transform: rotate(-90deg) scale(.6);
}

.bhb-kw--circle.is-open .bhb-kw__toggle .is-close {
	opacity: 1;
	transform: none;
}

.bhb-kw--circle.is-open .bhb-kw__toggle .is-chat {
	opacity: 0;
	transform: rotate(90deg) scale(.6);
}

.bhb-kw--circle.has-pulse:not(.is-open) .bhb-kw__toggle::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 50%;
	border: 2px solid var(--bhb-kw-fab-c1, #6d5efc);
	opacity: 0;
	pointer-events: none;
	animation: bhb-kw-pulse 2.4s ease-out infinite;
}

@keyframes bhb-kw-pulse {
	0% { transform: scale(1); opacity: .55; }
	100% { transform: scale(1.55); opacity: 0; }
}

/* ---------- Sichtbarkeit je Gerät ---------- */

@media (min-width: 1025px) {
	.bhb-kw--hide-desktop { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1024px) {
	.bhb-kw--hide-tablet { display: none !important; }
}

@media (max-width: 767px) {
	.bhb-kw--hide-mobile { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
	.bhb-kw,
	.bhb-kw *,
	.bhb-kw *::after {
		transition-duration: .01ms !important;
		animation: none !important;
	}
}

@media print {
	.bhb-kw { display: none !important; }
}

/* ---------- Popup-Fenster für Shortcodes ---------- */

button.bhb-kw__item {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	text-align: inherit;
}

.bhb-kw-modal[hidden] {
	display: none;
}

.bhb-kw-modal {
	position: fixed;
	inset: 0;
	z-index: calc(var(--bhb-kw-z, 9999) + 5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	animation: bhb-kw-in .25s ease both;
}

.bhb-kw-modal *,
.bhb-kw-modal *::before,
.bhb-kw-modal *::after {
	box-sizing: border-box;
}

.bhb-kw-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 14, 28, .55);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.bhb-kw-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 560px;
	max-height: calc(100vh - 48px);
	overflow: auto;
	border-radius: 20px;
	background: #fff;
	color: #1b2438;
	box-shadow: 0 30px 80px rgba(10, 14, 28, .4);
	outline: 0;
}

.bhb-kw-modal__content {
	padding: 28px;
}

/* Bringt das Formular bereits ein eigenes Karten-Design mit, wird das Fenster dahinter transparent. */
.bhb-kw-modal__dialog:has(.bhbnl-form-wrap) {
	background: transparent;
	box-shadow: none;
	overflow: visible;
}

.bhb-kw-modal__content:has(.bhbnl-form-wrap) {
	padding: 0;
}

.bhb-kw-modal__content .bhbnl-form-wrap {
	max-width: none;
	margin: 0;
}

.bhb-kw-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #1b2438;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 8px 25px rgba(0, 0, 0, .18);
}

.bhb-kw-modal__close:focus-visible {
	outline: 2px solid #5b6cf6;
	outline-offset: 2px;
}

.bhb-kw-modal-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.bhb-kw-modal {
		padding: 12px;
		align-items: flex-end;
	}
	.bhb-kw-modal__dialog {
		max-height: calc(100vh - 24px);
	}
}

/* ---------- Vorschau im Backend ---------- */

.bhb-kw--preview {
	position: absolute;
	animation: none;
}
