/* Distrimap - DA "Warm Architectural Minimalism" */
:root {
  --ink: #222222;
  --text: #717171;
  --rose: #FF385C;
  --bg: #F7F7F7;
  --white: #FFFFFF;
  --line: #E8E8E8;
  --green: #22C55E;
  --r8: 8px; --r12: 12px; --r16: 16px; --r40: 40px;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* HEADER */
.site-header {
  background: var(--white); border-bottom: 1px solid var(--line);
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 100;
}
.header-inner {
  max-width: 680px; margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left, 0px));
  height: 52px; display: flex; align-items: center; gap: 14px;
}
.back { color: var(--ink); display: flex; align-items: center; }
.logo {
  font-weight: 700; font-size: 15px; letter-spacing: -.01em;
  text-decoration: none; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.logo-txt { display: flex; flex-direction: column; }
.tld, .logo-base { display: none; }
/* home sur PC : logo et nom en grand, ".fr" en rose, baseline sous le nom (façon ancien leboncoin) */
@media (min-width: 768px) {
  .home .header-inner { height: 76px; }
  .home .logo { font-size: 26px; font-weight: 800; letter-spacing: -.02em; gap: 12px; line-height: 1.1; }
  .home .logo img { width: 30px; height: auto; }
  .home .tld { display: inline; color: var(--rose); }
  .home .logo-base { display: block; margin-top: 3px; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--text); }
}
.header-ref {
  margin-left: auto; font-size: 13px; font-weight: 600;
  color: var(--text); text-decoration: none;
}
.header-ref:hover { color: var(--ink); }
.header-tagline { display: none; margin-left: auto; font-size: 12px; font-weight: 600; color: var(--text); text-align: right; line-height: 1.3; text-decoration: none; }
.header-tagline strong { font-weight: 800; }
@media (max-width: 767px) {
  .header-tagline { display: block; }
  .back, .header-ref { display: none; }
}

/* PAGE */
.page {
  max-width: 680px; margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left, 0px)) max(48px, env(safe-area-inset-bottom, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--text); padding: 16px 0 0;
}
.breadcrumb a { color: var(--text); text-decoration: none; }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb .sep { color: #C4C4C4; }
.breadcrumb strong { color: var(--ink); font-weight: 600; }

h1 {
  font-size: clamp(26px, 6.5vw, 34px); font-weight: 800; line-height: 1.15;
  letter-spacing: -.03em; margin: 12px 0 14px; text-wrap: balance; text-align: center;
}
.intro { text-align: center; color: var(--text); font-size: 14px; margin: 0 0 8px; }

.meta-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.count-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; background: #EFEFEF; border-radius: var(--r40);
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.green-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }

