/* Keep Leaflet hero map below fixed header/logo layers */
#location-map,
.wp-block-hero__bg-gmap {
  position: relative;
  isolation: isolate;
  z-index: 0;
  pointer-events: auto;
}

#location-map .leaflet-pane,
#location-map .leaflet-top,
#location-map .leaflet-bottom,
#location-map .leaflet-control-container {
  z-index: 0;
}

/* Frontend: force zoom controls to right-middle. */
body:not(.wp-admin) #location-map .leaflet-top.leaflet-left,
body:not(.wp-admin) .wp-block-hero__bg-gmap .leaflet-top.leaflet-left {
  left: auto !important;
  right: 1rem !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

body:not(.wp-admin) #location-map .leaflet-top.leaflet-right,
body:not(.wp-admin) .wp-block-hero__bg-gmap .leaflet-top.leaflet-right {
  top: 50% !important;
  right: 1rem !important;
  transform: translateY(-50%) !important;
}

body:not(.wp-admin) #location-map .leaflet-control-container {
  z-index: 5;
}

body:not(.wp-admin) #location-map .leaflet-right .leaflet-control {
  margin-right: 0;
}

body:not(.wp-admin) #location-map .leaflet-control-zoom,
body:not(.wp-admin) .wp-block-hero__bg-gmap .leaflet-control-zoom {
  margin: 0 !important;
}

body:not(.wp-admin) #location-map .leaflet-control-zoom {
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

body:not(.wp-admin) #location-map .leaflet-control-zoom a {
  width: 2.25rem;
  height: 2.25rem;
  line-height: 2.15rem;
  font-size: 1.25rem;
  background: rgba(13, 13, 13, 0.85);
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

body:not(.wp-admin) #location-map .leaflet-control-zoom a:hover {
  background: rgba(225, 0, 0, 0.9);
  color: #fff;
}

/* Admin/editor: keep controls hidden. */
.wp-admin #location-map .leaflet-control-container {
  display: none !important;
}

.wp-block-hero::after {
  z-index: 3;
}

.wp-block-hero__text-container {
  z-index: 4;
}

header.site-header,
.site-header__fixed-wrapper,
.header-mobile__nav {
  z-index: 2000 !important;
}

@media (max-width: 991px) {
  .header-mobile__nav {
    isolation: isolate;
  }

  .header-mobile__nav::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.42s ease, box-shadow 0.42s ease;
  }

  .header-mobile__nav > * {
    position: relative;
    z-index: 1;
  }

  body.mobile-nav-scrolled.mobile-nav-dark .header-mobile__nav::before {
    opacity: 1;
    background: linear-gradient(
      180deg,
      rgba(12, 12, 12, 0.7) 44%,
      rgba(12, 12, 12, 0.1) 100%
    );
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
  }

  body.mobile-nav-scrolled.mobile-nav-light .header-mobile__nav::before {
    opacity: 1;
    background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.9) 44%,
      rgba(255, 255, 255, 0.5) 100%
    );
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  }

  body.overflow-y-hidden .header-mobile__nav::before,
  header.site-header.open .header-mobile__nav::before {
    opacity: 0 !important;
    background: none !important;
    box-shadow: none !important;
  }
}
