@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap');

:root {
    --primary: #041e42; /* Navy */
    --secondary: #c19f62; /* Gold */
    --text-main: #172b4d;
    --text-light: #5e6c84;
    --bg-light: #f4f5f7;
    --white: #ffffff;
    --border: #dfe1e6;
    --radius: 0;
    --shadow: 0 4px 12px rgba(9, 30, 66, 0.08);
}

.pimmo-container {
    max-width: 1140px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.5;
}

/* Breadcrumbs */
.pimmo-breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}
.pimmo-breadcrumb a { color: var(--primary); text-decoration: none; }
.pimmo-breadcrumb span { margin: 0 8px; opacity: 0.5; }

/* Header & Title */
.pimmo-header { margin-bottom: 40px; }
.pimmo-title { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px 0; }
.pimmo-subtitle { color: var(--text-light); font-size: 1.1rem; }

/* Stats Dashboard */
.pimmo-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}
.pimmo-stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}
.pimmo-stat-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-light); text-transform: uppercase; margin-bottom: 8px; }
.pimmo-stat-value { font-size: 2.2rem; font-weight: 800; color: var(--primary); }
.pimmo-stat-meta { display: block; font-size: 0.85rem; color: #36b37e; margin-top: 8px; font-weight: 600; }

/* Map Section */
.pimmo-map-container {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    margin-bottom: 50px;
}
#pimmo-map { height: 500px; background: #ebecf0; }

/* Grid of Zones */
.pimmo-section-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.pimmo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
.pimmo-zone-card {
    background: var(--white);
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}
.pimmo-zone-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    background: #fbfbff;
}
.pimmo-zone-name { font-weight: 600; font-size: 0.95rem; }
.pimmo-zone-price { color: var(--primary); font-weight: 700; font-size: 0.95rem; }

/* Leaflet Popup Premium */
.leaflet-container {
    font-family: 'Inter', -apple-system, sans-serif !important;
}
.leaflet-popup-content-wrapper { border-radius: 8px !important; padding: 5px !important; }
.leaflet-popup-content b { font-size: 1.1rem; color: var(--primary); }

/* --- HUB PAGE - PREMIUM TWO COLUMN LAYOUT --- */
.pi-m2-wrapper.hub-view {
    width: 100vw !important;
    max-width: none !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    background: #fff;
    overflow: hidden !important; /* Emprisonne la carte dans son conteneur */
    margin-top: 10px;
}

.pi-hub-main-container {
    display: flex !important;
    flex-direction: row !important;
    width: 100vw !important;
    min-height: calc(100vh - 155px);
}

.pi-hub-left-column {
    flex: 0 0 55% !important;
    width: 55% !important;
    background: #ffffff !important;
    color: #1a1a1a !important;
    padding: 60px 8% !important; /* Padding legacy plus large */
    box-sizing: border-box !important;
    border-right: 1px solid #f0f0f0;
    z-index: 10;
}

.pi-hub-right-column {
    flex: 0 0 45% !important;
    width: 45% !important;
    background: #040e31 !important;
    position: sticky;
    top: 0 !important; /* Retour au top legacy */
    height: 100vh;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; /* Centrage restauré */
    box-sizing: border-box !important;
    padding: 0 !important;
}

