﻿/* ---------------------------------------------------
   MAP WRAPPER
--------------------------------------------------- */
.rz-map {
    height: 10rem;
    padding: 1.25rem;
    background-color: #fff;
    box-shadow: 0 8px 10px rgba(0, 0, 0, 0.01);
    border-radius: .25rem;
}

.rz-map-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.map-error-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    padding: 2rem;
    text-align: center;
}

/* ---------------------------------------------------
   INFO‑WINDOW FADE/POP ANIMATION
--------------------------------------------------- */
.rz-info-window {
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ---------------------------------------------------
   CSS‑BASED PINS (fallback)
--------------------------------------------------- */
.pin-css {
    position: relative;
    background: #ff5722;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

    .pin-css::after {
        content: '';
        position: absolute;
        bottom: -6px;
        left: 50%;
        transform: translateX(-50%);
        border-width: 6px 6px 0;
        border-style: solid;
        border-color: #ff5722 transparent;
    }

/* ---------------------------------------------------
   MARKER‑PIN HTML/CSS INFO‑TABLE (when closed)
--------------------------------------------------- */
.mapInfo {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 50%;
    color: #263238;
    font-size: 14px;
    gap: 0.75rem;
    width: 30px;
    height: 30px;
    padding: 0.25rem;
    transition: all 0.3s ease-out;
}

    .mapInfo::after {
        content: "";
        position: absolute;
        top: 95%;
        left: 50%;
        transform: translateX(-50%);
        border-left: 9px solid transparent;
        border-right: 9px solid transparent;
        border-top: 9px solid #fff;
        transition: all 0.3s ease-out;
        z-index: 1;
    }

    .mapInfo .icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }

        .mapInfo .icon svg {
            width: auto;
            height: 20px;
        }

    .mapInfo .details {
        display: none;
        flex-direction: column;
        flex: 1;
    }

    .mapInfo .price {
        font-weight: bold;
        margin-right: 0.5rem;
    }

    .mapInfo .address {
        font-size: 0.625rem;
        color: #9e9e9e;
        margin: 0.25rem 0;
    }

    .mapInfo .features {
        display: flex;
        gap: 0.5rem;
        align-items: flex-end;
    }

        .mapInfo .features > div {
            display: flex;
            align-items: center;
            gap: 0.25rem;
            font-size: 0.625rem;
            padding: 0.25rem;
            background: #f5f5f5;
            border: 1px solid #ccc;
            border-radius: 0.25rem;
        }

    .mapInfo.highlight {
        width: auto;
        height: 80px;
        padding: 0.5rem 1rem;
        border-radius: 0.5rem;
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

        .mapInfo.highlight::after {
            border-top-color: #fff;
        }

        .mapInfo.highlight .details {
            display: flex;
        }

        .mapInfo.highlight .icon svg {
            width: 50px;
            height: 50px;
        }

        /* Icon color overrides using :has() if supported */
        .mapInfo.highlight:has(.fa-house) .icon {
            color: var(--house-color);
        }

    .mapInfo:not(.highlight):has(.fa-house) {
        background: var(--house-color);
    }

        .mapInfo:not(.highlight):has(.fa-house)::after {
            border-top-color: var(--house-color);
        }

    .mapInfo.highlight:has(.fa-building) .icon {
        color: var(--building-color);
    }

    .mapInfo:not(.highlight):has(.fa-building) {
        background: var(--building-color);
    }

        .mapInfo:not(.highlight):has(.fa-building)::after {
            border-top-color: var(--building-color);
        }

    .mapInfo.highlight:has(.fa-shop) .icon {
        color: var(--shop-color);
    }

    .mapInfo:not(.highlight):has(.fa-shop) {
        background: var(--shop-color);
    }

        .mapInfo:not(.highlight):has(.fa-shop)::after {
            border-top-color: var(--shop-color);
        }

/* ---------------------------------------------------
   CLUSTER ICON STYLING
--------------------------------------------------- */
.marker-cluster {
    background-color: rgba(233, 30, 99, 0.7);
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    text-align: center;
    line-height: 40px;
}

    .marker-cluster div {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* ---------------------------------------------------
   RESPONSIVE INFO WINDOW (pop‑up box over a marker)
--------------------------------------------------- */
.mapInfoWindow {
    animation: fadeInScale 0.25s ease-out;
    background: #fff;
    border-radius: 0.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-family: sans-serif;
    font-size: 0.9rem;
    color: #333;
    padding: 0.75rem;
    box-sizing: border-box;
    /* default width but shrink on small screens */
    width: 300px;
    max-width: 80vw;
}

@media (max-width: 600px) {
    .mapInfoWindow {
        width: 90vw;
        max-width: none;
        font-size: 0.85rem;
    }
}

.mapInfoWindow .miw-icon {
    width: 100%;
    margin-bottom: 0.5rem;
}

    .mapInfoWindow .miw-icon img {
        display: block;
        width: 100%;
        height: auto;
        border-radius: 4px;
    }

.mapInfoWindow .miw-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mapInfoWindow .miw-title {
    font-size: 1.1rem;
    font-weight: bold;
}

.mapInfoWindow .miw-desc {
    color: #666;
    line-height: 1.3;
}

.mapInfoWindow .miw-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mapInfoWindow .miw-features > div {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: #f5f5f5;
    border-radius: 0.25rem;
    font-size: 0.85rem;
}
