.tribe-map {
  --menu-section-pad-x: clamp(0.75rem, 3vw, 1.5rem);
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: 50%;
  margin-right: 0;
  transform: translateX(-50%);
  box-sizing: border-box;
}

.tribe-map > .menu-db-loading,
.tribe-map > .menu-db-empty {
  text-align: center;
  padding: 2rem 1rem;
  max-width: min(100%, 960px);
  margin-inline: auto;
}

.tribe-map__shell {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  min-height: clamp(280px, 42vw, 520px);
  border-radius: 0;
  overflow: hidden;
  border-top: 1px solid rgba(156, 173, 96, 0.28);
  border-bottom: 1px solid rgba(156, 173, 96, 0.28);
  border-left: 0;
  border-right: 0;
  box-shadow: none;
  background: #0b0f0d;
}

.tribe-map__search {
  position: absolute;
  top: clamp(0.65rem, 2vw, 0.85rem);
  left: clamp(0.65rem, 2vw, 0.85rem);
  right: auto;
  width: clamp(250px, 28vw, 320px);
  max-width: calc(100% - clamp(1.3rem, 4vw, 1.7rem));
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem 0.5rem;
  align-items: stretch;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: auto;
  --tribe-map-search-control-height: 2.45rem;
}

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

.tribe-map__search-input {
  grid-column: 1 / 2;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  height: var(--tribe-map-search-control-height);
  margin: 0;
  padding: 0 0.7rem;
  border: 1px solid rgba(156, 173, 96, 0.35);
  border-radius: 999px;
  background: #fff;
  color: #1a2418;
  font-family: var(--font-body, "Space Grotesk", system-ui, sans-serif);
  font-size: 0.84rem;
  line-height: 1.2;
}

.tribe-map__search-input::placeholder {
  color: rgba(26, 36, 24, 0.45);
}

.tribe-map__search-input:focus {
  outline: none;
  border-color: #9cad60;
  box-shadow: 0 0 0 3px rgba(156, 173, 96, 0.22);
}

.tribe-map__search-btn {
  grid-column: 2 / 3;
  grid-row: 1;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--tribe-map-search-control-height);
  margin: 0;
  padding: 0 0.95rem;
  border: 0;
  border-radius: 999px;
  background: var(--lime, #fb5b00);
  color: #fff;
  font-family: var(--font-body, "Space Grotesk", system-ui, sans-serif);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.tribe-map__search-btn:hover {
  filter: brightness(1.05);
}

.tribe-map__search-status {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.72);
}

.tribe-map__search-status[hidden] {
  display: none;
}

.tribe-map__compare {
  position: absolute;
  inset: 0;
  z-index: 900;
  background: #000;
}

.tribe-map__compare[hidden] {
  display: none !important;
}

