/* Rand Smart Maps – front end. All classes start with "rsm". */

.rsm {
	--rsm-h: 460px; --rsm-radius: 20px; --rsm-accent: #059669; --rsm-info-bg: #fff; --rsm-info-text: #0f172a; --rsm-info-radius: 16px; --rsm-info-font: 14px;
	--rsm-ease: cubic-bezier(.22, .8, .24, 1);
	position: relative; box-sizing: border-box; width: 100%; margin: 0 0 1.5em; overflow: hidden; isolation: isolate;
	border-radius: var(--rsm-radius); background: #eef2f5; color: var(--rsm-info-text); font-size: var(--rsm-info-font); line-height: 1.5;
}
.rsm *, .rsm *::before, .rsm *::after { box-sizing: border-box; }
.rsm.rsm--size-height { height: var(--rsm-h); }
.rsm.rsm--size-ratio { aspect-ratio: var(--rsm-ar, 16 / 9); }
@media (max-width: 1024px) {
	.rsm.rsm--size-height { height: var(--rsm-h-t, var(--rsm-h)); }
	.rsm.rsm--size-ratio { aspect-ratio: var(--rsm-ar-t, var(--rsm-ar, 16 / 9)); }
}
@media (max-width: 767px) {
	.rsm.rsm--size-height { height: var(--rsm-h-m, var(--rsm-h-t, var(--rsm-h))); }
	.rsm.rsm--size-ratio { aspect-ratio: var(--rsm-ar-m, var(--rsm-ar-t, var(--rsm-ar, 16 / 9))); }
}
.rsm.rsm--shadow { box-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 24px 48px -28px rgba(15, 23, 42, .45); }

.rsm-canvas { position: absolute; inset: 0; z-index: 1; }

