/* Customer app styles (mobile first) */
:root {
  --green: #1f7a3a;
  --green-dark: #165c2b;
  --green-soft: #e7f3ea;
  --bg: #f6f8f4;
  --card: #ffffff;
  --text: #1c2420;
  --muted: #6b7570;
  --line: #e3e8e2;
  --danger: #b3261e;
  --warn-bg: #fff7e0;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(140px + var(--safe-bottom)); }
.loading { padding: 40vh 0; text-align: center; color: var(--muted); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 10;
  background: var(--green); color: #fff;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
}
.header h1 { margin: 0; font-size: 20px; font-weight: 700; }
.header .sub { font-size: 13px; opacity: .9; margin-top: 2px; }

.notice { background: var(--green-soft); color: var(--green-dark); font-size: 14px; padding: 10px 16px; }

.install {
  margin: 12px 16px 0; padding: 12px 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  display: flex; gap: 12px; align-items: center; font-size: 14px;
}
.install img { width: 40px; height: 40px; border-radius: 10px; }
.install .grow { flex: 1; }
.install .x { background: none; border: 0; color: var(--muted); font-size: 20px; padding: 4px 8px; }

/* Search & categories */
.search { padding: 12px 16px 0; }
.search input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
}
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none;
  position: sticky; top: 64px; background: var(--bg); z-index: 5;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font-size: 14px; white-space: nowrap;
}
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }

