/* ============================================================
   GoShop Design System
   Shared across every screen (consumer + shopkeeper).
   Teal = brand/trust. Amber = action/money.
   Font stack: Inter (Latin) -> Noto Sans Devanagari (Nepali).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500&family=Noto+Sans+Devanagari:wght@400;500&display=swap');

:root {
  /* ---- Brand: Teal (trust) ---- */
  --teal-50:  #E1F5EE;
  --teal-100: #9FE1CB;
  --teal-400: #1D9E75;
  --teal-600: #0F6E56;   /* primary brand */
  --teal-800: #085041;
  --teal-900: #04342C;

  /* ---- Action: Amber (money / do-this) ---- */
  --amber-50:  #FAEEDA;
  --amber-400: #EF9F27;
  --amber-500: #BA7517;  /* primary action */
  --amber-800: #633806;
  --amber-900: #412402;

  /* ---- Neutrals ---- */
  --ink:       #1F1E1B;  /* primary text */
  --ink-soft:  #5F5E5A;  /* secondary text */
  --ink-faint: #888780;  /* hints */
  --line:      #E4E2DA;  /* hairline borders */
  --surface:   #FFFFFF;  /* cards */
  --page:      #F7F6F1;  /* page background */

  /* ---- Status ---- */
  --open:   #1D9E75;
  --closed: #C0392B;

  /* ---- Shape & rhythm ---- */
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 48px;           /* minimum touch target */
  --gap: 16px;

  /* ---- Font ---- */
  --font: "Inter", "Noto Sans Devanagari", system-ui, -apple-system, sans-serif;
}

/* ---- Reset ---- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Nepali text tends to sit tight; give it a touch more line height */
.np { line-height: 1.7; }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
input { font-family: inherit; font-size: 16px; } /* 16px stops iOS zoom-on-focus */

/* ============================================================
   Layout helpers
   ============================================================ */
.app {
  max-width: 480px;          /* mobile-first column */
  margin: 0 auto;
  min-height: 100vh;
  background: var(--page);
  position: relative;
  padding-bottom: 84px;      /* room for bottom nav */
}

.pad { padding: 0 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.spread { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.hide { display: none !important; }

/* ============================================================
   Buttons — large touch targets everywhere
   ============================================================ */
.btn {
  min-height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(0.98); }

.btn-action {                 /* amber = the money action */
  background: var(--amber-400);
  color: var(--amber-900);
  width: 100%;
}
.btn-action:active { background: var(--amber-500); }

.btn-teal {
  background: var(--teal-600);
  color: #fff;
  width: 100%;
}
.btn-outline {
  background: var(--surface);
  color: var(--teal-600);
  border: 1.5px solid var(--teal-600);
  flex: 1;
}

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.card-tap {                   /* tappable list card */
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
}
.card-tap:active { background: #fbfaf6; }

/* ============================================================
   Pills / badges
   ============================================================ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 20px;
}
.pill-open   { background: var(--teal-50);  color: var(--teal-800); }
.pill-closed { background: #FBEAE8;         color: var(--closed); }
.pill-dot { width: 7px; height: 7px; border-radius: 50%; }
.pill-open .pill-dot   { background: var(--open); }
.pill-closed .pill-dot { background: var(--closed); }

.freshness { font-size: 12px; color: var(--ink-faint); }

/* ============================================================
   Category tile (homepage grid)
   ============================================================ */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cat-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 8px 4px;
}
.cat-tile:active { background: #fbfaf6; }
.cat-ic {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.cat-teal  { background: var(--teal-50);  color: var(--teal-600); }
.cat-amber { background: var(--amber-50); color: var(--amber-500); }
.cat-label { font-size: 13px; font-weight: 500; line-height: 1.2; }

.thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}

/* ============================================================
   Header (consumer)
   ============================================================ */
.hdr {
  background: var(--teal-600);
  color: #fff;
  padding: 16px 16px 34px; /* v17: room for the floating search pill to overlap */
  border-radius: 0 0 20px 20px;
}
.loc-chip { display: flex; flex-direction: column; }
.loc-label { font-size: 12px; color: var(--teal-100); }
.loc-name { font-size: 18px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--teal-800); color: var(--teal-100);
  display: flex; align-items: center; justify-content: center;
  font-weight: 500;
}
.searchbar {
  margin-top: 14px;
  background: #fff;
  border-radius: 12px;
  min-height: var(--tap);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  color: var(--ink-faint);
  width: 100%;
}
.searchbar input {
  border: none; outline: none; flex: 1;
  background: transparent; color: var(--ink);
}

/* ============================================================
   Section titles
   ============================================================ */
.sec-title {
  font-size: 16px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 12px;
}
.sec-link { font-size: 13px; color: var(--teal-600); font-weight: 400; }

/* ============================================================
   Bottom nav
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 0;
  z-index: 20;
}
.nav-item {
  min-width: var(--tap); min-height: var(--tap);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--ink-faint);
}
.nav-item.active { color: var(--teal-600); }
.nav-item .ic { font-size: 24px; }

/* ============================================================
   Loading skeleton (low-data friendly, no spinners)
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: sk 1.2s ease infinite;
  border-radius: 8px;
}
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   Shop detail page
   ============================================================ */
.shop-hero {
  height: 150px;
  background: var(--teal-600);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal-100);
  position: relative;
}
.shop-hero .ti { font-size: 52px; }
.hero-btn {
  position: absolute; top: 14px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,.28); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.hero-btn.back { left: 14px; }
.hero-btn.save { right: 14px; }

.shop-body { padding: 16px; }
.shop-name { font-size: 20px; font-weight: 500; }
.shop-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.shop-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); margin: 10px 0; }

