/* === RESET + BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1e293b; background: #f8fafc; line-height: 1.6; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* === HEADER === */
.header { background: #1e3a5f; color: #fff; padding: .75rem 1.5rem; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.logo { color: #fff !important; font-size: 1.3rem; font-weight: 700; text-decoration: none !important; display: flex; align-items: center; }
.logo-img { height: 38px; width: auto; }
.header-nav { display: flex; gap: 1.25rem; }
.header-nav a { color: rgba(255,255,255,.85); font-size: .9rem; text-decoration: none; }
.header-nav a:hover { color: #fff; }

/* === HERO === */
.hero { text-align: center; padding: 2.5rem 1rem 1.5rem; }
.hero h1 { font-size: 2.2rem; margin-bottom: .5rem; }
.subtitle { font-size: 1.15rem; color: #475569; }
.subtitle-sm { font-size: .9rem; color: #94a3b8; margin-top: .25rem; }

/* === PRIX HERO === */
.prix-hero { text-align: center; padding: 2rem; background: linear-gradient(135deg, #1e3a5f, #2563eb); color: #fff; border-radius: 16px; }
.prix-hero.compact { padding: 1.5rem; }
.prix-hero .amount { font-size: 2.8rem; font-weight: 800; }
.prix-hero .period { font-size: 1rem; opacity: .85; }
.prix-hero .type-label { font-size: .85rem; opacity: .7; margin-bottom: .25rem; }
.prix-hero .prix-range { font-size: .85rem; opacity: .7; margin-top: .5rem; }
.prix-m2-hero { font-size: 1.1rem; opacity: .8; font-weight: 600; margin-top: .25rem; }
.card-m2 { font-size: .85rem; color: #2563eb; font-weight: 600; margin-top: .15rem; }
.prix-hero .prix-variants { display: flex; gap: 1.5rem; justify-content: center; margin-top: 1rem; padding-top: .75rem; border-top: 1px solid rgba(255,255,255,.2); }
.prix-hero .prix-variant .amount { font-size: 1.4rem; }
.prix-hero .prix-variant .label { font-size: .8rem; opacity: .7; }

/* === HERO 3 COL === */
.hero-3col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; align-items: center; }
.hero-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.kpi { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1rem; text-align: center; }
.kpi-value { font-size: 1.4rem; font-weight: 700; color: #1e3a5f; }
.kpi-label { font-size: .8rem; color: #6b7280; margin-top: .2rem; }
@media (max-width: 768px) { .hero-3col { grid-template-columns: 1fr; } }

/* === HERO MAP LAYOUT (commune) === */
.hero-map-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; align-items: stretch; min-height: 360px; }
.hero-left { display: flex; flex-direction: column; gap: 1rem; }
.hero-left .prix-hero { flex: 0 0 auto; }
.hero-kpis-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; flex: 1; }
.kpi-mini { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: .6rem .5rem; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.kpi-mini .kpi-value { font-size: 1.1rem; font-weight: 700; color: #1e3a5f; }
.kpi-mini .kpi-label { font-size: .7rem; color: #6b7280; margin-top: .15rem; }
.hero-map { border-radius: 12px; border: 1px solid #e5e7eb; overflow: hidden; min-height: 360px; z-index: 1; }
@media (max-width: 900px) { .hero-map-layout { grid-template-columns: 1fr; } .hero-map { min-height: 300px; } }

/* === INTRO BOX === */
.intro-box { background: #eff6ff; border-left: 4px solid #2563eb; border-radius: 0 8px 8px 0; padding: 1rem 1.25rem; margin-bottom: 2rem; font-size: .95rem; line-height: 1.7; color: #374151; }

/* === SECTIONS === */
.section { margin-bottom: 2.5rem; }
.section h2 { font-size: 1.3rem; margin-bottom: 1rem; color: #1e293b; }
.section-note { font-size: .9rem; color: #6b7280; line-height: 1.6; margin-top: .75rem; }
.source-note { font-size: .8rem; color: #9ca3af; text-align: center; margin: 2rem 0; }

/* === CARDS === */
.card-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.card-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.card-grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: .75rem; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem; }
.card-center { text-align: center; }
.card-link { display: block; transition: transform .2s, box-shadow .2s; cursor: pointer; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); text-decoration: none; }
.card-title { font-size: 1rem; font-weight: 600; color: #1e293b; margin-bottom: .5rem; }
.card-title-sm { font-size: .85rem; font-weight: 600; color: #1e293b; margin-bottom: .25rem; }
.card-label { font-size: .8rem; color: #6b7280; }
.card-label-sm { font-size: .75rem; color: #9ca3af; }
.card-value { font-size: 1.1rem; font-weight: 700; color: #2563eb; }
.card-sub { font-size: .8rem; color: #6b7280; margin-top: .25rem; }
.card-range { font-size: .75rem; color: #9ca3af; margin-top: .25rem; }
.card-sublabel { font-size: .75rem; color: #9ca3af; margin-top: -.1rem; margin-bottom: .25rem; }
.card-empty { opacity: .5; border-style: dashed; }
.big-number { font-size: 1.6rem; font-weight: 800; color: #2563eb; }
@media (max-width: 768px) { .card-grid-3 { grid-template-columns: 1fr; } .card-grid-4 { grid-template-columns: 1fr 1fr; } .card-grid-5 { grid-template-columns: 1fr 1fr; } }

/* === TABLE === */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; padding: .75rem; border-bottom: 2px solid #e5e7eb; font-weight: 600; color: #374151; }
.data-table td { padding: .6rem .75rem; border-bottom: 1px solid #f3f4f6; }
.data-table tr:hover { background: #f8fafc; }
.data-table .prix { font-weight: 600; color: #1e3a5f; }

/* === BREADCRUMBS === */
.breadcrumbs { margin-bottom: 1rem; font-size: .85rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; }
.breadcrumbs li:not(:last-child)::after { content: ' › '; color: #9ca3af; margin-left: .25rem; }
.breadcrumbs a { color: #2563eb; }

/* === TAG LIST === */
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { background: #eff6ff; color: #2563eb; padding: .4rem .8rem; border-radius: 6px; font-size: .85rem; }
.tag:hover { background: #dbeafe; text-decoration: none; }

/* === BAR CHART === */
.bar-chart-horizontal { display: flex; flex-direction: column; gap: .5rem; }
.bar-row { display: grid; grid-template-columns: 160px 1fr 100px; gap: .75rem; align-items: center; }
.bar-label { font-size: .9rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-label a { color: #1e293b; }
.bar-label a:hover { color: #2563eb; }
.bar-track { height: 28px; background: #f3f4f6; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: #2563eb; }
.bar-fill-cher { background: #dc2626; }
.bar-fill-abordable { background: #16a34a; }
.bar-value { font-size: .9rem; font-weight: 600; color: #1e293b; text-align: right; }
@media (max-width: 768px) { .bar-row { grid-template-columns: 120px 1fr 80px; } }

/* === FOURCHETTE === */
.fourchette { margin: .5rem 0; }
.fourchette-bar { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(90deg, #dbeafe, #2563eb, #1e3a5f); padding: .6rem 1rem; border-radius: 8px; color: #fff; font-weight: 600; font-size: .85rem; }
.fourchette-labels { display: flex; justify-content: space-between; font-size: .75rem; color: #6b7280; margin-top: .25rem; }

/* === HERO CARDS DUO === */
.hero-cards-duo { display: flex; gap: .75rem; margin-bottom: .75rem; }
.hero-card-type { flex: 1; background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%); border-radius: 12px; padding: 1rem; text-align: center; text-decoration: none; color: #fff; transition: transform .2s, box-shadow .2s; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.hero-card-type:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.hero-card-empty { opacity: .5; cursor: default; }
.hero-card-empty:hover { transform: none; }
.hct-emoji { font-size: 1.5rem; margin-bottom: .25rem; }
.hct-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .5px; opacity: .8; }
.hct-prix { font-size: 1.4rem; font-weight: 800; margin: .25rem 0; }
.hct-sub { font-size: .75rem; opacity: .7; }
@media (max-width: 768px) { .hero-cards-duo { flex-direction: column; } }

/* === FOURCHETTE WIDE (P10-P90) === */
.fourchette-bar-5 { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(90deg, #dbeafe, #93c5fd, #2563eb, #1e3a5f, #0f172a); padding: .6rem .75rem; border-radius: 8px; color: #fff; font-weight: 600; font-size: .8rem; }
.fw-val { text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.fw-median { font-size: .95rem; font-weight: 800; }
.fourchette-labels-5 { display: flex; justify-content: space-between; font-size: .7rem; color: #6b7280; margin-top: .25rem; }
.map-marker-dot { width: 16px; height: 16px; background: #dc2626; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,.3); }

/* === CHART === */
.chart-container { max-height: 350px; }

/* === TWO COL === */
.two-col-section { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.two-col-section .section-text { font-size: .9rem; line-height: 1.7; color: #4b5563; }
.two-col-section .section-text p { margin: 0 0 .75rem; }
@media (max-width: 768px) { .two-col-section { grid-template-columns: 1fr; } }

/* === FAQ === */
.faq-list { display: flex; flex-direction: column; gap: .75rem; }
.faq-item { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; }
.faq-item summary { padding: 1rem 1.25rem; font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; font-size: .95rem; color: #1e293b; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.3rem; font-weight: 400; color: #9ca3af; }
.faq-item[open] summary::after { content: '-'; }
.faq-item[open] summary { border-bottom: 1px solid #f3f4f6; }
.faq-item p { padding: .75rem 1.25rem 1rem; margin: 0; font-size: .9rem; line-height: 1.7; color: #4b5563; }

/* === FOOTER === */
.footer { background: #1e293b; color: #cbd5e1; padding: 2rem 1.5rem; margin-top: 3rem; font-size: .85rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.footer h4 { color: #fff; margin-bottom: .5rem; }
.footer a { color: #94a3b8; }
.footer a:hover { color: #fff; }
.footer-legal { font-size: .75rem; color: #64748b; margin-top: .5rem; }
.footer-bottom { max-width: 1200px; margin: 1.5rem auto 0; padding-top: 1rem; border-top: 1px solid #334155; text-align: center; font-size: .8rem; color: #64748b; }
@media (max-width: 768px) { .footer-inner { grid-template-columns: 1fr 1fr; } }

/* === MAP === */
.kpi-map { border-radius: 12px; }
.kpi-map .leaflet-container { border-radius: 12px; }
.map-label { background: rgba(30,58,95,.9) !important; color: #fff !important; border: none !important; padding: 2px 8px !important; font-size: .8rem !important; font-weight: 600 !important; border-radius: 4px !important; box-shadow: none !important; }
.map-label::before { border-top-color: rgba(30,58,95,.9) !important; }
.map-label-big { background: rgba(30,58,95,.95) !important; color: #fff !important; border: none !important; padding: 6px 12px !important; font-size: .95rem !important; font-weight: 700 !important; border-radius: 6px !important; box-shadow: 0 2px 8px rgba(0,0,0,.2) !important; text-align: center !important; line-height: 1.4 !important; }
.map-label-big::before { border-top-color: rgba(30,58,95,.95) !important; }
.map-label-sm { background: rgba(100,116,139,.85) !important; color: #fff !important; border: none !important; padding: 1px 6px !important; font-size: .7rem !important; font-weight: 500 !important; border-radius: 3px !important; box-shadow: none !important; }
.map-label-sm::before { border-top-color: rgba(100,116,139,.85) !important; }

/* === SEARCH === */
.search-box { position: relative; flex: 0 0 280px; }
.search-box input { width: 100%; padding: .5rem .75rem; border: none; border-radius: 8px; font-size: .9rem; background: rgba(255,255,255,.15); color: #fff; outline: none; }
.search-box input::placeholder { color: rgba(255,255,255,.5); }
.search-box input:focus { background: rgba(255,255,255,.25); }
.search-results { display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); overflow: hidden; z-index: 200; }
.search-item { display: flex; justify-content: space-between; align-items: center; padding: .65rem .85rem; text-decoration: none; color: #1e293b; border-bottom: 1px solid #f3f4f6; }
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #eff6ff; }
.search-nom { font-weight: 600; font-size: .9rem; }
.search-meta { font-size: .8rem; color: #6b7280; }
@media (max-width: 768px) { .search-box { flex: 1 1 100%; order: 3; margin-top: .5rem; } .header-inner { flex-wrap: wrap; } }

/* === RANKING DUO === */
.ranking-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.ranking-col { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem; }
.ranking-title { font-size: .95rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid #e5e7eb; }
.ranking-title.ranking-cher { color: #dc2626; border-bottom-color: #fecaca; }
.ranking-title.ranking-abordable { color: #16a34a; border-bottom-color: #bbf7d0; }
.ranking-row { display: grid; grid-template-columns: 24px 1fr 100px 90px; gap: .5rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid #f9fafb; }
.ranking-row:last-child { border-bottom: none; }
.ranking-rank { font-size: .8rem; font-weight: 700; color: #9ca3af; text-align: center; }
.ranking-name { font-size: .85rem; font-weight: 500; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking-name:hover { color: #2563eb; }
.ranking-bar-wrap { height: 20px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.ranking-prix { font-size: .85rem; font-weight: 700; color: #1e3a5f; text-align: right; }
@media (max-width: 768px) { .ranking-duo { grid-template-columns: 1fr; } .ranking-row { grid-template-columns: 24px 1fr 60px 80px; } .data-table { font-size: .8rem; } .data-table th, .data-table td { padding: .4rem .5rem; } }

/* === BUDGET LIST === */
.budget-list { display: flex; flex-direction: column; gap: .5rem; }
.budget-row { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; background: #f8fafc; border-radius: 8px; border-left: 4px solid #2563eb; }
.budget-amount { font-size: 1.1rem; font-weight: 800; color: #1e3a5f; min-width: 140px; }
.budget-arrow { color: #94a3b8; font-size: 1.2rem; }
.budget-desc { font-size: .9rem; color: #374151; }
.content-block p { margin-bottom: .75rem; line-height: 1.7; }
@media (max-width: 768px) { .budget-amount { min-width: 100px; font-size: .95rem; } }

/* === COMPARISON === */
.comparison-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.comparison-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.25rem; }
.comp-label { font-weight: 700; font-size: .95rem; margin-bottom: .75rem; }
.comp-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.comp-item { text-align: center; flex: 1; }
.comp-value { font-size: 1.2rem; font-weight: 800; color: #1e3a5f; }
.comp-sub { font-size: .75rem; color: #6b7280; }
.comp-vs { font-size: 1.1rem; font-weight: 800; color: #2563eb; white-space: nowrap; }
.comp-rank { margin-top: .5rem; font-size: .8rem; color: #6b7280; text-align: center; font-style: italic; }
@media (max-width: 768px) { .comparison-grid { grid-template-columns: 1fr; } }

.search-badge { display: inline-block; background: #2563eb; color: #fff; font-size: .65rem; font-weight: 700; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; vertical-align: middle; margin-right: 4px; }

/* === NAV CTA === */
.nav-cta { background: #2563eb; color: #fff !important; padding: .4rem .8rem; border-radius: 6px; display: inline-block; }
.nav-cta:hover { background: #1d4ed8; text-decoration: none; }
