/* Task 90: v10 customer/public pages. Scoped under body.pub so the
   homepage and seller pages never change. Tokens, fonts and base
   components (.card, .pill, .chip, .kick, homepage hp-* styles) come
   from app.css; this file only composes them for public pages. */

:root {
  --ink: #102A33;
  --muted: #56707A;
  --line: #E2EAEE;
  --bg: #F3F8FA;
  --card: #FFFFFF;
  --accent: #0F766E;
  --accent-ink: #115E59;
  --accent-soft: #E6FAF6;
  --accent-bright: #14B8A6;
  --blue: #0369A1;
  --blue-soft: #E8F4FD;
  --sky: #38BDF8;
  --sky-pale: #7DD3FC;
  --teal-glow: #5EEAD4;
}

/* ---- Shared public header: base .hdr stays hidden, partial shows ---- */
body.pub > .hdr, body.v13 > .hdr { display: none; }
/* No empty band between the top strip and the header (like home). */
body.pub .content { padding-top: 0; }
body.pub .hp-header,
body.pub .hp-sheet { overflow-wrap: break-word; }
body.pub .hp-header .logo,
body.pub .hp-header .hp-sell,
body.pub .hp-header .hp-bag,
body.pub .hp-header .hp-menu-btn { flex: none; }
body.pub .hp-header { min-width: 0; }

/* Task 93: no separate shop strip; on shop pages the Bag link sits in
   the shared header instead of the My orders pill (same destination). */
.hp-header.with-bag .hp-orders { display: none; }
.hp-header.with-bag .hp-bag { display: inline-flex; }

/* Mostly-white object icons (WhatsApp bubble, etc.) sit on a soft
   tinted square so they read on white buttons/cards. */
.obj-tint {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--soft);
  flex: none;
}
.obj-tint .obj { width: 20px; height: 20px; }
.obj-tint.tint-green { background: var(--green-soft); }

/* ---- Page head: eyebrow + title + subtitle + actions ---- */
.ph-head {
  display: grid;
  gap: 12px;
  margin: 20px 0 0;
}
.ph-head h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.ph-head .lead { margin: 4px 0 0; }
.ph-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 900px) {
  .ph-head { grid-template-columns: 1fr auto; align-items: start; }
  .ph-head h1 { font-size: 32px; }
  .ph-head-actions { justify-content: flex-end; }
}

/* ---- Section rhythm, like the homepage ---- */
body.pub .pub-sec { margin-top: 48px; min-width: 0; }
body.pub .pub-sec:first-child { margin-top: 20px; }
@media (max-width: 600px) {
  body.pub .pub-sec { margin-top: 40px; }
}

/* ---- Shared form classes (Task 89 macro names, Task 90 page CSS) ---- */
body.pub .form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 20px;
  margin: 16px 0;
  min-width: 0;
}
body.pub .form-card > h2,
body.pub .form-card > h3 { margin-top: 0; }
body.pub .field { margin: 0 0 16px; min-width: 0; }
body.pub .field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
body.pub .field-label .req { color: var(--red); }
body.pub .field-input,
body.pub .field-select,
body.pub .field-textarea {
  width: 100%;
  min-height: var(--tap);
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ink);
}
body.pub .field-textarea { min-height: 96px; resize: vertical; }
body.pub .field-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 6px 0 0;
}
body.pub .field-error {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--red);
  margin: 6px 0 0;
}
body.pub .field-input[aria-invalid="true"],
body.pub .field-select[aria-invalid="true"],
body.pub .field-textarea[aria-invalid="true"] {
  border-color: var(--red);
}
body.pub .action-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
body.pub details.more {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 12px 16px;
  margin: 16px 0;
}
body.pub details.more > summary {
  font-weight: 700;
  cursor: pointer;
  min-height: var(--tap);
  display: flex;
  align-items: center;
}
body.pub details.more .form-card { box-shadow: none; margin: 12px 0 4px; }

