#mapWrap {
  position: relative;
}

#map {
  height: 80vh;
  width: 100%;
  overflow: hidden;
  touch-action: pan-x pan-y pinch-zoom;
  overscroll-behavior: contain;
}

@media (pointer: coarse) {
  /* No mobile, bloqueia pinch/zoom da página em toda a área do mapa (inclui controles sobrepostos). */
  #mapWrap,
  #mapWrap * {
    touch-action: none;
  }
}

#mapWrap.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1030;
}

#mapWrap.fullscreen #map {
  height: 100%;
  width: 100%;
  border-radius: 0;
}

#mapError {
  max-width: 680px;
}

#mapLoading {
  position: absolute;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.75);
  touch-action: none;
}

#mapLoading.is-hidden {
  display: none;
  pointer-events: none;
}

.map-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.15);
}

.map-loading-text {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
}

#editorPanel,
#imageEditorV2Panel,
#drawPanel {
  z-index: 1040;
}

@media (max-width: 991.98px) {
  #editorPanel,
  #imageEditorV2Panel,
  #drawPanel {
    position: static !important;
    width: 100% !important;
    margin: 0 0 1rem 0 !important;
  }
}

.map-controls {
  position: absolute;
  right: 14px;
  bottom: 18px;
  top: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.map-controls button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #ffffff;
  color: #0d6efd;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-controls button img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  object-position: center;
}

.map-stats {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  pointer-events: none;
}

.map-watermark {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 1000;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  user-select: none;
}

#lotModal .modal-dialog {
  max-width: 360px;
}

#lotModal .modal-footer {
  justify-content: flex-end;
}

#lotModal .modal-footer > .d-flex {
  order: 1;
}

#lotModalDelete {
  order: 2;
  margin-left: 12px;
}

.map-stat-card {
  width: 88px;
  height: 88px;
  padding: 6px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.map-stat-title {
  font-size: 11px;
  letter-spacing: 0.08em;
}

.map-stat-value {
  font-size: 26px;
}

.map-stat-subtitle {
  font-size: 11px;
}

.map-stat-subtitle.placeholder {
  visibility: hidden;
}

.map-stat-percent {
  padding-top: 2px;
}

.map-controls button:hover {
  background: #f1f1f1;
}

.map-controls button:active {
  transform: scale(0.96);
}
