/* ==========================================
   Dar Arabia — Property Map Enhancements
   ========================================== */

.dar-map-filter-section {
    position: sticky;
    top: 0;
    z-index: 720;
    backdrop-filter: blur(12px);
}

.dar-map-filter-section::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 1px;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(48, 24, 115, 0.18),
            transparent
        );
}

.dar-map-filters {
    transition:
        max-height 0.3s ease,
        opacity 0.25s ease,
        transform 0.25s ease;
}

.dar-map-mobile-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    min-height: 43px;
    border: 1px solid #dfdae5;
    border-radius: 11px;
    background: #ffffff;
    color: #34255d;
    font: inherit;
    font-size: 10.5px;
    font-weight: 850;
    cursor: pointer;
}

.dar-map-mobile-filter-toggle svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dar-map-mobile-filter-toggle__count {
    display: none;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #d95a2b;
    color: #ffffff;
    font-size: 8px;
    line-height: 18px;
}

.dar-map-mobile-filter-toggle__count.is-visible {
    display: inline-block;
}

.dar-map-canvas-wrap {
    transition:
        border-radius 0.25s ease,
        box-shadow 0.25s ease;
}

.dar-map-canvas-wrap.is-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #e9e7ec;
}

.dar-map-canvas-wrap.is-fullscreen
#dar-property-map {
    width: 100% !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
}

body.dar-map-fullscreen-open {
    overflow: hidden !important;
}

.dar-map-tool {
    gap: 6px;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.dar-map-tool:hover {
    transform: translateY(-1px);
}

.dar-map-tool svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dar-map-tool.is-active {
    background: #d95a2b;
    color: #ffffff;
}

.dar-map-mobile-results {
    display: none;
}

.dar-map-results-overlay {
    position: fixed;
    inset: 0;
    z-index: 9800;
    display: none;
    background: rgba(20, 12, 44, 0.52);
    backdrop-filter: blur(4px);
}

.dar-map-results-overlay.is-open {
    display: block;
}

.dar-map-sidebar-mobile-head {
    display: none;
}

.dar-map-results-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 10px;
    background: #f0edf5;
    color: #39295f;
    font-size: 19px;
    cursor: pointer;
}

.dar-map-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.dar-map-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid #e1dce7;
    border-radius: 999px;
    background: #ffffff;
    color: #554966;
    font-size: 8.5px;
    font-weight: 800;
}

.dar-map-active-filter button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eeeaf3;
    color: #5c506e;
    font-size: 11px;
    cursor: pointer;
}

.dar-map-load-state {
    position: absolute;
    inset: 0;
    z-index: 430;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    background:
        linear-gradient(
            135deg,
            rgba(248, 247, 250, 0.9),
            rgba(233, 230, 238, 0.86)
        );
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.dar-map-load-state.is-visible {
    opacity: 1;
    visibility: visible;
}

.dar-map-load-state__card {
    min-width: 190px;
    padding: 20px;
    border: 1px solid #ded9e5;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    text-align: center;
    box-shadow: 0 14px 36px rgba(32, 21, 59, 0.12);
}

.dar-map-load-state__spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 10px;
    border: 3px solid #e6e1ec;
    border-top-color: #d95a2b;
    border-radius: 50%;
    animation: dar-map-spin 0.8s linear infinite;
}

.dar-map-load-state__card strong {
    display: block;
    color: #332653;
    font-size: 11px;
}

.dar-map-coordinate-notice {
    display: none;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #f0d7ca;
    border-radius: 11px;
    background: #fff7f2;
    color: #87523b;
    font-size: 9.5px;
    line-height: 1.7;
}

.dar-map-coordinate-notice.is-visible {
    display: block;
}

.dar-map-pin {
    transition:
        transform 0.2s ease,
        filter 0.2s ease;
}

.dar-map-pin:hover {
    filter: brightness(1.08);
}

.leaflet-marker-icon:hover
.dar-map-pin {
    transform:
        rotate(-45deg)
        scale(1.12);
}

.dar-map-list-card {
    position: relative;
}

.dar-map-list-card.is-active::before {
    content: "";
    position: absolute;
    inset-block: 10px;
    inset-inline-start: 0;
    width: 3px;
    border-radius: 999px;
    background: #d95a2b;
}

.dar-map-list-card.is-active {
    transform: translateX(-2px);
}

.dar-map-sidebar-count {
    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.dar-map-sidebar-count.is-updated {
    background: #d95a2b;
    color: #ffffff;
}

.dar-map-share-message {
    position: fixed;
    z-index: 100000;
    right: 50%;
    bottom: 28px;
    transform:
        translateX(50%)
        translateY(20px);
    padding: 11px 16px;
    border-radius: 11px;
    background: #27145f;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    box-shadow: 0 12px 32px rgba(25, 14, 54, 0.26);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s ease;
}

.dar-map-share-message.is-visible {
    opacity: 1;
    visibility: visible;
    transform:
        translateX(50%)
        translateY(0);
}

@keyframes dar-map-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 900px) {
    .dar-map-filter-section {
        top: 0;
        padding: 9px 0;
    }

    .dar-map-mobile-filter-toggle {
        display: flex;
    }

    .dar-map-filters {
        display: none;
        grid-template-columns: 1fr 1fr;
        margin-top: 8px;
        padding: 10px;
        border: 1px solid #e5e0e9;
        border-radius: 13px;
        background: #ffffff;
        box-shadow: 0 12px 30px rgba(32, 21, 59, 0.1);
    }

    .dar-map-filter-section.is-mobile-open
    .dar-map-filters {
        display: grid;
    }

    .dar-map-active-filters {
        margin-bottom: 2px;
    }

    .dar-map-mobile-results {
        position: absolute;
        z-index: 460;
        inset-inline-start: 12px;
        top: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 40px;
        padding: 0 12px;
        border: 1px solid rgba(45, 23, 111, 0.14);
        border-radius: 11px;
        background: rgba(255, 255, 255, 0.95);
        color: #332555;
        font: inherit;
        font-size: 9.5px;
        font-weight: 850;
        box-shadow: 0 7px 20px rgba(31, 21, 57, 0.14);
        cursor: pointer;
    }

    .dar-map-sidebar {
        position: fixed;
        z-index: 9900;
        right: 10px;
        bottom: 10px;
        left: 10px;
        max-height: min(76dvh, 650px);
        border-radius: 19px;
        transform: translateY(calc(100% + 30px));
        visibility: hidden;
        transition:
            transform 0.32s ease,
            visibility 0.32s ease;
    }

    .dar-map-sidebar.is-mobile-open {
        transform: translateY(0);
        visibility: visible;
    }

    .dar-map-sidebar-mobile-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 12px 14px;
        border-bottom: 1px solid #ece8ef;
    }

    .dar-map-sidebar-mobile-head strong {
        color: #302352;
        font-size: 12px;
    }

    .dar-map-sidebar
    .dar-map-sidebar-head {
        padding: 11px 14px;
    }

    .dar-map-list {
        max-height: calc(76dvh - 115px);
    }
}

@media (max-width: 580px) {
    .dar-map-filters {
        grid-template-columns: 1fr;
    }

    .dar-map-tool span {
        display: none;
    }

    .dar-map-tool {
        width: 38px;
        padding: 0;
    }

    .dar-map-mobile-results {
        top: 9px;
        inset-inline-start: 9px;
    }

    .dar-map-legend {
        padding: 7px 9px;
    }

    .dar-map-legend-item {
        font-size: 7.8px;
    }
}
