
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

#map {
    position: fixed;
    inset: 0;
    z-index: 1;
    /* left: 380px; */
}

@media (min-width: 992px) {
    #map {
        left: 380px;
    }
}


/*@media (min-width: 992px) {
    #legendOffcanvas {
        transform: none !important;
        visibility: visible !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 380px;
        height: 100%;
        border-right: 1px solid #ddd;
        z-index: 1000;
    }
}*/

/* Leaflet */
.leaflet-div-icon {
    background: none;
    border: none;
}

/*
        * Property styles in unhighlighted state.
        */
.property {
    align-items: center;
    background-color: #ffffff;
    border-radius: 50%;
    color: #263238;
    display: flex;
    /*font-size: 14px;*/
    gap: 15px;
    height: 30px;
    width: 30px;
    justify-content: center;
    padding: 4px;
    transition: all 0.3s ease-out;
    /*position: relative;
            transform: translateY(-9px);*/
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    transform-origin: bottom center;
}

    .property::after {
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-top: 9px solid #ffffff;
        content: '';
        height: 0;
        position: absolute;
        top: 90%;
        /*top: 95%;*/
        /*top: 100%;*/
        left: 50%;
        transform: translate(-50%, 0);
        transition: all 0.3s ease-out;
        width: 0;
        z-index: -1;
    }

    .property .icon {
        align-items: center;
        display: flex;
        justify-content: center;
        color: #ffffff;
    }

        .property .icon svg {
            height: 15px;
            width: auto;
        }

    .property .details {
        display: none;
        flex-direction: column;
        flex: 1;
    }

    .property .address {
        color: #9e9e9e;
        font-size: 10px;
        /*margin-bottom: 10px;*/
        /*margin-top: 5px;*/
    }

    .property .features {
        align-items: flex-end;
        display: flex;
        flex-direction: row;
        gap: 10px;
    }

        .property .features > div {
            align-items: center;
            background: #f5f5f5;
            border-radius: 5px;
            border: 1px solid #ccc;
            display: flex;
            font-size: 10px;
            gap: 5px;
            padding: 5px;
            /*width: 45px;*/
            width: auto;
        }

    /*
        * Property styles in highlighted state.
        */
    .property.highlight {
        background-color: #ffffff;
        border-radius: 8px;
        box-shadow: 10px 10px 5px rgba(0, 0, 0, 0.2);
        /*height: 80px;*/
        padding: 8px 15px;
        height: auto;
        width: auto;
        min-width: 200px;
        /*width:200px;*/
        transform: translateX(-50%);
    }

        .property.highlight::after {
            border-top: 9px solid #ffffff;
        }

        .property.highlight .details {
            display: flex;
        }

        .property.highlight .icon svg {
            width: 50px;
            height: 50px;
        }

    .property .bed {
        color: #ffa000;
    }

    .property .bath {
        color: #03a9f4;
    }

    .property .size {
        color: #388e3c;
    }

    /*
        * House icon colors.
        */
    .property.highlight:has(.fa-house) .icon {
        color: var(--house-color);
    }

    .property:not(.highlight):has(.fa-house) {
        background-color: var(--house-color);
    }

        .property:not(.highlight):has(.fa-house)::after {
            border-top: 9px solid var(--house-color);
        }

    /*
        * Building icon colors.
        */
    .property.highlight:has(.fa-building) .icon {
        color: var(--building-color);
    }

    .property:not(.highlight):has(.fa-building) {
        background-color: var(--building-color);
    }

        .property:not(.highlight):has(.fa-building)::after {
            border-top: 9px solid var(--building-color);
        }

    /*
        * Warehouse icon colors.
        */
    .property.highlight:has(.fa-warehouse) .icon {
        color: var(--warehouse-color);
    }

    .property:not(.highlight):has(.fa-warehouse) {
        background-color: var(--warehouse-color);
    }

        .property:not(.highlight):has(.fa-warehouse)::after {
            border-top: 9px solid var(--warehouse-color);
        }

    /*
        * Shop icon colors.
        */
    .property.highlight:has(.fa-shop) .icon {
        color: var(--shop-color);
    }

    .property:not(.highlight):has(.fa-shop) {
        background-color: var(--shop-color);
    }

        .property:not(.highlight):has(.fa-shop)::after {
            border-top: 9px solid var(--shop-color);
        }



.property {
    --poi-color: #7b1fa2;
    --poiOpen-color:#000000;
    background-color: var(--poi-color);
}

    .property::after {
        border-top-color: var(--poi-color);
        z-index: -1;
    }

    .property.highlight {
        background-color: #fff;
        width: auto !important;
        height: auto !important;
    }

        .property.highlight .icon {
            color: var(--poi-color);
        }

    /* Premium (opcional, discreto) */
    .property.premium {
        box-shadow: 0 0 0 3px rgba(255,215,0,0.8);
        height: 40px;
        width: 40px;
    }

        .property.premium .avatar {
            width: 38px;
            height: 38px;
            border-radius: 50%;
            /*border: 2px solid*/
        }

        .property.premium.highlight .avatar {
            width: 50px;
            height: auto;
            border-radius: 10px;
            /*border: 2px solid*/
            color: var(--poiOpen-color);
        }

        .property.premium::after {
            border-top-color: #ffd700cc; /*var(--poi-color);*/
            margin-top: 4px;
            z-index: -1;
        }

        .property.premium.highlight::after {
            display:none;
        }

/* ===========================
   LEGENDA / PAINEL LATERAL
   =========================== */

#legend-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 380px;
    height: 100%;
    background: #ffffff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    overflow: hidden;
}

#legend-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

@media (max-width: 991px) {
/*    #legend-panel {
        width: 100%;
        height: 70%;
        bottom: 0;
        top: auto;
        border-right: none;
        border-top: 1px solid #ddd;
        border-radius: 12px 12px 0 0;
    }*/

    #map {
        left: 0;
    }
}

/* ===========================
   MOBILE – LEGEND BOTTOM SHEET
   =========================== */
@media (max-width: 991px) {

    #legend-panel {
        position: fixed;
        left: 0;
        /*bottom: 0;*/
        width: 100%;
        /*height: 70vh;*/
        background: #fff;
        z-index: 1000;
        /*transform: translateY(calc(70vh - 100px));*/
        transition: transform 0.25s ease-out;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        display: flex;
        flex-direction: column;
        touch-action: none;

        top: auto;
        bottom: 0;
        height: 70vh;
        transform: translateY(0); /* JS controla */
        will-change: transform;
    }

        #legend-panel.expanded {
            transform: translateY(0);
        }
}

#legend-handle {
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    z-index: 10;
}

.handle-bar {
    width: 40px;
    height: 5px;
    border-radius: 3px;
    background: #bbb;
}
