.bsj-mapbox,
.bsj-mapbox * {
    box-sizing: border-box;
}

.bsj-mapbox {
    --bsj-mapbox-ink: #172432;
    --bsj-mapbox-muted: #64717d;
    --bsj-mapbox-accent: #134b9a;
    margin-top: clamp(44px, 5vw, 64px);
    padding-top: clamp(30px, 3vw, 38px);
    border-top: 1px solid #e9edf2;
}

.bsj-mapbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: clamp(22px, 2.5vw, 30px);
}

.bsj-mapbox__title {
    margin: 0;
    color: var(--bsj-mapbox-ink);
    font-size: clamp(24px, 2vw, 29px);
    font-weight: 500;
    line-height: 1.2;
}

.bsj-mapbox__address {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: #5c6d82;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    line-height: 1.35;
}

.bsj-mapbox__address svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: #aab5c2;
    stroke-width: 1.6;
}

.bsj-mapbox__frame {
    position: relative;
    min-height: clamp(430px, 43vw, 585px);
    overflow: hidden;
    border: 1px solid #edf0f3;
    border-radius: 20px;
    background: #f4f1eb;
}

/* Keep priority over the dynamically appended Mapbox `.mapboxgl-map` rule. */
.bsj-mapbox .bsj-mapbox__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.bsj-mapbox__fallback {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 32px;
    color: var(--bsj-mapbox-ink);
    text-align: center;
}

.bsj-mapbox__fallback > svg {
    width: 42px;
    height: 42px;
    fill: none;
    stroke: #7b8996;
    stroke-width: 1.5;
}

.bsj-mapbox__fallback p {
    display: grid;
    gap: 6px;
    max-width: 420px;
    margin: 0;
}

.bsj-mapbox__fallback p span {
    color: var(--bsj-mapbox-muted);
    font-size: 14px;
}

.bsj-mapbox__fallback button,
.bsj-mapbox__fallback a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 20px;
    border: 1px solid #ccd5de;
    border-radius: 999px;
    background: #fff;
    color: var(--bsj-mapbox-ink);
    font: inherit;
    font-size: 14px;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}

.bsj-mapbox__fallback button:hover,
.bsj-mapbox__fallback a:hover {
    border-color: var(--bsj-mapbox-accent);
    color: var(--bsj-mapbox-accent);
}

.bsj-mapbox__fallback button:focus-visible,
.bsj-mapbox__fallback a:focus-visible {
    outline: 3px solid rgba(19, 75, 154, 0.48);
    outline-offset: 3px;
}

.bsj-mapbox.is-ready .bsj-mapbox__fallback {
    display: none;
}

.bsj-mapbox.is-loading .bsj-mapbox__fallback button {
    opacity: 0.65;
    pointer-events: none;
}

.bsj-mapbox .bsj-mapbox__canvas:focus-visible {
    outline: 3px solid var(--bsj-mapbox-accent);
    outline-offset: -3px;
}

.bsj-mapbox .bsj-mapbox__canvas:fullscreen,
.bsj-mapbox .bsj-mapbox__canvas:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.bsj-mapbox__status {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 2;
    width: min(80%, 360px);
    margin: 0;
    padding: 12px 18px;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--bsj-mapbox-muted);
    text-align: center;
}

.bsj-mapbox__status:empty,
.bsj-mapbox.is-ready .bsj-mapbox__status {
    display: none;
}

.bsj-mapbox__marker-anchor {
    width: 0;
    height: 0;
    overflow: visible;
}

.bsj-mapbox__marker {
    position: absolute;
    bottom: var(--bsj-mapbox-marker-tip-offset, 6px);
    left: 0;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    width: min(152px, calc(100vw - 56px));
    min-height: 36px;
    overflow: visible;
    border: 0;
    border-radius: 18px;
    background: #eef3fb;
    box-shadow: 0 8px 22px rgba(27, 43, 63, 0.22);
    color: #173c73;
    font: inherit;
    scale: var(--bsj-mapbox-marker-scale, 1);
    translate: -50% 0;
    transform-origin: 50% 100%;
    text-align: left;
    text-decoration: none;
    transition: scale 120ms linear;
}

.bsj-mapbox__marker::after {
    position: absolute;
    bottom: -6px;
    left: 50%;
    z-index: 0;
    width: 11px;
    height: 7px;
    transform: translateX(-50%);
    background: #eef3fb;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    filter: drop-shadow(0 2px 1px rgba(27, 43, 63, 0.12));
    content: "";
    pointer-events: none;
}

.bsj-mapbox__marker-image,
.bsj-mapbox__marker-image-fallback {
    position: relative;
    z-index: 1;
    width: 28px;
    height: 28px;
    margin-left: 4px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #d9e3ef;
    object-fit: cover;
}

.bsj-mapbox__marker-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 4px 8px 4px 7px;
}

