/* bc-image-hotspot – Stage, Marker, Pulse, Tooltip */

.seico-image-hotspot {
	position: relative;
	width: 100%;
	isolation: isolate;
	--hotspot-tooltip-gap: 12px;
	--hotspot-tooltip-shift-x: 0px;
	--hotspot-tooltip-shift-y: 0px;
}

.seico-image-hotspot__stage {
	position: relative;
	width: 100%;
	line-height: 0;
	overflow: visible;
	border-radius: var(--hotspot-image-radius, 0);
}

.seico-image-hotspot__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--hotspot-image-radius, 0);
}

/* Hotspot-Banner: Layer-Split – Bild clippt, Marker/Tooltip frei */
.seico-hotspot-banner__hotspot .seico-image-hotspot {
	isolation: auto;
	position: relative;
	z-index: 2;
	overflow: visible;
}

.seico-hotspot-banner__hotspot .seico-image-hotspot__stage--layered {
	position: relative;
	overflow: visible;
	line-height: normal;
	min-height: 280px;
}

.seico-hotspot-banner__hotspot .seico-image-hotspot__image-layer {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	border-radius: 0 var(--hotspot-banner-radius, 20px) var(--hotspot-banner-radius, 20px) 0;
}

.seico-hotspot-banner__hotspot .seico-hotspot-banner__fade {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: var(--hotspot-banner-fade);
}

.seico-hotspot-banner__hotspot .seico-image-hotspot__overlay-layer {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	pointer-events: none;
	border-radius: 0 var(--hotspot-banner-radius, 20px) var(--hotspot-banner-radius, 20px) 0;
}

/*
 * Overlay: object-fit contain + Box-Größe per Scale (nicht transform auf cover).
 * Sonst wäre das Bild schon zugeschnitten und Scale würde nur den Crop verkleinern.
 */
.seico-hotspot-banner__hotspot .seico-image-hotspot__image--overlay {
	transform: none;
	flex: 0 0 auto;
}

.seico-hotspot-banner__hotspot .seico-image-hotspot__markers {
	position: absolute;
	inset: 0;
	z-index: 3;
	overflow: visible;
	pointer-events: none;
}