/* Findability chain */
.find-block {
  background: var(--amber-50);
  border-radius: var(--radius);
  padding: 14px;
  margin: 8px 0 14px;
}
.find-label {
  font-size: 11px; font-weight: 500; letter-spacing: .4px;
  text-transform: uppercase; color: var(--amber-800);
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 8px;
}
.find-step { display: flex; gap: 12px; align-items: flex-start; }
.find-step + .find-step { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e6cfa0; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: var(--amber-400); color: var(--amber-900);
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
}
.step-num.dest { background: var(--teal-600); color: #fff; }
.step-text-en { font-size: 15px; color: var(--amber-900); line-height: 1.4; }
.step-text-ne { font-size: 13px; color: var(--amber-800); margin-top: 3px; }
.find-single { font-size: 15px; color: var(--amber-900); line-height: 1.45; }
.find-single-ne { font-size: 13px; color: var(--amber-800); margin-top: 5px; }

/* Photo placeholder (real photos come from shopkeeper later) */
.photo-ph {
  width: 56px; height: 56px; border-radius: 8px; flex-shrink: 0;
  background: #f0e4cd; color: var(--amber-500);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}

/* Stock chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 20px; }
.chip-in  { background: var(--teal-50);  color: var(--teal-800); }
.chip-out { background: #F1EFE8; color: var(--ink-faint); text-decoration: line-through; }

.action-row { display: flex; gap: 10px; margin-top: 10px; }

/* ============================================================
   Welcome screen
   ============================================================ */
.welcome {
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 28px 22px 24px;
  max-width: 480px; margin: 0 auto;
}
.welcome-top { display: flex; justify-content: space-between; align-items: center; }
.brand { font-size: 18px; font-weight: 500; color: var(--teal-600); }
.lang-toggle {
  font-size: 13px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 6px 12px; min-height: 36px;
  display: inline-flex; align-items: center;
}
.welcome-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.namaste { font-size: 15px; color: var(--ink-soft); }
.welcome-name { font-size: 26px; font-weight: 500; line-height: 1.3; margin: 4px 0 24px; }
.info-tile {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 10px;
}
.info-tile.teal { background: var(--teal-50); color: var(--teal-900); }
.info-tile.plain { background: var(--surface); border: 1px solid var(--line); }
.info-tile .ti { font-size: 20px; }
.info-tile.teal .ti { color: var(--teal-800); }
.tile-label { font-size: 11px; color: var(--teal-600); }
.tile-main { font-size: 15px; font-weight: 500; }
.welcome-foot { text-align: center; }
.welcome-hint { font-size: 12px; color: var(--ink-faint); margin-top: 10px; }

/* ============================================================
   Registration bottom sheet (optional sign-up)
   ============================================================ */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .2s ease;
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(100%); transition: transform .25s ease;
}
.sheet-backdrop.show .sheet { transform: translateY(0); }
.sheet-handle { width: 36px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 16px; }
.sheet-title { font-size: 19px; font-weight: 500; }
.sheet-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.5; margin: 6px 0 16px; }
.field-label { font-size: 12px; color: var(--ink-soft); display: block; margin: 12px 0 6px; }
.field {
  width: 100%; min-height: var(--tap);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 12px; background: var(--surface); outline: none;
}
.field:focus { border-color: var(--teal-600); }
.phone-row { display: flex; gap: 8px; }
.phone-row .cc { width: 72px; text-align: center; flex-shrink: 0; }
.or-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.or-row::before, .or-row::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.or-row span { font-size: 12px; color: var(--ink-faint); }
.sheet-skip {
  display: block; width: 100%; text-align: center;
  font-size: 14px; color: var(--ink-soft);
  min-height: var(--tap); margin-top: 4px;
}
.otp-row { display: flex; gap: 8px; justify-content: space-between; margin: 8px 0 4px; }
.otp-box {
  flex: 1; max-width: 52px; height: 52px; text-align: center;
  font-size: 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); outline: none;
}
.otp-box:focus { border-color: var(--teal-600); }