.pi-hub-map-box {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    background: #040E31;
    padding: 0 !important;
    box-sizing: border-box !important;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.pi-m2-static-wrapper {
    width: 100% !important;
    height: 100% !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pi-m2-static-wrapper svg {
    width: 100% !important;
    height: 100% !important;
    display: block;
    max-width: none !important;
    max-height: 100vh !important;
    object-fit: cover !important; /* Remplit tout l'espace à droite */
}

/* HUB SPECIFIC CONTENT STYLES */
.pi-data-hero .pi-page-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #041e42 !important; /* Navy Title */
    margin-bottom: 15px;
    text-transform: uppercase;
}
.pi-hero-label {
    color: #666666 !important;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}
.pi-section-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 25px;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 10px;
    display: inline-block;
}
.pi-links-list .pi-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}
.pi-links-list .pi-item:hover {
    padding-left: 15px;
    background: rgba(193, 159, 98, 0.05);
}
.pi-links-list .pi-item h2 { font-size: 1.2rem; font-weight: 500; margin:0; }
.pi-links-list .pi-item a { text-decoration: none; color: #1a1a1a !important; }
.pi-links-list .pi-price { font-weight: 800; color: #C19F62 !important; font-size: 1.1rem; }

/* --- SINGLE CITY / QUARTIER - STABLE GRID LAYOUT --- */
.pi-m2-wrapper.single-view {
    width: 100% !important;
    max-width: none !important;
    background: #fff;
    margin-top: 0;
}

/* SMART MASONRY LAYOUT */
.pi-layout-flex {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    width: 90% !important;
    max-width: none !important;
    margin: 0 auto;
    align-items: stretch !important;
}

/* Header Spans Full Width */
.pi-header-block {
    width: 100% !important;
    padding: 40px 20px !important;
    box-sizing: border-box;
}

/* Columns */
.pi-col-left,
.pi-col-right {
    flex: 0 0 50% !important;
    width: 50% !important;
    box-sizing: border-box !important;
}

.pi-col-left { 
    padding-right: 15px; 
}
.pi-col-right { 
    padding-left: 15px; 
    /* Stretches naturally to match left column height, giving room for inner stickiness */
}

/* Blocks */
.pi-sticky-sidebar {
    position: sticky !important;
    top: 120px !important; /* Top offset from site menu */
    z-index: 99;
    width: 100% !important;
    box-sizing: border-box;
}
.pi-block-map {
    width: 100% !important;
    margin-bottom: 20px;
    box-sizing: border-box;
    display: block !important;
}
.pi-col-right .pi-block-estimation .banniere_estimate {
    padding: 30px 20px !important;
    box-sizing: border-box;
}
.pi-col-right .pi-block-estimation .banniere_estimate h3 {
    font-size: 1.3rem !important;
    line-height: 1.3 !important;
    margin-bottom: 15px !important;
}
.pi-block-details,
.pi-block-estimation,
.pi-block-evolution,
.pi-block-agencies {
    width: 100% !important;
    margin-bottom: 30px;
    box-sizing: border-box;
    display: block !important;
}

/* Force overflow: visible on theme parent elements to prevent sticky blocker */
html,
body.single-immo_prix,
body.single-immo_prix #page,
body.single-immo_prix #content,
body.single-immo_prix #primary,
body.single-immo_prix #main,
body.single-immo_prix .site-content,
body.single-immo_prix .main-content-wrapper,
body.single-immo_prix .vc_row,
body.single-immo_prix .vc_column,
body.single-immo_prix #wrapper,
body.single-immo_prix .wrapper,
body.single-immo_prix #main-content,
body.single-immo_prix .content-area {
    overflow: visible !important;
}

/* Map Container Height */
.pi-sticky-map-container {
    width: 100% !important;
    height: 600px !important;
    background: #f9f9f9;
    border: 1px solid #eee;
    position: relative;
}

/* Pool (hidden until distributed) */
#pi-masonry-pool {
    display: none;
}

/* Mobile Responsiveness */
/* City Description */
.pi-city-description {
    margin-top: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #444;
    max-width: 800px;
}

/* Paris Full-Width Agencies */
.pi-agencies-full-width {
    width: 100% !important;
    margin-top: 40px;
    clear: both;
}

.sg_agencies_index.pi-agencies-grid.pi-grid-4 .agencylinkblock {
    width: calc(25% - 20px) !important;
}

@media (max-width: 1024px) {
    .sg_agencies_index.pi-agencies-grid.pi-grid-4 .agencylinkblock {
        width: 100% !important;
    }
    .pi-layout-flex {
        flex-direction: column !important;
        width: 100% !important;
    }
    .pi-col-left,
    .pi-col-right {
        width: 100% !important;
        flex: 0 0 100% !important;
        padding: 0 !important;
    }
    .pi-sticky-sidebar {
        position: static !important;
    }
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
    .pi-layout-flex {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .pi-block-map,
    .pi-block-details,
    .pi-block-estimation,
    .pi-block-evolution,
    .pi-block-agencies {
        grid-column: auto !important;
        grid-row: auto !important;
        width: 100% !important;
        padding: 15px !important;
    }
    .pi-header-block { order: 1; }
    .pi-block-map { order: 2; height: 400px !important; margin-bottom: 20px; }
    .pi-block-details { order: 3; }
    .pi-block-estimation { order: 4; }
    .pi-block-evolution { order: 5; }
    .pi-block-agencies { order: 6; }
}

/* Block Styling & Titles */
.pimmo-evolution-premium {
    background: #fff;
    padding: 40px;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border-radius: 0 !important;
    margin-top: 40px;
    margin-bottom: 40px;
    box-sizing: border-box;
}

.pimmo-agencies-section {
    background: #fff;
    padding: 0; /* Removed padding */
    border: none; /* Removed border */
    box-shadow: none; /* Removed shadow */
    border-radius: 0 !important;
    margin-top: 40px;
    margin-bottom: 40px;
    box-sizing: border-box;
}

.pi-premium-h2 {
    margin-top: 0;
    margin-bottom: 30px;
    font-weight: 700;
    font-size: 1.6rem;
    color: #1a1a1a;
    line-height: 1.3;
}

/* Agency Cards - Matching Theme Style */
.sg_agencies_index {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sg_agencies_index.pi-agencies-grid {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 20px;
}

/* Force 2-column layout for agency cards in masonry */
.pi-agencies-grid .agencylinkblock {
    width: calc(50% - 20px) !important;
}

/* Minimal CTA override */
.pi-cta {
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure images don't have fixed height if parasitized */
.pi-agencies-grid .agencylinkblock .img {
    height: auto !important;
}


.pi-sticky-map-container {
    width: 100% !important;
    height: 600px !important;
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    border-bottom: 1px solid #eee;
    position: relative !important;
}

#pimmo-map {
    width: 100% !important;
    height: 100% !important;
}

/* BREADCRUMB */
.pi-breadcrumb {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 30px;
}
.pi-breadcrumb a { color: #040E31; text-decoration: none; }

/* LIST ITEMS */
.pi-details-list { margin-top: 0; }
.pi-sub-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 25px; color: #1a1a1a; }
.pi-list-item { display: flex; justify-content: space-between; align-items: center; padding: 18px 0; border-bottom: 1px solid #f0f0f0; }
.pi-list-item .name { font-size: 1.1rem; font-weight: 500; color: #333; text-decoration: none; }
.pi-list-item .price { font-weight: 800; color: #C19F62; font-size: 1.2rem; }

/* PRICE BADGE */
.pi-main-price-badge {
    color: #040e31;
    display: inline-flex;
    flex-direction: column;
}
.pi-main-price-badge .label { font-size: 1rem; text-transform: uppercase; opacity: 0.7; margin-bottom: 5px; }
.pi-main-price-badge .value { font-size: 2.2rem; font-weight: 800; color: #C19F62; }

/* ENCADRE PREMIUM PRIX MOYEN */
.pi-main-price-badge-box {
    border: 1px solid #040e31;
    padding: 15px 25px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-transform: uppercase;
    font-weight: 700;
    margin: 20px 0;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}
.pi-main-price-badge-box .label {
    font-size: 1rem;
    color: #040e31;
    letter-spacing: 0.05em;
}
.pi-main-price-badge-box .value {
    font-size: 1.8rem;
    color: #C19F62;
    font-weight: 800;
}

/* --- ESTIMATION BLOCK --- */
.pi-estimation-box {
    background: #fff;
    padding: 35px;
    border-radius: 0;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}
.pi-esti-title { font-size: 1.6rem; font-weight: 700; color: #040E31; margin-bottom: 15px; }
.pi-esti-text { font-size: 1rem; color: #666; line-height: 1.6; margin-bottom: 25px; }


/* RESPONSIVE */
@media (max-width: 1024px) {
    .pi-column-wrapper {
        display: contents !important;
    }
    .pi-layout-flex { 
        flex-direction: column !important; 
    }
    .pi-block-left, .pi-block-right, .pi-block-full { 
        width: 100% !important; 
        flex: none !important; 
        padding: 40px 20px !important; 
    }
    .pi-block-map {
        padding: 0 !important;
    }
    .pi-sticky-map-container { 
        position: static; 
        height: 450px !important; 
    }
}

