/* Bloque del shortcode: 100% del ancho del padre; el plugin controla el render responsive completo. */
.lpm-map-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.lpm-map-wrap--ratio .lpm-map {
  width: 100%;
  height: 100% !important;
  min-height: 0;
}

/* Pantalla completa del contenedor (p. ej. Elementor). */
.lpm-map-wrap--fill {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}

.lpm-map-wrap--fill .lpm-map {
  flex: 1 1 auto;
  width: 100%;
  height: 100% !important;
  min-height: 0;
}

/* Sin dimensiones del overlay y sin height en shortcode: evita colapso del stage. */
.lpm-map-wrap:not(.lpm-map-wrap--ratio):not(.lpm-map-wrap--fill) .lpm-map {
  min-height: 200px;
}

.lpm-map-wrap--fill:not([style*="min-height"]) .lpm-map {
  min-height: 200px;
}

/* Elementor: contener el widget del shortcode sin requerir retoques manuales. */
.elementor-widget-shortcode:has(.lpm-map-wrap) {
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.elementor-widget-shortcode:has(.lpm-map-wrap--fill) {
  height: 100%;
  align-self: stretch;
}

.elementor-widget-shortcode:has(.lpm-map-wrap--fill) .elementor-widget-container {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.elementor-widget-shortcode:has(.lpm-map-wrap--fill) .elementor-widget-container > .lpm-map-wrap {
  flex: 1 1 auto;
  min-height: 0;
}

.lpm-map {
  position: relative;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.lpm-map-stage {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: inherit;
  overflow: hidden;
}

.lpm-map-stage-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.lpm-map-markers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lpm-map-marker {
  position: absolute;
  pointer-events: none;
}

.lpm-map .lpm-map-marker-button {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  cursor: default;
  pointer-events: auto;
}

.lpm-map .lpm-map-marker-button:hover,
.lpm-map .lpm-map-marker-button:active {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: inherit;
}

.lpm-map .lpm-map-marker-button:focus-visible {
  outline: 2px solid rgba(55, 178, 77, 0.95);
  outline-offset: 4px;
}

.lpm-pin-with-count {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.lpm-pin-with-count-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  vertical-align: top;
}

.lpm-pin-count-badge {
  position: absolute;
  right: -4px;
  bottom: 12px;
  box-sizing: border-box;
  min-width: 18px;
  min-height: 18px;
  padding: 2px 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid rgba(55, 178, 77, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  color: #1a1a1a;
  pointer-events: none;
}

.lpm-map-tooltip {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, calc(-1 * var(--lpm-tooltip-gap, 10px)));
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  color: #222;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  max-width: min(320px, 90vw);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.lpm-map-marker-button:hover .lpm-map-tooltip,
.lpm-map-marker-button:focus-visible .lpm-map-tooltip {
  opacity: 1;
  visibility: visible;
}

/* Estado visible dentro del mapa para no alterar el alto del wrapper. */
.lpm-map-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 15;
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  color: #222;
  font-size: 13px;
  line-height: 1.25;
  pointer-events: none;
}

.lpm-map-status:empty {
  display: none;
}

.lpm-map-debug {
  display: none;
  margin-top: 12px;
  padding: 12px;
  background: #f6f6f6;
  border: 1px solid #ddd;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  max-height: 480px;
  overflow: auto;
  color: #111;
}
