/* WABA Booth Map: enlarge-in-modal + floating "Booth Map" button */

/* Elementor defines its globals on <body> (the kit class), so read them there */
body {
	/* Pulled from the site's Elementor global colors/fonts, with fallbacks */
	--waba-map-blue: var(--e-global-color-primary, #044389);
	--waba-map-button-font: var(--e-global-typography-accent-font-family, "Montserrat"), sans-serif;
	--waba-map-button-weight: var(--e-global-typography-accent-font-weight, 700);
	--waba-map-heading-font: var(--e-global-typography-primary-font-family, "Montserrat"), sans-serif;
	--waba-map-heading-weight: var(--e-global-typography-primary-font-weight, 900);
	--waba-map-top: 0px; /* admin bar height when logged in (set below) */
}
body.admin-bar { --waba-map-top: 32px; }
@media screen and (max-width: 782px) {
	body.admin-bar { --waba-map-top: 46px; }
}
@media screen and (max-width: 600px) {
	/* On phones the admin bar scrolls with the page; hide it while the map is open */
	body.admin-bar { --waba-map-top: 0px; }
	html.waba-map-fs-open #wpadminbar { display: none !important; }
}

.elementor-widget-uael-hotspot .elementor-widget-container { position: relative; }

/* A Template widget holding the map needs an explicit full width; without it,
   Elementor sizes its height from the SVG's tiny built-in size (289x150) on
   narrower screens, and whatever follows (the form) slides up over the map. */
.elementor-widget-template:has(.elementor-widget-uael-hotspot) { width: 100%; }

/* ---------- Enlarge button on the map ---------- */
.waba-map-fs-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 20;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: var(--waba-map-blue);
	color: #fff;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
	opacity: .92;
}
.waba-map-fs-btn:hover { opacity: 1; }
@media (max-width: 600px) {
	.waba-map-fs-btn { top: 4px; right: 4px; width: 30px; height: 30px; }
}

