.maps-search-icon {
    display: none;
}

@media (min-width: 768px) {
    .maps-search-field > .relative {
        display: flex;
        min-width: 0;
        align-items: center;
        height: 64px;
        padding: 0 16px;
    }

    .maps-search-field .maps-search-icon {
        position: static;
        display: inline-flex;
        flex: 0 0 30px;
        align-items: center;
        justify-content: flex-start;
        transform: none;
        color: #273746;
        pointer-events: none;
    }

    .maps-search-field input {
        display: block;
        flex: 1 1 auto;
        width: 0;
        min-width: 0;
        height: 100%;
        padding: 0 4px;
        border: 0;
        box-shadow: none;
        font-size: 20px;
        line-height: 1.25;
        white-space: nowrap;
    }
}

/* Keep map controls together regardless of Leaflet's default control corner. */
#map .leaflet-bottom.leaflet-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

#map .leaflet-bottom.leaflet-right .leaflet-control {
    position: relative !important;
    inset: auto !important;
    float: none !important;
    margin: 0 !important;
}

#map .live-location-control {
    margin: 0 !important;
}

@media (max-width: 767px) {
    .home-map-page-body .top-header {
height: 40px;
padding-left: 14px;
padding-right: 14px;
font-size: 12px;
    }

    .home-map-page-body .nav-menu {
height: 56px;
max-height: 56px;
padding: 8px 14px;
    }

    .home-map-page-body .nav-menu img {
max-height: 34px;
max-width: 128px;
    }

    .home-map-shell {
position: relative !important;
top: auto !important;
height: auto;
overflow: visible;
    }

    .home-map-canvas {
position: relative;
height: calc(100dvh - 97px);
min-height: 440px;
margin-top: -16px;
overflow: hidden;
    }

    .home-map-canvas #map {
height: 100%;
min-height: 440px;
    }

    .home-map-toolbar {
top: 10px;
right: 12px;
left: 12px;
width: auto;
padding: 0;
align-items: stretch;
flex-direction: column;
    }

    .home-mobile-map-search {
display: block !important;
width: 100%;
max-width: none;
    }

    .home-map-toolbar .home-map-location {
position: absolute;
top: 110px;
left: 0;
width: auto;
    }

    .home-map-location > div {
width: 44px;
height: 44px;
justify-content: center;
padding: 0;
border: 1px solid #e5e7eb;
border-radius: 12px;
box-shadow: 0 2px 8px rgb(15 23 42 / 14%);
    }

    .home-map-location .maps-location-icon {
display: inline-block;
width: 24px;
height: 24px;
font-size: 24px;
line-height: 1;
    }

    .home-map-location [data-lucide] {
display: none;
    }

    .home-map-location #selectedLocation {
display: none;
    }

    .home-map-toolbar > div:last-child {
display: none;
    }

    .home-map-category-filter {
top: 64px;
right: 12px;
bottom: auto;
left: 12px;
width: auto;
transform: none;
translate: none !important;
    }

    .home-map-category-filter > div {
display: grid;
width: 100%;
min-width: 0;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
padding: 0;
    }

    .home-map-category-filter .primary-btn {
min-width: 0;
height: 38px;
padding: 6px 4px;
border-radius: 11px;
font-size: 12px;
justify-content: center;
white-space: nowrap;
    }

    .home-map-canvas .maps-nearby-summary {
position: absolute;
right: 12px;
bottom: max(12px, env(safe-area-inset-bottom));
left: 12px;
z-index: 1000;
display: flex;
height: 52px;
align-items: center;
justify-content: space-between;
padding: 0 16px;
border: 1px solid #e5e7eb;
border-radius: 16px;
background: #fff;
box-shadow: 0 3px 14px rgb(15 23 42 / 16%);
color: #111827;
    }

    .home-map-canvas .maps-nearby-panel {
position: absolute;
right: 12px;
bottom: calc(72px + env(safe-area-inset-bottom));
left: 12px;
z-index: 10000;
max-height: min(52dvh, 430px);
overflow: hidden;
border: 1px solid #e5e7eb;
border-radius: 20px;
background: #fff;
box-shadow: 0 4px 20px rgb(15 23 42 / 18%);
    }

    .home-map-canvas .maps-nearby-panel-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid #e5e7eb;
