/* ==========================================================
   BARNES MAP STYLES
========================================================== */

/* Map container */
.search_results_bien .map-view {
    width: 100%;
    height: 700px;
}

.search_results_bien .properties-map {
    width: 100%;
    height: 700px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Mobile */
@media (max-width: 768px) {
    .search_results_bien .properties-map {
        height: 500px;
        border-radius: 0;
    }
}

/* Custom Popup Styles */
.leaflet-popup-content-wrapper {
    border-radius: 4px; /* Slightly reduced to match cards if they had any, standard clean look */
    padding: 0;
    overflow: hidden;
    box-shadow: 0 3px 14px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 0;
    min-width: 280px;
}

.barnes-map-popup {
    font-family: inherit;
    background: var(--white);
}

/* Image - Aspect ratio 4/3 like listing */
.barnes-map-popup-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.barnes-map-popup-content {
    padding: 16px;
}

/* Type - Matches .property-header */
.barnes-map-popup-type {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--brand-grey-300); /* Matches listing */
    margin-bottom: 6px;
}

/* Title - Matches .property-title */
.barnes-map-popup-title {
    font-size: 15px;
    font-weight: 400;
    margin: 0 0 6px;
    color: var(--noir-barnes);
    line-height: 1.3;
}

/* Title Link - Matches .property-title a */
.barnes-map-popup-title a {
    color: var(--noir-barnes);
    text-decoration: none;
    text-transform: uppercase;
    font-weight: 600;
    transition: color 0.2s ease;
}

.barnes-map-popup-title a:hover {
    text-decoration: underline; /* Matches listing hover */
}

/* Location - Matches .property-location */
.barnes-map-popup-location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--brand-grey-400); /* Matches listing */
    margin-bottom: 6px;
}

.barnes-map-popup-location i {
    font-size: 12px;
    color: var(--brand-grey-300); /* Matches listing */
}

/* Meta - Matches .property-meta */
.barnes-map-popup-meta {
    font-size: 13px;
    color: var(--brand-grey-400); /* Matches listing */
    margin-bottom: 6px;
}

/* Strong tags in meta - Matches listing */
.barnes-map-popup-meta strong {
    font-weight: 600;
    color: var(--noir-barnes);
}

/* Price - Matches .property-price */
.barnes-map-popup-price {
    font-size: 14px;
    color: var(--noir-barnes);
    /* font-weight removed to match listing regular weight if applicable, listing doesn't specify weight so inherits 400 usually, but let's keep it clean */
}

/* Link Button - Kept as functional element but styled to fit */
.barnes-map-popup-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--noir-barnes);
    color: var(--white);
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-top: 12px;
    transition: background 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.barnes-map-popup-link:hover {
    background: var(--rouge-barnes);
    color: var(--white);
}

/* Custom Marker Icon - Barnes Style (opzionale - attualmente usa marker default) */
.barnes-marker-icon {
    background: var(--noir-barnes);
    border: 3px solid var(--white);
    border-radius: 50% 50% 50% 0;
    width: 36px;
    height: 36px;
    transform: rotate(-45deg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.barnes-marker-icon::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--white);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Active marker */
.barnes-marker-icon.active {
    background: var(--rouge-barnes);
}

/* Hide list view when map is active - OVERRIDDEN BY JS NOW for split view */
/* .search_results_bien.map-active #search-results { display: none; } */

/* Split View Styles */
#list-column.split-view-list .col-md-6 {
    width: 100%;
    flex: 0 0 100%;
    max-width: 100%;
}

/* Ensure cards look good in narrow column */
#list-column.split-view-list .property-media .property-image {
    aspect-ratio: 16 / 9; /* Slightly shorter to fit more? Or keep 4/3 */
}

/* Sticky Map on Desktop */
@media (min-width: 992px) {
    #map-column {
        position: sticky;
        top: 20px;
        height: calc(100vh - 40px);
    }
    .map-view, .properties-map {
        height: 100% !important;
        margin-top: 0 !important;
    }
}

/* Mobile Map Height Increase */
@media (max-width: 768px) {
    .search_results_bien .properties-map {
        height: 75vh; /* Taller on mobile as requested */
        border-radius: 0;
    }
}

/* Fix Leaflet icon path issues */
.leaflet-default-icon-path {
    background-image: url('../map/leaflet/images/marker-icon.png');
}

/* No coordinates message */
.map-no-coordinates {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 16px;
    color: #666;
    text-align: center;
    padding: 40px 20px;
}

/* ==========================================================
   MARKER CLUSTER STYLES
========================================================== */
.marker-cluster-barnes {
    background: transparent;
}

.barnes-cluster-icon {
    width: 100%;
    height: 100%;
    background-color: #B4002F; /* Barnes Red */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(180, 0, 47, 0.4);
    border: 2px solid #fff; /* Optional: adds a nice white ring */
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.barnes-cluster-icon:hover {
    transform: scale(1.1);
    background-color: #900026; /* Darker red on hover */
    cursor: pointer;
}

.barnes-cluster-icon span {
    line-height: 1;
}

/* ==========================================================
   SINGLE MARKER STYLES
========================================================== */
.barnes-single-icon {
    background: transparent;
    border: none;
}

.barnes-single-icon svg {
    transition: transform 0.2s ease;
    cursor: pointer;
    display: block;
}

.barnes-single-icon:hover svg {
    transform: scale(1.2);
}
