/**
 * RSL Interactive Tourist Map — scoped styles.
 */
.rsl-tmap {
	--rsl-tmap-navy: #102b46;
	--rsl-tmap-blue: #2386c8;
	--rsl-tmap-turquoise: #29b9c5;
	--rsl-tmap-bg: #f5f9fc;
	--rsl-tmap-white: #ffffff;
	--rsl-tmap-muted: #5a6f82;
	--rsl-tmap-border: #d7e4ef;
	--rsl-tmap-radius: 16px;
	--rsl-tmap-zoom: 1;
	--rsl-tmap-anim-duration: 2s;
	--rsl-tmap-anim-intensity: 1;
	--rsl-tmap-route-color: #2386c8;
	--rsl-tmap-route-width: 3px;
	position: relative;
	width: 100%;
	max-width: var(--rsl-tmap-max-width, 100%);
	margin: 0 auto;
	color: var(--rsl-tmap-navy);
}

.rsl-tmap__intro {
	margin: 0 0 18px;
	text-align: center;
}

.rsl-tmap__intro h2,
.rsl-tmap__intro h3 {
	margin: 0 0 8px;
	color: var(--rsl-tmap-navy);
}

.rsl-tmap__intro p {
	margin: 0 auto;
	max-width: 54ch;
	color: var(--rsl-tmap-muted);
}

.rsl-tmap__shell {
	position: relative;
	background: var(--rsl-tmap-shell-bg, var(--rsl-tmap-bg));
	border: 1px solid var(--rsl-tmap-border);
	border-radius: var(--rsl-tmap-radius);
	box-shadow: var(--rsl-tmap-shadow, 0 12px 36px rgba(16, 43, 70, 0.08));
	overflow: hidden;
}

.rsl-tmap__viewport {
	position: relative;
	width: 100%;
	overflow: hidden;
	touch-action: none;
	cursor: grab;
	background: #cfe6f4;
	aspect-ratio: 1008 / 750;
}

.rsl-tmap__viewport.is-panning {
	cursor: grabbing;
}

.rsl-tmap__stage {
	position: absolute;
	inset: 0;
	transform-origin: center center;
	will-change: transform;
}

.rsl-tmap__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: center;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

.rsl-tmap__route {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	overflow: visible;
}

.rsl-tmap__route-path {
	fill: none;
	stroke: var(--rsl-tmap-route-color);
	stroke-width: var(--rsl-tmap-route-width);
	stroke-linecap: round;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
}

.rsl-tmap__route-path.is-dashed {
	stroke-dasharray: 8 8;
}

.rsl-tmap__boat {
	position: absolute;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border-radius: 50%;
	background: var(--rsl-tmap-blue);
	color: #fff;
	display: grid;
	place-items: center;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(16, 43, 70, 0.25);
	offset-rotate: auto;
}

.rsl-tmap__boat svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

.rsl-tmap__hotspots {
	position: absolute;
	inset: 0;
}