/* Products */
.section-title { margin: 18px 16px 8px; font-size: 15px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.list { margin: 0 16px; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .emoji { width: 44px; height: 44px; flex: none; display: grid; place-items: center; font-size: 28px; background: var(--bg); border-radius: 12px; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-weight: 600; }
.item .local { color: var(--muted); font-size: 13px; }
.item .meta { font-size: 14px; margin-top: 2px; }
.item .meta b { font-weight: 700; }
.item.out { opacity: .5; }
.item .tag { font-size: 12px; color: var(--danger); font-weight: 600; }

.add {
  min-width: 84px; padding: 8px 0; border-radius: 10px; border: 1.5px solid var(--green);
  background: var(--card); color: var(--green); font-weight: 700;
}
.stepper { display: flex; align-items: center; background: var(--green); color: #fff; border-radius: 10px; min-width: 84px; }
.stepper button { background: none; border: 0; color: #fff; font-size: 20px; width: 30px; height: 36px; font-weight: 700; }
.stepper span { flex: 1; text-align: center; font-weight: 700; }

/* Cart bar & bottom nav */
.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(64px + var(--safe-bottom));
  width: calc(100% - 24px); max-width: 536px; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--green); color: #fff; border: 0; border-radius: 14px; padding: 13px 16px;
  font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-bottom);
}
.nav-inner { max-width: 560px; margin: 0 auto; display: flex; }
.nav button {
  flex: 1; background: none; border: 0; padding: 9px 0 10px; font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative;
}
.nav button .ic { font-size: 20px; line-height: 1; }
.nav button.on { color: var(--green); font-weight: 700; }
.badge {
  position: absolute; top: 4px; left: calc(50% + 6px); background: var(--danger); color: #fff;
  border-radius: 999px; font-size: 11px; padding: 0 6px; font-weight: 700;
}

/* Generic blocks */
.page { padding: 16px; }
.page h2 { margin: 4px 0 12px; font-size: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.row.total { font-weight: 700; font-size: 17px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { background: var(--warn-bg); padding: 8px 12px; border-radius: 10px; font-size: 14px; margin-top: 8px; }
.ok-hint { background: var(--green-soft); color: var(--green-dark); padding: 8px 12px; border-radius: 10px; font-size: 14px; margin-top: 8px; }

label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=tel], select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
}
textarea { min-height: 64px; resize: vertical; }

.btn {
  display: block; width: 100%; padding: 14px; border-radius: 12px; border: 0;
  background: var(--green); color: #fff; font-weight: 700; font-size: 16px; margin-top: 16px;
}
.btn:disabled { opacity: .5; }
.btn.ghost { background: var(--card); color: var(--green); border: 1.5px solid var(--green); }
.btn.small { display: inline-block; width: auto; padding: 8px 14px; font-size: 14px; margin: 0; }
.btn.danger { background: var(--card); color: var(--danger); border: 1.5px solid var(--danger); }
.btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 14px; text-align: left; }
.slot.on { border-color: var(--green); background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
.slot small { display: block; font-weight: 400; color: var(--muted); }

.pay { display: flex; gap: 8px; }
.pay .slot { flex: 1; text-align: center; }

.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg); }
.status.new { background: #e8f0fe; color: #1a4fb5; }
.status.packed { background: #fff3d6; color: #8a5a00; }
.status.out { background: #ffe8d6; color: #a14a00; }
.status.delivered { background: var(--green-soft); color: var(--green-dark); }
.status.cancelled { background: #fde8e7; color: var(--danger); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 48px; }

.welcome { padding: 28px 20px; }
.welcome .logo { width: 72px; height: 72px; border-radius: 18px; display: block; margin-bottom: 12px; }
.welcome h1 { margin: 0 0 4px; font-size: 26px; }

.success { text-align: center; padding: 40px 20px; }
.success .big { font-size: 64px; }

.toast {
  position: fixed; left: 50%; bottom: calc(140px + var(--safe-bottom)); transform: translateX(-50%) translateY(20px);
  background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: all .2s; z-index: 50; max-width: 90%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--card); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 20px 20px calc(20px + var(--safe-bottom)); }
.sheet ol { padding-left: 20px; }
.sheet li { margin: 8px 0; }
.share-ic { display: inline-block; border: 1.5px solid currentColor; border-radius: 4px; padding: 0 4px; font-size: 12px; }

/* "Deliver to" button in the header */
.deliver-to {
  display: block; margin-top: 6px; background: rgba(255,255,255,.16); color: #fff; border: 0;
  border-radius: 10px; padding: 7px 10px; font-size: 14px; text-align: left; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.addr-mini { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px;
  padding-top: 10px; border-top: 1px solid var(--line); }

/* Address / map screen */
.addr { min-height: 100vh; background: var(--card); padding-bottom: calc(24px + var(--safe-bottom)); }
.addr-top { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px; }
.addr-title { font-weight: 700; font-size: 18px; }
.addr-back { background: var(--bg); border: 0; border-radius: 10px; width: 38px; height: 38px; font-size: 20px; }
.addr-search { position: relative; padding: 4px 16px 10px; z-index: 1001; }
.addr-search input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); }
.addr-results {
  position: absolute; left: 16px; right: 16px; top: 52px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 50vh; overflow-y: auto;
}
.addr-results button { display: block; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 10px 12px; }
.addr-results button:first-child { border-top: 0; }
.addr-results b { display: block; font-size: 15px; }
.addr-results span { display: block; font-size: 12px; color: var(--muted); }

.addr-map-wrap { position: relative; height: 46vh; min-height: 280px; }
.addr-map { position: absolute; inset: 0; background: #e8ede6; }
.addr-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); z-index: 1000; pointer-events: none; font-size: 40px; line-height: 1; filter: drop-shadow(0 3px 3px rgba(0,0,0,.35)); }
.addr-pin-tip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, calc(-100% - 46px)); z-index: 1000; pointer-events: none;
  background: #1c2420; color: #fff; font-size: 12px; padding: 5px 10px; border-radius: 8px; white-space: nowrap;
}
.addr-pin-tip.bad { background: var(--danger); }
.addr-locate {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 1000;
  background: var(--card); color: var(--green); border: 1.5px solid var(--green); border-radius: 999px;
  padding: 9px 16px; font-weight: 700; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.18); white-space: nowrap;
}
.addr-sheet { padding: 14px 16px 0; }
.addr-found { display: flex; gap: 10px; align-items: flex-start; }
.addr-found-ic { font-size: 22px; }
.addr-found-main { font-weight: 700; }
.addr-out { background: #fde8e7; color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 10px; }
.addr-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.addr-credit { text-align: center; margin-top: 12px; }
.addr-locnote { background: var(--green-soft); color: var(--green-dark); padding: 8px 12px; border-radius: 10px; font-size: 13px; margin-top: 10px; }
.addr-locnote.bad { background: var(--warn-bg); color: #6b4a00; }
.addr-locate:disabled { opacity: .7; }
.addr-locate.big { bottom: 50%; transform: translate(-50%, 50%); padding: 14px 22px; font-size: 16px; background: var(--green); color: #fff; }

/* Product photos & cards */
.center { text-align: center; }
.credits { margin: 24px 0 8px; }
.credits a { color: var(--muted); }
.rowimg { width: 52px; height: 52px; flex: none; border-radius: 12px; object-fit: cover; background: var(--bg); }
.noimg { display: grid; place-items: center; font-size: 28px; background: var(--bg); }

.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 16px; }
@media (min-width: 480px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.pcard.out { opacity: .5; }
.pimg { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--bg); }
.pimg.noimg { font-size: 56px; }
.pbody { padding: 8px 10px 10px; display: flex; flex-direction: column; flex: 1; }
.pbody .name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.pbody .local { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pfoot { display: flex; justify-content: space-between; align-items: flex-end; gap: 6px; margin-top: auto; padding-top: 8px; }
.pfoot b { font-size: 15px; }
.pcard .add { min-width: 62px; padding: 6px 0; font-size: 14px; }
.pcard .stepper { min-width: 78px; }
.pcard .stepper button { width: 26px; height: 32px; font-size: 18px; }
.pcard .tag { font-size: 11px; text-align: right; }

.ctiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 0 16px; }
.ctile { position: relative; border: 0; padding: 0; border-radius: var(--radius); overflow: hidden; background: var(--card); text-align: left; aspect-ratio: 4 / 3; }
.ctile .cimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ctile .cimg.noimg { font-size: 48px; }
.ctile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 35%, rgba(0,0,0,.65)); }
.ctile span, .ctile small { position: absolute; left: 10px; z-index: 1; color: #fff; }
.ctile span { bottom: 24px; font-weight: 700; font-size: 16px; }
.ctile small { bottom: 8px; font-size: 12px; opacity: .9; }

/* Home: one sideways row per category */
.rowhead { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 16px 8px; }
.rowhead h2 { margin: 0; font-size: 18px; }
.seeall { background: none; border: 0; color: var(--green); font-weight: 700; font-size: 14px; padding: 4px 0; }
.hrow {
  display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 6px; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.hrow::-webkit-scrollbar { display: none; }
.hrow .pcard { flex: 0 0 142px; scroll-snap-align: start; }
.hmore {
  flex: 0 0 96px; border: 1px dashed var(--green); border-radius: var(--radius); background: var(--green-soft);
  color: var(--green-dark); font-weight: 700; font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.hmore span { font-size: 28px; line-height: 1; }

/* Sideways rows on a computer: arrows, drag, thin scrollbar */
.hwrap { position: relative; }
.harrow { display: none; }
.dragging { cursor: grabbing; user-select: none; scroll-snap-type: none; }
.dragging * { pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .hrow, .chips { cursor: grab; scrollbar-width: thin; }
  .hrow::-webkit-scrollbar, .chips::-webkit-scrollbar { display: block; height: 6px; }
  .hrow::-webkit-scrollbar-thumb, .chips::-webkit-scrollbar-thumb { background: #cfd8cc; border-radius: 3px; }
  .harrow {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 40%; transform: translateY(-50%);
    z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card);
    color: var(--text); font-size: 24px; line-height: 1; box-shadow: 0 2px 10px rgba(0,0,0,.18); padding: 0 0 3px;
  }
  .harrow.left { left: 4px; }
  .harrow.right { right: 4px; }
  .harrow.off { opacity: 0; pointer-events: none; }
}

/* ===== Top bar (new design) ===== */
.topbar {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 92% -20%, rgba(255,255,255,.18) 0 90px, transparent 91px),
    radial-gradient(circle at 105% 120%, rgba(255,255,255,.10) 0 70px, transparent 71px),
    linear-gradient(135deg, #17602d 0%, #1f7a3a 45%, #2f9a52 100%);
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 16px;
  border-radius: 0 0 22px 22px;
  box-shadow: 0 6px 18px rgba(23, 96, 45, .25);
}
.topbar.slim { position: sticky; top: 0; z-index: 10; padding-bottom: 12px; border-radius: 0 0 18px 18px; }
.tb-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 42px; height: 42px; flex: none; border-radius: 12px; box-shadow: 0 3px 10px rgba(0,0,0,.22), 0 0 0 2px rgba(255,255,255,.35); }
.brand.small .brand-logo { width: 32px; height: 32px; border-radius: 9px; }
.brand-text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 5px; line-height: 1.1; }
.brand-text .b1 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.brand-text .b2 { font-size: 22px; font-weight: 400; letter-spacing: -.2px; opacity: .92; }
.brand.small .b1 { font-size: 19px; font-weight: 700; }
.brand-text small { flex-basis: 100%; font-size: 11.5px; letter-spacing: .3px; opacity: .8; margin-top: 3px; }
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6);
  background: rgba(255,255,255,.18); color: #fff; font-weight: 800; font-size: 16px;
}