body.pub .search.tools-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  padding: 6px 6px 6px 12px;
  margin-bottom: 0;
}
.tools-search .icon { flex: none; color: var(--muted); }
.tools-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  font: inherit;
  font-size: 16px;
  min-height: 40px;
  background: transparent;
  color: var(--ink);
}
.tools-search .mic {
  flex: none;
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}
body.pub .chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 4px;
  margin: 0;
  min-width: 0;
  max-width: 100%;
}
body.pub .chip-row .chip { flex: none; text-decoration: none; }
body.pub .chip-row .chip.on {
  background: var(--accent-soft);
  border-color: var(--accent-ink);
  color: var(--accent-ink);
}

/* Bag sheet lines mirror the laptop order column: name left with
   qty x price muted below, line amount right-aligned; total row
   label left / amount right. */
body.pub .sheet .rl {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line-2);
}
body.pub .sheet .rl > div { min-width: 0; }
body.pub .sheet .rl b { font-weight: 700; overflow-wrap: break-word; }
body.pub .sheet .rl small { display: block; color: var(--muted); font-size: 12px; }
body.pub .sheet .rl > b:last-child { text-align: right; white-space: nowrap; flex: none; }
body.pub .sheet .rt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-top: 10px;
}
body.pub .sheet .rt b { font-size: 22px; font-weight: 800; color: var(--ink); }

body.pub .filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  align-items: center;
  max-width: 100%;
}
body.pub [data-closed-notice] { flex-wrap: wrap; align-items: center; }
body.pub [data-closed-notice] .pill { flex: none; }
@media (max-width: 600px) {
  body.pub .filter-row { flex-wrap: wrap; }
  body.pub .filter-row .pin-wrap { flex: 1 1 100%; }
  body.pub .filter-row .pin-wrap input { width: 100%; }
}
body.pub .filter-row .chip,
body.pub .filter-row .seg { flex: none; }
body.pub .shop-row { min-width: 0; }
body.pub .rec-row { display: flex; gap: 10px; align-items: center; }
/* ---- Task 120: Order-by-voice is a compact panel directly under the
   search card. It shows only when the voice tab is selected or there
   is no query; after a typed search it stays hidden so the results
   come right after the search card. */
body.pub .voice-panel { margin-top: 12px; max-width: 100%; }
body.pub .voice-panel .form-card { padding: 14px 16px; margin: 0; }
body.pub .voice-panel .h2s { font-size: 17px; margin-bottom: 6px; }
body.pub .voice-panel .rec-row { margin: 0; }
body.pub .voice-panel #rec-status { margin: 6px 0; }
body.pub .voice-panel .more { margin: 6px 0 0; }
body.pub .voice-panel .notice { margin: 8px 0 0; }

