/**
 * Virtual Market widget styles.
 * Colours and sizes here are defaults; the widget's Style tab overrides them.
 */

.vm-widget {
	--vm-focus-color: #ffbf47;
	--vm-pulse-color: #ffffff;
	position: relative;
}

/* ---------- Scene ---------- */

.vm-widget .vm-scene {
	position: relative;
	width: 100%;
	height: 600px; /* Overridden by the "Scene height" control. */
	overflow: hidden;
	background: #222;
}

.vm-widget .vm-pano {
	width: 100%;
	height: 100%;
}

/* ---------- Flat mode image fit ----------
   The stage is always exactly the size of the displayed image, so hotspot
   percentages line up in every mode. --vm-ratio is the image's width ÷ height.

   height  – fill the height, scroll sideways (default)
   cover   – fill the whole box, scroll whichever way overflows
   contain – show the whole image, no scrolling

   The "Image fit" control adds vm-fit-*, vm-fit-tablet-* and vm-fit-mobile-*
   classes; the media queries use Elementor's default breakpoints. */

.vm-widget {
	--vm-ratio: 4;
}

.vm-widget .vm-scene {
	box-sizing: border-box;
	width: 100%;
}

.vm-widget .vm-flat-viewport {
	position: relative;
	width: 100%;
	height: 100%;
	/* Sideways: don't trigger browser back/forward swipes. Up/down: let the
	   page keep scrolling when the scene reaches its end. */
	overscroll-behavior-x: contain;
	overscroll-behavior-y: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
	cursor: grab;
}

.vm-widget .vm-flat-viewport.is-dragging {
	cursor: grabbing;
	user-select: none;
}

.vm-widget .vm-flat-stage {
	position: relative;
}

.vm-widget .vm-flat-stage img.vm-flat-image {
	display: block;
	max-width: none; /* Beat theme/Elementor "img { max-width: 100% }". */
	user-select: none;
	-webkit-user-drag: none;
}

/* height (default) */
.vm-widget .vm-flat-viewport,
.vm-fit-height .vm-widget .vm-flat-viewport {
	display: block;
	overflow-x: auto;
	overflow-y: hidden;
	container-type: normal;
}
.vm-widget .vm-flat-stage,
.vm-fit-height .vm-widget .vm-flat-stage {
	width: max-content;
	height: 100%;
	aspect-ratio: auto;
	margin: 0 auto; /* Centres images narrower than the box. */
}
.vm-widget .vm-flat-stage img.vm-flat-image,
.vm-fit-height .vm-widget .vm-flat-stage img.vm-flat-image {
	width: auto;
	height: 100%;
}

/* cover */
.vm-fit-cover .vm-widget .vm-flat-viewport {
	display: flex;
	overflow: auto;
	container-type: size;
}
.vm-fit-cover .vm-widget .vm-flat-stage {
	flex: none;
	width: max(100cqw, 100cqh * var(--vm-ratio));
	height: auto;
	aspect-ratio: var(--vm-ratio);
	margin: auto; /* Centres, and falls back to 0 when it overflows. */
}
.vm-fit-cover .vm-widget .vm-flat-stage img.vm-flat-image {
	width: 100%;
	height: 100%;
}

/* contain */
.vm-fit-contain .vm-widget .vm-flat-viewport {
	display: flex;
	overflow: hidden;
	container-type: size;
	cursor: default;
}
.vm-fit-contain .vm-widget .vm-flat-stage {
	flex: none;
	width: min(100cqw, 100cqh * var(--vm-ratio));
	height: auto;
	aspect-ratio: var(--vm-ratio);
	margin: auto;
}
.vm-fit-contain .vm-widget .vm-flat-stage img.vm-flat-image {
	width: 100%;
	height: 100%;
}

