.mdm-map-shell {
  --mdm-map-height-desktop: 620px;
  --mdm-map-height-compact: 520px;
  --mdm-map-height-mobile: 480px;
  --mdm-map-petrol: #5d9297;
  --mdm-map-petrol-dark: #416f73;
  --mdm-map-olive: #b0aa2b;
  --mdm-map-ink: #2d2c2a;
  --mdm-map-paper: #fffefb;
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgb(65 111 115 / 18%);
  border-radius: 24px;
  background: #eef3ef;
  box-shadow: 0 18px 55px rgb(34 52 49 / 13%), 0 2px 8px rgb(34 52 49 / 8%);
  container-type: inline-size;
}

.mdm-map-canvas {
  z-index: 1;
  width: 100%;
  height: var(--mdm-map-height-desktop);
  min-height: 280px;
  background: #eef3ef;
  font-family: inherit;
}

.mdm-map-canvas .leaflet-tile {
  filter: saturate(.72) contrast(.95) brightness(1.025) sepia(.045);
}

.mdm-map-canvas::after {
  position: absolute;
  z-index: 450;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 42%), inset 0 -35px 70px rgb(59 91 84 / 4%);
  pointer-events: none;
  content: '';
}

.mdm-map-toolbar {
  position: absolute;
  z-index: 650;
  top: 18px;
  right: 18px;
  display: flex;
  gap: 9px;
  align-items: center;
  pointer-events: none;
}

.mdm-map-result-count,
.mdm-map-action {
  min-height: 43px;
  border: 1px solid rgb(65 111 115 / 17%);
  border-radius: 14px;
  background: linear-gradient(180deg, rgb(255 255 253 / 98%), rgb(249 249 245 / 95%));
  color: var(--mdm-map-ink);
  box-shadow: 0 8px 23px rgb(34 52 49 / 14%), inset 0 1px 0 #fff;
  backdrop-filter: blur(9px);
}

.mdm-map-result-count {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 0 16px;
  font-size: 13px;
  letter-spacing: .01em;
}

.mdm-map-result-count i {
  width: 9px;
  height: 9px;
  margin-right: 3px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c7c04a, var(--mdm-map-olive));
  box-shadow: 0 0 0 4px rgb(176 170 43 / 16%), inset 0 1px 1px rgb(255 255 255 / 45%);
}

