:root {
  --ink: #3a3935;
  --ink-2: #66645e;
  --ink-3: #96938c;
  --line: #ebe9e4;
  --bg: #ffffff;
  --soft: #f7f6f2;
  --sage: #979c6d;
  --sage-d: #6c7150;
  --sage-l: #eff0e6;
  --accent: #6c7150;
  --accent-ring: #979c6d;
  --panel-w: 410px;
  --top-h: 72px;
  --r: 14px;
  --shadow: 0 10px 36px rgba(60, 58, 50, .10), 0 2px 8px rgba(60, 58, 50, .05);
  --ease: cubic-bezier(.22, .8, .24, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body.zn {
  font: 15px/1.5 Lato, system-ui, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

.zn-app {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
  grid-template-rows: var(--top-h) 1fr;
}

/* ---------- Barra in alto ---------- */
.zn-top {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 6;
}
.zn-logo img { display: block; height: 24px; width: auto; }

.zn-search {
  position: relative; flex: 0 1 520px;
  display: flex; align-items: center;
  height: 46px; padding: 0 6px 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.zn-search:focus-within { border-color: var(--sage); box-shadow: 0 0 0 4px var(--sage-l); }
.zn-ico { width: 18px; height: 18px; fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-linecap: round; flex: none; }
.zn-search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  padding: 0 10px; font-size: 15px;
}
.zn-search input::-webkit-search-cancel-button { display: none; }
.zn-me {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--sage-l);
  transition: transform .2s var(--ease), background .2s;
}
.zn-me svg { width: 18px; height: 18px; fill: none; stroke: var(--sage-d); stroke-width: 1.8; stroke-linecap: round; }
.zn-me:hover { transform: scale(1.06); }
.zn-me.is-busy svg { animation: zn-spin 1s linear infinite; }
.zn-me.is-on { background: var(--sage-d); }
.zn-me.is-on svg { stroke: #fff; }
@keyframes zn-spin { to { transform: rotate(360deg); } }

.zn-sugg {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  margin: 0; padding: 6px; list-style: none;
  background: var(--bg); border-radius: var(--r); box-shadow: var(--shadow);
  max-height: 60vh; overflow: auto;
}
.zn-sugg li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
}
.zn-sugg li[aria-selected="true"], .zn-sugg li:hover { background: var(--soft); }
.zn-sugg .k {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center; background: var(--soft);
}
.zn-sugg .k svg { width: 15px; height: 15px; fill: none; stroke: var(--ink-2); stroke-width: 2; }
.zn-sugg b { font-weight: 700; display: block; }
.zn-sugg small { color: var(--ink-3); display: block; font-size: 13px; }
.zn-sugg mark { background: none; color: var(--accent); }
.zn-sugg .zn-sugg-h { padding: 8px 12px 2px; font-size: 12px; color: var(--ink-3); cursor: default; }
.zn-sugg .zn-sugg-h:hover { background: none; }

.zn-shoplink {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--sage); color: var(--sage-d); text-decoration: none;
  font-weight: 700; font-size: 14px; white-space: nowrap;
  transition: background .2s;
}
.zn-shoplink:hover { background: var(--sage-l); }
.zn-shoplink svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }

.zn-chip-logo { height: 42px; padding: 0 14px; display: inline-flex; align-items: center; }
.zn-chip-logo img { display: block; height: 17px; width: auto; mix-blend-mode: multiply; }
.zn-l-memento img { height: 20px; }
.zn-l-numa img { height: 26px; }
.zn-l-touchmel img { height: 19px; }
.zn-l-emporiozani img { height: 30px; }
.zn-chip-logo[aria-pressed="false"] img { opacity: .85; }

.zn-tag {
  position: absolute; transform: translate(-50%, -100%);
  background: #fff; color: var(--ink); white-space: nowrap;
  font: 600 13px/1 Poppins, sans-serif; padding: 9px 12px; border-radius: 10px;
  box-shadow: 0 4px 16px rgba(60, 58, 50, .16); pointer-events: none;
}
.zn-tag::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px;
  background: #fff; transform: translateX(-50%) rotate(45deg);
}
.zn-tag.is-in { animation: zn-tag .35s var(--ease) both; }
@keyframes zn-tag { from { opacity: 0; transform: translate(-50%, calc(-100% + 6px)); } }

