/* ── SRP Properties Map — Frontend Styles ── */

.srp-map-wrapper {
    font-family: Arial, Helvetica, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
}

.srp-map-wrapper * {
    box-sizing: border-box;
}

/* ── Filters ── */

.srp-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.srp-map-filters label {
    font-size: 14px;
    font-weight: 600;
    color: #32373c;
    white-space: nowrap;
}

.srp-map-filters select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #32373c;
    min-width: 170px;
    cursor: pointer;
}

.srp-map-filters select:focus {
    outline: none;
    border-color: #1a7efb;
    box-shadow: 0 0 0 2px rgba(26, 126, 251, 0.2);
}

.srp-filter-count {
    font-size: 13px;
    color: #64748b;
    margin-left: auto;
}

/* ── Map Container ── */

.srp-map-container {
    width: 100%;
    height: 600px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

/* ── Legend ── */

.srp-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.srp-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #32373c;
}

.srp-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── InfoWindow ── */

.srp-iw {
    max-width: 340px;
    font-family: Arial, Helvetica, sans-serif;
    display: flex;
    flex-direction: column;
}

.srp-iw-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.srp-iw-badges {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.srp-iw-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.srp-iw-badge--type {
    background: #1a7efb;
    color: #fff;
}

.srp-iw-badge--sale {
    background: #32373c;
    color: #fff;
}

.srp-iw-title {
    font-size: 16px;
    font-weight: 700;
    color: #32373c;
    margin: 0 0 4px;
    line-height: 1.3;
}

.srp-iw-address {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 10px;
}

.srp-iw-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
}

.srp-iw-spec {
    font-size: 12px;
    color: #475569;
}

.srp-iw-spec strong {
    color: #32373c;
}

.srp-iw-highlights {
    font-size: 12px;
    color: #475569;
    margin-bottom: 10px;
    line-height: 1.4;
}

.srp-iw-brokers {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    margin-bottom: 10px;
}

.srp-iw-broker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.srp-iw-broker:last-child {
    margin-bottom: 0;
}

.srp-iw-broker-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
    flex-shrink: 0;
}

.srp-iw-broker-info {
    font-size: 12px;
    line-height: 1.4;
}

.srp-iw-broker-name {
    font-weight: 700;
    color: #32373c;
}

.srp-iw-broker-contact a {
    color: #1a7efb;
    text-decoration: none;
}

.srp-iw-broker-contact a:hover {
    text-decoration: underline;
}

.srp-iw-content {
    flex: 1;
}

.srp-iw-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    position: sticky;
    bottom: 0;
    background: #fff;
}

.srp-iw-btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.srp-iw-btn--primary {
    background: #1a7efb;
    color: #fff !important;
}

.srp-iw-btn--primary:hover {
    background: #1565d8;
    color: #fff !important;
    text-decoration: none;
}

.srp-iw-btn--primary:visited {
    color: #fff !important;
}

.srp-iw-btn--primary:active {
    color: #fff !important;
}

.srp-iw-btn--secondary {
    background: #f1f5f9;
    color: #32373c !important;
    border: 1px solid #cbd5e1;
}

.srp-iw-btn--secondary:hover {
    background: #e2e8f0;
    color: #32373c !important;
    text-decoration: none;
}

.srp-iw-btn--secondary:visited {
    color: #32373c !important;
}

/* Override Google Maps InfoWindow defaults */

.gm-style-iw {
    max-width: 360px !important;
}

.gm-style-iw-d {
    overflow: auto !important;
    max-height: 400px !important;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .srp-map-container {
        height: 550px;
    }

    .srp-map-filters {
        flex-direction: column;
        align-items: stretch;
    }

    .srp-map-filters select {
        min-width: 100%;
    }

    .srp-filter-count {
        margin-left: 0;
        text-align: center;
    }

    /* Compact InfoWindow on mobile */
    .gm-style-iw {
        max-width: 260px !important;
    }

    .gm-style-iw-d {
        max-height: 320px !important;
    }

    .srp-iw {
        max-width: 240px;
        font-size: 12px;
    }

    .srp-iw-img {
        height: 70px;
        margin-bottom: 6px;
    }

    .srp-iw-badges {
        margin-bottom: 4px;
        gap: 4px;
    }

    .srp-iw-badge {
        font-size: 9px;
        padding: 2px 5px;
    }

    .srp-iw-title {
        font-size: 13px;
        margin-bottom: 2px;
    }

    .srp-iw-address {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .srp-iw-specs {
        grid-template-columns: 1fr;
        gap: 3px;
        margin-bottom: 6px;
    }

    .srp-iw-spec {
        font-size: 11px;
    }

    .srp-iw-highlights {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .srp-iw-brokers {
        padding-top: 6px;
        margin-bottom: 6px;
    }

    .srp-iw-broker {
        gap: 6px;
        margin-bottom: 4px;
    }

    .srp-iw-broker-photo {
        width: 28px;
        height: 28px;
    }

    .srp-iw-broker-info {
        font-size: 11px;
    }

    .srp-iw-actions {
        padding-top: 6px;
        gap: 6px;
    }

    .srp-iw-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 100%;
    }

    .srp-map-legend {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .srp-map-container {
        height: 500px;
    }
}
