/* Map container & controls */
.sg-map {
  position: fixed;
  inset: 0;
  z-index: 0;
}
/* Google Maps injects nested divs; without 100% height the canvas stays blank */
.sg-map > div,
.sg-map .gm-style {
  width: 100% !important;
  height: 100% !important;
}
.sg-map .maplibregl-ctrl-attrib {
  font-size: 10px;
  opacity: .8;
}
.sg-map-controls {
  position: fixed;
  right: 10px;
  bottom: 44px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sg-map-ctrl {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(15, 23, 42, 0.06);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-map-ctrl:hover { background: #f8fafc; }
.sg-map-ctrl.is-active { color: #2563eb; border-color: #2563eb; }

.sg-map-context {
  padding: 0;
  overflow: hidden;
  background-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}
.sg-map-context__photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.sg-map-context__photo[hidden] {
  display: none !important;
}
.sg-map-ctrl.sg-map-context.has-photo {
  background-color: #94a3b8;
}
@media (hover: hover) {
  .sg-map-ctrl.sg-map-context.has-photo:hover {
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.2);
  }
}
.sg-map-ctrl.sg-map-context.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35), 0 2px 8px rgba(15, 23, 42, 0.12);
}

/* MapLibre marker root — must be the element passed to maplibregl.Marker (no position/transform here) */
.sg-maplibre-marker {
  cursor: pointer;
}
.sg-maplibre-marker.is-filtered-out {
  display: none !important;
  pointer-events: none;
  visibility: hidden;
}

/* Inner visual wrapper */
.sg-marker-wrap {
  position: relative;
}
.sg-marker-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease;
  box-sizing: border-box;
}
.sg-marker-wrap:hover .sg-marker-pin { transform: scale(1.06); }

.sg-marker-wrap--city {
  width: 28px;
  height: 28px;
}
.sg-marker-pin--city {
  width: 28px;
  height: 28px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  border-radius: 999px;
}

.sg-marker-pin--tier1 {
  width: 34px;
  height: 34px;
  background: #facc15;
  color: #0f172a;
  font-size: 14px;
}
.sg-marker-pin--tier2 {
  width: 32px;
  height: 32px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
}
.sg-marker-wrap--tier3 {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sg-marker-pin--tier3 {
  width: 20px;
  height: 20px;
  background: #64748b;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.35);
}
.sg-marker-pin--visited {
  background: #16a34a !important;
  color: #fff !important;
}
.sg-marker-wrap.is-hidden-place .sg-marker-pin {
  filter: grayscale(1);
  opacity: 0.4;
}

/* Selected place halo */
.sg-marker-wrap.is-selected::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  border: 3px solid currentColor;
  opacity: 0.9;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
  animation: sg-selected-pulse 1.4s ease-out infinite;
  pointer-events: none;
}
.sg-marker-wrap.is-selected-tier1::before {
  border-color: #eab308;
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.25);
}
.sg-marker-wrap.is-selected-tier2::before {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.sg-marker-wrap.is-selected-tier3::before {
  border-color: #475569;
  box-shadow: 0 0 0 3px rgba(71, 85, 105, 0.25);
}
.sg-marker-wrap.is-selected-tier-custom::before {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.28);
}

@keyframes sg-selected-pulse {
  0% { transform: scale(0.96); opacity: 0.95; }
  70% { transform: scale(1.05); opacity: 0.4; }
  100% { transform: scale(0.96); opacity: 0.95; }
}

/* User location marker (GPS) */
.sg-user-location {
  position: relative;
  width: 28px;
  height: 28px;
  pointer-events: none;
}
.sg-user-location__pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.35);
  animation: sg-user-pulse 1.6s ease-out infinite;
}
.sg-user-location__dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #0ea5e9;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.45);
}

@keyframes sg-user-pulse {
  0% { transform: scale(0.55); opacity: 0.95; }
  70% { transform: scale(1.55); opacity: 0.12; }
  100% { transform: scale(1.75); opacity: 0; }
}
