/* SmartMap SMC — visor Leaflet (capa cartográfica sobre estilos La Martona). */

.map-wrap.is-leaflet-viewer .map-scroller {
  display: none !important;
}

/* Avisos breves (map-hint--notice) por encima del contenedor Leaflet y sus controles. */
.map-wrap.is-leaflet-viewer .map-hint.map-hint--notice {
  z-index: 1310;
}

.map-leaflet,
#mapLeaflet {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #e8dcc8;
}

.map-wrap.is-map-loading .map-leaflet {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.leaflet-uf-marker {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  width: 40px !important;
  height: 40px !important;
  margin-left: -20px !important;
  margin-top: -20px !important;
  cursor: pointer;
}

.leaflet-uf-marker::before,
.leaflet-uf-marker::after {
  display: none;
  content: none;
}

.leaflet-uf-marker.selected {
  z-index: 900 !important;
  width: 68px !important;
  height: 68px !important;
  margin-left: -34px !important;
  margin-top: -34px !important;
  background: transparent !important;
}

.leaflet-uf-marker.selected::before {
  display: block;
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid var(--accent);
  box-shadow:
    0 0 0 1px rgba(0, 26, 66, .35),
    0 0 0 7px rgba(149, 128, 11, .14),
    0 2px 10px rgba(0, 26, 66, .28);
  pointer-events: none;
}

.leaflet-uf-marker.selected::after {
  display: block;
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: var(--accent);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, .92),
    0 1px 4px rgba(0, 26, 66, .45);
  pointer-events: none;
}

.leaflet-lote-marker,
.leaflet-infra-marker,
.leaflet-place-marker,
.leaflet-route-marker {
  background: transparent !important;
  border: 0 !important;
}

/* Marcadores Leaflet: el HTML usa badge+label, no el contenedor .command-category-marker
   del plano raster. Sin estas reglas queda el recuadro gris de .leaflet-div-icon y
   las etiquetas se superponen al ícono. */
.leaflet-marker-icon.leaflet-div-icon.smartmap-marker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  padding: 0;
  pointer-events: auto;
}

.map-leaflet .smartmap-marker .command-category-marker-badge {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid var(--accent, #f4df36);
  background: var(--lm-gradient-green);
  color: #fff;
  box-shadow:
    0 0 0 5px rgba(244, 223, 54, 0.22),
    0 4px 12px rgba(0, 0, 0, 0.38);
}

.map-leaflet .smartmap-marker .command-category-marker-badge[data-tono="azul"] {
  background: var(--smc-gradient-blue);
}

.map-leaflet .smartmap-marker .command-category-marker-badge[data-tono="verde"] {
  background: var(--smc-gradient-green);
}

.map-leaflet .smartmap-marker .command-category-marker-badge svg {
  width: 18px;
  height: 18px;
  display: block;
}

.map-leaflet .smartmap-marker .command-category-marker-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 3px);
  transform: translateX(-50%);
  display: none;
  max-width: min(172px, 42vw);
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(61, 22, 23, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
  overflow: visible;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.map-leaflet .smartmap-marker:hover .command-category-marker-label,
.map-leaflet .smartmap-marker:focus-visible .command-category-marker-label {
  border-color: rgba(244, 223, 54, 0.45);
  background: rgba(103, 41, 42, 0.96);
}

.map-leaflet .smartmap-marker.is-highlighted .command-category-marker-badge {
  box-shadow:
    0 0 0 5px rgba(244, 223, 54, 0.34),
    0 0 0 9px rgba(244, 223, 54, 0.12),
    0 4px 14px rgba(0, 0, 0, 0.42);
}

.map-leaflet .smartmap-marker.is-selected {
  z-index: 1000 !important;
}

/* Anillo centrado en la chapa del marcador (no en el contenedor Leaflet):
   en zoom bajo el badge se escala con is-compact-markers; si el anillo vive en
   el contenedor con top fijo y scale aparte, en móvil queda desfasado. */
.map-leaflet .smartmap-marker.is-selected .command-category-marker-badge::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 3px solid var(--accent);
  box-shadow:
    inset 0 0 0 1px rgba(12, 19, 33, 0.35),
    0 0 0 1.5px rgba(255, 255, 255, 0.95),
    0 0 0 7px rgba(244, 223, 54, 0.16),
    0 2px 12px rgba(12, 19, 33, 0.28);
  pointer-events: none;
  z-index: 0;
}

.map-leaflet .smartmap-marker.is-selected .command-category-marker-badge svg {
  position: relative;
  z-index: 1;
}

@media (min-width: 768px) {
  .map-leaflet .smartmap-marker .command-category-marker-label {
    max-width: 188px;
    font-size: 11.5px;
  }
}

@media (max-width: 480px) {
  .map-leaflet .smartmap-marker .command-category-marker-label {
    max-width: min(148px, 46vw);
    font-size: 10.5px;
    padding: 3px 8px;
  }
}

.leaflet-geo-debug-panel {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1200;
  background: rgba(0, 36, 98, 0.88);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  max-width: 220px;
  pointer-events: auto;
}

.smartmap-plan-overlay {
  image-rendering: auto;
}

.map-leaflet.show-place-labels .smartmap-marker .command-category-marker-label {
  display: block;
}

html[data-basemap-ui="ilustracion"] .map-plan-reference-note {
  display: block;
}

.map-plan-reference-note[hidden] {
  display: none !important;
}

/* —— Fondo Ilustración —— */

.map-leaflet .smc-illustration-image {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none !important;
  max-height: none !important;
  transform-origin: 0 0;
  user-select: none;
  -webkit-user-drag: none;
}

/* Vista general (sobre todo en celular): marcadores más chicos para que se vea el dibujo.
   Se escala el contenido, no el contenedor: Leaflet posiciona el contenedor con transform. */
.map-leaflet.is-compact-markers .leaflet-place-marker .command-category-marker-badge {
  scale: 0.7;
}

.map-leaflet .leaflet-place-marker .command-category-marker-badge {
  transition: scale 0.18s ease;
}

/* —— Canchas: área táctil invisible —— */
.map-leaflet path.smartmap-place-polygon--hit {
  cursor: pointer;
}

.map-leaflet path.smartmap-place-polygon--hit:focus {
  outline: none;
}

/* Contornos visibles solo con ?contornos=1 (control de calibración). */
.map-leaflet.is-polygon-debug path.smartmap-place-polygon {
  cursor: pointer;
  transition: fill-opacity 0.15s ease, stroke-width 0.12s ease;
}

.map-leaflet.is-polygon-debug path.smartmap-place-polygon:hover {
  fill-opacity: 0.18;
}

/* —— Menú Lugares: título y subtítulo en dos líneas —— */
#placesMenu .places-menu-item-label.places-menu-place-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: visible;
  text-overflow: unset;
  white-space: normal;
  line-height: 1.25;
}

#placesMenu .places-menu-item-label.places-menu-place-text .places-menu-share-title {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  font-weight: 600;
}

#placesMenu .places-menu-item-label.places-menu-place-text .places-menu-share-sub {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
