/**
 * Intelliguard Elements — Interactive Floor Plan widget styles.
 *
 * Faithful port of HospitalFloorPlan.tsx. Selectors are scoped under the
 * `ig-fp-` prefix / `.ig-fp` wrapper to avoid theme collisions. Brand tokens
 * are exposed as CSS custom properties on the widget wrapper so the widget is
 * self-contained. Percentage-positioned hotspots scale with the image; layout
 * collapses from side-by-side to stacked; animations honor reduced-motion.
 */

/* =========================================================================
   Wrapper + brand tokens
   ========================================================================= */
.ig-fp {
	--ig-navy: hsl(225 70% 17%);
	--ig-navy-light: hsl(225 50% 30%);
	--ig-gold: hsl(38 91% 55%);
	--ig-gold-light: hsl(38 91% 70%);
	--ig-teal: hsl(174 60% 42%);
	--ig-background: var(--ig-surface, hsl(0 0% 100%));
	--ig-foreground: var(--ig-ink, hsl(225 70% 17%));
	--ig-muted: hsl(220 14% 96%);
	--ig-muted-foreground: hsl(220 10% 46%);
	--ig-border: hsl(220 20% 90%);
	--ig-card: hsl(0 0% 100%);
	--ig-radius: 0.75rem;

	display: block;
	padding: 4rem 0;
	background: var(--ig-surface, var(--ig-muted));
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	box-sizing: border-box;
}

.ig-fp * {
	box-sizing: border-box;
}

.ig-fp__container {
	width: 100%;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 2rem;
}

/* =========================================================================
   Header
   ========================================================================= */
.ig-fp__head {
	text-align: center;
	margin-bottom: 3rem;
}

.ig-fp__eyebrow {
	display: inline-block;
	font-size: 0.875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--ig-gold);
}

.ig-fp__heading {
	font-size: clamp(1.875rem, 4vw, 2.25rem);
	font-weight: 700;
	color: var(--ig-navy);
	margin: 0.75rem 0 0.5rem;
}

.ig-fp__desc {
	color: var(--ig-muted-foreground);
	max-width: 36rem;
	margin: 0 auto;
	line-height: 1.6;
}

/* =========================================================================
   Layout — image + detail panel (side-by-side, collapses to stacked)
   ========================================================================= */
.ig-fp__layout {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	align-items: start;
}

@media (min-width: 1024px) {
	.ig-fp__layout {
		grid-template-columns: 1fr 380px;
	}
}

/* =========================================================================
   Stage (image + hotspots)
   ========================================================================= */
.ig-fp__stage {
	position: relative;
	background: transparent;
	line-height: 0;
}

.ig-fp__img {
	width: 100%;
	height: auto;
	display: block;
}

/* Percentage-positioned hotspot — scales with the image. */
.ig-fp__hotspot {
	position: absolute;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: all 0.3s ease;
}

.ig-fp__hotspot-box {
	position: absolute;
	inset: 0;
	border-radius: 0.5rem;
	border: 2px solid transparent;
	background: transparent;
	transition: all 0.3s ease;
}

.ig-fp__hotspot:hover .ig-fp__hotspot-box {
	background: hsl(225 70% 17% / 0.15);
	border-color: rgba(255, 255, 255, 0.4);
}

/* Island-shaped zones: the clipped box (and the label pill) are the only
   interactive surfaces, so hover/click follow the island outline instead of
   the bounding rectangle. Borders/shadows would be clipped mid-stroke, so
   the highlight relies on the background tint alone. */
.ig-fp__hotspot--poly {
	pointer-events: none;
}

.ig-fp__hotspot--poly .ig-fp__hotspot-box,
.ig-fp__hotspot--poly .ig-fp__hotspot-tag {
	pointer-events: auto;
}

.ig-fp__hotspot--poly .ig-fp__hotspot-box {
	border: 0;
	border-radius: 0;
}

.ig-fp__hotspot--poly:hover .ig-fp__hotspot-box,
.ig-fp__hotspot--poly.is-active .ig-fp__hotspot-box {
	background: hsl(225 70% 17% / 0.22);
	box-shadow: none;
}

.ig-fp__hotspot.is-active .ig-fp__hotspot-box {
	background: hsl(225 70% 17% / 0.25);
	border-color: var(--ig-gold);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.ig-fp__hotspot-tag {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1;
	padding: 0.375rem 0.75rem;
	border-radius: 9999px;
	white-space: nowrap;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
	background: hsl(225 70% 17% / 0.8);
	color: #fff;
	transition: all 0.3s ease;
}

.ig-fp__hotspot:hover .ig-fp__hotspot-tag {
	background: var(--ig-gold);
	color: var(--ig-navy);
}

.ig-fp__hotspot.is-active .ig-fp__hotspot-tag {
	background: var(--ig-gold);
	color: var(--ig-navy);
	transform: scale(1.1);
}

.ig-fp__hotspot-tag svg,
.ig-fp__hotspot-tag i {
	width: 0.875rem;
	height: 0.875rem;
	font-size: 0.875rem;
	flex-shrink: 0;
}

/* =========================================================================
   Aside (detail + empty panels)
   ========================================================================= */
@media (min-width: 1024px) {
	.ig-fp__aside {
		position: sticky;
		top: 6rem;
	}
}

.ig-fp__panel {
	background: var(--ig-card);
	border-radius: 1rem;
	padding: 2rem;
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
	border: 1px solid var(--ig-border);
}

/* Detail panel entrance animation (Framer Motion approximation). */
.ig-fp__detail[data-fp-panel]:not([hidden]) {
	animation: ig-fp-enter 0.3s ease-out both;
}

.ig-fp__detail-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.5rem;
}