/* ---- Order flow ---- */
.flow-steps {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 0;
  margin: 12px 0 0;
  flex-wrap: wrap;
}
.flow-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--muted);
}
.flow-steps li + li::before { content: "→"; color: var(--line-2); }
.flow-steps .n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  flex: none;
}
.flow-steps li.done { color: var(--ink); }
.flow-steps li.done .n { background: var(--accent-ink); color: #fff; }

/* Timeline: same hooks, roomier nodes. Horizontal on laptop, a clear
   vertical stepper on phones where five labels never fit one row. */
body.pub .tline { padding-top: 26px; }
body.pub .tline .st { width: auto; flex: 1; min-width: 0; font-size: 12px; }
body.pub .tline .st i { width: 30px; height: 30px; }
body.pub .hp-sec-head > div { flex: 1; min-width: 0; }
@media (max-width: 600px) {
  body.pub .tline {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 4px 4px;
  }
  body.pub .tline::before {
    left: 19px;
    right: auto;
    top: 16px;
    bottom: 16px;
    border-top: 0;
    border-left: 2.5px dashed #C8CCD3;
  }
  body.pub .tline .st {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
    padding: 9px 0;
    font-size: 13.5px;
  }
  body.pub .tline .st i { flex: none; }
  body.pub .tline .st .now {
    position: static;
    order: 3;
    margin-left: auto;
    flex: none;
  }
}
body.pub .next-step {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--accent-soft);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-weight: 600;
  margin: 12px 0 0;
}
.total-big {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.total-big .money { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }

/* Method picker + panels on the order page. */
body.pub .segmented { min-width: 0; }
body.pub .method-panel { scroll-margin-top: 140px; }

/* ---- My orders cards (rendered by my.js into these boxes) ---- */
.my-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin: 12px 0;
  display: grid;
  gap: 6px;
  min-width: 0;
}
.my-card-top { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.my-card-title { font-weight: 800; margin: 0; overflow-wrap: break-word; min-width: 0; }
.my-card-sub { color: var(--muted); font-size: 13.5px; margin: 0; }
.my-card-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.my-list { display: grid; gap: 0; }

/* ---- Bill / share / error ---- */
body.pub .bill-qr { text-align: center; }
body.pub .thanks { text-align: center; }

/* ---- Phones: sticky primary, 48px targets, no sideways scroll ---- */
body.pub .content { min-width: 0; }
body.pub .card,
body.pub .rcpt,
body.pub .form-card,
body.pub .my-card { overflow-wrap: break-word; }
@media (max-width: 600px) {
  body.pub .action-bar {
    position: sticky;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 8;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    box-shadow: var(--shadow-lift);
    padding: 12px;
    margin-left: 0;
    margin-right: 0;
  }
  body.pub .action-bar .pill { flex: 1; min-height: var(--tap); justify-content: center; }
  body.pub .ph-head-actions .pill { min-height: var(--tap); }
  body.pub .card-actions .pill { min-height: var(--tap); }
  body.pub .my-card-actions .pill { min-height: var(--tap); }
}
/* The bag count badge sits on the icon corner (v13 positions it). */
body.pub .hp-bag .nbadge { margin-left: 0; }

.voice-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
/* Category accordion: open by default, counts in the summary. */
body.pub .cat-acc {
  min-width: 0;
}
body.pub .cat-acc > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  min-height: 44px;
  padding: 6px 2px;
  list-style: none;
}
body.pub .cat-acc > summary::-webkit-details-marker {
  display: none;
}
body.pub .cat-acc > summary small {
  color: var(--muted);
  font-weight: 700;
}
body.pub .cat-acc > summary .chev {
  margin-left: auto;
  color: var(--accent-ink);
  transition: transform 0.2s ease-out;
}
body.pub .cat-acc[open] > summary .chev {
  transform: rotate(180deg);
}
body.pub .cat-cards {
  display: grid;
  gap: 14px;
  padding: 4px 0 10px;
}

/* ---- Task 122 (v12): market page pills, tabs, shops ---- */
body.pub .mkt-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent-ink);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  min-height: 44px;
  max-width: 100%;
}
body.pub .mkt-pill span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
body.pub .mkt-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0 0;
  border-bottom: 1px solid var(--line);
}
body.pub .mkt-tab {
  background: none;
  border: 0;
  border-bottom: 2.5px solid transparent;
  padding: 10px 4px;
  margin-bottom: -1px;
  font: inherit;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--muted);
  cursor: pointer;
  min-height: 44px;
}
body.pub .mkt-tab.on {
  color: var(--accent-ink);
  border-bottom-color: var(--accent);
}
body.pub .mkt-add {
  text-transform: uppercase;
  flex: none;
  min-height: 44px;
}

/* Task 150: labels on phones use normal case with a small "Required"
   hint instead of ALL CAPS with a squeezed-in star. */
@media (max-width: 700px) {
  body.pub .field-label {
    text-transform: none;
    letter-spacing: normal;
    font-size: 14px;
  }
  body.pub .field-label .req { display: none; }
  body.pub .field-label .req-hint {
    display: inline;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: capitalize;
    color: var(--muted);
  }
}
