@import "/assets/vendor/leaflet/leaflet.css";

/* UK shops map — matches the public dark theme (tokens.css / public.css vars). */
/* .sh-modal uses display:flex, which out-specifies the UA [hidden] rule; without
   this guard a hidden modal would paint on load. Also covers the empty-state note. */
[hidden]{display:none!important}

/* Category colours (mirrors shop_categories() in inc/Shops.php). Sets --dot on any
   element carrying data-c, used by the legend + list dots. Map pins read the same
   colours from the JSON payload in JS. */
[data-c="shops"]{--dot:#2f81f7}
[data-c="plants"]{--dot:#3fb950}
[data-c="co2"]{--dot:#d29922}
[data-c="breeders"]{--dot:#e0603f}
[data-c="hardscape"]{--dot:#a371f7}
[data-c="equipment"]{--dot:#13a594}
[data-c="wholesale"]{--dot:#8a93a3}

.sh-app{margin-top:6px}
.sh-inline-link{background:none;border:0;padding:0;color:var(--blue);font:inherit;font-weight:600;cursor:pointer}
.sh-inline-link:hover{text-decoration:underline}

/* ── Controls ─────────────────────────────────────────────────────────────── */
.sh-controls{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-bottom:14px}
.sh-search{flex:1 1 220px;min-width:0;background:var(--field-bg);border:1px solid var(--field-border);
  border-radius:var(--field-radius);color:var(--text);font:inherit;font-size:.95rem;padding:10px 14px;outline:none}
.sh-search:focus{border-color:var(--blue)}
.sh-chips{display:flex;flex-wrap:wrap;gap:7px;flex:2 1 auto}
.sh-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:20px;cursor:pointer;
  font-size:.84rem;font-weight:600;color:var(--muted);background:var(--card);border:1px solid var(--border2)}
.sh-chip:hover{color:var(--text);border-color:var(--border-strong)}
.sh-chip.is-on{color:var(--text);background:var(--blue-bg);border-color:var(--blue)}
.sh-chip-n{font-size:.74rem;font-weight:700;opacity:.7}
.sh-dot{width:9px;height:9px;border-radius:50%;background:var(--dot,#2f81f7);display:inline-block;flex:0 0 auto}
.sh-add-btn{flex:0 0 auto;padding:9px 15px;border-radius:10px;cursor:pointer;font-weight:600;font-size:.9rem;
  color:#04140a;background:var(--green);border:1px solid var(--green);transition:filter .12s}
.sh-add-btn:hover{filter:brightness(1.08)}

/* ── "Shops near me" radius search ────────────────────────────────────────── */
.sh-nearby{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 14px;padding:10px 12px;
  background:var(--card);border:1px solid var(--border2);border-radius:12px}
.sh-near-pin{color:var(--blue);flex:0 0 auto}
.sh-near-input{flex:1 1 200px;min-width:0;background:var(--field-bg);border:1px solid var(--field-border);
  border-radius:var(--field-radius);color:var(--text);font:inherit;font-size:.92rem;padding:8px 12px;outline:none}
.sh-near-input:focus{border-color:var(--blue)}
.sh-near-within{display:inline-flex;align-items:center;gap:6px;font-size:.86rem;color:var(--muted);flex:0 0 auto}
.sh-near-radius{background:var(--field-bg);border:1px solid var(--field-border);border-radius:var(--field-radius);
  color:var(--text);font:inherit;font-size:.9rem;padding:7px 8px;outline:none;cursor:pointer}
.sh-near-radius:focus{border-color:var(--blue)}
.sh-near-btn{flex:0 0 auto;padding:8px 15px;border-radius:9px;cursor:pointer;font-weight:600;font-size:.9rem;
  color:#04121f;background:var(--blue);border:1px solid var(--blue);transition:filter .12s}
.sh-near-btn:hover{filter:brightness(1.08)}
.sh-near-btn:disabled{opacity:.6;cursor:default}
.sh-near-geo,.sh-near-clear{flex:0 0 auto;padding:8px 12px;border-radius:9px;cursor:pointer;font-weight:600;font-size:.86rem;
  color:var(--muted);background:transparent;border:1px solid var(--border2)}
.sh-near-geo:hover,.sh-near-clear:hover{color:var(--text);border-color:var(--border-strong)}
.sh-item-dist{font-size:.74rem;font-weight:700;color:var(--blue);background:var(--blue-bg);
  border:1px solid rgba(88,166,255,.3);border-radius:20px;padding:1px 8px;margin-right:2px}

/* ── Map + list layout ────────────────────────────────────────────────────── */
.sh-layout{display:grid;grid-template-columns:1.5fr 1fr;gap:16px;align-items:start}
.sh-map-wrap{position:sticky;top:14px}
.sh-map{height:560px;border-radius:14px;border:1px solid var(--border2);overflow:hidden;background:#0a0f16;z-index:0}
.sh-map-note{margin:8px 2px 0;font-size:.78rem;color:var(--muted)}

.sh-list-wrap{display:flex;flex-direction:column;min-height:0}
.sh-list-head{font-size:.86rem;color:var(--muted);margin:0 0 8px;font-weight:600}
.sh-list-head #shopCount{color:var(--text)}
.sh-list-sub{font-weight:400}
.sh-list{list-style:none;margin:0;padding:0;max-height:560px;overflow-y:auto;
  border:1px solid var(--border);border-radius:12px;background:var(--card)}
.sh-item{display:flex;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border);cursor:pointer;transition:background .1s}
.sh-item:last-child{border-bottom:0}
.sh-item:hover,.sh-item.is-active{background:var(--surface)}
.sh-item-dot{width:10px;height:10px;border-radius:50%;background:var(--dot,#2f81f7);margin-top:5px;flex:0 0 auto}
.sh-item-main{flex:1;min-width:0}
.sh-item-name{font-weight:600;font-size:.95rem;color:var(--text)}
.sh-item-meta{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:.8rem;color:var(--muted);margin:2px 0 5px}
.sh-item-cat{color:var(--text2)}
.sh-item-addr::before{content:"·";margin-right:6px}
.sh-item-addr-unknown{font-style:italic;opacity:.75}
.sh-item-foot{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:.8rem}
.sh-item-link{color:var(--blue);text-decoration:none;font-weight:600}
.sh-item-link:hover{text-decoration:underline}
.sh-item-report{background:none;border:0;padding:0;color:var(--muted);font:inherit;font-size:.8rem;cursor:pointer}
.sh-item-report:hover{color:var(--amber);text-decoration:underline}
.sh-list-empty{padding:22px 14px;color:var(--muted);text-align:center;font-size:.9rem}

/* Freshness pills */
.sh-fresh{font-size:.74rem;font-weight:600;padding:2px 8px;border-radius:20px;white-space:nowrap}
.sh-fresh-ok{color:var(--green);background:var(--green-faint,rgba(63,185,80,.1))}
.sh-fresh-stale{color:var(--amber);background:rgba(210,153,34,.12)}
.sh-fresh-unv{color:var(--muted);background:var(--surface)}

.sh-credit{margin:16px 2px 0;font-size:.78rem;color:var(--muted);line-height:1.6}
.sh-credit a{color:var(--muted);text-decoration:underline}
.sh-credit a:hover{color:var(--blue)}

/* ── Leaflet popup — dark theme ───────────────────────────────────────────── */
.leaflet-container{font:inherit;background:#0a0f16}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:var(--card);color:var(--text);box-shadow:0 6px 24px rgba(0,0,0,.55)}
.leaflet-popup-content{margin:12px 14px;font-size:.9rem;line-height:1.5}
.leaflet-container a.leaflet-popup-close-button{color:var(--muted);padding:6px 6px 0 0}
.leaflet-container a.leaflet-popup-close-button:hover{color:var(--text)}
.sh-pop-name{font-weight:700;font-size:.98rem;display:block;margin-bottom:2px}
.sh-pop-cat{color:var(--muted);font-size:.82rem;display:block;margin-bottom:7px}
.sh-pop-row{display:flex;gap:7px;align-items:flex-start;font-size:.86rem;line-height:1.4;margin:4px 0;color:var(--text2)}
.sh-pop-ic{flex:0 0 auto;color:var(--muted);margin-top:1px;display:inline-flex}
.sh-pop-row a{color:var(--blue);text-decoration:none;word-break:break-word}
.sh-pop-row a:hover{text-decoration:underline}
.sh-pop-dim{color:var(--muted);font-style:italic}
.sh-pop-notes{display:block;font-size:.84rem;color:var(--muted);line-height:1.45;margin:6px 0}
.sh-pop-fresh{display:block;margin:8px 0 2px}
.sh-pop-links{display:flex;flex-wrap:wrap;gap:12px;margin-top:8px}
.sh-pop-links a,.sh-pop-links button{color:var(--blue);text-decoration:none;font-weight:600;background:none;border:0;padding:0;font:inherit;cursor:pointer}
.sh-pop-links button{color:var(--muted)}
.sh-pop-links a:hover,.sh-pop-links button:hover{text-decoration:underline}

/* ── Modals (suggest + report) ────────────────────────────────────────────── */
.sh-modal{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:16px}
.sh-modal-backdrop{position:absolute;inset:0;background:rgba(2,6,12,.72);backdrop-filter:blur(2px)}
.sh-modal-card{position:relative;background:var(--bg2);border:1px solid var(--border2);border-radius:16px;
  width:100%;max-width:460px;max-height:90vh;overflow-y:auto;padding:22px 22px 20px;box-shadow:0 20px 60px rgba(0,0,0,.6)}
.sh-modal-x{position:absolute;top:12px;right:14px;background:none;border:0;color:var(--muted);font-size:1.6rem;line-height:1;cursor:pointer}
.sh-modal-x:hover{color:var(--text)}
.sh-modal-h{margin:0 0 4px;font-size:1.25rem;color:var(--text)}
.sh-modal-sub{margin:0 0 16px;font-size:.88rem;color:var(--muted);line-height:1.5}
.sh-form{display:flex;flex-direction:column;gap:12px}
.sh-field{display:flex;flex-direction:column;gap:5px}
.sh-field>span{font-size:.82rem;font-weight:600;color:var(--text2)}
.sh-field-hint{font-weight:400;color:var(--muted)}
.sh-field input,.sh-field select,.sh-field textarea{background:var(--field-bg);border:1px solid var(--field-border);
  border-radius:var(--field-radius);color:var(--text);font:inherit;font-size:.92rem;padding:9px 12px;outline:none;width:100%}
.sh-field input:focus,.sh-field select:focus,.sh-field textarea:focus{border-color:var(--blue)}
.sh-field textarea{resize:vertical}
.sh-mini-map{height:220px;border-radius:10px;border:1px solid var(--border2);overflow:hidden;background:#0a0f16}
.sh-pin-note{font-size:.78rem;color:var(--muted)}
.sh-pin-note.is-set{color:var(--green)}
.sh-hp{position:absolute!important;left:-9999px;width:1px;height:1px;opacity:0}
.sh-form-note{font-size:.84rem;padding:9px 12px;border-radius:8px}
.sh-form-note.err{color:var(--amber);background:rgba(210,153,34,.12)}
.sh-form-note.ok{color:var(--green);background:var(--green-faint,rgba(63,185,80,.1))}
.sh-form-foot{display:flex;justify-content:flex-end;gap:9px;margin-top:4px}
.sh-btn-ghost{background:transparent;border:1px solid var(--border2);color:var(--muted);border-radius:9px;padding:9px 15px;font-weight:600;font-size:.9rem;cursor:pointer}
.sh-btn-ghost:hover{color:var(--text);border-color:var(--border-strong)}
.sh-btn-primary{background:var(--blue);border:1px solid var(--blue);color:#04121f;border-radius:9px;padding:9px 17px;font-weight:600;font-size:.9rem;cursor:pointer;transition:filter .12s}
.sh-btn-primary:hover{filter:brightness(1.08)}
.sh-btn-primary:disabled{opacity:.6;cursor:default}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media(max-width:900px){
  .sh-layout{grid-template-columns:1fr}
  .sh-map-wrap{position:static}
  .sh-map{height:420px}
  .sh-list{max-height:none}
}
@media(max-width:640px){
  .sh-controls{gap:8px}
  .sh-add-btn{flex:1 1 100%;order:3}
  .sh-search{flex:1 1 100%}
  .sh-map{height:340px}
  .sh-modal{padding:0;align-items:flex-end}
  .sh-modal-card{max-width:none;border-radius:16px 16px 0 0;max-height:94vh}
}
