/* Page carte (accueil) */
html, body.public { height: 100%; }
body.public { margin: 0; overflow: hidden; }

.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

.topbar {
  display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem;
  background: var(--green-900); color: #fff;
}
.logo { color: #fff; font-weight: 700; font-size: 1.15rem; text-decoration: none; white-space: nowrap; }
.search { flex: 1; display: flex; gap: .5rem; max-width: 640px; }
.search input {
  flex: 1; min-width: 0; padding: .55rem .8rem; border: 0; border-radius: 999px; font: inherit;
}
.search .btn { background: var(--gold); color: #1f2937; padding: .5rem 1rem; border-radius: 999px; }
.search .btn:hover { background: #d9b53a; }

.filters {
  display: flex; gap: .5rem; padding: .5rem 1rem; background: #fff;
  border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; align-items: center;
}
.filters select, .chip {
  padding: .4rem .7rem; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font: inherit; font-size: .9rem; color: var(--ink); cursor: pointer;
}
.chip:hover { background: var(--cream); }
.chip.on { background: var(--green-900); color: #fff; border-color: var(--green-900); }
.chip-check input { margin-right: .3rem; }
.chip-reset { color: var(--muted); }

.layout { flex: 1; display: flex; min-height: 0; position: relative; }

.panel {
  width: 35%; max-width: 480px; min-width: 320px; display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--line); z-index: 5;
}
.panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  padding: .5rem 1rem; border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--muted);
}
.panel-head select { border: 0; background: transparent; font: inherit; color: var(--ink); cursor: pointer; }
.sheet-handle { display: none; }

.results { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 0; }
.result {
  display: flex; gap: .75rem; justify-content: space-between; padding: .8rem 1rem;
  border-bottom: 1px solid var(--line); cursor: pointer;
}
.result:hover, .result:focus { background: var(--cream); outline: none; }
.result.active { background: #ecfdf5; box-shadow: inset 4px 0 0 var(--green-600); }
.result h3 { margin: 0 0 .15rem; font-size: 1rem; }
.result p { margin: 0; font-size: .88rem; color: var(--muted); }
.result .actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.result .actions a { font-size: .85rem; white-space: nowrap; }
.fav-btn { border: 0; background: transparent; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--muted); }
.fav-btn.on { color: var(--gold); }
.results .empty { padding: 1.5rem 1rem; color: var(--muted); }

.badge {
  display: inline-block; margin-top: .3rem; padding: .1rem .5rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; color: #fff; background: #6b7280;
}
.badge-certified { background: var(--green-900); }
.badge-evidence_checked { background: var(--green-600); }
.badge-self_declared { background: var(--gold); color: #1f2937; }
.badge-unconfirmed { background: #6b7280; }
.badge-disputed { background: var(--danger); }

.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: #e8e4d8; }
.area-btn {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); border-radius: 999px;
}
.area-btn[hidden], .map-msg[hidden] { display: none; }
.map-msg {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  max-width: 80%; padding: 1rem 1.25rem; background: #fff; border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0,0,0,.15); text-align: center;
}

.pin {
  width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.45); background: #6b7280;
}
.pin-certified { background: var(--green-900); }
.pin-evidence_checked { background: var(--green-600); }
.pin-self_declared { background: var(--gold); }
.pin-disputed { background: var(--danger); }
.pin-active { transform: rotate(-45deg) scale(1.5); }
.user-dot { width: 16px; height: 16px; border-radius: 50%; background: #2563eb; border: 3px solid #fff; box-shadow: 0 0 0 2px rgba(37,99,235,.35); }
.cluster {
  display: flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border-radius: 50%; background: var(--green-900); color: #fff; font-weight: 700;
  border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.4);
}

@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; gap: .5rem; }
  .search { flex-basis: 100%; max-width: none; }
  .map-wrap { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-width: none; min-width: 0;
    border-right: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -4px 16px rgba(0,0,0,.2);
    transition: height .25s ease;
  }
  .panel[data-sheet="peek"] { height: 96px; }
  .panel[data-sheet="half"] { height: 45%; }
  .panel[data-sheet="full"] { height: 88%; }
  .sheet-handle {
    display: block; width: 100%; height: 22px; border: 0; background: transparent; cursor: pointer; position: relative;
  }
  .sheet-handle::after {
    content: ""; position: absolute; top: 9px; left: 50%; width: 44px; height: 4px;
    margin-left: -22px; border-radius: 2px; background: var(--line);
  }
  .area-btn { top: 8px; }
}
