/* Half-map stack: map + floating legend */
.half-map-right-wrap .thessnest-halfmap-stack {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
}

.half-map-right-wrap .thessnest-halfmap-stack #homey-halfmap {
  position: relative;
  z-index: 1;
}

/* Floating legend (Airbnb-style card) */
.thessnest-halfmap-zone-legend {
  position: absolute;
  top: 64px;
  right: 16px;
  z-index: 500;
  width: auto;
  max-width: 220px;
  padding: 12px 14px;
  margin: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.12),
    0 0 1px rgba(0, 0, 0, 0.08);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  pointer-events: auto;
}

.thessnest-zone-legend-title {
  margin: 0 0 10px;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #222;
}

.thessnest-zone-legend-item {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0 0 8px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: #333;
  transition: background 0.15s ease;
}

.thessnest-zone-legend-item:last-child {
  margin-bottom: 0;
}

.thessnest-zone-legend-item:hover,
.thessnest-zone-legend-item:focus {
  background: rgba(0, 0, 0, 0.05);
  outline: none;
}

.thessnest-zone-legend-item:focus-visible {
  box-shadow: 0 0 0 2px #2563eb;
}

.thessnest-zone-legend-swatch {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.thessnest-zone-legend-swatch--poli-tsinari {
  background: rgba(247, 148, 29, 0.35);
  border-color: #f7941d;
}

.thessnest-zone-legend-swatch--east {
  background: rgba(22, 163, 74, 0.35);
  border-color: #16a34a;
}

.thessnest-zone-legend-swatch--centre {
  background: rgba(37, 99, 235, 0.35);
  border-color: #2563eb;
}

.thessnest-zone-legend-label {
  flex: 1;
}

@media (max-width: 767px) {
  .thessnest-halfmap-zone-legend {
    top: 10px;
    right: 10px;
    max-width: 200px;
    padding: 10px 12px;
    font-size: 12px;
  }
}