font-weight: 700;
    }

    .home-map-canvas .maps-nearby-list {
max-height: calc(min(52dvh, 430px) - 54px);
overflow-y: auto;
overscroll-behavior: contain;
    }

    .home-map-canvas .maps-nearby-item {
display: block;
width: 100%;
padding: 12px 16px;
border-bottom: 1px solid #f1f5f9;
text-align: left;
    }

    .home-map-canvas .maps-nearby-item:last-child {
border-bottom: 0;
    }

    .home-map-canvas .maps-nearby-summary-label {
display: flex;
align-items: center;
gap: 10px;
font-size: 15px;
font-weight: 700;
    }

    .home-map-canvas .maps-nearby-summary-label .material-symbols-outlined {
color: #087f68;
    }

    .home-map-shell #facilityCard {
position: fixed !important;
top: auto !important;
right: 0 !important;
bottom: 0 !important;
left: 0 !important;
width: 100% !important;
max-width: 100% !important;
max-height: min(78dvh, calc(100dvh - 97px)) !important;
padding: 16px 14px max(16px, env(safe-area-inset-bottom)) !important;
border-radius: 24px 24px 0 0;
box-shadow: 0 -8px 28px rgb(15 23 42 / 18%);
    }

    .home-map-shell #facilityCardImage {
height: 96px;
    }

    .home-map-shell #facilityCardClose {
top: 18px;
right: 16px;
    }

    .home-map-shell #map .live-location-control {
margin-right: 0 !important;
    }

    .home-map-shell > .-mt-6 {
margin-top: 0;
padding: 16px 0;
    }

    .home-map-spacer {
display: none;
    }
}
        @media (max-width: 767px) {
            .maps-page-body {
                height: 100dvh;
                min-height: 0;
                overflow: hidden;
            }

            .maps-page-body .top-header {
                height: 40px;
                padding-left: 14px;
                padding-right: 14px;
                font-size: 12px;
            }

            .maps-page-body .nav-menu {
                height: 56px;
                max-height: 56px;
                padding: 8px 14px;
            }

            .maps-page-body .nav-menu img {
                max-height: 34px;
                max-width: 128px;
            }

            .maps-page-body main {
                min-height: 0;
                overflow: hidden;
            }

            .maps-page-body footer {
                display: none;
            }

            .maps-page-shell {
                position: fixed;
                top: 97px;
                right: 0;
                bottom: 0;
                left: 0;
                height: auto;
                overflow: hidden;
            }

            .maps-toolbar {
                top: 10px;
                right: 12px;
                left: 12px;
                width: auto;
                padding: 0;
                align-items: stretch;
                flex-direction: column;
            }

            .maps-toolbar > :first-child {
                width: 100%;
                max-width: none;
            }

            .maps-search-field {
                width: 100%;
                border-radius: 12px;
                box-shadow: 0 2px 8px rgb(15 23 42 / 12%);
            }

            .maps-search-field input {
                height: 44px;
                padding-left: 40px;
                border: 0;
                border-radius: 12px;
                font-size: 14px;
            }

            .maps-search-icon {
                display: block;
                position: absolute;
                top: 50%;
                left: 12px;
                z-index: 1;
                transform: translateY(-50%);
                color: #273746;
                pointer-events: none;
            }

            .maps-location-controls {
                position: absolute;
                top: 110px;
                left: 0;
                width: auto;
            }

            .maps-location-controls #locationDropdownBtn {
                width: auto;
                height: 40px;
                padding: 0 14px;
                border: 1px solid #e5e7eb;
                border-radius: 12px;
                box-shadow: 0 2px 8px rgb(15 23 42 / 14%);
            }

            .maps-location-controls #locationDropdownBtn > div {
                display: flex;
                align-items: center;
                justify-content: center;
            }

            .maps-location-controls #locationDropdownBtn .maps-location-icon {
                display: inline-block;
                width: 24px;
                height: 24px;
                font-size: 24px;
                line-height: 1;
            }

            .maps-location-controls #selectedLocation {
                display: none;
            }

            .maps-location-controls > div:last-child {
                display: none;
            }

            .maps-category-filter {
                top: 64px;
                right: 12px;
                bottom: auto;
                left: 12px;
                width: auto;
                transform: none;
                translate: none !important;
            }

            .maps-category-filter > div {
                display: grid;
                width: 100%;
                min-width: 0;
                grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
                gap: 8px;
            }

            .maps-category-filter .primary-btn {
                min-width: 0;
                height: 38px;
                padding: 6px 4px;
                border-radius: 11px;
                font-size: 12px;
                justify-content: center;
                white-space: nowrap;
            }

            .maps-nearby-summary {
                position: absolute;
                right: 12px;
                bottom: max(12px, env(safe-area-inset-bottom));
                left: 12px;
                z-index: 1000;
                display: flex;
                height: 52px;
                align-items: center;
                justify-content: space-between;
                padding: 0 16px;
                border: 1px solid #e5e7eb;
                border-radius: 16px;
                background: #fff;
                box-shadow: 0 3px 14px rgb(15 23 42 / 16%);
                color: #111827;
            }

            .maps-nearby-panel {
                position: absolute;
                right: 12px;
                bottom: calc(72px + env(safe-area-inset-bottom));
                left: 12px;
                z-index: 10000;
                max-height: min(52dvh, 430px);
                overflow: hidden;
                border: 1px solid #e5e7eb;
                border-radius: 20px;
                background: #fff;
                box-shadow: 0 4px 20px rgb(15 23 42 / 18%);
            }

            .maps-nearby-panel-header {
                display: flex;
                align-items: center;
                justify-content: space-between;
                padding: 14px 16px;
                border-bottom: 1px solid #e5e7eb;
                font-weight: 700;
            }

            .maps-nearby-list {
                max-height: calc(min(52dvh, 430px) - 54px);
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            .maps-nearby-item {
                display: block;
                width: 100%;
                padding: 12px 16px;
                border-bottom: 1px solid #f1f5f9;
                text-align: left;
            }

            .maps-nearby-item:last-child {
                border-bottom: 0;
            }

            .maps-nearby-summary-label {
                display: flex;
                align-items: center;
                gap: 10px;
                font-size: 15px;
                font-weight: 700;
            }

            .maps-nearby-summary-label .material-symbols-outlined {
                color: #087f68;
            }

            #facilityCard {
                position: fixed !important;
                top: auto !important;
                right: 0 !important;
                bottom: 0 !important;
                left: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
                max-height: min(78dvh, calc(100dvh - 97px)) !important;
                padding: 16px 14px max(16px, env(safe-area-inset-bottom)) !important;
                border-radius: 24px 24px 0 0;
                box-shadow: 0 -8px 28px rgb(15 23 42 / 18%);
            }

            #facilityCardImage {
                height: 96px;
            }

            #facilityCardClose {
                top: 18px;
                right: 16px;
            }

            .maps-page-shell > .leaflet-container {
                background: #dcecf2;
            }

            #map .live-location-control {
                margin-right: 0 !important;
            }
        }

