/* ReadyMeds search: the results screen. List on the left, map on the right; on phones the map is behind and the list is a sheet. */
html.search, html.search body { height: 100%; }
html.search body { overflow: hidden; }

/* ---- top bar: logo, the request, account ---- */
.topbar { position: relative; z-index: 6; height: 64px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; padding: 0 var(--hgut); border-bottom: 1px solid var(--line); background: var(--bg); }
.topbar .right { display: flex; align-items: center; gap: 8px; }
.sfield { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; height: 44px; margin: 0 auto; padding: 0 6px 0 16px; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--bg); box-shadow: var(--shadow-sm); transition: box-shadow 0.2s var(--ease), border-color 0.2s; }
.sfield:focus-within { border-color: #b9bcc6; box-shadow: var(--shadow-md); }
.sfield .ic { width: 18px; height: 18px; flex: none; color: var(--fg-3); }
.sfield input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 0.9375rem; }
.sfield input::placeholder { color: var(--fg-4); }
.sgo { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--accent); color: #fff; transition: background-color 0.15s; }
.sgo:hover { background: var(--accent-hover); }
.sgo svg { width: 16px; height: 16px; }

/* ---- chips: what we understood, and the filters ---- */
.chips { position: relative; z-index: 5; height: 56px; display: flex; align-items: center; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); background: var(--bg); }
.chips__row { display: flex; align-items: center; gap: 8px; width: 100%; overflow-x: auto; scrollbar-width: none; }
.chips__row::-webkit-scrollbar { display: none; }
.seg { display: inline-flex; flex: none; padding: 3px; background: var(--bg-2); border-radius: var(--r-pill); }
.seg button { height: 32px; padding: 0 14px; border-radius: var(--r-pill); font-size: 0.875rem; font-weight: 500; color: var(--fg-2); transition: background-color 0.15s, color 0.15s; }
.seg button:hover { color: var(--fg); }
.seg button.is-on { background: var(--fg); color: #fff; }
.chipwrap { position: relative; flex: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; flex: none; border: 1px solid var(--line-2); border-radius: var(--r-pill); background: var(--bg); font-size: 0.875rem; font-weight: 500; color: var(--fg); white-space: nowrap; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.chip:hover { background: var(--bg-2); }
.chip.is-on { background: var(--fg); color: #fff; border-color: var(--fg); }
.chip svg { width: 16px; height: 16px; flex: none; }
.chip .chev { width: 14px; height: 14px; margin-left: -2px; opacity: 0.7; }
.chip img { width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08); }
.chip.is-on img { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25); }
.chip input { width: 150px; border: 0; background: none; outline: none; font: inherit; color: inherit; }
.chips__div { width: 1px; height: 24px; flex: none; margin: 0 4px; background: var(--line); }
/* ---- the two panes ---- */
.layout { position: relative; display: grid; grid-template-columns: 520px 1fr; grid-template-rows: minmax(0, 1fr); height: calc(100% - 120px); }
.side { position: relative; z-index: 3; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); border-right: 1px solid var(--line); }
.handle { display: none; }
.side .inner { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.results, .panel { padding: 18px var(--gutter) 48px; }
.results__head h1 { margin: 0 0 4px; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; text-wrap: balance; }
.results__head .sub { margin: 0 0 6px; font-size: 0.875rem; line-height: 1.45; color: var(--fg-3); }
.results__head .clear { margin: 0 0 6px; font-size: 0.875rem; }
.results__head .clear button { color: var(--accent); font-weight: 500; }
.group { margin: 18px 0 2px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-4); }

