/**
 * FANbox picker chrome — match GLS DPM dialog (inset, radius, 48px circles).
 * Map tiles are Esri World Street Map (zoom 19); chrome clones GLS DPM.
 *
 * @author advrider.ro
 */

#adb-fan-map {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: #00000080;
    color: #111417;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.35;
    box-sizing: border-box;
}

#adb-fan-map *,
#adb-fan-map *::before,
#adb-fan-map *::after {
    box-sizing: border-box;
}

#adb-fan-map.is-open {
    display: block;
}

.adb-fan-map__frame {
    position: absolute;
    inset: 0;
    display: flex;
    padding: 16px;
}

.adb-fan-map__surface {
    display: flex;
    flex: 1 1 auto;
    flex-direction: row;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 8px 24px #1114172e;
}

.adb-fan-map__side {
    display: flex;
    flex: 0 0 22.5rem;
    flex-direction: column;
    width: 22.5rem;
    max-width: 42%;
    min-width: 18rem;
    height: 100%;
    background: #fff;
}

.adb-fan-map__search {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 16px;
}

.adb-fan-map__search input {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0 16px;
    border: 1px solid #e6e8eb;
    border-radius: 10px;
    background: #fff;
    color: #1b1f24;
    font-size: 16px;
    line-height: 48px;
    appearance: none;
    -webkit-appearance: none;
}

.adb-fan-map__search input::-webkit-search-decoration,
.adb-fan-map__search input::-webkit-search-cancel-button {
    appearance: none;
    -webkit-appearance: none;
}

.adb-fan-map__search input:focus {
    outline: 0;
    border-color: #c5cbd3;
    background: #fff;
}

.adb-fan-map__search input::placeholder {
    color: #8a939c;
}

.adb-fan-map__search-btn,
.adb-fan-map__close,
.adb-fan-map__locate {
    display: inline-flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #f3f3f3;
    border-radius: 50%;
    background: #fff;
    color: #1b1f24;
    box-shadow: 0 4px 4px #6674833d;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.adb-fan-map__search-btn svg,
.adb-fan-map__close svg,
.adb-fan-map__locate svg {
    display: block;
    width: 24px;
    height: 24px;
}

.adb-fan-map__search-btn .adb-fan-map__search-ico--filter {
    display: none;
}

.adb-fan-map__puller {
    display: none;
}

.adb-fan-map__search-btn:hover,
.adb-fan-map__close:hover,
.adb-fan-map__locate:hover {
    background: #fff;
}

.adb-fan-map__list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.adb-fan-map__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: auto;
    margin: 0 16px;
    padding: 16px;
    border: 0;
    border-top: 1px solid #d6dbe1;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.adb-fan-map__item:first-child {
    border-top-color: transparent;
}

.adb-fan-map__item:hover,
.adb-fan-map__item.is-on {
    background: #f3f3f3;
    border-top-color: transparent;
}

.adb-fan-map__item:hover + .adb-fan-map__item,
.adb-fan-map__item.is-on + .adb-fan-map__item {
    border-top-color: transparent;
}

.adb-fan-map__ico {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-top: 2px;
    color: #061ab1;
    line-height: 0;
}

.adb-fan-map__item.is-busy .adb-fan-map__ico {
    color: #ff860d;
}

.adb-fan-map__ico svg {
    display: block;
    width: 24px;
    height: 24px;
}

.adb-fan-map__meta {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
}

.adb-fan-map__name {
    display: block;
    color: #172154;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.adb-fan-map__addr {
    display: flex;
    flex-flow: wrap;
    gap: 0 0.5ch;
    color: #111417;
    font-size: 14px;
    line-height: 1.35;
}

.adb-fan-map__addr-line {
    display: inline;
}

.adb-fan-map__hours {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #51be14;
}

.adb-fan-map__busy {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 6px;
    padding: 4px 8px;
    border: 1px solid #ff860d;
    border-radius: 5px;
    background: #fff;
    color: #ff860d;
    text-align: left;
}

.adb-fan-map__busy-ico {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    line-height: 0;
}

.adb-fan-map__busy-ico svg {
    display: block;
    width: 14px;
    height: 14px;
}

.adb-fan-map__busy-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.adb-fan-map__busy-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.adb-fan-map__busy-body {
    font-size: 10px;
    font-weight: 400;
    line-height: 1.3;
}

.adb-fan-map__chevron {
    flex: 0 0 20px;
    align-self: center;
    width: 20px;
    height: 20px;
    color: #a1acb8;
    line-height: 0;
}

.adb-fan-map__chevron svg {
    display: block;
    width: 20px;
    height: 20px;
}

.adb-fan-map__count {
    flex: 0 0 auto;
    padding: 8px 16px;
    color: #667483;
    font-size: 13px;
}

.adb-fan-map__detail {
    display: none;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

#adb-fan-map.is-detail .adb-fan-map__search,
#adb-fan-map.is-detail .adb-fan-map__list,
#adb-fan-map.is-detail .adb-fan-map__count {
    display: none;
}

#adb-fan-map.is-detail .adb-fan-map__detail {
    display: flex;
}

.adb-fan-map__detail-head {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 16px 12px;
}

