/* Delivery location picker: address search, current location and a fixed centre pin. */
.delivery-map-card{
  --dm-ink:var(--store-ink,#302a2d);--dm-muted:var(--store-muted,#71676c);--dm-line:var(--store-line,#e8e1dc);
  --dm-accent:var(--store-rose,#86516a);--dm-accent-dark:var(--store-rose-dark,#63394d);--dm-soft:var(--store-blush,#f1e6e9);
  --dm-surface:var(--store-surface,#fff);--dm-paper:var(--store-paper,#faf8f5);--dm-error:#a33a3a;
  margin:0 0 1.1rem;padding:16px;border:1px solid var(--dm-line);border-radius:16px;background:var(--dm-surface);color:var(--dm-ink)
}
.delivery-map-card svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.delivery-map-card :is(button,input):focus-visible{outline:2px solid var(--dm-accent);outline-offset:2px}

.delivery-map-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.delivery-map-head h3{margin:0;font-size:15px;font-weight:700;line-height:1.35;color:var(--dm-ink)}
.delivery-map-head p{margin:2px 0 0;font-size:13px;line-height:1.45;color:var(--dm-muted)}
.delivery-map-close{display:inline-flex;align-items:center;min-height:40px;padding:0 16px;border-radius:999px;background:var(--dm-soft);color:var(--dm-accent-dark);font-size:14px;font-weight:700}
.delivery-map-close[hidden]{display:none}

.delivery-map-tools{display:flex;gap:8px;margin-top:12px}
.delivery-map-search{position:relative;flex:1;min-width:0}
.delivery-map-search-icon{position:absolute;inset-inline-start:13px;top:50%;width:18px;height:18px;transform:translateY(-50%);color:var(--dm-muted);pointer-events:none}
.delivery-map-search input{width:100%;height:46px;padding-inline:40px 14px;border:1px solid var(--dm-line);border-radius:12px;background:var(--dm-paper);font-size:15px;color:var(--dm-ink);transition:border-color .15s,background .15s,box-shadow .15s}
.delivery-map-search input::placeholder{color:#9a9095}
.delivery-map-search input:focus{outline:none;border-color:var(--dm-accent);background:var(--dm-surface);box-shadow:0 0 0 3px color-mix(in srgb,var(--dm-accent) 16%,transparent)}
.delivery-map-search input::-webkit-search-cancel-button{cursor:pointer}

.delivery-map-results{position:absolute;inset-inline:0;top:calc(100% + 6px);z-index:1100;margin:0;padding:6px;list-style:none;max-height:288px;overflow:auto;background:var(--dm-surface);border:1px solid var(--dm-line);border-radius:14px;box-shadow:0 14px 34px rgba(48,42,45,.14)}
.delivery-map-results[hidden]{display:none}
.delivery-map-results li{display:flex;gap:10px;align-items:flex-start;padding:10px;border-radius:10px;cursor:pointer}
.delivery-map-results li svg{width:18px;height:18px;margin-top:1px;color:var(--dm-accent)}
.delivery-map-results li[aria-selected=true],.delivery-map-results li:hover{background:var(--dm-soft)}
.delivery-map-results .dm-option-text{display:grid;gap:1px;min-width:0}
.delivery-map-results strong{font-size:14px;font-weight:650;color:var(--dm-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.delivery-map-results small{font-size:12.5px;color:var(--dm-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.delivery-map-results .dm-option-note{cursor:default;color:var(--dm-muted);font-size:13px}
.delivery-map-results .dm-option-note:hover{background:none}

.delivery-map-chip{display:inline-flex;align-items:center;gap:7px;height:46px;padding:0 14px;border:1px solid var(--dm-line);border-radius:12px;background:var(--dm-surface);color:var(--dm-accent-dark);font-size:14px;font-weight:650;white-space:nowrap;transition:border-color .15s,background .15s}
.delivery-map-chip svg{width:18px;height:18px}
.delivery-map-chip:hover{border-color:var(--dm-accent);background:var(--dm-soft)}
.delivery-map-chip[aria-busy=true] svg{animation:dm-pulse 1s ease-in-out infinite}

.delivery-map-toggle{display:inline-flex;align-items:center;gap:7px;margin-top:10px;padding:6px 2px;color:var(--dm-accent);font-size:14px;font-weight:650}
.delivery-map-toggle svg{width:18px;height:18px}
.delivery-map-toggle:hover span{text-decoration:underline;text-underline-offset:3px}

.delivery-map-wrap{margin-top:12px}
.delivery-map-wrap[hidden]{display:none}
.delivery-map-canvas{position:relative;height:340px;border:1px solid var(--dm-line);border-radius:14px;overflow:hidden;background:#efeae6}
#deliveryMap{position:absolute;inset:0;z-index:1;background:#efeae6}
.delivery-map-pin{position:absolute;left:50%;top:50%;z-index:500;width:38px;height:50px;margin:-50px 0 0 -19px;pointer-events:none;transition:transform .18s ease}
.delivery-map-pin svg{width:100%;height:100%;filter:drop-shadow(0 4px 6px rgba(48,42,45,.28))}
.delivery-map-pin path{fill:var(--dm-accent);stroke:#fff;stroke-width:2.5}
.delivery-map-pin circle{fill:#fff;stroke:none}
.delivery-map-pin-shadow{position:absolute;left:50%;top:50%;z-index:499;width:14px;height:5px;margin:-2px 0 0 -7px;border-radius:50%;background:rgba(48,42,45,.32);pointer-events:none;transition:transform .18s ease,opacity .18s ease}
.delivery-map-canvas.is-moving .delivery-map-pin{transform:translateY(-10px)}
.delivery-map-canvas.is-moving .delivery-map-pin-shadow{transform:scale(1.6);opacity:.55}
.delivery-map-hint{position:absolute;left:50%;top:12px;z-index:600;margin:0;padding:6px 12px;transform:translateX(-50%);border-radius:999px;background:rgba(48,42,45,.82);color:#fff;font-size:12.5px;font-weight:600;white-space:nowrap;pointer-events:none;transition:opacity .25s}
.delivery-map-canvas.has-moved .delivery-map-hint{opacity:0}

.delivery-map-result{display:flex;align-items:center;gap:12px;margin-top:10px;padding:12px 12px 12px 14px;border:1px solid color-mix(in srgb,var(--dm-accent) 22%,var(--dm-line));border-radius:14px;background:var(--dm-soft)}
.delivery-map-result[hidden]{display:none}
.delivery-map-result-text{display:grid;gap:2px;flex:1;min-width:0}
.delivery-map-result-text strong{font-size:15px;font-weight:700;line-height:1.3;color:var(--dm-ink)}
.delivery-map-result-text span{font-size:13px;line-height:1.35;color:var(--dm-muted)}
.delivery-map-result.is-loading .delivery-map-result-text strong,.delivery-map-result.is-loading .delivery-map-result-text span{color:transparent;border-radius:6px;background:linear-gradient(90deg,#eadde1 0%,#f6eef1 50%,#eadde1 100%);background-size:200% 100%;animation:dm-shimmer 1.2s linear infinite}
.delivery-map-result.is-loading .delivery-map-result-text strong{width:70%;min-height:18px}
.delivery-map-result.is-loading .delivery-map-result-text span{width:45%;min-height:14px}
.delivery-map-use{flex-shrink:0;min-height:42px;padding:0 18px;border-radius:999px;background:var(--dm-accent);color:#fff;font-size:14px;font-weight:700;box-shadow:0 6px 16px color-mix(in srgb,var(--dm-accent) 26%,transparent);transition:background .15s}
.delivery-map-use:hover{background:var(--dm-accent-dark)}
.delivery-map-use:disabled{opacity:.45;box-shadow:none;cursor:not-allowed}
.delivery-map-use.is-done{background:var(--dm-surface);color:var(--dm-accent-dark);box-shadow:inset 0 0 0 1px var(--dm-line)}

.delivery-map-status{margin:8px 2px 0;font-size:13px;line-height:1.45;color:var(--dm-muted)}
.delivery-map-status:empty{display:none}
.delivery-map-status.is-error{color:var(--dm-error)}

.delivery-map-saved{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:10px 0 0;font-size:13px;color:var(--dm-ink)}
.delivery-map-saved[hidden]{display:none}
.delivery-map-saved svg{width:18px;height:18px;color:#3f7d58;stroke-width:2.4}
.delivery-map-link{color:var(--dm-muted);font-size:13px;text-decoration:underline;text-underline-offset:3px}
.delivery-map-link:hover{color:var(--dm-accent-dark)}

/* Leaflet controls in the shop style */
.delivery-map-canvas .leaflet-bar{border:0;border-radius:12px;overflow:hidden;box-shadow:0 4px 14px rgba(48,42,45,.16)}
.delivery-map-canvas .leaflet-bar a{width:36px;height:36px;line-height:36px;color:var(--dm-ink);font-weight:500}
.delivery-map-canvas .leaflet-control-attribution{font-size:10px;background:rgba(255,255,255,.75)}

@keyframes dm-pulse{50%{opacity:.35}}
@keyframes dm-shimmer{to{background-position:-200% 0}}

/* Phones: the map opens as a full-screen sheet so the pin is easy to place. */
@media(max-width:640px){
  .delivery-map-card{padding:14px}
  .delivery-map-chip span{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .delivery-map-chip{width:46px;justify-content:center;padding:0}
  .delivery-map-card.is-sheet{position:fixed;inset:0;z-index:2000;display:flex;flex-direction:column;margin:0;padding:calc(12px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom));border:0;border-radius:0;overflow:hidden}
  #deliveryMapCard.is-sheet{margin:0} /* beats the form's space-y margins */
  .delivery-map-card.is-sheet .delivery-map-head{align-items:center}
  .delivery-map-card.is-sheet .delivery-map-head p,.delivery-map-card.is-sheet .delivery-map-toggle,.delivery-map-card.is-sheet .delivery-map-saved{display:none}
  .delivery-map-card.is-sheet .delivery-map-wrap{display:flex;flex-direction:column;flex:1;min-height:0}
  .delivery-map-card.is-sheet .delivery-map-canvas{flex:1;height:auto;min-height:220px}
  .delivery-map-card.is-sheet .delivery-map-result{flex-wrap:wrap}
  .delivery-map-card.is-sheet .delivery-map-use{width:100%;min-height:48px;font-size:15px}
  .delivery-map-canvas{height:300px}
}
body.delivery-map-locked{overflow:hidden}

@media(prefers-reduced-motion:reduce){
  .delivery-map-pin,.delivery-map-pin-shadow,.delivery-map-hint{transition:none}
  .delivery-map-chip[aria-busy=true] svg,.delivery-map-result.is-loading *{animation:none}
}