/* Tablet (Elementor default: up to 1024px) */
@media (max-width: 1024px) {
	.vm-fit-tablet-height .vm-widget .vm-flat-viewport {
		display: block;
		overflow-x: auto;
		overflow-y: hidden;
		container-type: normal;
		cursor: grab;
	}
	.vm-fit-tablet-height .vm-widget .vm-flat-stage {
		flex: initial;
		width: max-content;
		height: 100%;
		aspect-ratio: auto;
		margin: 0 auto;
	}
	.vm-fit-tablet-height .vm-widget .vm-flat-stage img.vm-flat-image {
		width: auto;
		height: 100%;
	}

	.vm-fit-tablet-cover .vm-widget .vm-flat-viewport {
		display: flex;
		overflow: auto;
		container-type: size;
		cursor: grab;
	}
	.vm-fit-tablet-cover .vm-widget .vm-flat-stage {
		flex: none;
		width: max(100cqw, 100cqh * var(--vm-ratio));
		height: auto;
		aspect-ratio: var(--vm-ratio);
		margin: auto;
	}

	.vm-fit-tablet-contain .vm-widget .vm-flat-viewport {
		display: flex;
		overflow: hidden;
		container-type: size;
		cursor: default;
	}
	.vm-fit-tablet-contain .vm-widget .vm-flat-stage {
		flex: none;
		width: min(100cqw, 100cqh * var(--vm-ratio));
		height: auto;
		aspect-ratio: var(--vm-ratio);
		margin: auto;
	}

	.vm-fit-tablet-cover .vm-widget .vm-flat-stage img.vm-flat-image,
	.vm-fit-tablet-contain .vm-widget .vm-flat-stage img.vm-flat-image {
		width: 100%;
		height: 100%;
	}
}

/* Mobile (Elementor default: up to 767px) */
@media (max-width: 767px) {
	.vm-fit-mobile-height .vm-widget .vm-flat-viewport {
		display: block;
		overflow-x: auto;
		overflow-y: hidden;
		container-type: normal;
		cursor: grab;
	}
	.vm-fit-mobile-height .vm-widget .vm-flat-stage {
		flex: initial;
		width: max-content;
		height: 100%;
		aspect-ratio: auto;
		margin: 0 auto;
	}
	.vm-fit-mobile-height .vm-widget .vm-flat-stage img.vm-flat-image {
		width: auto;
		height: 100%;
	}

	.vm-fit-mobile-cover .vm-widget .vm-flat-viewport {
		display: flex;
		overflow: auto;
		container-type: size;
		cursor: grab;
	}
	.vm-fit-mobile-cover .vm-widget .vm-flat-stage {
		flex: none;
		width: max(100cqw, 100cqh * var(--vm-ratio));
		height: auto;
		aspect-ratio: var(--vm-ratio);
		margin: auto;
	}

	.vm-fit-mobile-contain .vm-widget .vm-flat-viewport {
		display: flex;
		overflow: hidden;
		container-type: size;
		cursor: default;
	}
	.vm-fit-mobile-contain .vm-widget .vm-flat-stage {
		flex: none;
		width: min(100cqw, 100cqh * var(--vm-ratio));
		height: auto;
		aspect-ratio: var(--vm-ratio);
		margin: auto;
	}

	.vm-fit-mobile-cover .vm-widget .vm-flat-stage img.vm-flat-image,
	.vm-fit-mobile-contain .vm-widget .vm-flat-stage img.vm-flat-image {
		width: 100%;
		height: 100%;
	}
}

/* ---------- Hotspot button (44 × 44 px minimum tap target) ---------- */

.vm-widget button.vm-hotspot {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: inherit;
	line-height: 1;
	cursor: pointer;
	transform: translate(-50%, -50%);
	-webkit-tap-highlight-color: transparent;
}

.vm-widget button.vm-hotspot:hover,
.vm-widget button.vm-hotspot:focus {
	background: transparent;
	box-shadow: none;
	outline: none;
}

.vm-widget button.vm-hotspot:focus-visible {
	outline: 3px solid var(--vm-focus-color);
	outline-offset: 2px;
}

/* 360° mode: Pannellum positions the wrapper, so the button sits in flow. */
.vm-widget .pnlm-hotspot-base.vm-pano-hotspot {
	width: auto;
	height: auto;
}

.vm-widget .vm-pano-hotspot button.vm-hotspot {
	position: relative;
	transform: none;
}

/* ---------- Marker ---------- */

.vm-widget .vm-marker {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: #ffffff;
	color: #1d3557;
	font-size: 16px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
	transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.vm-widget .vm-marker i {
	line-height: 1;
}

.vm-widget .vm-marker svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.vm-widget .vm-marker img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	border-radius: inherit;
	object-fit: cover;
}

.vm-widget .vm-hotspot:hover .vm-marker,
.vm-widget .vm-hotspot:focus-visible .vm-marker {
	transform: scale(1.1);
}

/* Optional pulse ring ("Pulse animation" control adds .vm-pulse-yes). */
.vm-pulse-yes .vm-marker::after {
	content: "";
	position: absolute;
	inset: -2px;
	border: 2px solid var(--vm-pulse-color);
	border-radius: inherit;
	pointer-events: none;
	animation: vm-pulse 2s ease-out infinite;
}

