/* Leaflet + OpenStreetMap look and feel for the admin and vendor panels. */
.leaflet-container {
    /* Own stacking context: map panes must stay under the navbar and floating panels. */
    z-index: 0;
    direction: ltr;
    font-family: "Zain", sans-serif;
    font-size: 14px;
    background: #e9edf6;
}

#map,
#map-canvas,
#map_canvas,
#location_map_canvas {
    min-height: 200px;
}

/* Bars, buttons */
.leaflet-bar {
    border: 0 !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(11, 31, 75, 0.2);
}

.leaflet-bar a,
.leaflet-bar a:hover,
.leaflet-bar a:focus {
    width: 34px;
    height: 34px;
    line-height: 34px;
    border-bottom-color: rgba(255, 255, 255, 0.16);
    background-color: #0b1f4b;
    color: #fff;
}

.leaflet-bar a:hover,
.leaflet-bar a:focus {
    background-color: #c8f031;
    color: #0b1f4b;
}

.leaflet-bar a.leaflet-disabled {
    background-color: #3d5488;
    color: #b9c3da;
}

/* Pins: zero-size icon, so the bottom of the pin sits exactly on the coordinate. */
.osm-marker {
    background: none;
    border: 0;
}

.osm-marker__pin,
.osm-marker__image {
    position: absolute;
    bottom: 0;
    left: 0;
    transform: translateX(-50%);
    max-width: none;
    filter: drop-shadow(0 2px 3px rgba(11, 31, 75, 0.35));
}

/* Popups */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(11, 31, 75, 0.22);
}

.leaflet-popup-content {
    margin: 10px 14px;
    font-size: 14px;
    line-height: 1.4;
    color: #0b1f4b;
}

[dir="rtl"] .leaflet-popup-content {
    direction: rtl;
    text-align: right;
}

.leaflet-popup-content::after {
    content: "";
    display: block;
    clear: both;
}

/* Search box floating over the map */
.osm-search {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: min(320px, calc(100% - 120px));
}

[dir="rtl"] .osm-search {
    direction: rtl;
}

.osm-search #pac-input {
    display: block;
    position: static !important;
    width: 100% !important;
    height: 38px;
    padding-inline: 12px;
    margin: 0;
    transform: none;
    border: 1px solid #0b1f4b;
    border-radius: 8px !important;
    outline: none;
    background: #fff;
    color: #0b1f4b;
    font-family: inherit;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(11, 31, 75, 0.18);
}

.osm-search #pac-input:focus {
    border-color: #c8f031;
    box-shadow: 0 0 0 3px rgba(200, 240, 49, 0.45);
}

.osm-search__results {
    display: none;
    margin: 4px 0 0;
    padding: 4px;
    max-height: 220px;
    overflow-y: auto;
    list-style: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(11, 31, 75, 0.22);
}

.osm-search__results.is-open {
    display: block;
}

.osm-search__result,
.osm-search__message {
    padding: 7px 10px;
    border-radius: 6px;
    color: #0b1f4b;
    font-size: 13px;
    line-height: 1.35;
}

.osm-search__result {
    cursor: pointer;
}

.osm-search__result:hover,
.osm-search__result.is-active {
    background: #c8f031;
}

.osm-search__message {
    color: #5b6777;
}

/* Zone drawing toolbar */
.osm-draw-toolbar a {
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px;
}

.osm-draw-toolbar__draw {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 7-3.5 11h-11L3 10z'/%3E%3C/svg%3E");
}

.osm-draw-toolbar__clear {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

.osm-draw-toolbar__draw:hover,
.osm-draw-toolbar__draw:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1f4b' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M12 3l9 7-3.5 11h-11L3 10z'/%3E%3C/svg%3E");
}

.osm-draw-toolbar__clear:hover,
.osm-draw-toolbar__clear:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b1f4b' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

.leaflet-draw-tooltip {
    background: #0b1f4b;
    border-radius: 6px;
    font-family: inherit;
    font-size: 13px;
}

/* Leaflet.draw parks the tooltip in the map corner until the mouse first moves over it. */
.leaflet-container:not(:hover) .leaflet-draw-tooltip {
    display: none;
}

.leaflet-draw-tooltip::before {
    border-right-color: #0b1f4b;
}

.leaflet-div-icon.leaflet-editing-icon {
    border: 2px solid #0b1f4b;
    border-radius: 50%;
    background: #c8f031;
}

/* Dashboards float the delivery man search bar over the top of the map. */
@media (min-width: 768px) {
    .__map-wrapper-2 .leaflet-top {
        top: 56px;
    }
}

@media (max-width: 575px) {
    .osm-search {
        top: 54px;
        left: 10px;
        width: calc(100% - 20px);
        transform: none;
    }

    .osm-draw-toolbar a {
        width: 40px;
        height: 40px;
        line-height: 40px;
    }
}