/* Shared icon styling */
.waba-map-fs-btn svg,
.waba-map-close svg,
.waba-map-float svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex: none;
}
.waba-map-fs-btn:focus-visible,
.waba-map-close:focus-visible,
.waba-map-float:focus-visible { outline: 3px solid #f2b705; outline-offset: 2px; }

/* ---------- Floating "Booth Map" button ---------- */
.waba-map-float {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 24px;
	border: 0;
	border-radius: 3px;
	background: var(--waba-map-blue);
	color: #fff;
	font-family: var(--waba-map-button-font);
	font-size: 15px;
	font-weight: var(--waba-map-button-weight);
	line-height: 15px;
	letter-spacing: normal;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.waba-map-float.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .2s ease, transform .2s ease;
}
.waba-map-float:hover { filter: brightness(1.12); }
@media (max-width: 600px) {
	.waba-map-float { right: 14px; bottom: 14px; padding: 11px 18px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.waba-map-float, .waba-map-float.is-visible { transition: none; transform: none; }
}

/* ---------- Modal ---------- */
/* Header only exists inside the popup. Needs !important: the Hotspot widget's own
   Custom CSS sets display:block on every div inside it. */
html body .elementor-widget-uael-hotspot:not(.waba-map-fs) .waba-map-modal-head { display: none !important; }

html.waba-map-fs-open,
html.waba-map-fs-open body { overflow: hidden !important; }

/* The widget becomes the dimmed backdrop layer... */
html body .elementor .elementor-element.elementor-widget-uael-hotspot.waba-map-fs.waba-map-fs {
	position: fixed !important;
	top: var(--waba-map-top) !important;
	right: 0 !important;
	bottom: 0 !important;
	left: 0 !important;
	z-index: 99999 !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 24px !important;
	box-sizing: border-box !important;
	background: rgba(10, 20, 45, .72) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
}

/* ...and its content becomes the white panel, sized so the whole map fits */
html body .elementor .elementor-element.elementor-widget-uael-hotspot.waba-map-fs.waba-map-fs > .elementor-widget-container {
	position: relative !important;
	box-sizing: border-box !important;
	width: calc(min(100vw - 72px, (100vh - var(--waba-map-top) - 104px) * var(--waba-map-ratio)) + 24px) !important;
	width: calc(min(100vw - 72px, (100dvh - var(--waba-map-top) - 104px) * var(--waba-map-ratio)) + 24px) !important;
	max-width: none !important;
	height: auto !important; /* Elementor sets 100% on widget containers */
	max-height: 100% !important;
	margin: 0 !important;
	padding: 0 12px 12px !important;
	overflow: auto !important;
	background: #fff !important;
	border-radius: 8px !important;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .45) !important;
}

html body .elementor .elementor-element.elementor-widget-uael-hotspot.waba-map-fs.waba-map-fs .waba-map-modal-head {
	position: sticky;
	top: 0;
	left: 0;
	z-index: 30;
	display: flex !important;
	align-items: center;
	justify-content: space-between;
	height: 44px;
	width: auto !important;
	background: #fff;
}
.waba-map-modal-title {
	color: var(--waba-map-blue);
	font-family: var(--waba-map-heading-font);
	font-size: 20px;
	font-weight: var(--waba-map-heading-weight);
	line-height: 1;
	letter-spacing: normal;
	text-transform: uppercase;
}
.waba-map-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	margin-right: -4px;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: transparent;
	color: #333;
	cursor: pointer;
}
.waba-map-close:hover { background: #eef1f7; }
.waba-map-close svg { width: 22px; height: 22px; }

/* While open, hide the on-map enlarge button */
html body .elementor-widget-uael-hotspot.waba-map-fs .waba-map-fs-btn { display: none !important; }

/* Phones and small tablets: full-window panel, map shown larger than the
   screen so booths are readable; scroll (or pinch) to move around. */
@media (max-width: 767px) {
	html body .elementor .elementor-element.elementor-widget-uael-hotspot.waba-map-fs.waba-map-fs {
		padding: 0 !important;
		background: #fff !important;
	}
	html body .elementor .elementor-element.elementor-widget-uael-hotspot.waba-map-fs.waba-map-fs > .elementor-widget-container {
		width: 100% !important;
		height: 100% !important;
		border-radius: 0 !important;
		box-shadow: none !important;
		-webkit-overflow-scrolling: touch;
		/* center the map vertically in the screen */
		display: flex !important;
		flex-direction: column !important;
		align-items: flex-start !important;
	}
	html body .elementor .elementor-element.elementor-widget-uael-hotspot.waba-map-fs.waba-map-fs .elementor-widget-container > .uael-hotspot {
		margin: auto 0 !important;
		flex: none !important;
	}
	html body .elementor .elementor-element.elementor-widget-uael-hotspot.waba-map-fs.waba-map-fs .elementor-widget-container > .uael-hotspot {
		width: 1100px !important;
		max-width: none !important;
	}
	html body .elementor .elementor-element.elementor-widget-uael-hotspot.waba-map-fs.waba-map-fs .waba-map-modal-head {
		position: sticky;
		left: 0;
		width: calc(100vw - 24px) !important;
	}
}

/* UAE's tooltips (z-index 98) are attached to <body>; keep them above the modal */
html.waba-map-fs-open .tooltipster-base { z-index: 100000 !important; }

/* ---------- Booth tooltips (rendered inside the map, see map-tooltips.js) ---------- */
.waba-tip {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 50;
	box-sizing: border-box;
	width: max-content;
	max-width: 220px;
	padding: 12px;
	background: var(--waba-map-blue);
	color: #fff;
	font-family: var(--waba-map-button-font);
	font-size: 12.5px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	white-space: normal;
	pointer-events: none;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	animation: waba-tip-in .12s ease-out;
}
.waba-tip p { margin: 0; }
@keyframes waba-tip-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .waba-tip { animation: none; } }
/* Markers are now tap targets on touch screens */
.elementor-widget-uael-hotspot .uael-hotspot-content { cursor: pointer; -webkit-tap-highlight-color: transparent; }

/* Floating button collapses to just the icon near the form's Submit button */
.waba-map-float span {
	display: inline-block;
	max-width: 10em;
	overflow: hidden;
	white-space: nowrap;
	transition: max-width .2s ease, opacity .15s ease;
}
.waba-map-float.is-compact { gap: 0; padding-left: 12px; padding-right: 12px; }
.waba-map-float.is-compact span { max-width: 0; opacity: 0; }
@media (max-width: 600px) {
	.waba-map-float.is-compact { padding-left: 11px; padding-right: 11px; }
}
@media (prefers-reduced-motion: reduce) {
	.waba-map-float span { transition: none; }
}