.bsj-mapbox__marker-title,
.bsj-mapbox__marker-price {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bsj-mapbox__marker--nearby {
    grid-template-columns: 24px auto;
    width: auto;
    min-width: 64px;
    max-width: 90px;
    min-height: 30px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 6px 18px rgba(27, 43, 63, 0.17);
    color: #243b58;
    -webkit-backdrop-filter: blur(10px) saturate(135%);
    backdrop-filter: blur(10px) saturate(135%);
}

.bsj-mapbox__marker--nearby::after {
    background: rgba(255, 255, 255, 0.88);
}

.bsj-mapbox__marker--nearby .bsj-mapbox__marker-image,
.bsj-mapbox__marker--nearby .bsj-mapbox__marker-image-fallback {
    width: 24px;
    height: 24px;
    margin-left: 3px;
}

.bsj-mapbox__marker--nearby .bsj-mapbox__marker-copy {
    padding: 3px 7px 3px 5px;
}

.bsj-mapbox__marker--nearby .bsj-mapbox__marker-price {
    margin-top: 0;
    overflow: visible;
    color: #56687d;
    font-size: 9px;
    font-weight: 500;
    white-space: nowrap;
}

.bsj-mapbox__marker--nearby:hover,
.bsj-mapbox__marker--nearby:focus-visible {
    color: var(--bsj-mapbox-accent);
    box-shadow: 0 8px 22px rgba(27, 43, 63, 0.24);
}

.bsj-mapbox__marker--nearby:focus-visible {
    outline: 3px solid rgba(19, 75, 154, 0.48);
    outline-offset: 2px;
}

.bsj-mapbox__nearby-toggle {
    position: absolute;
    top: 18px;
    left: 50%;
    z-index: 3;
    min-height: 42px;
    padding: 9px 20px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.64);
    box-shadow:
        0 8px 22px rgba(34, 48, 65, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.78);
    color: #2b3948;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    backdrop-filter: blur(14px) saturate(145%);
}

.bsj-mapbox__nearby-toggle:hover {
    background: rgba(255, 255, 255, 0.78);
}

.bsj-mapbox__nearby-toggle:focus-visible {
    outline: 3px solid rgba(19, 75, 154, 0.48);
    outline-offset: 2px;
}

.bsj-mapbox .mapboxgl-popup.bsj-mapbox__popup {
    z-index: 4;
}

.bsj-mapbox .bsj-mapbox__popup .mapboxgl-popup-content {
    width: 136px;
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 26px rgba(27, 43, 63, 0.2);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
}

.bsj-mapbox .bsj-mapbox__popup .mapboxgl-popup-tip {
    border-top-color: rgba(255, 255, 255, 0.92);
}

.bsj-mapbox__popup-card {
    display: block;
    color: var(--bsj-mapbox-ink);
    text-decoration: none;
}

.bsj-mapbox__popup-media {
    display: block;
    width: 100%;
    height: 72px;
    overflow: hidden;
    background: #e6ebf0;
}

.bsj-mapbox__popup-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.bsj-mapbox__popup-card:hover .bsj-mapbox__popup-media img {
    transform: scale(1.025);
}

.bsj-mapbox__popup-media--empty {
    background: linear-gradient(145deg, #e8edf2, #d8e1ea);
}

.bsj-mapbox__popup-copy {
    display: block;
    padding: 7px 8px 8px;
}

.bsj-mapbox__popup-title,
.bsj-mapbox__popup-price {
    display: block;
}

.bsj-mapbox__popup-title {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
}

.bsj-mapbox__popup-price {
    margin-top: 3px;
    color: #64717d;
    font-size: 9px;
    line-height: 1.3;
}

.bsj-mapbox__popup-card:focus-visible {
    outline: 3px solid rgba(19, 75, 154, 0.48);
    outline-offset: -3px;
}

.bsj-mapbox__marker-title {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}

.bsj-mapbox__marker-price {
    margin-top: 1px;
    color: #56687d;
    font-size: 9px;
    line-height: 1.3;
}

.bsj-mapbox .mapboxgl-ctrl-group {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.62);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.46);
    box-shadow:
        0 8px 24px rgba(34, 48, 65, 0.09),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(14px) saturate(145%);
    backdrop-filter: blur(14px) saturate(145%);
}

.bsj-mapbox .mapboxgl-ctrl-group button {
    width: 40px;
    height: 40px;
    background-color: transparent;
}

.bsj-mapbox .mapboxgl-ctrl-group button + button {
    border-top-color: rgba(74, 89, 108, 0.11);
}

.bsj-mapbox .mapboxgl-ctrl-group button:hover,
.bsj-mapbox .mapboxgl-ctrl-group button:focus-visible {
    background-color: rgba(255, 255, 255, 0.38);
}

.bsj-mapbox .mapboxgl-ctrl-group button:focus-visible {
    outline: 2px solid rgba(19, 75, 154, 0.48);
    outline-offset: -3px;
}

.bsj-mapbox .mapboxgl-ctrl-icon {
    opacity: 0.62;
}

.bsj-mapbox .mapboxgl-ctrl-top-right {
    top: 14px;
    right: 14px;
}

.bsj-mapbox .mapboxgl-ctrl-attrib {
    color: #46515d;
    font-size: 10px;
}

@media (max-width: 767px) {
    .bsj-mapbox {
        margin-top: 40px;
        padding-top: 28px;
    }

    .bsj-mapbox__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }

    .bsj-mapbox__frame {
        min-height: 410px;
        border-radius: 16px;
    }

    .bsj-mapbox__marker {
        width: min(144px, calc(100vw - 48px));
    }

    .bsj-mapbox__marker--nearby {
        width: auto;
        min-width: 64px;
        max-width: 90px;
    }
}

@media (max-width: 420px) {
    .bsj-mapbox__frame {
        min-height: 360px;
    }
}

@media (min-width: 992px) {
    .bsj-mapbox__frame {
        min-height: clamp(420px, 39vw, 540px);
    }

    .bsj-hotel-presentation .bsj-mapbox__title {
        font-size: clamp(21px, 1.55vw, 23px);
    }

    .bsj-hotel-presentation .bsj-mapbox__address {
        font-size: 12px;
    }

    .bsj-hotel-presentation .bsj-mapbox__nearby-toggle {
        min-height: 38px;
        padding: 7px 16px;
        font-size: 12px;
    }

    .bsj-hotel-presentation .bsj-mapbox .mapboxgl-ctrl-group button {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bsj-mapbox__marker {
        transition: none;
    }

    .bsj-mapbox .mapboxgl-canvas {
        scroll-behavior: auto;
    }
}