/* FILTRES */
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 18px -20px 20px; padding: 0 20px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 36px; padding: 0 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r40);
  font-size: 13px; font-weight: 600; color: var(--ink); font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: border-color .15s;
}
.chip:hover { border-color: #BBBBBB; }
.chip .n { font-size: 11px; font-weight: 700; color: var(--text); background: #F0F0F0; padding: 1px 7px; border-radius: var(--r40); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.active .n { background: rgba(255,255,255,.18); color: #fff; }

/* SECTIONS */
.section-title { font-size: 18px; font-weight: 700; margin: 32px 0 14px; letter-spacing: -.01em; }
.section-title:first-child { margin-top: 20px; }

/* CARTES MACHINES */
.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r16);
  text-decoration: none; color: var(--ink);
  transition: box-shadow .15s, border-color .15s;
}
.card:hover { border-color: #D6D6D6; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.thumb {
  width: 56px; height: 56px; flex-shrink: 0;
  background: #F2F2F2; border: 1px solid var(--line); border-radius: var(--r12);
  display: flex; align-items: center; justify-content: center;
}
.thumb span { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 5px rgba(0,0,0,.18)); }
.card-body { flex: 1; min-width: 0; }
.card-cat { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text); margin-bottom: 2px; }
.card-name { font-size: 16px; font-weight: 700; line-height: 1.25; margin: 0 0 4px; letter-spacing: -.01em; }
.card-detail { font-size: 13px; color: #484848; margin-bottom: 3px; }
.card-loc { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text); }
.card-loc svg { flex-shrink: 0; }
.chev { color: #BBBBBB; flex-shrink: 0; }
[hidden] { display: none !important; }

/* Bouton "Voir plus" sous une longue liste de machines */
.btn-plus {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 14px; padding: 13px 20px;
  background: var(--white); color: var(--ink); border: 1px solid var(--ink); border-radius: var(--r40);
  font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer;
}
.btn-plus:hover { background: #F7F7F7; }
.btn-plus .n { font-size: 12px; font-weight: 700; background: #F0F0F0; padding: 1px 8px; border-radius: var(--r40); }

/* LISTE DE LIENS (communes, départements) */
.links { display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: var(--r16); overflow: hidden; }
.links a { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.links a + a { border-top: 1px solid var(--line); }
.links a:hover { background: #FAFAFA; }
.links .n { color: var(--text); font-weight: 500; white-space: nowrap; }

/* TEXTE */
.prose { background: var(--white); border: 1px solid var(--line); border-radius: var(--r16); padding: 18px 20px; }
.prose p { margin: 0 0 12px; line-height: 1.65; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { font-size: 16px; margin: 18px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 15px; font-weight: 700; margin: 18px 0 6px; line-height: 1.35; }
.prose h3:first-child { margin-top: 0; }
.prose ul { margin: 0; padding-left: 20px; }
.prose li { line-height: 1.6; margin: 0 0 6px; }
.prose li:last-child { margin-bottom: 0; }
.chapo { font-size: 15px; line-height: 1.6; color: var(--ink); margin: 18px 0 0; }

/* FICHE */
.fiche-hero { text-align: center; padding: 8px 0 4px; }
.ctag {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 18px;
  font-size: 11px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .06em;
}
.fiche-thumb { width: 72px; height: 72px; margin: 18px auto 0; }
.fiche-thumb span { font-size: 34px; }
.fiche-loc { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; color: var(--text); margin: 0; }
.fiche-body { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.infos { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--r16); overflow: hidden; }
.infos div { display: flex; gap: 12px; padding: 12px 16px; font-size: 14px; }
.infos div + div { border-top: 1px solid var(--line); }
.infos dt { color: var(--text); min-width: 80px; }
.infos dd { margin: 0; font-weight: 600; }
.fiche-links { display: flex; flex-direction: column; gap: 8px; align-items: center; margin-top: 4px; }
.link-subtle { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.link-muted { font-size: 12px; color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* CTA principal : noir, comme "Autour de moi" */
.btn-main {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 20px;
  background: var(--ink); color: #fff; border-radius: var(--r40);
  font-size: 16px; font-weight: 700; font-family: inherit;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.btn-main:hover { background: #000; }
.sticky-cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
  background: var(--white); border-top: 1px solid var(--line);
  padding: 12px max(20px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
}
.sticky-cta-inner { max-width: 640px; margin: 0 auto; }
body.has-cta { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }

/* ACCUEIL */
.hero { padding: 36px 0 32px; }
.hero-h1 { font-size: clamp(30px, 7vw, 44px); line-height: 1.1; margin: 0 0 16px; }
.rotating-word { transition: opacity .18s ease; }
.rotating-word .uw { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.rotating-word.fade { opacity: 0; }
.hero-count { margin: 0 0 28px; text-align: center; font-size: 14px; font-weight: 500; line-height: 1.55; color: var(--text); }
.hero-count strong { font-weight: 700; color: var(--ink); }
@media (max-width: 767px) { .br-pc { display: none; } }
.hero-count .green-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; vertical-align: 1px; }
.geo-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 24px; margin-bottom: 10px;
  background: var(--ink); color: #fff; border: none; border-radius: var(--r40);
  font-size: 16px; font-weight: 700; font-family: inherit; letter-spacing: -.01em;
  cursor: pointer; transition: opacity .15s;
}
.geo-btn:hover:not(:disabled) { opacity: .85; }
.geo-btn:disabled { opacity: .55; cursor: default; }
.search { position: relative; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 0 7px; height: 50px;
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--r40);
  transition: border-color .15s, box-shadow .15s;
}
.search-bar:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(34,34,34,.06); }
.search-icon {
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.search-bar input {
  flex: 1; min-width: 0; border: none; background: none; font-size: 16px;
  color: var(--ink); outline: none; font-family: inherit;
}
.search-bar input::placeholder { color: #BBBBBB; font-size: 15px; }
.sugg {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 50;
  margin: 0; padding: 6px; list-style: none;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r16);
  box-shadow: 0 8px 28px rgba(0,0,0,.1);
}
.sugg a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 12px; border-radius: var(--r8);
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600;
}
.sugg a:hover, .sugg a.on { background: #F2F2F2; }
.sugg .d { font-size: 12px; font-weight: 500; color: var(--text); white-space: nowrap; }
.sugg .vide { padding: 10px 12px; font-size: 13px; color: var(--text); }
.tiles-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tile-img {
  width: 100%; aspect-ratio: 1; margin-bottom: 4px;
  background: #F2F2F2; border: 1px solid var(--line); border-radius: var(--r16);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease;
}
a.tile:hover .tile-img { transform: scale(1.04); box-shadow: 0 8px 28px rgba(0,0,0,.1); }
.tile-em { font-size: clamp(30px, 9vw, 46px); line-height: 1; filter: drop-shadow(0 3px 8px rgba(0,0,0,.18)); }
.tile-lbl { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.25; }
.tile-n { font-size: 11px; font-weight: 600; color: var(--text); }
.tile-vide { opacity: .45; }
.tile-vide .tile-em { filter: grayscale(1); }
.exp-card {
  margin-top: 28px; padding: 32px 24px; text-align: center;
  background: var(--white); border: 1px solid var(--line); border-radius: 20px;
}
.exp-icon {
  width: 52px; height: 52px; margin: 0 auto 18px;
  background: var(--bg); border-radius: var(--r12);
  display: flex; align-items: center; justify-content: center; font-size: 26px; line-height: 1;
}
.exp-title { font-size: 20px; font-weight: 800; margin: 0 0 8px; letter-spacing: -.02em; }
.exp-sub { font-size: 14px; color: var(--text); margin: 0 0 22px; line-height: 1.55; }
.exp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border: 2px solid var(--rose); border-radius: var(--r40);
  background: var(--rose); font-size: 14px; font-weight: 700; color: #fff; text-decoration: none;
  transition: background .15s, border-color .15s;
}
.exp-btn:hover { background: #E31C5F; border-color: #E31C5F; }
.exp-free { font-size: 12px; color: var(--text); margin: 10px 0 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills a {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r40);
  font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.pills a:hover { border-color: #BBBBBB; }
.pills .n, .dep-list .n { font-size: 11px; font-weight: 600; color: var(--text); }
#carte-deps { aspect-ratio: 600 / 578; }
#carte-deps svg { display: block; width: 100%; height: 100%; }
#carte-deps path { fill: #EDEDED; stroke: #fff; stroke-width: 1; stroke-linejoin: round; }
#carte-deps path.n1 { fill: #C4C4C4; }
#carte-deps path.n2 { fill: #8A8A8A; }
#carte-deps path.n3 { fill: var(--ink); }
#carte-deps path[data-u] { cursor: pointer; transition: fill .12s; }
#carte-deps path[data-u]:hover { fill: var(--rose); }
.exp-card + .dep-list { margin-top: 28px; }
.dep-list {
  columns: 2; column-gap: 20px; padding: 10px 16px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r16);
}
.dep-list a {
  display: flex; justify-content: space-between; gap: 8px; padding: 6px 0;
  break-inside: avoid; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.dep-list a:hover { text-decoration: underline; }
@media (max-width: 420px) { .dep-list { columns: 1; } }

/* BARRE DU BAS (mobile) */
.tabbar { display: none; }
@media (max-width: 767px) {
  .tabbar {
    display: flex; justify-content: space-around;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
    background: var(--white); border-top: 1px solid var(--line);
    padding: 8px max(12px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  }
  body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font-size: 11px; font-weight: 600; color: var(--ink); text-decoration: none; }
.tab svg { width: 22px; height: 22px; }
.tab .si-liste, .tab .si-carte { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.tab .si-carte, body.en-carte .tab .si-liste { display: none; }
body.en-carte .tab .si-carte { display: flex; }

/* VUE CARTE : par-dessus la page, entre le header et la barre du bas */
.btn-vue {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r40);
  font-size: 12.5px; font-weight: 700; color: var(--ink); text-decoration: none;
}
.btn-vue svg { width: 14px; height: 14px; }
.btn-vue:hover { border-color: #BBBBBB; }
@media (max-width: 767px) { .btn-vue { display: none; } }
.vue-carte {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
  top: calc(52px + env(safe-area-inset-top, 0px)); background: #F1F0EC;
}
@media (max-width: 767px) { .vue-carte { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); } }
body.en-carte { overflow: hidden; }
#carte-map { position: absolute; inset: 0; }
.btn-vue-liste { position: absolute; z-index: 5; top: 14px; left: 50%; transform: translateX(-50%); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.pin {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: var(--ink); border: 2.5px solid var(--white); box-shadow: 0 3px 10px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; line-height: 1; cursor: pointer;
}
.pin.sel { width: 44px; height: 44px; font-size: 21px; z-index: 3; }
.sheet {
  position: absolute; z-index: 5; left: 50%; transform: translateX(-50%);
  width: min(480px, calc(100% - 32px)); bottom: 20px;
}
.sheet .card { box-shadow: 0 8px 30px rgba(0,0,0,.15); }

/* FOOTER */
.site-footer { background: var(--ink); padding: 32px 0 24px; margin-top: 48px; }
.f-inner { max-width: 680px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left, 0px)); }
.f-logo { font-weight: 800; font-size: 16px; color: #fff; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.f-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.f-links a { font-size: 12px; color: rgba(255,255,255,.45); text-decoration: none; }
.f-links a:hover { color: rgba(255,255,255,.8); }
.f-copy { font-size: 11px; color: rgba(255,255,255,.35); margin-top: 14px; }