.rsl-tmap__marker {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: var(--rsl-marker-size, 36px);
	height: var(--rsl-marker-size, 36px);
	border: 2px solid rgba(255, 255, 255, 0.95);
	border-radius: 999px;
	background: var(--rsl-marker-bg, var(--rsl-tmap-blue));
	color: var(--rsl-marker-color, #fff);
	padding: 0;
	margin: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 16px rgba(16, 43, 70, 0.28);
	z-index: 2;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rsl-tmap__marker:hover,
.rsl-tmap__marker:focus-visible {
	transform: translate(-50%, -50%) scale(1.08);
	outline: 2px solid var(--rsl-tmap-turquoise);
	outline-offset: 3px;
	z-index: 4;
}

.rsl-tmap__marker.is-active {
	transform: translate(-50%, -50%) scale(1.12);
	box-shadow: 0 0 0 6px rgba(41, 185, 197, 0.28), 0 8px 20px rgba(16, 43, 70, 0.35);
	z-index: 5;
}

.rsl-tmap__marker svg {
	width: 58%;
	height: 58%;
	fill: currentColor;
	pointer-events: none;
}

.rsl-tmap__marker::after {
	content: '';
	position: absolute;
	inset: -6px;
	border-radius: inherit;
	border: 2px solid var(--rsl-pulse-color, rgba(35, 134, 200, 0.55));
	opacity: 0;
	pointer-events: none;
}

/* Editor-only positioning (Elementor preview iframe). */
body.rsl-tmap-noselect {
	user-select: none !important;
	-webkit-user-select: none !important;
}

.rsl-tmap.is-edit-drag .rsl-tmap__hotspots {
	pointer-events: none;
	z-index: 40;
}

.rsl-tmap.is-edit-drag .rsl-tmap__marker,
.rsl-tmap.is-edit-drag .rsl-tmap__marker.is-draggable {
	pointer-events: auto !important;
	cursor: move !important;
	animation: none !important;
	user-select: none;
	-webkit-user-select: none;
	z-index: 50;
	touch-action: none;
}

.rsl-tmap.is-edit-drag .rsl-tmap__marker.is-draggable::after {
	animation: none !important;
}

.rsl-tmap.is-edit-drag .rsl-tmap__marker.is-dragging {
	cursor: grabbing !important;
	z-index: 60;
	transform: translate(-50%, -50%) scale(1.18);
	box-shadow: 0 0 0 4px rgba(41, 185, 197, 0.5), 0 10px 24px rgba(16, 43, 70, 0.4);
}

.rsl-tmap.is-edit-drag .rsl-tmap__marker[data-editor-pos]::before {
	content: attr(data-editor-pos);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: #102b46;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	padding: 5px 7px;
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	z-index: 70;
}

.rsl-tmap.is-edit-drag .rsl-tmap__viewport {
	cursor: default;
}

.rsl-tmap.is-edit-drag .rsl-tmap__controls,
.rsl-tmap.is-edit-drag .rsl-tmap__popup {
	opacity: 0.35;
	pointer-events: none !important;
}

.rsl-tmap.is-marker-dragging .rsl-tmap__img,
.rsl-tmap.is-marker-dragging .rsl-tmap__route {
	pointer-events: none !important;
}

.rsl-tmap__tooltip {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 10px);
	transform: translateX(-50%) translateY(4px);
	background: var(--rsl-tooltip-bg, #102b46);
	color: var(--rsl-tooltip-color, #fff);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	padding: 6px 8px;
	border-radius: 8px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
	z-index: 6;
}

.rsl-tmap__marker:hover .rsl-tmap__tooltip,
.rsl-tmap__marker:focus-visible .rsl-tmap__tooltip {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

.rsl-tmap__controls {
	position: absolute;
	right: 12px;
	bottom: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	z-index: 8;
}

.rsl-tmap__controls button {
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 10px;
	background: var(--rsl-tmap-white);
	color: var(--rsl-tmap-navy);
	box-shadow: 0 6px 16px rgba(16, 43, 70, 0.18);
	cursor: pointer;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
}

.rsl-tmap__controls button:hover,
.rsl-tmap__controls button:focus-visible {
	background: var(--rsl-tmap-navy);
	color: #fff;
	outline: none;
}

.rsl-tmap__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 14px;
	padding: 12px 14px;
	border-top: 1px solid var(--rsl-tmap-border);
	background: var(--rsl-tmap-white);
}

.rsl-tmap__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--rsl-tmap-navy);
	background: transparent;
	border: 0;
	padding: 0;
	cursor: pointer;
}

.rsl-tmap__legend-swatch {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--rsl-tmap-blue);
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.rsl-tmap__popup {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 16px;
	background: rgba(16, 43, 70, 0.28);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s ease;
	z-index: 20;
}

.rsl-tmap__popup.is-open {
	opacity: 1;
	pointer-events: auto;
}

.rsl-tmap__popup-card {
	width: min(420px, 100%);
	background: var(--rsl-popup-bg, #fff);
	color: var(--rsl-popup-color, var(--rsl-tmap-navy));
	border-radius: 16px;
	border: 1px solid var(--rsl-tmap-border);
	box-shadow: 0 18px 40px rgba(16, 43, 70, 0.28);
	padding: var(--rsl-popup-pad, 18px);
	transform: translateY(12px);
	transition: transform 0.22s ease;
	max-height: min(70vh, 520px);
	overflow: auto;
}

.rsl-tmap__popup.is-open .rsl-tmap__popup-card {
	transform: translateY(0);
}

.rsl-tmap__popup-close {
	float: right;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: #eef5fa;
	color: var(--rsl-tmap-navy);
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
}

.rsl-tmap__popup-img {
	display: block;
	width: 100%;
	max-height: 180px;
	object-fit: cover;
	border-radius: 12px;
	margin: 0 0 12px;
}

.rsl-tmap__popup-title {
	margin: 0 0 8px;
	font-size: 20px;
}

.rsl-tmap__popup-desc {
	margin: 0 0 14px;
	color: var(--rsl-tmap-muted);
	font-size: 14px;
}

.rsl-tmap__popup-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 700;
	color: var(--rsl-tmap-blue);
	text-decoration: none;
}

.rsl-tmap__popup-link:hover,
.rsl-tmap__popup-link:focus-visible {
	color: var(--rsl-tmap-navy);
	text-decoration: underline;
}

.rsl-tmap__note {
	margin: 10px 0 0;
	font-size: 12px;
	color: var(--rsl-tmap-muted);
	text-align: center;
}

.rsl-tmap.is-fullscreen {
	background: #0b1d30;
	padding: 16px;
	max-width: none !important;
	width: 100%;
	height: 100%;
	overflow: auto;
}

.rsl-tmap.is-fullscreen .rsl-tmap__viewport {
	height: calc(100vh - 120px);
	aspect-ratio: auto;
}

/* Animations */
.rsl-tmap[data-animations='1'] .rsl-tmap__marker.is-anim-pulse::after {
	animation: rsl-tmap-pulse var(--rsl-tmap-anim-duration) ease-out infinite;
	animation-delay: var(--rsl-marker-delay, 0s);
}

.rsl-tmap[data-animations='1'] .rsl-tmap__marker.is-anim-float {
	animation: rsl-tmap-float var(--rsl-tmap-anim-duration) ease-in-out infinite;
	animation-delay: var(--rsl-marker-delay, 0s);
}

.rsl-tmap[data-animations='1'] .rsl-tmap__marker.is-anim-bounce {
	animation: rsl-tmap-bounce calc(var(--rsl-tmap-anim-duration) * 0.7) ease-in-out infinite;
	animation-delay: var(--rsl-marker-delay, 0s);
}

.rsl-tmap[data-animations='1'] .rsl-tmap__marker.is-anim-glow {
	animation: rsl-tmap-glow var(--rsl-tmap-anim-duration) ease-in-out infinite;
	animation-delay: var(--rsl-marker-delay, 0s);
}

.rsl-tmap[data-animations='1'] .rsl-tmap__marker.is-anim-scale {
	animation: rsl-tmap-scale var(--rsl-tmap-anim-duration) ease-in-out infinite;
	animation-delay: var(--rsl-marker-delay, 0s);
}

.rsl-tmap[data-animations='1'] .rsl-tmap__marker.is-anim-fade {
	animation: rsl-tmap-fade 0.8s ease both;
	animation-delay: var(--rsl-marker-delay, 0s);
}

.rsl-tmap[data-animations='1'] .rsl-tmap__marker.is-anim-hover:hover {
	animation: rsl-tmap-scale 0.6s ease-in-out infinite;
}

@keyframes rsl-tmap-pulse {
	0% { opacity: 0.7; transform: scale(1); }
	100% { opacity: 0; transform: scale(calc(1 + 0.45 * var(--rsl-tmap-anim-intensity))); }
}

@keyframes rsl-tmap-float {
	0%, 100% { transform: translate(-50%, calc(-50% - 0px)); }
	50% { transform: translate(-50%, calc(-50% - (6px * var(--rsl-tmap-anim-intensity)))); }
}

@keyframes rsl-tmap-bounce {
	0%, 100% { transform: translate(-50%, -50%); }
	40% { transform: translate(-50%, calc(-50% - (8px * var(--rsl-tmap-anim-intensity)))); }
	60% { transform: translate(-50%, calc(-50% - (3px * var(--rsl-tmap-anim-intensity)))); }
}

@keyframes rsl-tmap-glow {
	0%, 100% { box-shadow: 0 6px 16px rgba(16, 43, 70, 0.28); }
	50% { box-shadow: 0 0 0 calc(6px * var(--rsl-tmap-anim-intensity)) rgba(41, 185, 197, 0.35), 0 8px 22px rgba(16, 43, 70, 0.35); }
}

@keyframes rsl-tmap-scale {
	0%, 100% { transform: translate(-50%, -50%) scale(1); }
	50% { transform: translate(-50%, -50%) scale(calc(1 + 0.08 * var(--rsl-tmap-anim-intensity))); }
}

@keyframes rsl-tmap-fade {
	from { opacity: 0; transform: translate(-50%, -40%); }
	to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes rsl-tmap-boat {
	from { offset-distance: 0%; }
	to { offset-distance: 100%; }
}

.rsl-tmap.is-reduced-motion .rsl-tmap__marker,
.rsl-tmap.is-reduced-motion .rsl-tmap__marker::after,
.rsl-tmap.is-reduced-motion .rsl-tmap__popup,
.rsl-tmap.is-reduced-motion .rsl-tmap__popup-card {
	animation: none !important;
	transition: none !important;
}

@media (max-width: 767px) {
	.rsl-tmap__controls {
		right: 8px;
		bottom: 8px;
	}
	.rsl-tmap__controls button {
		width: 36px;
		height: 36px;
	}
	.rsl-tmap__tooltip {
		display: none;
	}
	.rsl-tmap__popup {
		align-items: stretch;
		padding: 10px;
	}
}
