/* WFAddrPick (public/js/address-picker.js) — the ONE place picker, Shipping ON only.
   Theme tokens only, so day, night and the remodel follow. Type scale + chips copy the Stock Locations
   "Assigned runners" panel: 12px uppercase labels, 14.5px/600 names, soft pale chips, hairline cards. */

/* the original input stays as the data holder */
input.wfap-src { display: none !important; }

/* ── the field ───────────────────────────────────────────────────────── */
.wfap-field { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 16px; box-sizing: border-box; text-align: left; cursor: pointer;
  font: inherit; font-size: 16px; color: var(--white); background: var(--bg-void); border: 1px solid var(--border); border-radius: 8px; transition: border-color .15s, background .15s; }
.wfap-field:hover:not(:disabled) { border-color: var(--blue); }
.wfap-field:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.wfap-field:disabled { opacity: .55; cursor: not-allowed; }
.wfap-f-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wfap-f-txt b { font-weight: 600; }
.wfap-ph { color: var(--muted); }
.wfap-field .wfap-chev { flex: none; color: var(--muted); }
.wfap-f-chip { flex: none; }
@media (max-width: 520px) { .wfap-f-chip { display: none; } }

/* ── shared bits ─────────────────────────────────────────────────────── */
.wfap-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.wfap-dot.is-off { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 20%, transparent); }
.wfap-dot.is-none { background: transparent; border: 1.5px solid var(--muted); box-shadow: none; }
.wfap-dot.is-free { background: transparent; border: 2px solid var(--blue); box-shadow: none; }
.wfap-code { font-style: normal; font-size: 11.5px; font-weight: 600; letter-spacing: .3px; margin-left: 8px; padding: 2px 7px; border-radius: 6px; background: var(--bg-hover); color: var(--off-white); vertical-align: 1px; }
.wfap-chip { display: inline-block; font-size: 12px; font-weight: 600; line-height: 1.3; padding: 3px 9px; border-radius: 8px; background: var(--bg-hover); color: var(--off-white); white-space: nowrap; }

/* ── the modal (desktop) / bottom sheet (phone) ──────────────────────── */
html.wfap-lock { overflow: hidden; }
.wfap-ov { position: fixed; inset: 0; z-index: 100200; display: flex; align-items: center; justify-content: center; padding: 32px; box-sizing: border-box;
  background: color-mix(in srgb, #0b1220 48%, transparent); opacity: 0; transition: opacity .16s ease; overscroll-behavior: contain; }
.wfap-ov.is-open { opacity: 1; }
.wfap-sheet { position: relative; display: flex; flex-direction: column; width: min(1040px, 100%); max-height: min(780px, 100%); box-sizing: border-box; padding: 28px 32px 28px;
  background: var(--bg-raised); color: var(--white); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 30px 80px rgba(8, 15, 30, .35);
  transform: translateY(10px) scale(.99); transition: transform .18s ease; }
.wfap-ov.is-open .wfap-sheet { transform: none; }
.wfap-grab { display: none; }
.wfap-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.wfap-title { margin: 0; font-family: var(--font-body); font-size: 26px; font-weight: 700; letter-spacing: -.4px; line-height: 1.15; color: var(--white); }
.wfap-sub { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.wfap-x { flex: none; width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-raised); color: var(--off-white); font-size: 24px; line-height: 1; cursor: pointer; }
.wfap-x:hover { background: var(--bg-hover); }
.wfap-search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; margin-bottom: 8px; border-radius: 12px; background: var(--bg-void); border: 1px solid var(--border); color: var(--muted); }
.wfap-search:focus-within { border-color: var(--blue); }
.wfap-search input { flex: 1; min-width: 0; height: 100%; border: 0 !important; outline: 0; background: transparent !important; box-shadow: none !important; padding: 0 !important; font: inherit; font-size: 16px; color: var(--white); }
.wfap-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 -8px; padding: 0 8px 4px; }
.wfap-sec { display: flex; align-items: center; gap: 8px; margin: 24px 0 12px; font-size: 12px !important; font-weight: 700 !important; letter-spacing: 1.4px !important; text-transform: uppercase; color: var(--white); }
.wfap-sec span { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--bg-hover); color: var(--off-white); letter-spacing: 0; }
.wfap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.wfap-grid--lead { margin-top: 16px; }
.wfap-grid--lead:empty { display: none; }

.wfap-card { position: relative; display: flex; align-items: flex-start; gap: 14px; width: 100%; min-height: 76px; box-sizing: border-box; padding: 16px 18px; text-align: left; cursor: pointer; font: inherit; color: var(--white);
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: 14px; transition: border-color .12s, background .12s, box-shadow .12s; }
.wfap-card .wfap-dot { margin-top: 5px; }
.wfap-card:hover:not([aria-disabled="true"]) { border-color: var(--blue); box-shadow: 0 2px 10px color-mix(in srgb, var(--blue) 14%, transparent); }
.wfap-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.wfap-card.is-sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, var(--bg-raised)); }
.wfap-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.wfap-name { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--white); overflow-wrap: anywhere; }
.wfap-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.wfap-status { font-size: 13px; font-weight: 600; color: var(--green); }
.wfap-tick { flex: none; color: var(--blue); display: inline-flex; margin-top: 2px; }
.wfap-card.is-off { cursor: not-allowed; border-color: color-mix(in srgb, var(--red) 45%, var(--border)); background: color-mix(in srgb, var(--red) 6%, var(--bg-raised)); }
.wfap-card.is-off .wfap-name, .wfap-card.is-off .wfap-chip { opacity: .72; }
.wfap-card.is-off .wfap-status { color: var(--red); }
.wfap-card.is-extra { border-style: dashed; }
.wfap-card.is-extra .wfap-status { color: var(--muted); font-weight: 500; }
.wfap-card.is-extra.is-free .wfap-name { color: var(--blue); }
.wfap-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -3px 0 0 -6px; border-radius: 50%; background: var(--bg-hover); color: var(--off-white); }
.wfap-empty { padding: 36px 8px; text-align: center; font-size: 14px; color: var(--muted); }

/* ── phone: a bottom sheet ───────────────────────────────────────────── */
@media (max-width: 720px) {
  .wfap-ov { align-items: flex-end; padding: 0; }
  .wfap-sheet { width: 100%; max-height: 92dvh; padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)); border-radius: 22px 22px 0 0; border-bottom: 0; transform: translateY(40px); }
  .wfap-grab { display: block; width: 40px; height: 5px; margin: 4px auto 14px; border-radius: 3px; background: var(--border); }
  .wfap-head { margin-bottom: 14px; }
  .wfap-title { font-size: 22px; }
  .wfap-sub { font-size: 13.5px; margin-top: 4px; }
  .wfap-grid { grid-template-columns: 1fr; gap: 10px; }
  .wfap-sec { margin: 20px 0 10px; }
  .wfap-card { min-height: 68px; padding: 14px 16px; }
}
@media (prefers-reduced-motion: reduce) { .wfap-ov, .wfap-sheet { transition: none; } }