/* ---------- Pannello elenco ---------- */
.zn-panel {
  grid-row: 2; grid-column: 1;
  display: flex; flex-direction: column;
  background: var(--bg);
  border-right: 1px solid var(--line);
  min-height: 0; z-index: 3;
}
.zn-grip { display: none; }
.zn-filters { padding: 18px 20px 10px; }
.zn-brands { display: flex; flex-wrap: wrap; gap: 8px; }
.zn-chip {
  height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg); font-size: 13.5px; font-weight: 700; color: var(--ink-2);
  transition: background .2s, color .2s, border-color .2s;
}
.zn-chip:hover { border-color: var(--ink-3); }
.zn-chip[aria-pressed="true"] { background: var(--sage-l); border-color: var(--sage); color: var(--sage-d); }
.zn-online {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
.zn-online input { width: 17px; height: 17px; accent-color: var(--sage-d); margin: 0; }

.zn-count { margin: 6px 20px 8px; font-size: 13px; color: var(--ink-3); }

.zn-list {
  list-style: none; margin: 0; padding: 0 12px 24px;
  overflow-y: auto; flex: 1; min-height: 0;
  overscroll-behavior: contain;
}
.zn-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 14px;
  width: 100%; text-align: left;
  padding: 14px 12px; border: 0; border-radius: 12px; background: none;
  border-bottom: 1px solid var(--line);
  transition: background .2s;
  animation: zn-in .35s var(--ease) both;
}
.zn-list li:last-child .zn-item { border-bottom: 0; }
.zn-item:hover, .zn-item.is-hover { background: var(--soft); }
.zn-item.is-sel { background: var(--soft); box-shadow: inset 3px 0 0 var(--accent-ring); }
.zn-item .n { font: 600 15px/1.3 Poppins, sans-serif; }
.zn-item .ad { grid-column: 1; color: var(--ink-2); font-size: 13.5px; }
.zn-item .br { grid-column: 1; color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.zn-item .d { grid-row: 1; grid-column: 2; font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.zn-item .ct { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 8px; }
.zn-item .ct i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--sage-l); }
.zn-item .ct svg { width: 14px; height: 14px; fill: none; stroke: var(--sage-d); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zn-owner a, .zn-own {
  display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 14px 12px;
  border: 1px dashed #d9d8cc; border-radius: 12px; text-decoration: none; font-size: 13.5px; color: var(--ink-2);
  transition: border-color .2s, background .2s;
}
.zn-owner a:hover, .zn-own:hover { border-color: var(--sage); background: var(--sage-l); }
.zn-owner svg, .zn-own svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--sage-d); stroke-width: 1.8; stroke-linejoin: round; }
.zn-owner b { color: var(--sage-d); }
.zn-own { margin-top: 24px; }
.zn-socs { display: flex; gap: 10px; margin-top: 16px; }
.zn-soc {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--line); transition: border-color .2s, background .2s;
}
.zn-soc:hover { border-color: var(--sage); background: var(--sage-l); }
.zn-soc svg { width: 19px; height: 19px; fill: none; stroke: var(--ink-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.zn-bp { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.zn-bp a {
  font-size: 12.5px; font-weight: 700; text-decoration: none; color: var(--sage-d);
  padding: 4px 10px; border-radius: 999px; background: #fff; border: 1px solid #dcdecb;
}
.zn-bp a::after { content: " \2197"; }
.zn-bp a:hover { border-color: var(--sage); }
@keyframes zn-in { from { opacity: 0; transform: translateY(6px); } }

.zn-empty { padding: 28px 12px; color: var(--ink-2); }
.zn-empty b { display: block; font: 600 16px Poppins, sans-serif; color: var(--ink); margin-bottom: 4px; }

body.has-card .zn-panel > * { visibility: hidden; }

/* ---------- Mappa ---------- */
.zn-mapwrap { grid-row: 2; grid-column: 2; position: relative; min-height: 0; }
.zn-map { position: absolute; inset: 0; background: #f3f2ee; }

/* ---------- Scheda negozio ---------- */
.zn-card {
  position: absolute; z-index: 5;
  top: calc(var(--top-h) + 16px); left: 16px; bottom: 16px;
  width: calc(var(--panel-w) - 32px);
  background: var(--bg); border-radius: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  animation: zn-card .45s var(--ease) both;
}
@keyframes zn-card { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.zn-sv {
  position: relative; height: 240px; flex: none;
  background: var(--soft) center / cover;
}
.zn-sv-pano { position: absolute; inset: 0; }
.zn-sv-note {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--ink-3); font-size: 13px; text-align: center; padding: 20px;
}
.zn-sv-btn {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px 0 12px;
  border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .94); color: var(--ink);
  font-size: 13px; font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.zn-sv-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.zn-x {
  position: absolute; right: 12px; top: 12px; z-index: 3;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .94); box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
  display: grid; place-items: center;
}
.zn-x svg { width: 16px; height: 16px; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }

.zn-sv.is-full {
  position: fixed; inset: 0; height: auto; z-index: 50; border-radius: 0;
}
.zn-sv.is-full .zn-sv-btn { display: none; }

.zn-body { padding: 22px 24px 26px; overflow-y: auto; flex: 1; }
.zn-body h2 { margin: 0 0 4px; font: 600 22px/1.25 Poppins, sans-serif; letter-spacing: -.01em; }
.zn-body .ad { margin: 0; color: var(--ink-2); }
.zn-body .dist { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--accent); }
.zn-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0 20px; }
.zn-tags span {
  font-size: 12.5px; font-weight: 700; color: var(--ink-2);
  padding: 4px 10px; border-radius: 999px; background: var(--soft);
}

.zn-acts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.zn-act {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; border-radius: 12px; border: 1px solid var(--line);
  text-decoration: none; font-weight: 700; font-size: 14px; color: var(--ink);
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.zn-act:hover { border-color: var(--sage); }
.zn-act:active { transform: scale(.98); }
.zn-act svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zn-act.pri { grid-column: 1 / -1; background: var(--sage-d); border-color: var(--sage-d); color: #fff; }
.zn-act.pri:hover { background: #5d6244; }

.zn-shop {
  display: block; margin-top: 18px; padding: 16px 18px;
  border-radius: 12px; background: var(--sage-l);
}
.zn-shop > a { text-decoration: none; }
.zn-shop small { display: block; font-size: 12.5px; color: var(--ink-3); }
.zn-shop b { font: 600 15px Poppins, sans-serif; }
.zn-shop b::after { content: " \2192"; transition: margin .2s; }
.zn-shop > a:hover b::after { margin-left: 4px; }

.zn-meta { margin: 20px 0 0; padding: 0; list-style: none; font-size: 14px; }
.zn-meta li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.zn-meta li span { color: var(--ink-3); min-width: 72px; }
.zn-meta a { text-decoration: none; border-bottom: 1px solid var(--line); }
.zn-meta a:hover { border-color: var(--ink); }

.zn-near { margin-top: 26px; }
.zn-near h3 { margin: 0 0 6px; font: 600 14px Poppins, sans-serif; }
.zn-near button {
  display: flex; justify-content: space-between; gap: 10px; width: 100%;
  padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 14px;
}
.zn-near button em { font-style: normal; color: var(--ink-3); white-space: nowrap; }
.zn-near button:hover span { text-decoration: underline; }

/* toast */
.zn-toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translateX(-50%);
  background: var(--sage-d); color: #fff; font-size: 14px;
  padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
  animation: zn-in .3s var(--ease) both;
}

/* ---------- Mobile ---------- */
@media (max-width: 899px) {
  :root { --top-h: 0px; }
  .zn-app { display: block; }
  .zn-mapwrap { position: absolute; inset: 0; }

  .zn-top {
    position: absolute; top: 0; left: 0; right: 0;
    padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
    background: linear-gradient(#fff 55%, rgba(255, 255, 255, 0));
    border: 0; gap: 12px; flex-wrap: wrap;
  }
  .zn-logo img { height: 18px; }
  .zn-search { order: 2; }
  .zn-shoplink { order: 1; height: 32px; padding: 0 12px; font-size: 13px; background: #fff; }
  .zn-shoplink svg { width: 16px; height: 16px; }
  .zn-search { flex: 1 1 100%; height: 50px; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); border-color: transparent; }

  .zn-panel {
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 88vh; height: 88dvh;
    border: 0; border-radius: 20px 20px 0 0;
    box-shadow: 0 -6px 30px rgba(0, 0, 0, .14);
    transform: translateY(var(--sheet-y, calc(100% - 168px)));
    transition: transform .45s var(--ease);
    touch-action: none;
  }
  .zn-panel.is-drag { transition: none; }
  .zn-grip { display: block; padding: 10px 0 2px; cursor: grab; }
  .zn-grip span { display: block; width: 40px; height: 5px; margin: 0 auto; border-radius: 3px; background: #dcdad3; }
  .zn-filters { padding: 8px 16px 6px; }
  .zn-brands { touch-action: pan-x; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .zn-brands::-webkit-scrollbar { display: none; }
  .zn-chip { flex: none; }
  .zn-online { margin-top: 10px; }
  .zn-count { margin: 4px 16px 6px; }
  .zn-list { touch-action: pan-y; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

  .zn-card {
    top: auto; left: 0; right: 0; bottom: 0; width: auto;
    max-height: 60vh; max-height: 60dvh;
    border-radius: 20px 20px 0 0;
    animation-name: zn-card-m;
  }
  @keyframes zn-card-m { from { transform: translateY(100%); } }
  .zn-sv { height: 170px; }
  .zn-body { padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); }
  .zn-body h2 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