.tribe-map__compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.tribe-map__compare-item {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 0;
  background: var(--compare-bg, #0b0f0d);
  overflow: hidden;
}

.tribe-map__compare-label {
  margin: 0;
  padding: 0.45rem 0.65rem 0.25rem;
  font-family: var(--font-body, "Space Grotesk", system-ui, sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(0, 0, 0, 0.55);
}

.tribe-map__compare-canvas {
  min-height: 0;
  width: 100%;
  height: 100%;
}

.tribe-map__compare-choose {
  margin: 0.35rem 0.55rem 0.45rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(156, 173, 96, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-family: var(--font-body, "Space Grotesk", system-ui, sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  justify-self: start;
}

.tribe-map__compare-choose:hover {
  border-color: var(--lime, #fb5b00);
  color: var(--lime, #fb5b00);
}

.tribe-map__compare-toggle {
  position: absolute;
  right: clamp(0.65rem, 2vw, 0.85rem);
  bottom: clamp(0.65rem, 2vw, 0.85rem);
  z-index: 1100;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(8, 12, 10, 0.88);
  color: #fff;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.tribe-map__compare-toggle:hover {
  border-color: rgba(156, 173, 96, 0.55);
}

.tribe-map__shell--compare .tribe-map__canvas {
  visibility: hidden;
}

.tribe-map__shell--compare .leaflet-control-zoom {
  display: none;
}

.tribe-map__canvas {
  width: 100%;
  height: 100%;
  min-height: clamp(280px, 42vw, 520px);
  background: #0b0f0d;
}

.tribe-map .leaflet-container {
  width: 100%;
  height: 100%;
  font-family: var(--font-body, "Space Grotesk", system-ui, sans-serif);
  background: #0b0f0d;
}

.tribe-map .leaflet-tile-pane img.leaflet-tile {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.tribe-map .leaflet-zoom-animated {
  will-change: transform;
}

.tribe-map .leaflet-control-zoom a {
  background: rgba(18, 22, 20, 0.92);
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(156, 173, 96, 0.35);
}

.tribe-map .leaflet-control-zoom a:hover {
  background: rgba(156, 173, 96, 0.22);
  color: #fff;
}

.tribe-map .leaflet-top.leaflet-left {
  top: 4.75rem;
}

.tribe-map .leaflet-control-attribution {
  background: rgba(8, 12, 10, 0.82);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.62rem;
}

.tribe-map .leaflet-control-attribution a {
  color: rgba(156, 173, 96, 0.9);
}

.tribe-map__marker-wrap {
  background: transparent;
  border: 0;
}

.tribe-map__pulse-dot {
  position: relative;
  width: var(--dot-size, 12px);
  height: var(--dot-size, 12px);
}

.tribe-map__pulse-dot-core {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #9cad60;
  box-shadow:
    0 0 0 2px rgba(156, 173, 96, 0.35),
    0 0 12px rgba(156, 173, 96, 0.45);
  z-index: 2;
}

.tribe-map__pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(156, 173, 96, 0.55);
  transform: scale(1);
  opacity: 0.65;
  animation: tribe-map-pulse 2.4s ease-out infinite;
  z-index: 1;
}

.tribe-map__pulse-ring--delayed {
  animation-delay: 1.2s;
}

.tribe-map__pin {
  display: block;
  width: 12px;
  height: 16px;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
}

.tribe-map__pin-shape {
  fill: #ffffff;
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 0.8;
}

.tribe-map__restaurant-cluster {
  --cluster-size: 20px;
  width: var(--cluster-size);
  height: var(--cluster-size);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.tribe-map__restaurant-cluster span {
  font-family: var(--font-body, "Space Grotesk", system-ui, sans-serif);
  font-size: clamp(0.48rem, 1vw, 0.56rem);
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

.tribe-map__legend {
  position: absolute;
  top: clamp(0.65rem, 2vw, 0.85rem);
  right: clamp(0.65rem, 2vw, 0.85rem);
  z-index: 1000;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(8, 12, 10, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  pointer-events: auto;
}

.tribe-map__legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  transition:
    color 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.tribe-map__legend-toggle.is-active {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.tribe-map__legend-toggle:hover {
  color: rgba(255, 255, 255, 0.82);
}

.tribe-map__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.82);
}

.tribe-map__legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tribe-map__legend-dot--user {
  background: #9cad60;
  box-shadow: 0 0 8px rgba(156, 173, 96, 0.55);
}

.tribe-map__legend-dot--restaurant {
  background: #fb5b00;
  box-shadow: 0 0 8px rgba(251, 91, 0, 0.55);
}

.tribe-map__legend-pin {
  position: relative;
  width: 6px;
  height: 8px;
  flex-shrink: 0;
}

.tribe-map__legend-pin::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  transform-origin: 50% 80%;
}

@keyframes tribe-map-pulse {
  0% {
    transform: scale(1);
    opacity: 0.65;
  }

  100% {
    transform: scale(2.75);
    opacity: 0;
  }
}

.tribe-map__popup-wrap--restaurant .leaflet-popup-content-wrapper {
  border-color: rgba(251, 91, 0, 0.35);
}

.tribe-map__popup-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 9.5rem;
  overflow-y: auto;
}

.tribe-map__popup-list-item {
  margin: 0;
}

.tribe-map__popup-list-link {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #fff;
  text-decoration: none;
}

.tribe-map__popup-list-link:hover {
  color: #fb5b00;
}

.tribe-map__popup-more {
  margin: 0.45rem 0 0;
  font-size: 0.65rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.58);
}

.tribe-map__popup-wrap .leaflet-popup-content-wrapper {
  background: rgba(8, 12, 10, 0.95);
  border: 1px solid rgba(156, 173, 96, 0.35);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  color: #fff;
}

.tribe-map__popup-wrap .leaflet-popup-tip {
  background: rgba(8, 12, 10, 0.95);
  border: 1px solid rgba(156, 173, 96, 0.35);
  box-shadow: none;
}

.tribe-map__popup-wrap .leaflet-popup-content {
  margin: 0.55rem 0.7rem;
  line-height: 1.3;
}

.tribe-map__popup {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tribe-map__popup-name {
  font-size: 0.82rem;
  font-weight: 600;
}

.tribe-map__popup-city {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.72);
}

.tribe-map__popup-meta {
  font-size: 0.65rem;
  color: rgba(156, 173, 96, 0.95);
}

.tribe-map__popup-meta--restaurant {
  color: rgba(251, 91, 0, 0.95);
}

.tribe-map__popup-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fb5b00;
  text-decoration: none;
}

.tribe-map__popup-link:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .tribe-map__pulse-ring {
    animation: none;
    opacity: 0.35;
    transform: scale(1.35);
  }

  .tribe-map__pulse-ring--delayed {
    display: none;
  }
}

@media (max-width: 640px) {
  .tribe-map__shell {
    aspect-ratio: 4 / 3;
    min-height: clamp(240px, 70vw, 420px);
  }

  .tribe-map__compare-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, minmax(140px, 1fr));
    overflow-y: auto;
  }

  .tribe-map__compare-toggle {
    left: clamp(0.65rem, 2vw, 0.85rem);
    right: auto;
    max-width: calc(100% - 1.3rem);
  }

  .tribe-map__canvas {
    min-height: clamp(240px, 70vw, 420px);
  }

  .tribe-map .leaflet-top.leaflet-left {
    top: 5.5rem;
  }

  .tribe-map__legend {
    top: auto;
    bottom: 3.5rem;
    right: clamp(0.65rem, 2vw, 0.85rem);
    left: auto;
  }
}
