/* Public map page */
html, body { height: 100%; }
body { display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); position: relative; z-index: 1100;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.show-sm { display: none; }

.status-bar {
  display: none; padding: 10px 16px; font-weight: 700; font-size: 14px;
  background: var(--ink); color: #fff; position: relative; z-index: 1050;
}
.status-bar.visible { display: block; }
.status-bar.error { background: var(--alarm); }
.status-bar.success { background: var(--basil); }

.layout { flex: 1; display: flex; min-height: 0; }

/* ---- Side panel ---- */
.panel {
  width: 390px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--line); min-height: 0;
}
.panel-head { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.search {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: 0 12px; background: var(--card); color: var(--muted);
}
.search:focus-within { border-color: var(--ink); color: var(--ink); }
.search input { border: 0; padding: 12px 0; font-size: 16px; box-shadow: none !important; background: transparent; }
.filters { display: flex; gap: 6px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.filters select { width: auto; margin-left: auto; padding: 6px 28px 6px 10px; font-size: 13.5px; }
.toggle { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span {
  display: inline-block; padding: 6px 11px; border-radius: 999px; font-size: 13.5px; font-weight: 700;
  border: 1px solid var(--line-strong); color: var(--muted); background: var(--card);
}
.toggle input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.toggle input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.result-count { font-size: 13px; color: var(--muted); margin-top: 10px; }
.result-count strong { color: var(--ink); }

.results { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.result {
  display: grid; grid-template-columns: 52px 1fr; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer;
  position: relative;
}
.result:hover, .result:focus-visible { background: #f7f8fa; }
.result.premium { background: linear-gradient(90deg, var(--lamp-soft), #fffdf6 60%); }
.result.premium::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--lamp); }
.slot {
  width: 52px; height: 52px; border-radius: var(--r-sm);
  background: #e9edf1; border: 1px solid var(--line-strong);
  display: grid; place-items: center; overflow: hidden;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--muted); text-align: center; line-height: 1.05;
}
.slot img { width: 100%; height: 100%; object-fit: cover; }
.result.premium .slot { background: var(--lamp); border-color: var(--lamp-deep); color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 200, 61, .25); }
.slot small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 10.5px; }
.result-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.result-addr { font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.result-note { font-size: 13px; margin-top: 6px; color: var(--ink); }
.result-empty { padding: 28px 18px; color: var(--muted); }
.result-empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

.panel-foot { border-top: 1px solid var(--line); padding: 10px 16px 12px; font-size: 13px; background: #fafbfc; }
.sponsor {
  display: block; text-decoration: none; color: var(--ink);
  border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 7px 10px; margin-bottom: 8px; background: var(--card);
  display: flex; gap: 8px; align-items: baseline;
}
.sponsor:hover { border-color: var(--ink); }
.sponsor-label { font-size: 11.5px; color: var(--muted); flex-shrink: 0; }
.sponsor-text { font-weight: 700; font-size: 13.5px; }
.foot-cta { margin-bottom: 6px; }
.foot-cta .link-btn { font-weight: 700; }
.foot-links { color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px; }
.foot-links a { color: var(--muted); }

/* ---- Map ---- */
.map-wrap { flex: 1; position: relative; min-width: 0; }
#map { position: absolute; inset: 0; background: #e7ebee; }
.leaflet-container { font-family: var(--font-body); }
.list-toggle { display: none; position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 1000; box-shadow: 0 8px 24px -8px rgba(0,0,0,.5); border-radius: 999px; padding: 12px 20px; }

.pick-banner {
  display: none; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 1000;
  background: var(--ink); color: #fff; font-weight: 700; padding: 8px 8px 8px 16px; border-radius: 999px;
  align-items: center; gap: 12px; white-space: nowrap; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
}
.pick-banner.visible { display: flex; }

/* Pins: a loaf for regular machines, a lit compartment for premium */
.pin { background: none; border: 0; }
.pin svg { display: block; filter: drop-shadow(0 2px 2px rgba(29,39,49,.35)); }
.pin-premium svg { filter: drop-shadow(0 0 6px rgba(255, 200, 61, .9)) drop-shadow(0 2px 2px rgba(29,39,49,.4)); }
.cluster {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: #fff; border: 3px solid #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
  box-shadow: 0 2px 6px rgba(29,39,49,.4);
}
.cluster.has-premium { border-color: var(--lamp); }

/* Popup */
.leaflet-popup-content-wrapper { border-radius: var(--r-md); padding: 0; box-shadow: 0 16px 40px -14px rgba(29,39,49,.5); }
.leaflet-popup-content { margin: 0; width: 290px !important; font-size: 14px; line-height: 1.45; }
.leaflet-popup-close-button { top: 6px !important; right: 6px !important; color: var(--muted) !important; }
.pop-photo { width: 100%; height: 130px; object-fit: cover; display: block; border-radius: var(--r-md) var(--r-md) 0 0; }
.pop-body { padding: 12px 14px 14px; }
.pop-head { display: flex; gap: 10px; align-items: center; padding-right: 18px; }
.pop-logo { width: 40px; height: 40px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.pop-title { font-family: var(--font-display); font-weight: 700; font-size: 16.5px; line-height: 1.2; }
.pop-addr { color: var(--muted); font-size: 13.5px; }
.pop-live {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: var(--r-sm);
  font-weight: 700; font-size: 13.5px;
}
.pop-live.vers { background: var(--basil-soft); color: var(--basil); }
.pop-live.bijna_op { background: var(--lamp-soft); color: #7a5800; }
.pop-live.uitverkocht { background: var(--alarm-soft); color: var(--alarm); }
.pop-live time { font-weight: 400; margin-left: auto; font-size: 12.5px; }
.pop-announce { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--lamp); background: #fffbee; font-size: 13.5px; }
.pop-desc { margin-top: 8px; font-size: 13.5px; }
.pop-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.pop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 12px; }
.pop-actions .btn { min-height: 36px; font-size: 13.5px; color: var(--ink); }
.pop-actions .btn-primary { color: #fff; }
.pop-actions .wide { grid-column: span 2; }
.pop-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; }
.pop-foot a { color: var(--muted); }

/* Add form */
.location-picker { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); }
.location-picker #locationStatus.set { color: var(--basil); font-weight: 700; }
.location-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-preview { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--r-sm); }
.hint { margin: -6px 0 14px; }

/* ---- Small screens: map first, list as a sheet ---- */
@media (max-width: 760px) {
  .hide-sm { display: none; }
  .show-sm { display: inline; }
  .wordmark-sub { display: none; }
  .wordmark-name { font-size: 17px; }
  .wordmark svg { width: 30px; height: 30px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn { padding: 9px 10px; }
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: 56px; width: auto; z-index: 1080;
    transform: translateY(100%); transition: transform .25s ease-out; border-right: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: 0 -10px 30px -10px rgba(0,0,0,.3);
  }
  .panel.open { transform: none; }
  .list-toggle { display: inline-flex; z-index: 1090; }
  .row { flex-direction: column; gap: 0; }
  .row > .field.narrow { flex: 1; }
}

/* Shop status, products, payment in the popup */
.pop-shop { margin-top: 10px; border-radius: var(--r-sm); font-size: 13.5px; }
.pop-shop summary { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-sm); font-weight: 700; cursor: pointer; list-style: none; }
.pop-shop summary::-webkit-details-marker { display: none; }
.pop-shop summary::after { content: "Uren"; margin-left: auto; font-weight: 400; font-size: 12.5px; text-decoration: underline; }
.pop-shop[open] summary::after { content: "Verberg"; }
.pop-shop summary small { display: block; font-weight: 400; font-size: 12px; }
.pop-shop.open-now summary { background: var(--basil-soft); color: var(--basil); }
.pop-shop.closed-now summary { background: var(--bg); color: var(--muted); }
.pop-shop table.week { margin: 8px 10px 2px; width: calc(100% - 20px); }
.pop-shop-note { margin: 6px 10px 0; font-size: 12.5px; color: var(--muted); }
.pop-products { margin-top: 10px; font-size: 13.5px; }
.pop-products table { width: 100%; border-collapse: collapse; }
.pop-products td { padding: 3px 0; border-bottom: 1px dotted var(--line-strong); }
.pop-products td small { color: var(--muted); }
.pop-products td.pr { text-align: right; font-weight: 700; white-space: nowrap; padding-left: 10px; font-variant-numeric: tabular-nums; }
.pop-products details summary { font-size: 12.5px; color: var(--crust-dark); cursor: pointer; margin-top: 4px; }
.pop-pay { margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.leaflet-popup-content { overflow-y: auto; overscroll-behavior: contain; }

/* Verified badge (machine managed by its baker) */
.verified { display: inline-flex; align-items: center; gap: 4px; color: var(--verified); vertical-align: -2px; white-space: nowrap; }
.verified svg { flex-shrink: 0; }
.verified span { font-family: var(--font-body); font-size: 12px; font-weight: 700; }

/* Location bar above the list */
.loc-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 14px; }
.loc-label { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.loc-bar select { width: auto; padding: 5px 26px 5px 8px; font-size: 13.5px; }
.loc-bar .link-btn { margin-left: auto; font-size: 13.5px; font-weight: 700; }

/* Location window */
.loc-modal .modal-intro { margin-bottom: 16px; }
.loc-msg { font-size: 14px; color: var(--muted); margin: 10px 0 0; min-height: 0; }
.loc-msg:empty { display: none; }
.loc-msg.warn { color: #7a5800; background: var(--lamp-soft); border: 1px solid #f2dc95; padding: 8px 10px; border-radius: var(--r-sm); }
.loc-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 16px 0 12px; }
.loc-or::before, .loc-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.loc-input-row { display: flex; gap: 6px; margin-top: 6px; }
.loc-input-row input { font-size: 16px; }
.loc-sugg { list-style: none; margin: 6px 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.loc-sugg:empty { display: none; }
.loc-sugg li + li { border-top: 1px solid var(--line); }
.loc-sugg button { display: block; width: 100%; text-align: left; background: var(--card); border: 0; padding: 10px 12px; font: 700 15px var(--font-body); color: var(--ink); cursor: pointer; }
.loc-sugg button:hover, .loc-sugg button:focus-visible { background: var(--bg); }
.loc-sugg small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }

.loc-browse { display: block; margin: 18px auto 0; font-size: 14px; color: var(--muted); }
.loc-browse:hover { color: var(--ink); }

/* Follow / share / confirm in the popup */
.pop-tools { display: flex; gap: 6px; margin-top: 10px; }
.pop-tool { flex: 1; font: 700 13px var(--font-body); padding: 7px 8px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); cursor: pointer; }
.pop-tool:hover { border-color: var(--ink); }
.pop-tool[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pop-products tr.soldout td { color: var(--muted); }
.pop-products tr.soldout td:first-child { text-decoration: line-through; }
.pop-products .so { text-decoration: none; display: inline-block; font-size: 11px; font-weight: 700; color: var(--alarm); background: var(--alarm-soft); border-radius: 999px; padding: 1px 6px; }
.followed { font-family: var(--font-body); font-size: 11.5px; font-weight: 700; color: #fff; background: var(--ink); border-radius: 999px; padding: 2px 7px; vertical-align: 2px; }
/* Spam trap: invisible to people */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