@keyframes vm-pulse {
	0% {
		opacity: 0.8;
		transform: scale(1);
	}
	100% {
		opacity: 0;
		transform: scale(1.8);
	}
}

/* ---------- Shaped areas ---------- */

.vm-widget {
	--vm-area-color: #ffffff;
	--vm-area-opacity: 0.15;
	--vm-area-opacity-hover: 0.5;
	--vm-area-glow: 8px;
}

.vm-widget button.vm-hotspot--area {
	z-index: 1; /* Markers (z-index 2) stay on top of areas. */
	width: 10%;
	height: 20%;
	border-radius: 0;
}

.vm-widget button.vm-hotspot--area.vm-shape-rounded {
	border-radius: 12px;
}

.vm-widget button.vm-hotspot--area.vm-shape-ellipse {
	border-radius: 50%;
}

/* Highlight layer. Opacity sits on the wrapper so the glow (drop-shadow)
   follows the shape's outline, including custom image shapes. */
.vm-widget .vm-area {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	opacity: var(--vm-area-opacity);
	filter: drop-shadow(0 0 var(--vm-area-glow) var(--vm-area-color));
	pointer-events: none;
	transition: opacity 0.2s;
}

.vm-widget .vm-area__shape {
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background-color: var(--vm-area-color);
}

.vm-widget .vm-shape-image .vm-area__shape {
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
}

.vm-widget .vm-hotspot--area.is-hover .vm-area,
.vm-widget .vm-hotspot--area:focus-visible .vm-area {
	opacity: var(--vm-area-opacity-hover);
}

/* Transparent parts of a custom shape aren't clickable. */
.vm-widget .vm-hotspot--area.is-miss {
	cursor: inherit;
}

.vm-tooltips-hover .vm-widget button.vm-hotspot--area.is-miss .vm-tooltip {
	opacity: 0;
	visibility: hidden;
}

/* Areas show their tooltip on hover via .is-hover (set by script). */
.vm-widget .vm-hotspot--area.is-hover .vm-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.vm-widget .vm-hotspot--area:hover .vm-marker,
.vm-widget .vm-hotspot--area:focus-visible .vm-marker {
	transform: none;
}

/* Editor: outline areas so they are easy to find, plus a resize handle. */
.vm-editing button.vm-hotspot--area {
	outline: 2px dashed rgba(34, 113, 177, 0.8);
	outline-offset: 0;
}

.vm-editing .vm-resize-handle {
	position: absolute;
	right: -9px;
	bottom: -9px;
	z-index: 3;
	width: 18px;
	height: 18px;
	border: 2px solid #ffffff;
	border-radius: 4px;
	background: #2271b1;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
	cursor: nwse-resize;
	touch-action: none;
}

/* ---------- Scene builder (grid) ----------
   The stage behaves like an image whose proportions come from the grid,
   so every image-fit mode and Automatic height work unchanged.
   Sizes are in units of one cell's width:
     cell height = 1 / cell ratio
     W = columns + gaps + 2 × padding
     H = rows × cell height + gaps + 2 × padding                        */

.vm-widget.vm-build {
	--vm-cols: 5;
	--vm-rows: 2;
	--vm-cell-ratio: 1;
	--vm-gap: 0.08;
	--vm-pad: 0.08;
	--vm-cell-px: 200px;
	--vm-cell-zoom: 1;
	--vm-ch: calc(1 / var(--vm-cell-ratio));
	--vm-W: calc(var(--vm-cols) + (var(--vm-cols) - 1) * var(--vm-gap) + 2 * var(--vm-pad));
	--vm-H: calc(var(--vm-rows) * var(--vm-ch) + (var(--vm-rows) - 1) * var(--vm-gap) + 2 * var(--vm-pad));
	--vm-ratio: calc(var(--vm-W) / var(--vm-H));
}

/* Plain light background unless a colour or image is chosen. */
.vm-widget.vm-build .vm-scene {
	background-color: #f4f5f7;
}