/* ============================================================
   Register nudge banner (homepage, 3rd visit)
   ============================================================ */
.nudge {
  display: flex; align-items: center; gap: 10px;
  background: var(--amber-50); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 16px;
  font-size: 13px; color: var(--amber-900);
}
.nudge .ti { font-size: 18px; color: var(--amber-500); flex-shrink: 0; }
.nudge b { font-weight: 500; }
.nudge-cta { margin-left: auto; color: var(--amber-800); font-weight: 500; flex-shrink: 0; min-height: var(--tap); display: flex; align-items: center; }
.nudge-close { color: var(--amber-800); font-size: 16px; min-width: 32px; min-height: 32px; }

/* Register dot on profile nav */
.nav-dot { position: relative; }
.nav-dot::after {
  content: ""; position: absolute; top: 6px; right: 10px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--amber-400);
}

/* ============================================================
   Location switcher + planning mode
   ============================================================ */
.loc-name { min-height: 36px; }
.planning-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--amber-50);
  border-radius: 20px;
  padding: 8px 14px;
  margin-top: 12px;
  font-size: 13px; color: var(--amber-900);
}
.planning-pill .ti { color: var(--amber-500); }
.planning-pill b { font-weight: 500; }
.planning-exit {
  margin-left: auto; flex-shrink: 0;
  color: var(--amber-800); font-weight: 500; font-size: 13px;
  min-height: 36px; display: flex; align-items: center; gap: 4px;
}