/* Plane = sichtbarer object-fit:cover-Ausschnitt des Basisbilds */
.seico-image-hotspot__image-plane {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.seico-image-hotspot__image-plane .seico-image-hotspot__marker-wrap {
	pointer-events: auto;
}

.seico-hotspot-banner__hotspot .seico-image-hotspot__marker-wrap {
	z-index: 3;
	pointer-events: auto;
}

.seico-hotspot-banner__hotspot .seico-image-hotspot__marker-wrap.is-open {
	z-index: 30;
}

.seico-hotspot-banner__hotspot .seico-image-hotspot__tooltip {
	z-index: 40;
}

@media (max-width: 991px) {
	.seico-hotspot-banner__hotspot .seico-image-hotspot__image-layer,
	.seico-hotspot-banner__hotspot .seico-image-hotspot__overlay-layer {
		border-radius: 0 0 var(--hotspot-banner-radius, 20px) var(--hotspot-banner-radius, 20px);
	}
}

/* Hotspot-Banner: Bild füllt Media-Spalte (object-fit cover) */
.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot,
.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot {
	height: 100%;
	min-height: 0;
}

.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__stage--layered {
	height: 100%;
	min-height: 280px;
}

.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__image-layer,
.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__overlay-layer,
.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-hotspot-banner__fade,
.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__markers {
	height: 100%;
	min-height: 280px;
}

.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__image {
	width: 100%;
	height: 100%;
	min-height: 280px;
	object-fit: cover;
	object-position: center;
	border-radius: 0;
}

/* Overlay bewusst contain + zentrierte Scale-Box (ganzes Motiv sichtbar) */
.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__image--overlay {
	width: calc(100% * var(--hotspot-overlay-scale, 1));
	height: calc(100% * var(--hotspot-overlay-scale, 1));
	min-width: 0;
	min-height: 0;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
	border-radius: 0;
}

@media (max-width: 991px) {
	.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__stage--layered,
	.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__image-layer,
	.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__overlay-layer,
	.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-hotspot-banner__fade,
	.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__markers,
	.seico-hotspot-banner.is-cover-image .seico-hotspot-banner__hotspot .seico-image-hotspot__image {
		min-height: 0;
		height: 100%;
	}
}

.seico-image-hotspot__marker-wrap {
	position: absolute;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	top: var(--hotspot-pos-top, auto);
	left: var(--hotspot-pos-left, auto);
	bottom: var(--hotspot-pos-bottom, auto);
	right: var(--hotspot-pos-right, auto);
}

/* Breakpoint-Overrides (Fallback, falls Desktop-Position nicht passt) */
@media (max-width: 991px) {
	.seico-image-hotspot__marker-wrap {
		top: var(--hotspot-pos-top-tablet, var(--hotspot-pos-top, auto));
		left: var(--hotspot-pos-left-tablet, var(--hotspot-pos-left, auto));
		bottom: var(--hotspot-pos-bottom-tablet, var(--hotspot-pos-bottom, auto));
		right: var(--hotspot-pos-right-tablet, var(--hotspot-pos-right, auto));
	}
}

@media (max-width: 767px) {
	.seico-image-hotspot__marker-wrap {
		top: var(--hotspot-pos-top-mobile, var(--hotspot-pos-top-tablet, var(--hotspot-pos-top, auto)));
		left: var(--hotspot-pos-left-mobile, var(--hotspot-pos-left-tablet, var(--hotspot-pos-left, auto)));
		bottom: var(--hotspot-pos-bottom-mobile, var(--hotspot-pos-bottom-tablet, var(--hotspot-pos-bottom, auto)));
		right: var(--hotspot-pos-right-mobile, var(--hotspot-pos-right-tablet, var(--hotspot-pos-right, auto)));
	}
}

.seico-image-hotspot__marker-wrap.is-open {
	z-index: 10;
}

.seico-image-hotspot__marker {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--hotspot-marker-size, 42px);
	height: var(--hotspot-marker-size, 42px);
	padding: 0;
	border: var(--hotspot-marker-border-width, 1px) solid var(--hotspot-marker-border-color, #0093fa);
	border-radius: var(--hotspot-marker-radius, 12px);
	background: var(--hotspot-marker-bg, var(--color-primary, #062b45));
	color: var(--hotspot-marker-icon, #ffffff);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.seico-image-hotspot__marker:hover,
.seico-image-hotspot__marker:focus-visible {
	background: var(--hotspot-marker-bg-hover, #0080D4);
	color: var(--hotspot-marker-icon-hover, #ffffff);
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 98, 167, 0.25);
}

.seico-image-hotspot__marker:active,
.seico-image-hotspot__marker-wrap.is-open .seico-image-hotspot__marker,
.seico-image-hotspot__marker[aria-expanded="true"] {
	background: var(--hotspot-marker-bg-active, #004A87);
	color: var(--hotspot-marker-icon-active, #ffffff);
}

.seico-image-hotspot__marker-wrap.is-open .seico-image-hotspot__marker:hover,
.seico-image-hotspot__marker[aria-expanded="true"]:hover {
	background: var(--hotspot-marker-bg-active, #004A87);
	color: var(--hotspot-marker-icon-active, #ffffff);
}

.seico-image-hotspot__marker-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--hotspot-icon-size, 20px);
	height: var(--hotspot-icon-size, 20px);
	pointer-events: none;
}

.seico-image-hotspot__marker-icon svg {
	fill: none;
}

.seico-image-hotspot__marker-icon svg path {
	stroke: currentColor;
}

.seico-image-hotspot__marker-icon-svg {
	display: block;
	width: var(--hotspot-icon-size, 24px);
	height: var(--hotspot-icon-size, 24px);
}

.seico-image-hotspot__marker-icon-img {
	display: block;
	width: var(--hotspot-icon-size, 20px);
	height: var(--hotspot-icon-size, 20px);
	object-fit: contain;
}

.seico-image-hotspot__marker-pulse {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: 2px solid var(--hotspot-marker-bg, #0062A7);
	opacity: 0.45;
	animation: seico-hotspot-pulse var(--hotspot-pulse-speed, 4s) ease-out infinite;
	pointer-events: none;
}

.seico-image-hotspot__marker-wrap.is-open .seico-image-hotspot__marker-pulse,
.seico-image-hotspot__marker[aria-expanded="true"] .seico-image-hotspot__marker-pulse {
	border-color: var(--hotspot-marker-bg-active, #004A87);
}

@keyframes seico-hotspot-pulse {
	0% {
		transform: scale(1);
		opacity: 0.45;
	}
	70% {
		transform: scale(1.8);
		opacity: 0;
	}
	100% {
		transform: scale(1.8);
		opacity: 0;
	}
}

.seico-image-hotspot__marker-label {
	position: relative;
	z-index: 1;
	max-width: 12rem;
	padding: 4px 8px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.95);
	color: var(--color-primary);
	font-size: 0.8125rem;
	line-height: 1.3;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	pointer-events: none;
}

.seico-image-hotspot__tooltip {
	position: absolute;
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	width: var(--hotspot-content-width, 20em);
	max-width: var(--hotspot-content-max-width, 50vw);
	padding: var(--hotspot-content-padding, 16px);
	border: var(--hotspot-content-border-width, 0) solid var(--hotspot-content-border-color, transparent);
	border-radius: var(--hotspot-content-radius, 8px);
	background: var(--hotspot-content-bg, #ffffff);
	color: var(--color-primary);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	text-align: left;
	line-height: 1.5;
}

.seico-image-hotspot__tooltip.is-placement-bottom {
	top: calc(100% + var(--hotspot-tooltip-gap, 12px));
	left: 50%;
	transform: translate(calc(-50% + var(--hotspot-tooltip-shift-x, 0px)), var(--hotspot-tooltip-shift-y, 0px));
}

.seico-image-hotspot__tooltip.is-placement-top {
	bottom: calc(100% + var(--hotspot-tooltip-gap, 12px));
	left: 50%;
	transform: translate(calc(-50% + var(--hotspot-tooltip-shift-x, 0px)), var(--hotspot-tooltip-shift-y, 0px));
}

.seico-image-hotspot__tooltip.is-placement-left {
	right: calc(100% + var(--hotspot-tooltip-gap, 12px));
	top: 50%;
	transform: translate(var(--hotspot-tooltip-shift-x, 0px), calc(-50% + var(--hotspot-tooltip-shift-y, 0px)));
}

.seico-image-hotspot__tooltip.is-placement-right {
	left: calc(100% + var(--hotspot-tooltip-gap, 12px));
	top: 50%;
	transform: translate(var(--hotspot-tooltip-shift-x, 0px), calc(-50% + var(--hotspot-tooltip-shift-y, 0px)));
}

.seico-image-hotspot__tooltip[hidden] {
	display: none !important;
}

.seico-image-hotspot__tooltip--portaled {
	position: fixed;
	z-index: 9999;
	margin: 0;
}

.seico-image-hotspot__tooltip--portaled.is-placement-bottom,
.seico-image-hotspot__tooltip--portaled.is-placement-top,
.seico-image-hotspot__tooltip--portaled.is-placement-left,
.seico-image-hotspot__tooltip--portaled.is-placement-right {
	top: auto;
	right: auto;
	bottom: auto;
	left: auto;
	transform: none;
}

.seico-image-hotspot__tooltip-title {
	margin: 0 0 8px;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.3;
}

.seico-image-hotspot__tooltip-desc {
	font-size: 0.9375rem;
}

.seico-image-hotspot__tooltip-desc > :first-child {
	margin-top: 0;
}

.seico-image-hotspot__tooltip-desc > :last-child {
	margin-bottom: 0;
}

.seico-image-hotspot__tooltip-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 12px;
}

.seico-image-hotspot__tooltip-actions .button {
	width: 100%;
	height: auto;
	min-height: 44px;
	white-space: normal;
}

.seico-image-hotspot__tooltip-actions .button-text {
	min-width: 0;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

/* Kompakter Linkabschluss: Trennlinie bis an beide Tooltip-Ränder. */
.seico-image-hotspot__tooltip-actions--links {
	gap: 0;
	margin: 12px calc(-1 * var(--hotspot-content-padding, 16px)) calc(-1 * var(--hotspot-content-padding, 16px));
	border-top: 1px solid var(--color-border-detail, #d1d5db);
}

.seico-image-hotspot__tooltip-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 44px;
	padding: 12px var(--hotspot-content-padding, 16px);
	color: var(--color-primary, #062b45);
	background: transparent;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.45;
	text-decoration: none;
}

.seico-image-hotspot__tooltip-link + .seico-image-hotspot__tooltip-link {
	border-top: 1px solid var(--color-border-detail, #d1d5db);
}

.seico-image-hotspot__tooltip-link:last-child {
	border-radius: 0 0 var(--hotspot-content-radius, 8px) var(--hotspot-content-radius, 8px);
}

.seico-image-hotspot__tooltip-link span {
	min-width: 0;
	overflow-wrap: anywhere;
}

.seico-image-hotspot__tooltip-link svg {
	flex: 0 0 16px;
}

.seico-image-hotspot__tooltip-link:hover {
	background: #f5f6f7;
}

.seico-image-hotspot__tooltip-link:hover span,
.seico-image-hotspot__tooltip-link:focus-visible span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.seico-image-hotspot__tooltip-link:focus-visible {
	outline: 2px solid var(--color-primary, #062b45);
	outline-offset: -3px;
}

/* Builder: Tooltips wie Frontend – nur bei Klick/Open sichtbar */
.seico-image-hotspot.is-builder .seico-image-hotspot__tooltip[hidden] {
	display: none !important;
}

/* Hover-Modus: offener Wrap */
.seico-image-hotspot[data-reveal="hover"] .seico-image-hotspot__marker-wrap.is-open .seico-image-hotspot__tooltip {
	display: block !important;
}

.seico-image-hotspot[data-reveal="hover"] .seico-image-hotspot__marker-wrap.is-open .seico-image-hotspot__tooltip[hidden] {
	display: block !important;
}

@media (max-width: 767px) {
	.seico-image-hotspot__tooltip {
		max-width: min(var(--hotspot-content-max-width, 50vw), calc(100vw - 48px));
	}
}

@media (max-width: 520px) {
	.seico-image-hotspot__marker-label {
		max-width: 9rem;
		font-size: 0.75rem;
	}

	.seico-image-hotspot__tooltip {
		width: min(var(--hotspot-content-width, 20em), calc(100vw - 32px));
		max-width: calc(100vw - 32px);
	}
}

.bc-image-hotspot-empty {
	margin: 0;
	padding: 16px;
	border: 1px dashed #ccc;
	color: #666;
	text-align: center;
}
