#mapsvg-map-3 .mapsvg svg,
#mapsvg-map-4 .mapsvg svg,
#mapsvg-map-5 .mapsvg svg,
#mapsvg-map-3 .mapsvg-marker,
#mapsvg-map-4 .mapsvg-marker,
#mapsvg-map-5 .mapsvg-marker,
#mapsvg-map-3 .mapsvg-marker-cluster,
#mapsvg-map-4 .mapsvg-marker-cluster,
#mapsvg-map-5 .mapsvg-marker-cluster,
#mapsvg-map-3 .mapsvg-region-label,
#mapsvg-map-4 .mapsvg-region-label,
#mapsvg-map-5 .mapsvg-region-label,
#mapsvg-map-3 .mapsvg-bubble,
#mapsvg-map-4 .mapsvg-bubble,
#mapsvg-map-5 .mapsvg-bubble,
#mapsvg-map-3 .mapsvg-popover,
#mapsvg-map-4 .mapsvg-popover,
#mapsvg-map-5 .mapsvg-popover {
  transition: none !important;
}

.mapsvg .mapsvg-buttons {
  margin: 16px;
}

.mapsvg .mapsvg-btn-group {
  margin-bottom: 8px;
  overflow: hidden;
  background: #FFFFFF;
  border: 1px solid #EEEAEA;
  border-radius: 5px;
  box-shadow: none;
}

.mapsvg .mapsvg-btn-map,
.mapsvg .mapsvg-btn {
  width: 44px;
  height: 44px;
  padding: 0;
  line-height: 44px;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background: #FFFFFF;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.mapsvg .mapsvg-btn-map:hover,
.mapsvg .mapsvg-btn:hover {
  background: #F7F7F7;
}

.mapsvg .mapsvg-btn-map:focus-visible,
.mapsvg .mapsvg-btn:focus-visible {
  outline: 2px solid #202154 !important;
  outline-offset: -2px;
}

.mapsvg .mapsvg-btn-map.mapsvg-in {
  border-bottom: 1px solid #EEEAEA;
}

.mapsvg .mapsvg-btn-map.mapsvg-in:before,
.mapsvg .mapsvg-btn-map.mapsvg-out:before {
  top: 21px;
  left: 12px;
  width: 20px;
  height: 2px;
  background-color: #202154;
}

.mapsvg .mapsvg-btn-map.mapsvg-in:after {
  top: 12px;
  left: 21px;
  width: 2px;
  height: 20px;
  background-color: #202154;
}

.mapsvg .mapsvg-btn-zoom-reset,
.mapsvg .alcaidesa-mapsvg-fullscreen {
  display: grid !important;
  place-items: center;
  line-height: 0 !important;
  overflow: visible !important;
}

.mapsvg .alcaidesa-map-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  pointer-events: none;
}

/* Reencuadrar: diana sencilla y legible */
.mapsvg .alcaidesa-map-icon-reset::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid #202154;
  border-radius: 50%;
  box-sizing: border-box;
}

