.bgm-globe-wrap {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
}

.bgm-globe-wrap .bgm-map {
    position: absolute;
    inset: 0;
}

/* Grayscale only the rendered map surface, not marker/popup overlays,
   so pins can stay in color on top of the black & white globe */
.bgm-globe-wrap .bgm-map .maplibregl-canvas {
    filter: grayscale(100%) contrast(1.15);
    /* Some themes reset "canvas { pointer-events: none }" for decorative background
       canvases, which would silently kill click-and-drag on the map. Force it back on. */
    pointer-events: auto !important;
}

.bgm-globe-wrap .bgm-heading {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    margin: 0;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    font-family: sans-serif;
}

/* Zero-size Anchor & Pin Alignment */
.bgm-globe-wrap .bgm-marker-wrap {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    line-height: 0 !important;
    user-select: none;
}

.bgm-globe-wrap .maplibregl-marker,
.bgm-globe-wrap .maplibregl-marker * {
    cursor: pointer !important;
}

/* Inner pin container anchored at needle bottom tip */
.bgm-globe-wrap .bgm-pin-inner {
    position: absolute !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    cursor: pointer !important;
    transform-origin: bottom center;
    transition: transform 0.15s ease-out;
    line-height: 0 !important;
}

.bgm-globe-wrap .bgm-pin-inner:hover {
    transform: scale(1.18);
    z-index: 50 !important;
}

.bgm-globe-wrap .bgm-pin-icon {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.bgm-globe-wrap .bgm-default-pin {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    line-height: 0 !important;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.bgm-globe-wrap .bgm-default-pin svg {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: visible;
}

/* Rolled-up Pin Cluster Counter Badge */
.bgm-globe-wrap .bgm-cluster-badge {
    position: absolute;
    top: -5px;
    right: -9px;
    background: #ff3b30;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 1.5px #ffffff;
    pointer-events: none;
    z-index: 10;
}

.bgm-globe-wrap .bgm-stars {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none !important;
    mix-blend-mode: screen;
    max-width: none !important;
    max-height: none !important;
}

/* Screen reader & crawler accessible markup (invisible on screen, fully indexable by search engines) */
.bgm-globe-wrap .bgm-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.bgm-crawler-fallback {
    color: #fff;
    padding: 20px;
    background: #111;
}

/* Modern MapLibre Popup Overrides */
.bgm-globe-wrap .maplibregl-popup {
    z-index: 100;
}

.bgm-globe-wrap .maplibregl-popup-content {
    background: #ffffff !important;
    color: #222222 !important;
    padding: 12px 14px !important;
    border-radius: 8px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.bgm-globe-wrap .maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #ffffff !important; }
.bgm-globe-wrap .maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #ffffff !important; }
.bgm-globe-wrap .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #ffffff !important; }
.bgm-globe-wrap .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #ffffff !important; }

/* Single Popup Content */
.bgm-popup-content {
    padding: 2px 0;
}

.bgm-popup-title {
    display: block;
    font-weight: 700;
    color: #111111;
    font-size: 13.5px;
    margin-bottom: 2px;
}

.bgm-popup-locality {
    font-size: 11.5px;
    font-weight: 600;
    color: #666666;
    margin-bottom: 4px;
}

.bgm-popup-desc {
    margin: 4px 0 6px 0;
    color: #444444;
    font-size: 12px;
    line-height: 1.35;
}

.bgm-popup-link {
    display: inline-block;
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    margin-top: 2px;
}

.bgm-popup-link:hover {
    text-decoration: underline;
}

/* Cluster / Roll-up Multi-location Popup Card */
.bgm-popup-cluster {
    min-width: 190px;
    max-width: 280px;
}

.bgm-cluster-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #111111;
    padding-bottom: 6px;
    margin-bottom: 6px;
    border-bottom: 1px solid #ebebeb;
}

.bgm-cluster-count-pill {
    background: #ff3b30;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 14px;
}

.bgm-cluster-list {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.bgm-cluster-list::-webkit-scrollbar {
    width: 4px;
}
.bgm-cluster-list::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 2px;
}

.bgm-cluster-item {
    padding: 6px 0;
    border-bottom: 1px solid #f2f2f2;
}

.bgm-cluster-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.bgm-cluster-item:first-child {
    padding-top: 0;
}