/* Landmark picker rows (inside the bottom sheet) */
.lm-list { max-height: 52vh; overflow-y: auto; margin-top: 4px; }
.lm-search {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 0 12px; height: 46px; margin-bottom: 4px;
  background: var(--paper);
}
.lm-search:focus-within { border-color: var(--teal-600); }
.lm-search .ti { font-size: 18px; color: var(--ink-faint); }
.lm-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 15px; font-family: inherit; color: var(--ink);
}
.lm-group {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 12px 2px 4px;
}
.lm-empty {
  font-size: 13px; color: var(--ink-soft); text-align: center;
  padding: 24px 12px; line-height: 1.5;
}
.lm-row {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; width: 100%;
  padding: 0 4px; text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.lm-row:last-child { border-bottom: none; }
.lm-row .ti { font-size: 20px; color: var(--teal-600); }
.lm-row.me .ti { color: var(--amber-500); }
.lm-sub { font-size: 12px; color: var(--ink-faint); }
.lm-check { margin-left: auto; color: var(--teal-600); }

/* ============================================================
   Search results page
   ============================================================ */
.search-hdr {
  background: var(--teal-600); color: #fff;
  padding: 12px 16px 16px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 0 0 20px 20px;
  /* v17: results scroll, the search bar stays in reach */
  position: sticky; top: 0; z-index: 40;
}
.search-back {
  width: 40px; height: 40px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
}
.result-context {
  font-size: 13px; color: var(--ink-soft);
  margin: 14px 0 10px;
  display: flex; align-items: center; gap: 6px;
}
.match-chip {
  display: inline-block; font-size: 12px; font-weight: 500;
  background: var(--teal-50); color: var(--teal-800);
  border-radius: 14px; padding: 3px 10px; margin: 2px 4px 0 0;
}
.match-chip.out { background: #F1EFE8; color: var(--ink-faint); text-decoration: line-through; }
.empty-state { text-align: center; padding: 44px 24px; color: var(--ink-soft); }
.empty-state .ti { font-size: 34px; color: var(--ink-faint); }

/* ============================================================
   Two-part directions block: Google's job vs GoShop's job
   ============================================================ */
.dir-part {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  background: var(--surface);
}
.dir-part-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  margin-bottom: 10px;
}
.dir-part-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal-600); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.dir-part-sub { font-size: 12px; color: var(--ink-faint); margin-top: 8px; text-align: center; }

/* ============================================================
   Last-mile mini map (Leaflet + OpenStreetMap)
   ============================================================ */
.lastmile-map {
  height: 260px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: 12px;
  z-index: 0;
}
.map-pin {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--teal-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.map-pin.dest { background: var(--amber-500); color: #412402; }
.step-num.indoor { background: var(--ink-faint); }
.map-note { font-size: 11px; color: var(--ink-faint); margin: -6px 0 10px; text-align: center; }

/* ============================================================
   You-are-here dot, recenter button, offline sketch
   ============================================================ */
.you-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: #2A7FDB; border: 3px solid #fff;
  box-shadow: 0 0 0 2px rgba(42,127,219,.35), 0 1px 4px rgba(0,0,0,.3);
}
.recenter-btn {
  background: var(--surface) !important;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px !important;
  color: var(--teal-600); font-size: 17px;
  cursor: pointer; border: 1px solid var(--line) !important;
}
.sketch-wrap {
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  padding: 10px; margin-bottom: 12px; background: var(--surface);
}
.sketch-note {
  font-size: 11px; color: var(--ink-faint);
  text-align: center; margin-top: 6px;
}

/* ============================================================
   GoShop Pin (v16) — the shop's shareable address code
   ============================================================ */
.pin-chip {
  display: flex; align-items: center; gap: 10px;
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin: 4px 0 10px;
}
.pin-label {
  font-size: 11px; color: var(--teal-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pin-code {
  font-size: 17px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--teal-900);
  font-variant-numeric: tabular-nums;
}
.pin-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--teal-600); font-size: 17px; cursor: pointer;
}
.pin-btn:first-of-type { margin-left: auto; }
.pin-btn:active { background: var(--teal-50); }

/* ============================================================
   v17 — Mappls-inspired layering (honest version)
   ============================================================ */

/* Floating search pill: half over the teal header at rest,
   sticks to the top and rides over content on scroll. */
.search-float {
  position: sticky; top: 0; z-index: 40;
  padding: 8px 16px 10px;
  margin-top: -32px; /* overlap the header curve */
}
.search-float .searchbar {
  margin-top: 0;
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(31, 30, 27, .14);
}

/* Cross-document view transitions: page changes crossfade
   instead of flashing white. Pure progressive enhancement —
   browsers without support simply load pages as before. */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) { animation-duration: .18s; }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; }
}

/* Pin shown small inside the preview sheet */
.pin-mini {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--teal-50); color: var(--teal-800);
  border: 1px solid var(--teal-100);
  border-radius: 6px; padding: 1px 7px;
  font-weight: 600; letter-spacing: .5px; font-size: 12.5px;
}
.pin-mini i { font-size: 13px; color: var(--teal-600); }

/* Card press feedback — taps should feel acknowledged */
.card:active { transform: scale(.985); transition: transform .08s; }