@media (max-width: 767px) {
    #facilityCard,
    .home-map-shell #facilityCard {
        height: var(--facility-sheet-height, 54dvh) !important;
        max-height: min(88dvh, calc(100dvh - 97px)) !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transition: height 0.25s ease;
    }

    #facilityCard.facility-sheet-dragging,
    .home-map-shell #facilityCard.facility-sheet-dragging {
        transition: none;
    }

    #facilityCard.hidden {
        display: none !important;
    }

    #facilityCard .facility-sheet-handle {
        position: sticky;
        top: 0;
        z-index: 2;
        margin: -16px -14px 0;
        background: white;
    }

}

@media (max-width: 767px) {
    /* Keep zoom and live-location controls in one clear stack above the
       Nearby Providers sheet instead of translating one control over another. */
    #map .leaflet-bottom.leaflet-right {
        right: 12px !important;
        bottom: 78px !important;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
    }

    #map .leaflet-bottom.leaflet-right .leaflet-control {
        position: relative !important;
        inset: auto !important;
        float: none !important;
        margin: 0 !important;
    }

    #map .leaflet-control-zoom {
        right: auto !important;
        bottom: auto !important;
    }

    #map .live-location-control {
        transform: none !important;
    }
}

.navigation-user-icon {
    background: transparent;
    border: none;
}

.navigation-user-arrow {
    position: relative;
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

.navigation-user-arrow-head {
    position: absolute;
    top: 1px;
    left: 8px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 23px solid #2563eb;
}

.navigation-user-arrow-body {
    position: absolute;
    top: 16px;
    left: 13px;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    background: #2563eb;
    border: 1px solid white;
}

/* Destination reached popup */
.destination-reached-popup {
    position: absolute;
    top: 145px;
    right: 24px;
    z-index: 10001;
    width: min(340px, calc(100% - 32px));
    padding: 18px 36px 18px 16px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    border: 1px solid #e5e7eb;
    animation: destinationPopupIn 0.25s ease-out;
}

.destination-reached-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.destination-reached-icon {
    color: #16a34a;
    font-size: 30px;
    flex-shrink: 0;
}

.destination-reached-title {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.destination-reached-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
}

.destination-reached-close {
    position: absolute;
    top: 7px;
    right: 7px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #6b7280;
    cursor: pointer;
}

.destination-reached-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.destination-reached-close .material-symbols-outlined {
    font-size: 19px;
}

@keyframes destinationPopupIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .destination-reached-popup {
        top: 115px;
        right: 12px;
        width: min(320px, calc(100% - 24px));
    }
}
