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

.dar-map-page {
    min-height: 760px;
    background: #f7f6f9;
    color: #292130;
}

.dar-map-container {
    width: min(1440px, calc(100% - 28px));
    margin-inline: auto;
}

/* Header */

.dar-map-hero {
    padding: 31px 0 27px;
    background:
        radial-gradient(
            circle at 88% 12%,
            rgba(217, 90, 43, 0.29),
            transparent 28%
        ),
        linear-gradient(
            135deg,
            #241169 0%,
            #351d80 56%,
            #1b0e4b 100%
        );
    color: #ffffff;
}

.dar-map-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 10.5px;
}

.dar-map-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.dar-map-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 25px;
    align-items: end;
}

.dar-map-hero h1 {
    margin: 0;
    font-size: clamp(29px, 4vw, 45px);
    line-height: 1.25;
    font-weight: 900;
}

.dar-map-hero p {
    max-width: 720px;
    margin: 9px 0 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 12px;
    line-height: 1.8;
}

.dar-map-hero-counts {
    display: flex;
    gap: 9px;
}

.dar-map-hero-count {
    min-width: 100px;
    padding: 12px 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.09);
    text-align: center;
    backdrop-filter: blur(10px);
}

.dar-map-hero-count strong {
    display: block;
    font-size: 20px;
    font-weight: 900;
}

.dar-map-hero-count span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.66);
    font-size: 9.5px;
}

/* Filters */

.dar-map-filter-section {
    position: relative;
    z-index: 500;
    padding: 14px 0;
    border-bottom: 1px solid #e6e2ea;
    background: #ffffff;
    box-shadow: 0 9px 25px rgba(30, 20, 55, 0.055);
}

.dar-map-filters {
    display: grid;
    grid-template-columns:
        minmax(180px, 1.3fr)
        repeat(5, minmax(125px, 0.65fr))
        auto;
    gap: 8px;
    align-items: center;
}

.dar-map-field {
    position: relative;
    min-width: 0;
}

.dar-map-input,
.dar-map-select {
    width: 100%;
    height: 43px;
    padding: 0 11px;
    border: 1px solid #e0dce5;
    border-radius: 11px;
    background: #faf9fb;
    color: #3d3550;
    font: inherit;
    font-size: 11px;
    outline: none;
}

.dar-map-input:focus,
.dar-map-select:focus {
    border-color: #735cb1;
    background: #ffffff;
}

.dar-map-reset {
    height: 43px;
    padding: 0 15px;
    border: 0;
    border-radius: 11px;
    background: #2d176f;
    color: #ffffff;
    font: inherit;
    font-size: 10.5px;
    font-weight: 850;
    cursor: pointer;
}

.dar-map-reset:hover {
    background: #d95a2b;
}

/* Layout */

.dar-map-main {
    padding: 15px 0 55px;
}

.dar-map-layout {
    display: grid;
    grid-template-columns: 365px minmax(0, 1fr);
    gap: 14px;
    align-items: stretch;
    height: calc(100vh - 245px);
    min-height: 610px;
    max-height: 890px;
}

.dar-map-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    border: 1px solid #e5e1e9;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 35px rgba(31, 21, 57, 0.065);
}

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

.dar-map-sidebar-head h2 {
    margin: 0;
    color: #312451;
    font-size: 15px;
    font-weight: 900;
}

.dar-map-sidebar-count {
    padding: 5px 8px;
    border-radius: 8px;
    background: #f0edf5;
    color: #5a4a78;
    font-size: 9.5px;
    font-weight: 800;
}

.dar-map-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
    scrollbar-width: thin;
}

.dar-map-list-card {
    display: grid;
    grid-template-columns: 93px minmax(0, 1fr);
    gap: 11px;
    margin-bottom: 9px;
    padding: 8px;
    border: 1px solid #ebe7ee;
    border-radius: 13px;
    background: #ffffff;
    cursor: pointer;
    transition: 0.2s ease;
}

.dar-map-list-card:hover,
.dar-map-list-card.is-active {
    border-color: rgba(62, 39, 128, 0.36);
    background: #faf8fc;
    box-shadow: 0 8px 20px rgba(38, 24, 71, 0.08);
}

.dar-map-list-image {
    position: relative;
    overflow: hidden;
    min-height: 82px;
    border-radius: 10px;
    background:
        linear-gradient(
            145deg,
            #35217c,
            #d95a2b
        );
}

.dar-map-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dar-map-list-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    font-size: 9px;
    font-weight: 850;
}

.dar-map-list-badge {
    position: absolute;
    top: 5px;
    inset-inline-start: 5px;
    padding: 4px 6px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.94);
    color: #31215f;
    font-size: 7.5px;
    font-weight: 900;
}

.dar-map-list-content {
    min-width: 0;
}

.dar-map-list-title {
    display: -webkit-box;
    overflow: hidden;
    margin: 1px 0 4px;
    color: #322650;
    font-size: 12px;
    line-height: 1.45;
    font-weight: 900;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dar-map-list-location {
    overflow: hidden;
    color: #847c89;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dar-map-list-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 7px;
}

.dar-map-list-specs span {
    padding: 4px 5px;
    border-radius: 6px;
    background: #f0edf5;
    color: #5b5068;
    font-size: 7.8px;
    font-weight: 750;
}

.dar-map-list-link {
    display: inline-flex;
    margin-top: 7px;
    color: #d95a2b;
    text-decoration: none;
    font-size: 9px;
    font-weight: 850;
}

.dar-map-empty {
    padding: 38px 17px;
    text-align: center;
    color: #776f7e;
    font-size: 11px;
    line-height: 1.8;
}

/* Map */

.dar-map-canvas-wrap {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dfdbe4;
    border-radius: 18px;
    background: #e9e7ec;
    box-shadow: 0 12px 35px rgba(31, 21, 57, 0.065);
}

#dar-property-map {
    width: 100%;
    height: 100%;
    min-height: 610px;
    z-index: 1;
}

