/* Map base */
.uli-map {
  width: 100%;
  min-height: 420px;
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .uli-map { min-height: 300px; }
}

/* ---------- Category toggle (chip) control ---------- */

.uli-toggle-control {
  font: inherit;
  padding: 6px 8px;
  background: transparent; /* inner handles bg */
}

.uli-toggle-inner {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.uli-toggle {
  --chip-bg: rgba(255,255,255,0.9);
  --chip-border: rgba(0,0,0,0.12);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--chip-border);
  background: var(--chip-bg);
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  cursor: pointer;
  user-select: none;
  transition: opacity .15s ease, box-shadow .15s ease, border-color .15s ease, background-color .15s ease;
}

/* Hide default checkbox, keep accessible */
.uli-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* Swatch + label */
.uli-swatch {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  transition: opacity .15s ease, filter .15s ease;
}
.uli-label {
  font-size: 12px;
  line-height: 1;
  transition: opacity .15s ease;
}

/* Focus state */
.uli-toggle:has(input:focus-visible) {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Default (unchecked/off) */
.uli-toggle {
  border-color: rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.85);
}
.uli-toggle .uli-swatch { opacity: .35; filter: saturate(.5) brightness(1.1); }
.uli-toggle .uli-label  { opacity: .75; }

/* Checked/on */
.uli-toggle:has(input:checked) {
  border-color: rgba(0,0,0,0.18);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.uli-toggle:has(input:checked) .uli-swatch { opacity: 1; filter: none; }
.uli-toggle:has(input:checked) .uli-label  { opacity: 1; }

/* Hover affordance */
.uli-toggle:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.10); }

/* ---------- Maplibre popup + ULI popup content ---------- */

/* Stronger overall shadow */
.maplibregl-popup { filter: drop-shadow(0 6px 18px rgba(0,0,0,0.18)); }

/* Content box */
.maplibregl-popup .maplibregl-popup-content {
  padding: 0 10px 10px 10px; /* image bleeds to edges via negative margin */
  border-radius: 8px;
}

/* Big, visible close button */
.maplibregl-popup .maplibregl-popup-close-button {
  top: 0;
  right: 6px;
  font-size: 18px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  color: #111;
}
.maplibregl-popup .maplibregl-popup-close-button:hover { background: #f8f8f8; }

/* ULI popup content */
.uli-popup {
  max-width: 320px;
  font: 14px/1.45 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.uli-popup__media {
  margin: -10px -10px 8px -10px; /* bleed to edges */
}
.uli-popup__media img {
  display: block;
  width: 100%;
  height: auto;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.uli-popup__body { display: grid; gap: 6px; }
.uli-popup__title { font-weight: 600; color: #111; }
.uli-popup__address { color: #555; }
.uli-popup__cta { margin-top: 4px; text-decoration: none; }