.vm-widget .vm-build-stage {
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

/* Gives the stage its width in "Fill height" mode, as an <img> would. */
.vm-widget .vm-build-sizer {
	display: block;
	height: 100%;
	aspect-ratio: var(--vm-ratio);
	pointer-events: none;
}

/* Flat: each cell sits in its grid position, in % of the stage. */
.vm-widget .vm-flat-stage button.vm-hotspot.vm-build-stall {
	position: absolute;
	display: block;
	left: calc((var(--vm-pad) + var(--vm-col) * (1 + var(--vm-gap))) / var(--vm-W) * 100%);
	top: calc((var(--vm-pad) + var(--vm-row) * (var(--vm-ch) + var(--vm-gap))) / var(--vm-H) * 100%);
	width: calc(100% / var(--vm-W));
	height: calc(var(--vm-ch) / var(--vm-H) * 100%);
	min-width: 0;
	min-height: 0;
	border-radius: 0;
	transform: none;
}

/* 360°: Pannellum centres each cell on its point; cells scale with zoom. */
.vm-widget .vm-pano-hotspot button.vm-hotspot.vm-build-stall {
	position: relative;
	display: block;
	width: calc(var(--vm-cell-px) * var(--vm-zoom, 1));
	height: auto;
	aspect-ratio: var(--vm-cell-ratio);
	min-width: 0;
	min-height: 0;
	border-radius: 0;
	transform: none;
}

.vm-widget .vm-cell-inner {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 6%;
	overflow: hidden;
	border: 1px solid #d5d9de;
	border-radius: 8px;
	background-color: #ffffff;
	transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.vm-widget .vm-cell-empty .vm-cell-inner {
	border-style: dashed;
}

.vm-widget .vm-cell-img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: contain;
}

.vm-widget .vm-cell-name {
	overflow: hidden;
	color: #6b7280;
	font-size: 14px;
	line-height: 1.3;
	text-align: center;
	overflow-wrap: anywhere;
}

.vm-widget .vm-build-stall:hover .vm-cell-inner,
.vm-widget .vm-build-stall:focus-visible .vm-cell-inner {
	border-color: #9aa3ad;
	transform: scale(var(--vm-cell-zoom));
}

/* Cells show their name inside, so no hover pulse/marker effects apply. */
.vm-widget button.vm-build-stall:focus-visible {
	outline-offset: 3px;
}

.vm-widget.vm-mode-360 {
	--vm-ratio: 1.7778; /* 16:9 box for "Automatic" height in 360° mode. */
}

/* ---------- Tooltip ---------- */

.vm-widget .vm-tooltip {
	position: absolute;
	bottom: calc(100% + 2px);
	left: 50%;
	z-index: 3;
	padding: 4px 10px;
	border-radius: 4px;
	background-color: rgba(0, 0, 0, 0.85);
	color: #ffffff;
	font-size: 14px;
	line-height: 1.3;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 4px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.vm-widget .vm-hotspot:hover .vm-tooltip,
.vm-widget .vm-hotspot:focus-visible .vm-tooltip,
.vm-tooltips-always .vm-widget .vm-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

/* "Show tooltip: Never" – hidden everywhere (names remain as aria-labels). */
.vm-tooltips-none .vm-widget .vm-tooltip {
	display: none !important;
}

/* ---------- Fallback stall list (screen readers / keyboard) ---------- */

.vm-widget .vm-stall-list,
.vm-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Revealed as a panel while a keyboard user is inside it. */
.vm-widget .vm-stall-list:focus-within {
	top: 12px;
	right: 12px;
	z-index: 10;
	width: auto;
	max-width: min(320px, calc(100% - 24px));
	height: auto;
	max-height: calc(100% - 24px);
	overflow: auto;
	clip-path: none;
	padding: 12px 16px;
	border-radius: 6px;
	background: #ffffff;
	color: #1a1a1a;
	white-space: normal;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.vm-widget .vm-stall-list__title {
	margin: 0 0 8px;
	font-weight: 600;
}

.vm-widget .vm-stall-list ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vm-widget .vm-stall-list button.vm-stall-link {
	display: block;
	width: 100%;
	min-height: 44px;
	margin: 0;
	padding: 8px 4px;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: left;
	text-decoration: underline;
	cursor: pointer;
}

.vm-widget .vm-stall-list button.vm-stall-link:hover,
.vm-widget .vm-stall-list button.vm-stall-link:focus {
	background: #eef2f7;
	color: inherit;
}

.vm-widget .vm-stall-list button.vm-stall-link:focus-visible {
	outline: 3px solid #1d3557;
	outline-offset: 1px;
}

/* ---------- Pop-up window (front end) ---------- */

html.vm-dialog-open {
	overflow: hidden; /* Stop the page scrolling behind the window. */
}

.vm-widget .vm-dialog {
	box-sizing: border-box;
	width: min(800px, calc(100vw - 32px));
	max-width: calc(100vw - 32px);
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	overflow: auto;
	overscroll-behavior: contain;
	border: 0;
	border-radius: 8px;
	background-color: #ffffff;
	color: inherit;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

/* Fallback for browsers without showModal(). */
.vm-widget .vm-dialog[open]:not(:modal) {
	position: fixed;
	inset: 0;
	z-index: 99999;
}

.vm-widget .vm-dialog::backdrop {
	background-color: rgba(0, 0, 0, 0.7);
}

.vm-widget .vm-dialog__body {
	padding: 24px;
}

/* Only the chosen stall's container is shown. */
.vm-widget .vm-dialog .vm-panels > .elementor-element:not(.vm-panel-active) {
	display: none;
}

.vm-widget button.vm-dialog__close {
	position: sticky;
	top: 8px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 8px 8px -52px auto; /* Floats over the content's top-right corner. */
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.9);
	color: #1a1a1a;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	cursor: pointer;
}

.vm-widget button.vm-dialog__close:hover,
.vm-widget button.vm-dialog__close:focus {
	background-color: #ffffff;
	color: #1a1a1a;
	outline: none;
}

.vm-widget button.vm-dialog__close:focus-visible {
	outline: 3px solid var(--vm-focus-color);
	outline-offset: 2px;
}

/* Opening animation ("Opening animation" control adds .vm-dialog-anim-yes). */
.vm-dialog-anim-yes .vm-dialog[open] {
	animation: vm-dialog-in 0.25s ease-out;
}

.vm-dialog-anim-yes .vm-dialog[open]::backdrop {
	animation: vm-backdrop-in 0.25s ease-out;
}

@keyframes vm-dialog-in {
	from {
		opacity: 0;
		transform: translateY(12px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes vm-backdrop-in {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

/* ---------- Stall containers in the editor ---------- */

/* Default position before Elementor's per-stall CSS applies. */
.vm-widget .vm-flat-stage button.vm-hotspot {
	left: 50%;
	top: 50%;
}

/* Tabs that switch which stall's container is shown (one at a time keeps the editor fast). */
.vm-widget .vm-panel-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 12px;
}

.vm-widget button.vm-panel-tab {
	margin: 0;
	padding: 6px 12px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #ffffff;
	color: #3c434a;
	font: 500 12px/1.4 system-ui, sans-serif;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.vm-widget button.vm-panel-tab:hover,
.vm-widget button.vm-panel-tab:focus {
	border-color: #2271b1;
	background: #ffffff;
	color: #2271b1;
}

.vm-widget button.vm-panel-tab[aria-pressed="true"] {
	border-color: #2271b1;
	background: #2271b1;
	color: #ffffff;
}

.vm-widget .vm-panels--editor > .elementor-element.vm-panel-hidden {
	display: none !important;
}

.vm-widget .vm-panels-heading {
	margin: 24px 0 8px;
	color: #69727d;
	font: 600 13px/1.4 system-ui, sans-serif;
}

.vm-widget .vm-panels--editor {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.vm-widget .vm-panels--editor > .elementor-element {
	position: relative;
	outline: 2px dashed #c3c4c7;
	outline-offset: 0;
	padding-top: 28px;
	transition: outline-color 0.3s;
}

.vm-widget .vm-panels--editor > .elementor-element::before {
	content: attr(data-vm-label);
	position: absolute;
	top: 4px;
	left: 8px;
	color: #69727d;
	font: 600 12px/1.4 system-ui, sans-serif;
	pointer-events: none;
}

.vm-widget .vm-panels--editor > .elementor-element.vm-panel-flash {
	outline-color: #2271b1;
	outline-style: solid;
}

/* ---------- Editor helpers ---------- */

/* Hotspots can be dragged into place in the editor. */
.vm-editing button.vm-hotspot {
	cursor: grab;
	touch-action: none;
	user-select: none;
	-webkit-user-drag: none;
}

.vm-editing button.vm-hotspot.is-dragging {
	z-index: 30;
	cursor: grabbing;
}

.vm-editing button.vm-hotspot.is-dragging .vm-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.vm-editing button.vm-hotspot.is-dragging .vm-marker {
	box-shadow: 0 0 0 3px #2271b1, 0 6px 16px rgba(0, 0, 0, 0.4);
}

.vm-widget .vm-helper {
	position: absolute;
	bottom: 10px;
	left: 10px;
	z-index: 20;
	max-width: calc(100% - 20px);
	padding: 6px 10px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.85);
	color: #ffffff;
	font: 13px/1.4 system-ui, sans-serif;
	user-select: all;
}

.vm-empty {
	padding: 40px 20px;
	border: 2px dashed #c3c4c7;
	color: #50575e;
	text-align: center;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.vm-pulse-yes .vm-marker::after {
		display: none;
		animation: none;
	}

	.vm-widget .vm-marker,
	.vm-widget .vm-tooltip {
		transition: none;
	}

	.vm-widget .vm-hotspot:hover .vm-marker,
	.vm-widget .vm-hotspot:focus-visible .vm-marker {
		transform: none;
	}

	.vm-dialog-anim-yes .vm-dialog[open],
	.vm-dialog-anim-yes .vm-dialog[open]::backdrop {
		animation: none;
	}

	.vm-widget .vm-area,
	.vm-widget .vm-cell-inner {
		transition: none;
	}

	.vm-widget .vm-build-stall:hover .vm-cell-inner,
	.vm-widget .vm-build-stall:focus-visible .vm-cell-inner {
		transform: none;
	}
}

/* ---------- Walkthrough mode ----------
   Every view fills the scene box and is a flat scene of its own; only the
   current one is shown. During a move the old view sits on top and fades. */

.vm-widget {
	--vm-arrow-size: 56px;
	--vm-arrow-color: #ffffff;
	--vm-arrow-bg: rgba(0, 0, 0, 0.5);
	--vm-arrow-bg-hover: rgba(0, 0, 0, 0.75);
	--vm-arrow-border: rgba(255, 255, 255, 0.9);
	--vm-nav-bg: rgba(0, 0, 0, 0.65);
	--vm-nav-color: #ffffff;
}

.vm-widget .vm-walk {
	position: absolute;
	inset: 0;
}

.vm-widget .vm-walk-view {
	position: absolute;
	inset: 0;
	background: #222;
}

.vm-widget .vm-walk-view[hidden] {
	display: none;
}

.vm-widget .vm-walk-view.is-current {
	z-index: 1;
}

.vm-widget .vm-walk-view.is-leaving {
	z-index: 2;
	pointer-events: none;
}

/* Arrows: round buttons, at least a 44 px tap target. */
.vm-widget button.vm-arrow {
	z-index: 3;
	box-sizing: border-box;
	width: max(44px, var(--vm-arrow-size));
	height: max(44px, var(--vm-arrow-size));
	border: 2px solid var(--vm-arrow-border);
	background: var(--vm-arrow-bg);
	color: var(--vm-arrow-color);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
	transition: background-color 0.15s, transform 0.15s;
}

.vm-widget button.vm-arrow:hover,
.vm-widget button.vm-arrow:focus {
	background: var(--vm-arrow-bg-hover);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.vm-widget button.vm-arrow:hover,
.vm-widget button.vm-arrow:focus-visible {
	transform: translate(-50%, -50%) scale(1.08);
}

.vm-widget .vm-arrow__icon {
	display: flex;
	width: 55%;
	height: 55%;
}

.vm-widget .vm-arrow__icon svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.vm-widget.vm-editing button.vm-arrow.is-dragging {
	cursor: grabbing;
	transform: translate(-50%, -50%) scale(1.12);
}

/* Back, Start and the view name. */
.vm-widget .vm-walk-nav {
	position: absolute;
	left: 12px;
	bottom: 12px;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	max-width: calc(100% - 24px);
	pointer-events: none;
}

.vm-widget .vm-walk-nav > * {
	pointer-events: auto;
}

.vm-widget button.vm-walk-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-radius: 999px;
	background: var(--vm-nav-bg);
	color: var(--vm-nav-color);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
}

.vm-widget button.vm-walk-btn:hover,
.vm-widget button.vm-walk-btn:focus {
	background: var(--vm-nav-bg);
	color: var(--vm-nav-color);
	filter: brightness(1.25);
}

.vm-widget button.vm-walk-btn:focus-visible {
	outline: 3px solid var(--vm-focus-color);
	outline-offset: 2px;
}

.vm-widget button.vm-walk-btn[hidden] {
	display: none;
}

.vm-widget .vm-walk-name {
	margin: 0;
	padding: 12px 16px;
	border-radius: 999px;
	background: var(--vm-nav-bg);
	color: var(--vm-nav-color);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
}

/* Waiting for the next view's image. */
.vm-widget .vm-walk-scene.is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 6;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border: 4px solid rgba(255, 255, 255, 0.35);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: vm-walk-spin 0.8s linear infinite;
}

@keyframes vm-walk-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Editor coordinates badge: top-left, clear of the Back/Start bar. */
.vm-widget.vm-mode-walk .vm-helper {
	top: 10px;
	bottom: auto;
}

/* Editor bar: choose the view to work on, and see any linking problems. */
.vm-widget .vm-walk-editbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 16px;
	padding: 8px 12px;
	background: #f1f3f5;
	border: 1px solid #d5dadf;
	border-bottom: 0;
	color: #1f2124;
	font-size: 13px;
	line-height: 1.4;
}

.vm-widget .vm-walk-editbar__pick {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-weight: 600;
}

.vm-widget .vm-walk-editbar select {
	min-width: 160px;
	padding: 4px 8px;
	font-size: 13px;
}

.vm-widget .vm-walk-warn {
	flex-basis: 100%;
	margin: 0;
	padding: 0 0 0 18px;
	color: #b32d2e;
}

@media (prefers-reduced-motion: reduce) {
	.vm-widget button.vm-arrow {
		transition: none;
	}

	.vm-widget .vm-walk-scene.is-loading::after {
		animation-duration: 2s;
	}
}

/* ---------- Walkthrough: edge exits ----------
   Pinned to the edges of the scene box (not the image), so they stay put
   while a wide image scrolls. */

.vm-widget {
	--vm-exit-gap: 14px;
	--vm-map-size: 64px;
	--vm-thumb-size: 128px;
}

.vm-widget .vm-walk-exits {
	position: absolute;
	inset: 0;
	z-index: 4;
	pointer-events: none;
}

/* Same base button as stall hotspots: round, centred on its point. */
.vm-widget .vm-walk-exits button.vm-exit {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	line-height: 1;
	cursor: pointer;
	pointer-events: auto;
	transform: translate(-50%, -50%);
	-webkit-tap-highlight-color: transparent;
}

.vm-widget .vm-walk-exits button.vm-exit:hover,
.vm-widget .vm-walk-exits button.vm-exit:focus-visible {
	transform: translate(-50%, -50%) scale(1.08);
}

.vm-widget .vm-walk-exits button.vm-exit:focus {
	outline: none;
}

.vm-widget .vm-walk-exits button.vm-exit:focus-visible {
	outline: 3px solid var(--vm-focus-color);
	outline-offset: 3px;
}

.vm-widget .vm-exit--forward {
	left: 50%;
	top: calc(var(--vm-exit-gap) + max(44px, var(--vm-arrow-size)) / 2);
}

.vm-widget .vm-exit--back {
	left: 50%;
	top: calc(100% - var(--vm-exit-gap) - max(44px, var(--vm-arrow-size)) / 2);
}

.vm-widget .vm-exit--left {
	top: 50%;
	left: calc(var(--vm-exit-gap) + max(44px, var(--vm-arrow-size)) / 2);
}

.vm-widget .vm-exit--right {
	top: 50%;
	left: calc(100% - var(--vm-exit-gap) - max(44px, var(--vm-arrow-size)) / 2);
}

/* On narrow screens, lift the back exit clear of the Back/Start bar. */
@media (max-width: 600px) {
	.vm-widget .vm-exit--back {
		top: calc(100% - var(--vm-exit-gap) - 56px - max(44px, var(--vm-arrow-size)) / 2);
	}
}

/* Exit tooltips: shown on hover/focus, kept inside the scene. */
.vm-widget .vm-exit:hover .vm-tooltip,
.vm-widget .vm-exit:focus-visible .vm-tooltip {
	opacity: 1;
	visibility: visible;
}

.vm-widget .vm-exit--left .vm-tooltip {
	left: 0;
	transform: none;
}

.vm-widget .vm-exit--right .vm-tooltip {
	left: auto;
	right: 0;
	transform: none;
}

.vm-widget .vm-exit--forward .vm-tooltip {
	top: calc(100% + 8px);
	bottom: auto;
}

/* ---------- Walkthrough: scenes button and list ---------- */

/* Spans the scene (so the list can size against it) but lets clicks
   through everywhere except the button and the open list. */
.vm-widget .vm-walk-map {
	position: absolute;
	inset: 12px;
	z-index: 7;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: flex-end;
	gap: 10px;
	pointer-events: none;
}

.vm-widget .vm-walk-map > * {
	pointer-events: auto;
}

.vm-widget button.vm-walk-map__toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: max(44px, var(--vm-map-size));
	height: max(44px, var(--vm-map-size));
	margin: 0;
	padding: 0;
	overflow: visible;
	border: 2px solid var(--vm-arrow-border);
	border-radius: 12px;
	background: var(--vm-nav-bg);
	color: var(--vm-nav-color);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
	cursor: pointer;
}

.vm-widget button.vm-walk-map__toggle:hover,
.vm-widget button.vm-walk-map__toggle:focus {
	background: var(--vm-nav-bg);
	color: var(--vm-nav-color);
	filter: brightness(1.2);
}

.vm-widget button.vm-walk-map__toggle:focus-visible {
	outline: 3px solid var(--vm-focus-color);
	outline-offset: 2px;
}

.vm-widget .vm-walk-map__toggle svg {
	width: 55%;
	height: 55%;
}

.vm-widget .vm-walk-map__toggle.has-image img {
	width: 100%;
	height: 100%;
	border-radius: 10px;
	object-fit: cover;
}

.vm-widget .vm-walk-map.is-open .vm-walk-map__toggle {
	border-color: var(--vm-focus-color);
}

/* Toggle tooltip: to the left of the button. */
.vm-widget .vm-walk-map__toggle .vm-tooltip {
	top: 50%;
	bottom: auto;
	left: auto;
	right: calc(100% + 8px);
	transform: translateY(-50%);
}

.vm-widget .vm-walk-map__toggle:hover .vm-tooltip,
.vm-widget .vm-walk-map__toggle:focus-visible .vm-tooltip {
	opacity: 1;
	visibility: visible;
}

.vm-widget .vm-walk-map.is-open .vm-walk-map__toggle .vm-tooltip {
	opacity: 0;
	visibility: hidden;
}

.vm-widget .vm-walk-map__panel {
	box-sizing: border-box;
	width: min(100%, calc(3 * var(--vm-thumb-size) + 2 * 10px + 2 * 12px + 6px));
	min-width: min(100%, calc(var(--vm-thumb-size) + 2 * 12px + 6px));
	max-height: calc(100% - max(44px, var(--vm-map-size)) - 10px);
	padding: 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: 12px;
	background: var(--vm-nav-bg);
	color: var(--vm-nav-color);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
	backdrop-filter: blur(4px);
}

.vm-widget .vm-walk-map__panel[hidden] {
	display: none;
}

.vm-widget .vm-walk-map__title {
	margin: 0 0 10px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
}

.vm-widget .vm-walk-map__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--vm-thumb-size), 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.vm-widget .vm-walk-map__list li {
	margin: 0;
	padding: 0;
}

.vm-widget button.vm-walk-map__item {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.vm-widget button.vm-walk-map__item:hover,
.vm-widget button.vm-walk-map__item:focus {
	background: none;
	color: inherit;
}

.vm-widget .vm-walk-map__thumb {
	display: block;
	box-sizing: border-box;
	width: 100%;
	aspect-ratio: 1;
	max-width: var(--vm-thumb-size);
	overflow: hidden;
	border: 3px solid transparent;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.12);
	transition: border-color 0.15s;
}

.vm-widget .vm-walk-map__thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vm-widget .vm-walk-map__item:hover .vm-walk-map__thumb {
	border-color: rgba(255, 255, 255, 0.6);
}

.vm-widget .vm-walk-map__item:focus-visible {
	outline: none;
}

.vm-widget .vm-walk-map__item:focus-visible .vm-walk-map__thumb {
	border-color: var(--vm-focus-color);
	outline: 2px solid var(--vm-focus-color);
	outline-offset: 2px;
}

/* The scene you're in. */
.vm-widget .vm-walk-map__item[aria-current="true"] .vm-walk-map__thumb {
	border-color: var(--vm-arrow-border);
	box-shadow: 0 0 0 2px var(--vm-focus-color);
}

.vm-widget .vm-walk-map__name {
	display: -webkit-box;
	max-width: var(--vm-thumb-size);
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Keep the Back/Start bar clear of the scenes button. */
.vm-widget .vm-walk-scene .vm-walk-nav {
	max-width: calc(100% - 24px - max(44px, var(--vm-map-size)) - 12px);
}
