/* Mapa Red BAMX - estilos del plugin.
   Adaptado desde style.css: se retiraron las reglas globales (*, html, body)
   porque en WordPress afectarian a todo el tema. */

:root {
  --bamx-verde: #97b7a4;
  --bamx-verde-hover: #7aa58b;
  --bamx-rojo: #c82032;
  --bamx-rojo-hover: #e12d3e;
  --bamx-hoja: #2f7f3d;
  --sin-cobertura: #d7dcd8;
  --sin-cobertura-hover: #c4cbc6;
}

.mapa-bamx, .mapa-bamx *, .mapa-tooltip, .mapa-tooltip * { box-sizing: border-box; }

.mapa-bamx {
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
}

.mapa-bamx__svg-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.mapa-mexico-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* Solo los estados, no las manzanitas */
.mapa-mexico-svg #features > path {
  fill: var(--sin-cobertura) !important;
  stroke: #ffffff !important;
  stroke-width: 1.6 !important;
  transition: fill .18s ease, filter .18s ease;
}

.mapa-mexico-svg #features > path.tiene-cobertura {
  fill: var(--bamx-verde) !important;
}

/* Hover de estados con cobertura */
.mapa-mexico-svg #features > path.tiene-cobertura:hover,
.mapa-mexico-svg #features > path.tiene-cobertura:focus-visible {
  fill: var(--bamx-verde-hover) !important;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.16));
  outline: none;
}

/* Durango y Guerrero: gris un poco más oscuro al pasar el cursor */
.mapa-mexico-svg #features > path:not(.tiene-cobertura):hover,
.mapa-mexico-svg #features > path:not(.tiene-cobertura):focus-visible {
  fill: var(--sin-cobertura-hover) !important;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.12));
  outline: none;
}

#label_points,
#points { display: none; }

.bamx-marker {
  cursor: pointer;
  outline: none;
}

.bamx-marker__halo {
  display: none;
}

.bamx-marker__manzana {
  fill: var(--bamx-rojo) !important;
  stroke: #971824 !important;
  stroke-width: .8;
}

.bamx-marker__hoja {
  fill: var(--bamx-hoja) !important;
  stroke: none !important;
}

.bamx-marker__tallo {
  fill: none !important;
  stroke: var(--bamx-hoja) !important;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.bamx-marker:hover,
.bamx-marker:focus-visible {
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.32));
}

.bamx-marker:hover .bamx-marker__halo,
.bamx-marker:focus-visible .bamx-marker__halo {
  fill: #ffffff;
  stroke: var(--bamx-rojo);
  stroke-width: 2;
}

.bamx-marker:hover .bamx-marker__manzana,
.bamx-marker:focus-visible .bamx-marker__manzana {
  fill: var(--bamx-rojo-hover) !important;
}

.mapa-tooltip {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100vw - 12px);
  filter: drop-shadow(0 5px 9px rgba(0,0,0,.18));
}

.mapa-tooltip.is-flipped {
  flex-direction: row-reverse;
}

.mapa-tooltip[hidden] {
  display: none !important;
}

.mapa-tooltip__pin {
  display: block;
  width: 32px;
  height: auto;
  flex: 0 0 auto;
}

.mapa-tooltip__label {
  display: flex;
  align-items: center;
  min-height: 32px;
  max-width: min(470px, 58vw);
  padding: 6px 10px;
  background: rgba(75, 54, 43, .88);
  color: #ffffff;
  font-family: Montserrat, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  border-radius: 15px 15px 15px 0;
}

/* Tablet */
@media (max-width: 1024px) {
  .mapa-tooltip { gap: 4px; }
  .mapa-tooltip__pin { width: 27px; }
  .mapa-tooltip__label {
    min-height: 30px;
    max-width: min(420px, 62vw);
    padding: 6px 9px;
    font-size: 13px;
    border-radius: 14px 14px 14px 0;
  }
}

/* Celular */
@media (max-width: 600px) {
  .mapa-tooltip { gap: 4px; }
  .mapa-tooltip__pin { width: 30px; }
  .mapa-tooltip__label {
    min-height: 28px;
    max-width: min(280px, 72vw);
    padding: 5px 8px;
    font-size: 12px;
    line-height: 1.25;
    border-radius: 12px 12px 12px 0;
  }
}

/* Celulares muy pequeños */
@media (max-width: 380px) {
  .mapa-tooltip__pin { width: 25px; }
  .mapa-tooltip__label {
    max-width: 70vw;
    padding: 5px 7px;
    font-size: 11px;
  }
}


/* Marcadores pequeños, como en el mapa institucional */
.bamx-marker__manzana {
  vector-effect: non-scaling-stroke;
}

.bamx-marker--cobertura {
  cursor: pointer;
}

.bamx-box__body {
  fill: #b99063;
  stroke: #5d4730;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.bamx-box__flap {
  fill: #d1aa78;
  stroke: #5d4730;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.bamx-box__mark {
  fill: #3f713d;
  stroke: none;
}

.bamx-marker--cobertura:hover,
.bamx-marker--cobertura:focus-visible {
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.35));
}

.bamx-box__pin { fill:#8aa889; stroke:#496447; stroke-width:1; }
.bamx-box__pin-hole { fill:#f4d36d; stroke:none; }