.mdm-map-action {
  padding: 0 15px;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  pointer-events: auto;
  transition: color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.mdm-map-action > span {
  margin-right: 3px;
  color: var(--mdm-map-petrol);
  font-size: 18px;
}

.mdm-map-action:hover,
.mdm-map-action:focus-visible {
  outline: none;
  background: linear-gradient(145deg, #6fa3a7, var(--mdm-map-petrol-dark));
  color: #fff;
  box-shadow: 0 10px 24px rgb(45 82 84 / 24%), inset 0 1px 0 rgb(255 255 255 / 25%);
  transform: translateY(-2px);
}

.mdm-map-action:hover > span,
.mdm-map-action:focus-visible > span { color: #fff; }
.mdm-map-action:disabled { opacity: .55; cursor: default; transform: none; }

.mdm-map-action-label {
  font: inherit;
}

.mdm-map-shell:fullscreen,
.mdm-map-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
}

.mdm-map-shell:fullscreen .mdm-map-canvas,
.mdm-map-shell:-webkit-full-screen .mdm-map-canvas {
  height: 100vh;
}

.mdm-map-canvas .leaflet-bar {
  overflow: hidden;
  border: 1px solid rgb(65 111 115 / 16%);
  border-radius: 14px;
  box-shadow: 0 9px 25px rgb(34 52 49 / 17%), inset 0 1px 0 #fff;
}

.mdm-map-canvas .leaflet-bar a {
  width: 40px;
  height: 40px;
  border-color: #e8ece8;
  background: linear-gradient(180deg, #fff, #f7f8f5);
  color: var(--mdm-map-petrol-dark);
  font-size: 21px;
  line-height: 40px;
}

.mdm-map-canvas .leaflet-bar a:hover,
.mdm-map-canvas .leaflet-bar a:focus { background: linear-gradient(145deg, #6fa3a7, var(--mdm-map-petrol-dark)); color: #fff; }
.mdm-map-canvas .leaflet-control-attribution { padding: 3px 7px; background: rgb(255 255 255 / 80%); font-size: 9px; backdrop-filter: blur(4px); }

.mdm-map-svg-icon {
  border: 0;
  background: transparent;
  filter: drop-shadow(0 6px 7px rgb(35 49 45 / 30%));
}

.mdm-map-svg-icon svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  transition: transform .22s ease, filter .22s ease;
  transform-origin: 50% 100%;
}

.mdm-map-svg-icon:hover svg,
.mdm-map-svg-icon.is-active svg { transform: translateY(-5px) scale(1.09); filter: brightness(1.09); }
.leaflet-marker-icon.is-active:not(.mdm-map-svg-icon) { filter: drop-shadow(0 6px 8px rgb(35 49 45 / 40%)) saturate(1.2); }

.mdm-map-cluster {
  display: grid !important;
  place-items: center;
  border: 3px solid rgb(255 255 255 / 94%);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 24%, #82b2b5 0, var(--mdm-map-petrol) 42%, var(--mdm-map-petrol-dark) 100%);
  color: #fff;
  box-shadow: 0 7px 19px rgb(41 70 71 / 31%), 0 0 0 7px rgb(93 146 151 / 17%), inset 0 2px 3px rgb(255 255 255 / 30%);
  font-weight: 750;
  text-shadow: 0 1px 2px rgb(25 55 57 / 32%);
  transition: transform .2s ease, filter .2s ease;
}

.mdm-map-cluster:hover { z-index: 999 !important; filter: brightness(1.06); transform: scale(1.09) translateY(-2px); }
.mdm-map-cluster--medium { background: radial-gradient(circle at 32% 24%, #9aaa8f 0, #708668 50%, #53684c 100%); }
.mdm-map-cluster--large { background: radial-gradient(circle at 32% 24%, #d2cb55 0, var(--mdm-map-olive) 48%, #817c16 100%); }
.mdm-map-cluster span { line-height: 1; }

.mdm-map-popup .leaflet-popup-content-wrapper {
  overflow: hidden;
  padding: 0;
  border: 1px solid rgb(65 111 115 / 14%);
  border-radius: 21px;
  background: var(--mdm-map-paper);
  box-shadow: 0 22px 58px rgb(30 46 43 / 26%), 0 4px 12px rgb(30 46 43 / 10%);
}

.mdm-map-popup .leaflet-popup-content { margin: 0; }
.mdm-map-popup .leaflet-popup-tip { background: var(--mdm-map-paper); box-shadow: 4px 4px 9px rgb(30 46 43 / 12%); }

.mdm-map-popup .leaflet-popup-close-button {
  z-index: 5;
  top: 10px;
  right: 10px;
  width: 35px;
  height: 35px;
  border: 1px solid rgb(65 111 115 / 11%);
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #f7f7f3);
  color: var(--mdm-map-ink);
  font-size: 25px;
  line-height: 32px;
  box-shadow: 0 4px 15px rgb(0 0 0 / 16%), inset 0 1px 0 #fff;
  transition: color .2s ease, transform .2s ease;
}

.mdm-map-popup .leaflet-popup-close-button:hover { color: var(--mdm-map-petrol-dark); transform: rotate(7deg) scale(1.03); }
.mdm-map-elementor-card {
  width: 100%;
  max-width: 100%;
}

/* Elementor nasconde .elementor-page-title fuori dal contenitore nativo del Loop Grid. */
.mdm-map-elementor-card .elementor-widget-theme-post-title.elementor-page-title {
  display: block;
  width: auto;
  min-height: 1px;
}

.mdm-map-elementor-card .elementor-widget-theme-post-title .elementor-widget-container,
.mdm-map-elementor-card .elementor-widget-theme-post-title .elementor-heading-title {
  width: auto;
  height: auto;
}
.mdm-map-card { overflow: hidden; background: var(--mdm-map-paper); }
.mdm-map-card-image { display: block; width: 100%; height: 220px; object-fit: cover; }
.mdm-map-card-body { padding: 22px; }
.mdm-map-card-body h3 { margin: 0 0 14px; color: var(--mdm-map-ink); }
.mdm-map-card-body a { color: var(--mdm-map-petrol-dark); font-weight: 700; }

.mdm-map-loading {
  display: grid;
  gap: 12px;
  padding: 28px;
}

.mdm-map-loading span {
  display: block;
  height: 14px;
  overflow: hidden;
  border-radius: 7px;
  background: linear-gradient(90deg, #e9ece8 25%, #fafaf7 50%, #e9ece8 75%);
  background-size: 200% 100%;
  box-shadow: inset 0 1px 2px rgb(49 67 62 / 5%);
  animation: mdm-map-shimmer 1.25s infinite;
}

.mdm-map-loading span:first-child { height: 150px; border-radius: 14px; }
.mdm-map-loading span:last-child { width: 62%; }
.mdm-map-error { padding: 32px; }

@keyframes mdm-map-shimmer { to { background-position: -200% 0; } }

.mdm-map-empty {
  position: absolute;
  z-index: 500;
  top: 50%;
  left: 50%;
  max-width: 320px;
  margin: 0;
  padding: 18px 22px;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(65 111 115 / 15%);
  border-radius: 18px;
  background: linear-gradient(180deg, #fffefb, #f8f8f3);
  color: var(--mdm-map-ink);
  text-align: center;
  box-shadow: 0 14px 40px rgb(34 52 49 / 17%), inset 0 1px 0 #fff;
}

.mdm-map-sheet,
.mdm-map-backdrop { display: none; }

@container (max-width: 680px) {
  .mdm-map-canvas { height: var(--mdm-map-height-compact); }
  .mdm-map-toolbar { top: 12px; right: 12px; gap: 7px; }
  .mdm-map-result-count, .mdm-map-action { min-height: 39px; border-radius: 12px; }
  .mdm-map-result-count { padding: 0 13px; }
  .mdm-map-action { min-width: 42px; padding: 0 11px; }
}

@container (max-width: 480px) {
  .mdm-map-action-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mdm-map-action > span { margin-right: 0; }
}

@media (max-width: 767px) {
  .mdm-map-shell { border-radius: 18px; }
  .mdm-map-canvas { width: 100%; height: var(--mdm-map-height-mobile); min-height: 280px; }
  .mdm-map-toolbar { top: 12px; right: 12px; left: 12px; justify-content: space-between; }
  .mdm-map-result-count, .mdm-map-action { min-height: 39px; border-radius: 12px; }
  .mdm-map-result-count { padding: 0 13px; }
  .mdm-map-action { padding: 0 12px; }

  .mdm-map-backdrop {
    position: fixed;
    z-index: 999998;
    inset: 0;
    display: block;
    border: 0;
    background: rgb(24 31 30 / 40%);
    backdrop-filter: blur(3px);
  }

  .mdm-map-backdrop[hidden] { display: none; }

  .mdm-map-sheet {
    position: fixed;
    z-index: 999999;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    max-height: 82vh;
    overflow: auto;
    border: 1px solid rgb(255 255 255 / 65%);
    border-bottom: 0;
    border-radius: 25px 25px 0 0;
    background: linear-gradient(180deg, #fffefb, #faf9f4);
    box-shadow: 0 -18px 60px rgb(20 31 29 / 31%), inset 0 1px 0 #fff;
  }

  .mdm-map-sheet::before {
    display: block;
    width: 46px;
    height: 4px;
    margin: 9px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #d5dbd7, #aebbb5, #d5dbd7);
    box-shadow: 0 1px 1px #fff;
    content: '';
  }

  .mdm-map-sheet[hidden] { display: none; }

  .mdm-map-sheet-close {
    position: sticky;
    z-index: 5;
    top: 10px;
    float: right;
    width: 39px;
    height: 39px;
    margin: 8px 10px -47px 0;
    border: 1px solid rgb(65 111 115 / 12%);
    border-radius: 50%;
    background: linear-gradient(180deg, #fff, #f5f6f2);
    color: var(--mdm-map-ink);
    font-size: 29px;
    line-height: 34px;
    box-shadow: 0 4px 16px rgb(0 0 0 / 16%), inset 0 1px 0 #fff;
    cursor: pointer;
  }

  .mdm-map-sheet-content { clear: both; }
  .mdm-map-elementor-card {
    width: 100%;
    max-width: 100%;
  }
  body.mdm-map-sheet-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  .mdm-map-shell *, .mdm-map-shell *::before, .mdm-map-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.mdm-map-shell:fullscreen .mdm-map-canvas,
.mdm-map-shell:-webkit-full-screen .mdm-map-canvas {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}