.mapsvg .alcaidesa-map-icon-reset::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(#202154, #202154) center top / 2px 5px no-repeat,
    linear-gradient(#202154, #202154) center bottom / 2px 5px no-repeat,
    linear-gradient(#202154, #202154) left center / 5px 2px no-repeat,
    linear-gradient(#202154, #202154) right center / 5px 2px no-repeat;
}

/* Fullscreen: cuatro esquinas dibujadas con bordes */
.mapsvg .alcaidesa-map-icon-fullscreen,
.mapsvg .alcaidesa-map-icon-exit-fullscreen {
  background:
    linear-gradient(#202154, #202154) left top / 7px 2px no-repeat,
    linear-gradient(#202154, #202154) left top / 2px 7px no-repeat,
    linear-gradient(#202154, #202154) right top / 7px 2px no-repeat,
    linear-gradient(#202154, #202154) right top / 2px 7px no-repeat,
    linear-gradient(#202154, #202154) left bottom / 7px 2px no-repeat,
    linear-gradient(#202154, #202154) left bottom / 2px 7px no-repeat,
    linear-gradient(#202154, #202154) right bottom / 7px 2px no-repeat,
    linear-gradient(#202154, #202154) right bottom / 2px 7px no-repeat;
}

.mapsvg .alcaidesa-map-icon-exit-fullscreen {
  transform: scale(0.78);
}

.mapsvg .alcaidesa-map-icon-exit-fullscreen::before,
.mapsvg .alcaidesa-map-icon-exit-fullscreen::after {
  content: "";
  position: absolute;
  inset: 4px;
}
.mapsvg-wrap-all.alcaidesa-mapsvg-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  background: #FFFFFF !important;
  display: flex !important;
  flex-direction: column !important;
}

body.alcaidesa-mapsvg-fullscreen-open {
  overflow: hidden !important;
}

/* El fullscreen se mueve al final de <body>. Ocultamos ademas la navegacion
   para evitar cualquier stacking context/z-index extremo del header o megamenu. */
body.alcaidesa-mapsvg-fullscreen-open #masthead,
body.alcaidesa-mapsvg-fullscreen-open #site-navigation,
body.alcaidesa-mapsvg-fullscreen-open #mobile-menu-control-wrapper,
body.alcaidesa-mapsvg-fullscreen-open .alcaidesa-menu-dropdown {
  visibility: hidden !important;
  pointer-events: none !important;
}

.mapsvg-wrap-all.alcaidesa-mapsvg-fullscreen .mapsvg-wrap,
.mapsvg-wrap-all.alcaidesa-mapsvg-fullscreen .mapsvg-map-container,
.mapsvg-wrap-all.alcaidesa-mapsvg-fullscreen .mapsvg {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 0 !important;
}

.mapsvg-wrap-all.alcaidesa-mapsvg-fullscreen .mapsvg-wrap,
.mapsvg-wrap-all.alcaidesa-mapsvg-fullscreen .mapsvg-map-container {
  flex: 1 1 auto !important;
}

.mapsvg-wrap-all.alcaidesa-mapsvg-fullscreen .mapsvg {
  padding-bottom: 0 !important;
}

@media (max-width: 767px) {
  .mapsvg .mapsvg-buttons {
    margin: 8px;
  }

  .mapsvg .mapsvg-btn-group {
    margin-bottom: 6px;
    border-radius: 6px;
  }

  .mapsvg .alcaidesa-map-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
  }

  .mapsvg .mapsvg-btn-map,
  .mapsvg .mapsvg-btn {
    width: 40px;
    height: 40px;
    line-height: 40px;
  }

  .mapsvg .mapsvg-btn-map.mapsvg-in:before,
  .mapsvg .mapsvg-btn-map.mapsvg-out:before {
    top: 19px;
    left: 11px;
    width: 18px;
  }

  .mapsvg .mapsvg-btn-map.mapsvg-in:after {
    top: 11px;
    left: 19px;
    height: 18px;
  }


  /* El gesto dentro del mapa lo gestionamos nosotros para que el pinch
     no compita con el zoom nativo del navegador ni con MapSVG. */
  #mapsvg-3,
  #mapsvg-4,
  #mapsvg-5 {
    touch-action: none !important;
    overscroll-behavior: contain;
  }

  /* En movil no mostramos los filtros de MapSVG. */
  #mapsvg-map-3 .mapsvg-header,
  #mapsvg-map-4 .mapsvg-header,
  #mapsvg-map-5 .mapsvg-header {
    display: none !important;
  }

  /* Encuadre movil: zona util de la marina.
     ViewBox 500x430 = ratio 86%, mucho mas legible que el panoramico desktop. */
  body:not(.alcaidesa-mapsvg-fullscreen-open) #mapsvg-3,
  body:not(.alcaidesa-mapsvg-fullscreen-open) #mapsvg-4,
  body:not(.alcaidesa-mapsvg-fullscreen-open) #mapsvg-5 {
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 86% !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mapsvg .mapsvg-btn-map,
  .mapsvg .mapsvg-btn {
    transition: none !important;
  }
}
