/* ALJT - Map height */
header.aljt-map-header #aljt-map,
header.aljt-map-header #aljt-map .leaflet-container{
  height: 30vh !important;
  min-height: 240px;
}

/* Disable sticky header behavior if any */
header.aljt-map-header{
  position: relative;
  top: auto;
}

/* PiP mode */
body.aljt-map-pip header.aljt-map-header{
  position: fixed !important;
  left: 16px;
  bottom: 16px;
  width: 420px;
  height: 260px;
  z-index: 2147483000 !important;
  isolation: isolate;
  border-radius: 18px;
  overflow: visible;
  box-shadow: 0 18px 50px rgba(0,0,0,.25);
  background: #fff;
}

body.aljt-map-pip header.aljt-map-header #aljt-map,
body.aljt-map-pip header.aljt-map-header #aljt-map .leaflet-container{
  height: 100% !important;
  min-height: 0 !important;
}

/* Controls overlay */
#aljt-map-pip-controls{
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 8px;
  z-index: 10000;
}

#aljt-map-pip-controls button{
  border: 0;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0,0,0,.15);
  font-weight: 600;
}

body.aljt-map-pip.aljt-map-pip--expanded header.aljt-map-header{
  left: 16px;
  bottom: 16px;
  width: min(900px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 32px));
}

@media (max-width: 768px){
  body.aljt-map-pip header.aljt-map-header{
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: 240px;
  }
}

.aljt-map-pip-spacer{display:block;width:100%;height:0;pointer-events:none;}


body.aljt-map-pip header.aljt-map-header #aljt-map,
body.aljt-map-pip header.aljt-map-header #aljt-map .leaflet-container{
  border-radius: inherit;
}

body.aljt-map-pip header.aljt-map-header #aljt-map{
  overflow: hidden;
}

body.aljt-map-pip header.aljt-map-header .leaflet-popup-pane,
body.aljt-map-pip header.aljt-map-header .leaflet-popup,
body.aljt-map-pip header.aljt-map-header .leaflet-popup-tip-container{
  z-index: 2147483005 !important;
}

body.aljt-map-pip header.aljt-map-header .leaflet-control-container,
body.aljt-map-pip header.aljt-map-header .leaflet-top,
body.aljt-map-pip header.aljt-map-header .leaflet-bottom{
  z-index: 2147483002 !important;
}

body.aljt-map-pip header.aljt-map-header .aljt-map-controls,
body.aljt-map-pip #aljt-map-pip-controls,
body.aljt-map-pip header.aljt-map-header .aljt-map-updating{
  display: none !important;
}

body.aljt-map-pip header.aljt-map-header .leaflet-popup-content-wrapper{
  border-radius: 10px !important;
  overflow: hidden !important;
  max-width: min(320px, calc(100vw - 48px)) !important;
  min-width: 240px !important;
}

body.aljt-map-pip header.aljt-map-header .leaflet-popup-close-button{
  z-index: 2147483006 !important;
}

@media (max-width: 768px){
  body.aljt-map-pip header.aljt-map-header{
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    height: 240px;
    z-index: 2147483000 !important;
  }

  body.aljt-map-pip header.aljt-map-header .leaflet-popup-content-wrapper{
    max-width: min(300px, calc(100vw - 40px)) !important;
    min-width: 220px !important;
  }
}