.ig-fp__detail-id {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.ig-fp__detail-icon {
	width: 3rem;
	height: 3rem;
	border-radius: 0.75rem;
	background: hsl(38 91% 55% / 0.15);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.ig-fp__detail-icon svg,
.ig-fp__detail-icon i {
	width: 1.5rem;
	height: 1.5rem;
	font-size: 1.5rem;
	color: var(--ig-gold);
}

.ig-fp__detail-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ig-muted-foreground);
	margin: 0;
}

.ig-fp__detail-product {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--ig-navy);
	margin: 0;
}

.ig-fp__detail-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.375rem;
	border: 0;
	background: transparent;
	border-radius: 9999px;
	cursor: pointer;
	color: var(--ig-muted-foreground);
	transition: background-color 0.2s ease;
	flex-shrink: 0;
}

.ig-fp__detail-close:hover {
	background: var(--ig-muted);
}

.ig-fp__detail-close svg {
	width: 1rem;
	height: 1rem;
}

.ig-fp__detail-desc {
	color: var(--ig-muted-foreground);
	font-size: 0.875rem;
	line-height: 1.7;
	margin: 0 0 1.5rem;
}

.ig-fp__detail-list {
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.ig-fp__detail-item {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	font-size: 0.875rem;
	line-height: 1.5;
}

.ig-fp__detail-item > span:last-child {
	color: var(--ig-foreground);
}

.ig-fp__detail-chevron {
	display: inline-flex;
	color: var(--ig-gold);
	margin-top: 0.125rem;
	flex-shrink: 0;
}

.ig-fp__detail-chevron svg {
	width: 1rem;
	height: 1rem;
}

.ig-fp__detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.ig-fp__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	border-radius: 9999px;
	padding: 0.625rem 1.5rem;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.ig-fp__btn--gold {
	background: var(--ig-gold);
	color: var(--ig-navy);
}

.ig-fp__btn--gold:hover {
	background: var(--ig-gold-light);
	color: var(--ig-navy);
}

.ig-fp__btn--gold svg {
	width: 1rem;
	height: 1rem;
}

.ig-fp__btn--outline {
	background: transparent;
	color: var(--ig-navy);
	border: 1px solid var(--ig-navy);
}

.ig-fp__btn--outline:hover {
	background: var(--ig-navy);
	color: #fff;
}

/* =========================================================================
   Empty state
   ========================================================================= */
.ig-fp__panel--empty {
	text-align: center;
}

.ig-fp__empty-icon {
	width: 4rem;
	height: 4rem;
	border-radius: 9999px;
	background: var(--ig-muted);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 1.25rem;
	color: var(--ig-muted-foreground);
}

.ig-fp__empty-icon svg {
	width: 1.75rem;
	height: 1.75rem;
}

.ig-fp__empty-title {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--ig-navy);
	margin: 0 0 0.5rem;
}

.ig-fp__empty-text {
	color: var(--ig-muted-foreground);
	font-size: 0.875rem;
	line-height: 1.7;
	margin: 0;
}

.ig-fp__chips {
	margin-top: 1.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.ig-fp__chip {
	font-size: 0.75rem;
	font-weight: 500;
	padding: 0.375rem 0.75rem;
	border-radius: 9999px;
	border: 1px solid var(--ig-border);
	background: transparent;
	color: var(--ig-foreground);
	cursor: pointer;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.ig-fp__chip:hover {
	border-color: var(--ig-gold);
	color: var(--ig-gold);
}

/* =========================================================================
   Keyframes
   ========================================================================= */
@keyframes ig-fp-enter {
	from { opacity: 0; transform: translateX(20px); }
	to   { opacity: 1; transform: translateX(0); }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.ig-fp__hotspot,
	.ig-fp__hotspot-box,
	.ig-fp__hotspot-tag,
	.ig-fp__btn,
	.ig-fp__chip,
	.ig-fp__detail-close {
		transition: none !important;
	}

	.ig-fp__detail[data-fp-panel]:not([hidden]) {
		animation: none !important;
	}
}

/* Editor-only affordance: zones are draggable in the Elementor preview. */
.elementor-editor-active .ig-fp__hotspot { cursor: move; }
.elementor-editor-active .ig-fp__hotspot.is-dragging { opacity: 0.85; }
