/* Map multiselect filters. Loaded after the base stylesheet. */
.map-filters {
  grid-template-columns: minmax(230px, 1.45fr) repeat(5, minmax(124px, 0.75fr));
}

@media (min-width: 761px) and (max-width: 1560px) {
  .map-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-filters input {
    grid-column: 1 / -1;
  }
}

.map-multiselect {
  position: relative;
  min-width: 0;
}

.map-multiselect-toggle {
  position: relative;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
}

.map-multiselect-toggle::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(255, 255, 255, 0.82);
  border-bottom: 2px solid rgba(255, 255, 255, 0.82);
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.18s ease;
}

.map-multiselect-toggle span {
  display: block;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-multiselect.is-open .map-multiselect-toggle::after {
  transform: translateY(-35%) rotate(225deg);
}

.map-multiselect.has-value .map-multiselect-toggle {
  border-color: rgba(168, 85, 247, 0.58);
  background:
    linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(37, 99, 235, 0.09)),
    rgba(255, 255, 255, 0.07);
}

.map-multiselect-menu {
  position: absolute;
  z-index: 90;
  top: calc(100% + 8px);
  left: 0;
  width: min(260px, 88vw);
  max-height: 260px;
  padding: 8px;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(139, 92, 246, 0.08)),
    rgba(5, 8, 14, 0.94);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.44);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  backdrop-filter: blur(18px) saturate(125%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}

.map-multiselect.is-open .map-multiselect-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.map-multiselect-option {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 11px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.map-multiselect-option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.map-multiselect-option input {
  width: 15px;
  height: 15px;
  accent-color: #8b5cf6;
  flex: 0 0 auto;
}

#map-download-addresses {
  border-color: rgba(34, 211, 238, 0.48);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.15), rgba(139, 92, 246, 0.12)),
    rgba(255, 255, 255, 0.06);
}

@media (max-width: 760px) {
  .panel-map #map-city-filter,
  .panel-map #map-status-filter {
    display: none !important;
  }

  .panel-map .map-filters {
    grid-template-columns: 1fr 1fr;
  }

  .panel-map .map-filters input {
    grid-column: 1 / -1;
  }

  .map-multiselect-menu {
    width: min(260px, calc(100vw - 40px));
    max-height: 220px;
  }
}