/* ---------- Placeholder ---------- */
.rsm-ph { position: absolute; inset: 0; z-index: 2; transition: opacity .55s var(--rsm-ease), visibility .55s; }
.rsm.rsm--ready .rsm-ph { opacity: 0; visibility: hidden; pointer-events: none; }
.rsm-ph__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.95); }
.rsm-ph__art { position: absolute; inset: 0; background: var(--rsm-land, #f5f5f5); overflow: hidden; }
.rsm-ph__roads { position: absolute; inset: 0; width: 100%; height: 100%; }
.rsm-ph__water { fill: var(--rsm-water, #c9c9c9); }
.rsm-ph__park { fill: color-mix(in srgb, var(--rsm-land, #f5f5f5) 70%, #86efac); opacity: .55; }
.rsm-ph__road path { fill: none; stroke: var(--rsm-road, #fff); stroke-width: 9; stroke-linecap: round; }
.rsm-ph__road--main path { stroke-width: 16; }
.rsm-ph__pin { position: absolute; width: 34px; margin: -44px 0 0 -17px; animation: rsm-float 3.2s var(--rsm-ease) infinite; filter: drop-shadow(0 6px 8px rgba(15, 23, 42, .25)); }
.rsm-ph__pin:nth-child(3) { animation-delay: .4s; }
.rsm-ph__pin:nth-child(4) { animation-delay: .8s; }
.rsm-pin { display: block; width: 100%; height: auto; }
@keyframes rsm-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.rsm-ph__overlay {
	position: absolute; left: 50%; bottom: 22px; z-index: 3; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 12px;
	width: min(92%, 420px); padding: 18px; border-radius: calc(var(--rsm-radius) * .8); text-align: center;
	background: color-mix(in srgb, var(--rsm-info-bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .45), inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.rsm-ph__card { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.rsm-ph__icon { flex: 0 0 34px; width: 34px; height: 34px; padding: 6px 7px; border-radius: 11px; background: color-mix(in srgb, var(--rsm-accent) 12%, transparent); }
.rsm-ph__text { min-width: 0; }
.rsm-ph__text strong { display: block; overflow: hidden; color: var(--rsm-info-text); font-size: 1.05em; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
.rsm-ph__text span { display: block; margin-top: 1px; color: color-mix(in srgb, var(--rsm-info-text) 62%, transparent); font-size: .9em; }
.rsm-ph__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; width: 100%; }
.rsm .rsm-ph__btn {
	-webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: 0; padding: 0 20px;
	border: 0; border-radius: 999px; background: var(--rsm-accent); color: #fff; font: inherit; font-weight: 700; line-height: 1; cursor: pointer;
	box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--rsm-accent) 80%, #000); transition: transform .2s var(--rsm-ease), box-shadow .2s;
}
.rsm .rsm-ph__btn:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -12px color-mix(in srgb, var(--rsm-accent) 80%, #000); }
.rsm .rsm-ph__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--rsm-accent) 45%, transparent); outline-offset: 2px; }
.rsm-ph__btn svg, .rsm-ph__link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rsm .rsm-ph__link { display: inline-flex; align-items: center; gap: 5px; color: var(--rsm-accent); font-size: .92em; font-weight: 600; text-decoration: none; }
.rsm .rsm-ph__link:hover { text-decoration: underline; }
.rsm-ph__link svg { width: 15px; height: 15px; }
.rsm-ph__privacy { flex-basis: 100%; margin: 0; color: color-mix(in srgb, var(--rsm-info-text) 55%, transparent); font-size: .8em; }
.rsm .rsm-ph__privacy a { color: inherit; text-decoration: underline; }
.rsm-ph__loading { display: inline-flex; align-items: center; gap: 8px; color: color-mix(in srgb, var(--rsm-info-text) 70%, transparent); font-size: .9em; font-weight: 600; }
.rsm-spin { width: 16px; height: 16px; border: 2px solid color-mix(in srgb, var(--rsm-accent) 25%, transparent); border-top-color: var(--rsm-accent); border-radius: 50%; animation: rsm-spin .8s linear infinite; }
@keyframes rsm-spin { to { transform: rotate(360deg); } }
.rsm:not(.rsm--loading) .rsm-ph__loading { display: none; }
.rsm .rsm-ph__admin { flex-basis: 100%; padding: 8px 10px; border: 1px dashed #f59e0b; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: .8em; text-decoration: none; }
.rsm-ph__error { flex-basis: 100%; margin: 0; padding: 8px 10px; border-radius: 10px; background: #fef2f2; color: #b91c1c; font-size: .85em; }
.rsm.rsm--error .rsm-ph__loading, .rsm.rsm--error .rsm-ph__btn { display: none; }
.rsm.rsm--dark .rsm-ph__overlay { box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7), inset 0 0 0 1px rgba(255, 255, 255, .15); }

/* ---------- Markers (HTML pins on the map) ---------- */
.rsm .rsm-marker {
	-webkit-appearance: none; appearance: none; position: absolute; display: block; margin: 0; padding: 0; border: 0; background: none; cursor: pointer;
	transform-origin: 50% 100%; filter: drop-shadow(0 4px 6px rgba(15, 23, 42, .28)); transition: transform .2s var(--rsm-ease), filter .2s;
}
.rsm .rsm-marker:hover, .rsm .rsm-marker.is-active { transform: translateY(-3px) scale(1.06); filter: drop-shadow(0 8px 10px rgba(15, 23, 42, .32)); }
.rsm .rsm-marker:focus-visible { outline: 3px solid color-mix(in srgb, var(--rsm-accent) 55%, transparent); outline-offset: 3px; border-radius: 8px; }
.rsm .rsm-marker img, .rsm .rsm-marker svg { display: block; width: 100%; height: 100%; object-fit: contain; }
.rsm .rsm-marker--drop { animation: rsm-drop .62s cubic-bezier(.3, 1.35, .5, 1) both; }
.rsm .rsm-marker--bounce { animation: rsm-bounce .55s ease 3 both; }
@keyframes rsm-drop { 0% { opacity: 0; transform: translateY(-120px); } 60% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes rsm-bounce { 0%, 100% { transform: none; } 45% { transform: translateY(-18px); } 70% { transform: translateY(-4px); } }

/* ---------- Info card on the map ---------- */
.rsm-pop { position: absolute; z-index: 10; width: 0; height: 0; }
.rsm-pop__card {
	position: absolute; left: 0; bottom: 0; width: max-content; min-width: 220px; max-width: min(300px, 78vw); padding: 18px 18px 16px; transform: translate(-50%, 0);
	border-radius: var(--rsm-info-radius); background: var(--rsm-info-bg); color: var(--rsm-info-text); font-family: inherit; font-size: var(--rsm-info-font); line-height: 1.5; text-align: left;
	animation: rsm-pop .32s var(--rsm-ease) both;
}
.rsm.rsm--shadow .rsm-pop__card { box-shadow: 0 2px 6px rgba(15, 23, 42, .1), 0 22px 44px -16px rgba(15, 23, 42, .45); }
@keyframes rsm-pop { from { opacity: 0; transform: translate(-50%, 8px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
.rsm-pop__tip { position: absolute; left: 0; bottom: -7px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg); background: var(--rsm-info-bg); border-radius: 0 0 3px 0; }
.rsm .rsm-pop__close {
	-webkit-appearance: none; appearance: none; position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 28px; height: 28px; margin: 0; padding: 0;
	border: 0; border-radius: 50%; background: color-mix(in srgb, var(--rsm-info-text) 7%, transparent); color: var(--rsm-info-text); cursor: pointer; transition: background .15s;
}
.rsm .rsm-pop__close:hover { background: color-mix(in srgb, var(--rsm-info-text) 14%, transparent); }
.rsm-pop__close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.rsm-pop__title { display: block; margin: 0 30px 6px 0; font-size: 1.12em; font-weight: 700; line-height: 1.3; }
.rsm-pop__desc { margin: 0 0 10px; color: color-mix(in srgb, var(--rsm-info-text) 72%, transparent); }
.rsm-pop__desc p { margin: 0 0 4px; }
.rsm-pop__desc p:last-child { margin: 0; }
.rsm-pop__rows { display: grid; gap: 6px; margin: 0 0 12px; padding: 10px 0 0; border-top: 1px solid color-mix(in srgb, var(--rsm-info-text) 10%, transparent); list-style: none; }
.rsm-pop__rows li { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 0; font-size: .93em; }
.rsm-pop__rows svg { flex: 0 0 16px; width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--rsm-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rsm .rsm-pop__rows a { color: inherit; text-decoration: none; word-break: break-word; }
.rsm .rsm-pop__rows a:hover { color: var(--rsm-accent); text-decoration: underline; }
.rsm .rsm-pop__dir {
	display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 999px;
	background: var(--rsm-accent); color: #fff; font-weight: 700; text-decoration: none; transition: filter .15s, transform .15s;
}
.rsm .rsm-pop__dir:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff; }
.rsm-pop__dir svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.rsm-pop__rows:last-child, .rsm-pop__desc:last-child { margin-bottom: 0; }

/* Google Maps controls: softer corners to match the design. */
.rsm .gm-style .gm-control-active, .rsm .gm-style .gm-fullscreen-control, .rsm .gm-style .gm-svpc { border-radius: 10px !important; }
.rsm .gm-style .gmnoprint > div[draggable="false"] { border-radius: 10px !important; overflow: hidden; }

/* Text version for screen readers and search engines. */
.rsm-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.rsm-notice { padding: 14px 16px; border: 1px dashed #94a3b8; border-radius: 10px; background: #f8fafc; color: #475569; font-size: 14px; }

@media (max-width: 480px) {
	.rsm-ph__overlay { bottom: 12px; padding: 14px; gap: 10px; }
	.rsm-pop__card { padding: 16px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
	.rsm *, .rsm *::before, .rsm *::after { animation: none !important; transition: none !important; }
}

/* ---------- OpenStreetMap (Leaflet) ---------- */
.rsm .leaflet-container { width: 100%; height: 100%; background: #e9edf0; font-family: inherit; font-size: inherit; line-height: inherit; outline: 0; }
.rsm.rsm--dark .leaflet-container { background: #1e2530; }
.rsm .leaflet-tile { filter: var(--rsm-tiles, none); }
.rsm .rsm-lf-pin { margin: 0; border: 0; background: none; }
.rsm .rsm-lf-pin .rsm-marker { left: 0; top: 0; pointer-events: auto; }
.rsm .leaflet-popup-pane .rsm-pop { pointer-events: auto; }
.rsm .leaflet-bar { overflow: hidden; border: 0; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 8px 20px -8px rgba(15, 23, 42, .4); }
.rsm .leaflet-bar a, .rsm .leaflet-bar a:hover { width: 38px; height: 38px; border-bottom-color: #e5e7eb; background: #fff; color: #1f2937; font: 600 20px/38px system-ui, sans-serif; text-decoration: none; }
.rsm .leaflet-bar a:hover { background: #f3f4f6; }
.rsm .leaflet-bar a.leaflet-disabled { background: #fff; color: #cbd5e1; }
.rsm .leaflet-right .leaflet-control { margin-right: 12px; }
.rsm .leaflet-bottom .leaflet-control-zoom { margin-bottom: 28px; }
.rsm .leaflet-top .leaflet-control { margin-top: 12px; }
.rsm .rsm-fs {
	-webkit-appearance: none; appearance: none; display: grid; place-items: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 0; border-radius: 12px;
	background: #fff; color: #1f2937; cursor: pointer; box-shadow: 0 1px 2px rgba(15, 23, 42, .12), 0 8px 20px -8px rgba(15, 23, 42, .4);
}
.rsm .rsm-fs:hover { background: #f3f4f6; }
.rsm .rsm-fs:focus-visible, .rsm .leaflet-bar a:focus-visible { outline: 3px solid color-mix(in srgb, var(--rsm-accent) 50%, transparent); outline-offset: 2px; }
.rsm .rsm-fs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rsm:fullscreen { border-radius: 0; }
.rsm .leaflet-control-attribution { padding: 2px 8px; border-radius: 8px 0 0 0; background: rgba(255, 255, 255, .82); color: #475569; font-size: 11px; line-height: 1.6; }
.rsm .leaflet-control-attribution a { color: inherit; text-decoration: underline; }