.dar-map-tools {
    position: absolute;
    z-index: 450;
    top: 14px;
    inset-inline-end: 14px;
    display: grid;
    gap: 7px;
}

.dar-map-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 11px;
    border: 1px solid rgba(46, 31, 83, 0.13);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.95);
    color: #332555;
    font: inherit;
    font-size: 9.5px;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 7px 20px rgba(31, 21, 57, 0.14);
}

.dar-map-tool:hover {
    background: #2d176f;
    color: #ffffff;
}

.dar-map-legend {
    position: absolute;
    z-index: 450;
    inset-inline-start: 14px;
    bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 9px 11px;
    border: 1px solid rgba(46, 31, 83, 0.11);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.93);
    box-shadow: 0 7px 20px rgba(31, 21, 57, 0.13);
    backdrop-filter: blur(8px);
}

.dar-map-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #5d5564;
    font-size: 8.5px;
    font-weight: 750;
}

.dar-map-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.dar-map-legend-dot--project {
    background: #301873;
}

.dar-map-legend-dot--sale {
    background: #d95a2b;
}

.dar-map-legend-dot--rent {
    background: #16876b;
}

/* Leaflet marker */

.dar-property-div-icon {
    border: 0 !important;
    background: transparent !important;
}

.dar-map-pin {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 37px;
    height: 37px;
    border: 3px solid #ffffff;
    border-radius: 50% 50% 50% 8px;
    color: #ffffff;
    font-size: 10px;
    font-weight: 900;
    box-shadow: 0 7px 18px rgba(30, 19, 55, 0.28);
    transform: rotate(-45deg);
}

.dar-map-pin span {
    transform: rotate(45deg);
}

.dar-map-pin--project {
    background: #301873;
}

.dar-map-pin--sale {
    background: #d95a2b;
}

.dar-map-pin--rent {
    background: #16876b;
}

.dar-map-user-location {
    width: 19px;
    height: 19px;
    border: 4px solid #ffffff;
    border-radius: 50%;
    background: #2783e8;
    box-shadow:
        0 0 0 6px rgba(39, 131, 232, 0.2),
        0 5px 15px rgba(25, 75, 145, 0.3);
}

/* Popup */

.leaflet-popup-content-wrapper {
    overflow: hidden;
    padding: 0;
    border-radius: 15px;
    box-shadow: 0 16px 38px rgba(25, 16, 48, 0.2);
}

.leaflet-popup-content {
    width: 260px !important;
    margin: 0;
}

.dar-map-popup-image {
    height: 135px;
    overflow: hidden;
    background:
        linear-gradient(
            145deg,
            #35217c,
            #d95a2b
        );
}

.dar-map-popup-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dar-map-popup-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 850;
}

.dar-map-popup-body {
    padding: 13px;
}

.dar-map-popup-type {
    margin-bottom: 5px;
    color: #d95a2b;
    font-size: 8.5px;
    font-weight: 850;
}

.dar-map-popup-title {
    margin: 0;
    color: #302352;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 900;
}

.dar-map-popup-location {
    margin-top: 5px;
    color: #817987;
    font-size: 9px;
}

.dar-map-popup-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.dar-map-popup-specs span {
    padding: 5px 6px;
    border-radius: 7px;
    background: #f0edf5;
    color: #5b5068;
    font-size: 8px;
    font-weight: 750;
}

.dar-map-popup-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 11px;
}

.dar-map-popup-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 8.5px;
    font-weight: 850;
}

.dar-map-popup-details {
    background: #2d176f;
    color: #ffffff;
}

.dar-map-popup-directions {
    border: 1px solid #ded9e4;
    background: #faf9fb;
    color: #3c2e67;
}

/* Cluster */

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: rgba(48, 24, 115, 0.22);
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: #301873;
    color: #ffffff;
    font-weight: 900;
}

/* Mobile */

.dar-map-mobile-list-toggle {
    display: none;
}

@media (max-width: 1180px) {
    .dar-map-filters {
        grid-template-columns:
            repeat(4, minmax(135px, 1fr));
    }

    .dar-map-layout {
        grid-template-columns: 320px minmax(0, 1fr);
    }
}

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

    .dar-map-hero-counts {
        justify-content: flex-start;
    }

    .dar-map-filters {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

    .dar-map-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        max-height: none;
    }

    .dar-map-canvas-wrap {
        order: 1;
        height: 61vh;
        min-height: 480px;
    }

    #dar-property-map {
        min-height: 480px;
    }

    .dar-map-sidebar {
        order: 2;
        max-height: 620px;
    }

    .dar-map-list {
        max-height: 540px;
    }
}

@media (max-width: 580px) {
    .dar-map-container {
        width: min(100% - 18px, 1440px);
    }

    .dar-map-hero {
        padding: 24px 0;
    }

    .dar-map-hero-counts {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .dar-map-hero-count {
        min-width: 0;
    }

    .dar-map-filters {
        grid-template-columns: 1fr;
    }

    .dar-map-canvas-wrap {
        height: 66vh;
        min-height: 450px;
        border-radius: 14px;
    }

    #dar-property-map {
        min-height: 450px;
    }

    .dar-map-tools {
        top: 10px;
        inset-inline-end: 10px;
    }

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

    .dar-map-legend {
        inset-inline-start: 9px;
        bottom: 9px;
        max-width: calc(100% - 18px);
    }

    .dar-map-list-card {
        grid-template-columns: 85px minmax(0, 1fr);
    }
}