.adb-fan-map__detail-title {
    flex: 1 1 auto;
    min-width: 0;
    color: #172154;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.adb-fan-map__detail-back {
    display: inline-flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #f3f3f3;
    border-radius: 50%;
    background: #fff;
    color: #1b1f24;
    box-shadow: 0 4px 4px #6674833d;
    cursor: pointer;
    appearance: none;
}

.adb-fan-map__detail-back svg {
    display: block;
    width: 24px;
    height: 24px;
}

.adb-fan-map__detail-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 16px 16px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.adb-fan-map__near-label {
    margin: 12px 0 6px;
    color: #061ab1;
    font-size: 13px;
    font-weight: 700;
}

.adb-fan-map__near-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.adb-fan-map__near {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: #061ab1;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    text-decoration: underline;
    cursor: pointer;
}

.adb-fan-map__svc {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    color: #111417;
    font-size: 14px;
}

.adb-fan-map__svc-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 1px solid #d6dbe1;
    border-radius: 50%;
    color: #51be14;
    font-size: 13px;
    font-weight: 700;
}

.adb-fan-map__detail-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    padding: 12px 16px 16px;
}

.adb-fan-map__route,
.adb-fan-map__choose {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 48px;
    padding: 0 12px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 700;
    line-height: 48px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
}

.adb-fan-map__route {
    border: 1px solid #d6dbe1;
    background: #fff;
    color: #172154;
}

.adb-fan-map__choose {
    border: 0;
    background: #ffcc00;
    color: #172154;
}

.adb-fan-map__popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 24px #1114172e;
}

.adb-fan-map__popup .leaflet-popup-content {
    margin: 12px 14px 10px;
}

.adb-fan-map__callout-name {
    color: #172154;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.adb-fan-map__callout-hours {
    margin-top: 4px;
    color: #51be14;
    font-size: 13px;
    font-weight: 600;
}

.adb-fan-map__map {
    position: relative;
    isolation: isolate;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}

.adb-fan-map__map-canvas,
.adb-fan-map__map .leaflet-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #dce4ea;
    font-family: inherit;
}

#adb-fan-map .leaflet-container img {
    max-width: none;
}

.adb-fan-map__map-btns {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0;
    pointer-events: none;
}

.adb-fan-map__map-btns > button {
    pointer-events: auto;
}

.adb-fan-map__close,
.adb-fan-map__locate {
    position: static;
    flex: 0 0 48px;
}

#adb-fan-map .leaflet-control-zoom {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 1rem 1rem 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#adb-fan-map .leaflet-bar a,
#adb-fan-map .leaflet-control-zoom a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin: 0;
    border: 1px solid #f3f3f3 !important;
    border-radius: 50% !important;
    background: #fff;
    color: #1b1f24;
    font-size: 20px;
    line-height: 48px;
    box-shadow: 0 4px 4px #6674833d;
}

#adb-fan-map .leaflet-bar a:hover,
#adb-fan-map .leaflet-control-zoom a:hover {
    background: #fff;
}

.adb-fan-pin,
.adb-fan-cluster {
    display: flex;
    align-items: center;
    justify-content: center;
}

.adb-fan-pin {
    width: 28px;
    height: 28px;
    border: 2px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: #1e4d9c;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
    transform: rotate(-45deg);
}

.adb-fan-pin span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #fff;
    transform: rotate(45deg);
}

.adb-fan-pin.is-on {
    background: #c0392b;
    z-index: 2;
}

.adb-fan-cluster {
    width: 32px;
    height: 32px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #1e4d9c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
}

.adb-fan-cluster.is-lg {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

@media (max-width: 767px) {
    .adb-fan-map__frame {
        padding: 0;
    }

    .adb-fan-map__surface {
        display: block;
        position: relative;
        border-radius: 0;
        background: #fff;
    }

    .adb-fan-map__map {
        position: absolute;
        inset: 0;
        height: auto;
    }

    .adb-fan-map__side {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1200;
        display: flex;
        flex: none;
        flex-direction: column;
        width: 100%;
        max-width: none;
        min-width: 0;
        height: min(58%, 512px);
        overflow: hidden;
        background: #fff;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 8px 12px #1114170a;
    }

    .adb-fan-map__search input,
    .adb-fan-map__search-btn {
        border-color: #e6e8eb;
        border-radius: 12px;
        box-shadow: none;
    }

    .adb-fan-map__search-btn .adb-fan-map__search-ico--find {
        display: none;
    }

    .adb-fan-map__search-btn .adb-fan-map__search-ico--filter {
        display: block;
    }

    .adb-fan-map__puller {
        display: flex;
        flex: 0 0 40px;
        align-items: flex-start;
        justify-content: center;
        width: 100%;
        height: 40px;
        margin: 0;
        padding-top: 10px;
        overflow: hidden;
        cursor: grab;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .adb-fan-map__puller:active,
    #adb-fan-map.is-sheet-drag .adb-fan-map__puller {
        cursor: grabbing;
    }

    #adb-fan-map.is-sheet-drag .adb-fan-map__list {
        overflow: hidden;
    }

    .adb-fan-map__puller::before {
        display: block;
        width: 48px;
        height: 6px;
        border-radius: 3px;
        background: #c5cbd3;
        content: "";
    }

    #adb-fan-map .leaflet-control-zoom {
        margin: 0 12px calc(min(58vh, 512px) + 12px) 0;
    }
}