.topbar .deliver-to {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 14px; text-align: left;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 14px;
  padding: 9px 12px; color: #fff; backdrop-filter: blur(4px);
}
.dt-ic { font-size: 18px; }
.dt-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dt-text small { font-size: 11px; opacity: .8; }
.dt-text b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-caret { opacity: .8; }

/* Search stays at the top while scrolling */
.search { position: sticky; top: 0; z-index: 9; background: var(--bg); padding: 12px 16px 4px; display: flex; align-items: center; }
.search-ic { position: absolute; left: 30px; font-size: 15px; opacity: .55; pointer-events: none; }
.search input {
  padding: 12px 14px 12px 40px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
  box-shadow: 0 2px 8px rgba(0,0,0,.05); font-size: 15px;
}
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,122,58,.15); }
.chips { position: static; padding-top: 10px; }
.chip.on { box-shadow: 0 3px 10px rgba(31,122,58,.3); }
.welcome .logo { border-radius: 18px; box-shadow: 0 6px 18px rgba(23,96,45,.3); }

/* ---------- OTP login ---------- */
.welcome .lg-title { font-size: 19px; margin: 22px 0 6px; }
.phonebox { display: flex; align-items: stretch; border: 1.5px solid #dfe5de; border-radius: 12px; background: #fff; overflow: hidden; }
.phonebox:focus-within { border-color: #1f7a3a; }
.phonebox span { display: flex; align-items: center; padding: 0 12px; font-weight: 700; background: #f4f6f3; border-right: 1px solid #dfe5de; }
.phonebox input { border: 0 !important; margin: 0 !important; flex: 1; min-width: 0; box-shadow: none !important; outline: none; }
.linkbtn { background: none; border: 0; padding: 0; color: #1f7a3a; font-weight: 700; cursor: pointer; font: inherit; text-decoration: underline; }

/* ===== veggoracart brand ===== */
.topbar {
  background:
    radial-gradient(circle at 95% -25%, rgba(201,245,58,.22) 0 95px, transparent 96px),
    radial-gradient(circle at 108% 125%, rgba(201,245,58,.12) 0 75px, transparent 76px),
    linear-gradient(135deg, #0b3d2e 0%, #0f5132 55%, #14713f 100%);
  box-shadow: 0 6px 18px rgba(11, 61, 46, .3);
}
.brand-logo { box-shadow: 0 3px 10px rgba(0,0,0,.25); }
.wm { font-weight: 900; letter-spacing: -1px; line-height: 1; white-space: nowrap; }
.brand-text .wm { font-size: 25px; }
.wm1 { color: #fff; }
.wm2 { color: #c9f53a; }
.brand-text small { margin-top: 4px; }
.brand.small .b1 { font-weight: 800; }
.wm-big .wm { font-size: 34px; }
.wm-big .wm1 { color: #0b3d2e; }
.wm-big .wm2 { color: #16a34a; }
.avatar { background: rgba(201,245,58,.16); border-color: rgba(201,245,58,.7); }
/* "Continue with Google" button */
.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; margin-top: 10px;
  padding: 14px 16px; border-radius: 14px; border: 1.5px solid #dadce0; background: #fff; color: #1f1f1f;
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.gbtn:hover { background: #f8faf8; }
.gbtn:disabled { opacity: .6; cursor: default; }
.g-ic { width: 22px; height: 22px; flex: none; }
