.nearby-page {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 120px);
  margin: -1rem -0.75rem 0;
}

.nearby-map-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 50vh;
  min-height: 280px;
  max-height: 520px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
}

.nearby-map-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.nearby-map-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.nearby-map-toolbar-filters {
  flex: 0 1 280px;
  min-width: 180px;
  max-width: 320px;
  margin-left: auto;
}

.nearby-filters-form--inline {
  margin: 0;
}

.nearby-map-layer-filter {
  width: 100%;
  max-width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.nearby-map-layer-filter:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}

.nearby-map-tab {
  appearance: none;
  border: 1px solid var(--border, #cbd5e1);
  background: #fff;
  color: #0f172a;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nearby-map-tab:hover:not(:disabled) {
  border-color: #94a3b8;
}

.nearby-map-tab--active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.nearby-map-tab--disabled,
.nearby-map-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nearby-map {
  position: relative;
  flex: 1 1 auto;
  min-height: 180px;
  width: 100%;
  overflow: hidden;
}

.nearby-map-pin {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 88px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -100%);
  text-align: center;
  font: inherit;
  color: inherit;
}

.nearby-map-pin__cover {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.28);
  background: #e2e8f0;
}

.nearby-map-pin__cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nearby-map-pin__cover--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
}

.nearby-map-pin__title {
  margin-top: 4px;
  max-width: 88px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  color: #0f172a;
  text-shadow:
    0 1px 0 #fff,
    0 -1px 0 #fff,
    1px 0 0 #fff,
    -1px 0 0 #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nearby-map-cluster {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--cluster-color, #0f172a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  border: 2px solid #fff;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.32);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.nearby-map-fallback {
  padding: 10px 12px;
  font-size: 13px;
}

.nearby-map-empty {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  pointer-events: none;
}

.nearby-filters-panel {
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.nearby-filters-form {
  margin: 0;
}

.nearby-filters-form--events {
  margin: 0;
  width: 100%;
}

.nearby-refine-dropdown,
.nearby-event-filters-dropdown {
  position: relative;
  width: 100%;
}

.nearby-filters-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}

.nearby-filters-trigger:hover,
.nearby-event-filters-dropdown.is-open .nearby-filters-trigger {
  border-color: #94a3b8;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.nearby-filters-trigger--active {
  border-color: #2563eb;
  background: #f8fbff;
}

.nearby-filters-trigger-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1 1 auto;
}

.nearby-filters-trigger-kicker {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.nearby-filters-trigger-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  .nearby-map-toolbar-filters {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
  }
}

.nearby-filters-trigger-extra {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  padding: 2px 7px;
}

.nearby-filters-trigger-chevron {
  flex-shrink: 0;
  color: #64748b;
  transition: transform 0.15s ease;
}

.nearby-refine-popover,
.nearby-event-filters-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  width: min(360px, calc(100vw - 24px));
  z-index: 30;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.nearby-refine-popover[hidden],
.nearby-event-filters-popover[hidden] {
  display: none !important;
}

.nearby-event-filters-dropdown.is-open .nearby-filters-trigger-chevron,
.nearby-refine-dropdown.is-open .nearby-filters-trigger-chevron {
  transform: rotate(180deg);
}

.nearby-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.nearby-filters-row--tags {
  align-items: flex-start;
}

.nearby-filters-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}

.nearby-filters-label {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  width: 100%;
}

.nearby-filters-label--inline {
  font-weight: 600;
  color: #64748b;
  width: auto;
}

.nearby-filters-select {
  min-width: 220px;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.nearby-filters-select--full,
.nearby-filters-input--full {
  width: 100%;
  min-width: 0;
}

.nearby-filters-select--compact {
  min-width: 140px;
}

.nearby-filters-input {
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
}

.nearby-filters-input--price {
  min-width: 88px;
  max-width: 110px;
}

.nearby-tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  margin-top: 2px;
}

.nearby-tag-chip {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.nearby-tag-chip:hover,
.nearby-tag-chip--active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.nearby-list-panel {
  flex: 1 1 auto;
  overflow: auto;
  padding: 16px 12px 24px;
}

.nearby-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.nearby-list-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.nearby-region-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.nearby-region-form input {
  min-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
}

.nearby-events-grid {
  margin-top: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .nearby-page {
    margin: -0.75rem -0.5rem 0;
  }

  .nearby-map-panel {
    height: 45vh;
    min-height: 260px;
  }

  .nearby-map {
    min-height: 160px;
  }

  .nearby-map-tabs {
    gap: 6px;
    padding: 8px;
  }

  .nearby-map-tab {
    padding: 6px 10px;
    font-size: 12px;
  }

  .nearby-list-head {
    flex-direction: column;
    align-items: stretch;
  }

  .nearby-region-form {
    width: 100%;
  }

  .nearby-region-form input {
    flex: 1;
    min-width: 0;
  }
}