/* ---- a pharmacy ---- */
.card { position: relative; display: grid; grid-template-columns: 88px 1fr; gap: 0 14px; align-items: start; margin: 0 calc(-1 * var(--gutter)); padding: 16px var(--gutter); border-top: 1px solid var(--line); cursor: pointer; transition: background-color 0.15s; }
.cards .card:first-of-type { border-top: 0; }
.card__body { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; align-items: start; min-width: 0; }
.card__tile { display: grid; place-items: center; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }
.card__tile--logo { background: var(--bg); border: 1px solid var(--line); padding: 14px; }
.card__tile--logo img { width: 100%; height: 100%; object-fit: contain; }
.tile--a { background: var(--accent-soft); color: var(--accent-ink); }
.tile--b { background: var(--green-soft); color: var(--green); }
.tile--c { background: #fff1dc; color: var(--orange-ink); }
.tile--d { background: #efe9fb; color: #5b3fa0; }
.fav { position: absolute; left: calc(var(--gutter) + 58px); top: 22px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); transition: transform 0.15s var(--ease); }
.fav:hover { transform: scale(1.08); }
.fav svg { width: 16px; height: 16px; }
.fav.is-on { color: #e0245e; }
.fav.is-on svg path { fill: currentColor; }
.chip[data-filter="saved"] svg { width: 15px; height: 15px; }
.chip[data-filter="saved"].is-on svg path { fill: #ff6b94; stroke: #ff6b94; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.panel__head h2 { margin: 0; flex: 1; min-width: 0; }
.panel__logo { width: 44px; height: 44px; flex: none; border-radius: 12px; }
.card__tile--logo:has(img[src*="/logos/"]) { padding: 0; border: 0; }
.panel .fav--panel { position: static; width: 40px; height: 40px; flex: none; border: 1px solid var(--line-2); box-shadow: none; }
.panel .fav--panel svg { width: 19px; height: 19px; }
.card:hover, .card.is-hover { background: var(--bg-2); }
.card__name { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.card__badges { display: flex; gap: 4px; }
.card__meta { grid-column: 1 / -1; font-size: 0.875rem; color: var(--fg-3); }
.card__meta .rate { color: var(--fg-2); }
.card__meta .rate svg { width: 13px; height: 13px; }
.card__ready { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.9375rem; font-weight: 600; color: var(--green); }
.card__ready .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--green); }
.card__ready.is-later { color: var(--fg-2); }
.card__ready.is-later .dot { background: var(--fg-4); }
.card__ready.is-off { color: var(--fg-4); }
.card__ready.is-off .dot { background: var(--line-2); }
.card__stock { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--fg-3); }
.card__go { grid-column: 1 / -1; margin-top: 8px; }
.card__go .btn { height: 36px; }
.card.is-hover .btn--soft, .card:hover .btn--soft { background: var(--bg-3); }

.ico--box { display: grid; place-items: center; background: var(--orange); color: #1d1d1f; }
.ico--box svg { width: 13px; height: 13px; }
.card__box { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; color: var(--fg-2); }
.card__box svg { width: 14px; height: 14px; color: var(--fg-3); }

.ico--chain { display: grid; place-items: center; color: #fff; font-size: 0.75rem; font-weight: 700; }
.card--chain .card__name { color: var(--fg-2); }
.card__note { grid-column: 1 / -1; font-size: 0.8125rem; color: var(--fg-3); }
.card__go .ext { display: inline-flex; align-items: center; gap: 6px; }
.ext svg { width: 14px; height: 14px; }
.card__box svg, .chip[data-filter="lockbox"] svg { color: var(--orange-ink); }
.card__price { grid-column: 1 / -1; font-size: 0.875rem; color: var(--fg-2); }
.card__price b { font-weight: 600; color: var(--fg); }
.compare { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.cmp { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 4px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 0.8125rem; color: var(--fg-2); }
.cmp b { font-weight: 600; color: var(--fg); }
.cmp .clogo { height: 22px; padding: 0 2px; }
.cmp .clogo img { height: 14px; max-width: 64px; }
.cmp .rm { width: 14px; height: 17px; }
.cmp--us { background: var(--green-soft); border-color: transparent; color: var(--green); }
.cmp--us b { color: var(--green); }
.card__badges .clogo img { height: 18px; max-width: 84px; }
.panel .badges .clogo { height: 22px; }
.panel .badges .clogo img { height: 13px; max-width: 60px; }

/* ---- skeleton while we look up the postcode ---- */
.skel { height: 14px; margin: 6px 0; border-radius: 7px; background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 37%, var(--bg-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skel.w1 { width: 60%; } .skel.w2 { width: 40%; } .skel.w3 { width: 75%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skelcard { padding: 18px 0; border-top: 1px solid var(--line); }

/* ---- the chosen pharmacy ---- */
.back { display: inline-flex; align-items: center; gap: 6px; height: 36px; margin-left: -8px; padding: 0 12px 0 8px; border-radius: var(--r-pill); font-size: 0.875rem; font-weight: 500; color: var(--fg-2); }
.back:hover { background: var(--bg-2); color: var(--fg); }
.back svg { width: 16px; height: 16px; }
.panel h2 { margin: 14px 0 4px; font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.panel .meta { margin: 0; font-size: 0.9375rem; line-height: 1.5; color: var(--fg-3); }
.panel .meta .rate { color: var(--fg-2); }
.panel .meta .rate svg { width: 14px; height: 14px; }
.panel .badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; font-size: 0.8125rem; color: var(--fg-2); }
.panel .badges > span { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 3px; border: 1px solid var(--line); border-radius: var(--r-pill); white-space: nowrap; }
.panel .badges .ico { width: 22px; height: 22px; }
.section { margin-top: 24px; }
.section h3 { margin: 0 0 10px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-4); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 44px; padding: 6px 14px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg); font-size: 0.9375rem; font-weight: 500; line-height: 1.2; text-align: left; transition: border-color 0.15s, background-color 0.15s; }
.opt small { font-size: 0.75rem; font-weight: 500; color: var(--fg-4); }
.opt:hover { border-color: #b9bcc6; }
.opt.is-on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.is-on small { color: var(--accent-ink); opacity: 0.8; }
.pricebox { display: flex; align-items: baseline; gap: 8px; margin-top: 14px; }
.pricebox b { font-size: 1.75rem; font-weight: 600; letter-spacing: -0.02em; }
.pricebox span { font-size: 0.875rem; color: var(--fg-3); }
.note { margin: 6px 0 0; font-size: 0.8125rem; color: var(--fg-4); }
.cta { display: flex; align-items: center; justify-content: center; width: 100%; height: 52px; margin-top: 18px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 1rem; font-weight: 600; transition: background-color 0.15s; }
.cta:hover { background: var(--accent-hover); }
.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.step i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-2); font-style: normal; font-size: 0.8125rem; font-weight: 600; }
.step b { display: block; font-size: 0.9375rem; font-weight: 600; }
.step span { font-size: 0.875rem; line-height: 1.45; color: var(--fg-3); }
.assure { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 0.875rem; line-height: 1.45; color: var(--fg-2); }
.assure li { display: flex; gap: 8px; align-items: flex-start; }
.assure svg { width: 18px; height: 18px; flex: none; color: var(--green); }

/* ---- the map ---- */
.mapwrap { position: relative; min-width: 0; min-height: 0; background: var(--bg-2); }
#map { position: absolute; inset: 0; }
.area { position: absolute; top: 14px; left: 50%; z-index: 2; height: 38px; padding: 0 16px; transform: translateX(-50%); border-radius: var(--r-pill); background: var(--bg); box-shadow: var(--shadow-md); font-size: 0.875rem; font-weight: 600; color: var(--fg); }
.area:hover { background: var(--bg-2); }
.mapctl { position: absolute; right: 14px; bottom: 28px; z-index: 2; display: grid; gap: 8px; }
.mapctl button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--bg); box-shadow: var(--shadow-md); color: var(--fg); font-size: 1.25rem; font-weight: 500; transition: background-color 0.15s; }
.mapctl button:hover { background: var(--bg-2); }
.mapctl svg { width: 18px; height: 18px; }
.maplibregl-ctrl-attrib { font-family: var(--font); font-size: 10px; }
.maplibregl-ctrl-bottom-right { z-index: 1; }
.mk { cursor: pointer; z-index: 1; }
.mk--chain { z-index: 0; }
.mk.is-hidden { visibility: hidden; }
.mk.is-hover { visibility: visible; z-index: 2; }
.mk .pin { position: static; width: max-content; transform: none; }
.mk .pin .nm { display: none; }
.mk.is-on, .mk:hover { z-index: 3; }
.mk.is-on .pin .nm, .mk:hover .pin .nm { display: inline; }
.mk .pin.is-later b { color: var(--fg-2); }
.mk .pin.is-later .t { color: var(--fg-3); }
.mk .pin.is-on b, .mk .pin.is-on .nm, .mk .pin.is-on .pr, .mk .pin.is-later.is-on b { color: #fff; }
.mk .pin.is-later.is-on .t { color: #8ff0b0; }
/* On a phone the chosen pin drops its lock box chip, as the hero pill does; the panel below still says 24-hour lock box. */
@media (max-width: 720px) { .mk.is-on .pin .h24 { display: none; } }
.you-mk .you { position: static; display: block; transform: none; }

/* ---- toast ---- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 30; max-width: calc(100% - 32px); padding: 12px 18px; transform: translateX(-50%); border-radius: 16px; background: var(--fg); color: #fff; font-size: 0.9375rem; line-height: 1.4; box-shadow: var(--shadow-lg); }

/* ---- phones and small tablets: map behind, list as a sheet ---- */
@media (max-width: 900px) {
  .card { grid-template-columns: 76px 1fr; gap: 0 12px; }
  .card__tile { width: 76px; height: 76px; font-size: 1.25rem; }
  .card__tile--logo { padding: 11px; }
  .fav { left: calc(var(--gutter) + 48px); top: 20px; width: 28px; height: 28px; }
  .topbar { height: 60px; grid-template-columns: auto 1fr; gap: 12px; }
  .topbar .right { display: none; }
  .topbar .brand img { height: 40px; }
  .sfield { height: 40px; }
  .chips { position: absolute; top: 60px; left: 0; right: 0; z-index: 4; height: auto; padding: 10px 0 12px; border: 0; background: none; pointer-events: none; }
  .chips__row { padding: 0 var(--gutter); pointer-events: auto; }
  .chip, .seg { box-shadow: var(--shadow-md); }
  .chip { border-color: transparent; }
  .seg { background: var(--bg); }
  .layout { display: block; height: calc(100% - 60px); }
  .mapwrap { position: absolute; inset: 0; }
  .area { top: 72px; }
  .mapctl { right: 12px; bottom: calc(100% - var(--sheet, 46%) + 14px); transition: bottom 0.3s var(--ease); }
  .side { position: absolute; left: 0; right: 0; bottom: 0; top: var(--sheet, 46%); z-index: 5; border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -8px 30px -12px rgba(0, 0, 0, 0.28); transition: top 0.3s var(--ease); }
  .side.is-dragging { transition: none; }
  .handle { display: grid; place-items: center; height: 26px; flex: none; cursor: grab; touch-action: none; }
  .handle::before { content: ""; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
  .results, .panel { padding-top: 4px; padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
  .layout.is-full .mapctl { display: none; }
}
