/* order.hopop.in - the shops' ordering site. Phone first: most shopkeepers
   will open this on the phone at the counter. Inputs are 16px or iOS zooms. */
:root {
  --navy: #0d2c4f;
  --navy-2: #1d4675;
  --ink: #16202c;
  --mute: #66717f;
  --line: #e3e8ee;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ok: #1f8a4c;
  --bad: #c0392b;
  --warm: #fff6e0;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(13, 44, 79, .06), 0 4px 14px rgba(13, 44, 79, .06);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(84px + var(--safe-b));
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 30; background: #fff;
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.top .logo { height: 34px; width: auto; }
.top .spacer { flex: 1; }
.who {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 6px 12px 6px 6px; max-width: 52vw;
}
.who .dot {
  width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none;
}
.who .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 14px; }

/* ---------------------------------------------------------------- banner */
.banner { position: relative; margin: 14px auto 0; border-radius: var(--radius); overflow: hidden; background: #e9eef3; aspect-ratio: 1400 / 386; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s; }
.banner img.on { opacity: 1; }
.banner .dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 6px; }
.banner .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(13, 44, 79, .25); }
.banner .dots i.on { background: var(--navy); }

/* ------------------------------------------------------------ categories */
.bar {
  position: sticky; top: 60px; z-index: 20; background: var(--bg);
  padding: 12px 0 10px; border-bottom: 1px solid transparent;
}
.bar.stuck { border-bottom-color: var(--line); }
.search { display: flex; gap: 8px; align-items: center; }
.search input {
  flex: 1; min-width: 0; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff;
  padding: 0 14px; font-size: 16px; outline: none;
}
.search input:focus { border-color: var(--navy-2); }
.views { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; flex: none; }
.views button { border: 0; background: none; padding: 0 12px; height: 42px; font-size: 13px; font-weight: 600; color: var(--mute); }
.views button.on { background: var(--navy); color: #fff; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px;
  font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap;
}
.cats button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.cats button small { opacity: .6; font-weight: 500; margin-left: 4px; }

.section-h { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 10px; }
.section-h h2 { margin: 0; font-size: 18px; }
.section-h span { color: var(--mute); font-size: 13px; }

/* ------------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.card .pic { aspect-ratio: 1 / 1; background: #f0f3f6; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.card .pic .none { width: 100%; height: 100%; display: grid; place-items: center; color: #9aa6b2; font-size: 12px; }
.card .body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .nm { font-size: 13.5px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 35px; }
.card .meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--mute); }
.card .meta b { color: var(--ink); font-weight: 600; }
.sizes { display: flex; flex-wrap: wrap; gap: 5px; }
.sizes button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 4px 7px; font-size: 12px; min-width: 34px; position: relative;
}
.sizes button.on { border-color: var(--navy); background: #eaf0f7; font-weight: 700; }
.sizes button.has::after { content: ''; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; background: var(--ok); border-radius: 50%; border: 2px solid #fff; }
.card .push { margin-top: auto; }

.add {
  width: 100%; height: 40px; border: 0; border-radius: 9px; background: var(--navy); color: #fff; font-weight: 700; font-size: 14px;
}
.step { display: flex; align-items: center; height: 40px; border-radius: 9px; border: 1.5px solid var(--navy); overflow: hidden; }
.step button { width: 40px; height: 100%; border: 0; background: #fff; font-size: 20px; font-weight: 700; color: var(--navy); flex: none; }
.step input {
  flex: 1; min-width: 0; height: 100%; border: 0; text-align: center; font-size: 16px; font-weight: 700; outline: none; background: #fff;
  -moz-appearance: textfield;
}
.step input::-webkit-outer-spin-button, .step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ------------------------------------------------------------ row form */
.rows { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.row { display: grid; grid-template-columns: 48px 1fr 92px; gap: 10px; align-items: center; padding: 8px 12px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .th { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: #f0f3f6; }
.row .th img { width: 100%; height: 100%; object-fit: cover; }
.row .nm { font-size: 14px; font-weight: 600; line-height: 1.25; }
.row .sub { font-size: 12px; color: var(--mute); margin-top: 2px; }
.row input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 9px; text-align: center; font-size: 16px; font-weight: 700; outline: none; background: #fff;
}
.row input:focus { border-color: var(--navy-2); }
.row.has { background: #f3f8f4; }
.row.has input { border-color: var(--ok); }
.rows .group { padding: 10px 12px; background: #f7f9fb; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--mute); border-top: 1px solid var(--line); }
.rows .group:first-child { border-top: 0; }

.empty { text-align: center; color: var(--mute); padding: 40px 16px; }

/* ---------------------------------------------------------- bottom bar */
.basket {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + var(--safe-b)); transform: translateY(110%); transition: transform .2s;
}
.basket.on { transform: none; }
.basket .wrap { display: flex; align-items: center; gap: 12px; padding: 0; }
.basket .sum { flex: 1; font-size: 14px; }
.basket .sum b { font-size: 16px; }
.btn {
  height: 46px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--navy); color: #fff; font-weight: 700; font-size: 15px;
}
.btn:disabled { opacity: .5; }
.btn.ghost { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.btn.wide { width: 100%; }
.link { border: 0; background: none; color: var(--navy-2); font-weight: 600; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- sheets */
.veil { position: fixed; inset: 0; z-index: 60; background: rgba(10, 22, 36, .45); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) { .veil { align-items: center; } }
.sheet {
  background: #fff; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + var(--safe-b)); -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) { .sheet { border-radius: 18px; } }
.sheet h2 { margin: 0 0 4px; font-size: 20px; }
.sheet .lead { margin: 0 0 16px; color: var(--mute); }
.sheet .x { float: right; border: 0; background: #f0f3f6; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; line-height: 1; }

.login { text-align: left; }
.login .logo { height: 44px; width: auto; margin: 4px 0 18px; }
.phone { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; height: 52px; background: #fff; }
.phone:focus-within { border-color: var(--navy-2); }
.phone span { padding: 0 12px; color: var(--mute); font-weight: 600; border-right: 1px solid var(--line); height: 100%; display: grid; place-items: center; }
.phone input { flex: 1; min-width: 0; border: 0; height: 100%; padding: 0 14px; font-size: 18px; letter-spacing: .04em; outline: none; }
.code { width: 100%; height: 56px; border: 1.5px solid var(--line); border-radius: 12px; text-align: center; font-size: 26px; font-weight: 700; letter-spacing: .4em; outline: none; }
.code:focus { border-color: var(--navy-2); }
.err { color: var(--bad); font-size: 14px; margin: 10px 0 0; min-height: 20px; }
.note { color: var(--mute); font-size: 13px; margin: 12px 0 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.contact { background: var(--warm); border-radius: 12px; padding: 14px; font-size: 14px; line-height: 1.5; }

.lines { margin: 6px 0 14px; }
.line { display: grid; grid-template-columns: 44px 1fr 110px; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.line:first-child { border-top: 0; }
.line .th { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: #f0f3f6; }
.line .th img { width: 100%; height: 100%; object-fit: cover; }
.line .nm { font-size: 14px; font-weight: 600; line-height: 1.25; }
.line .sub { font-size: 12px; color: var(--mute); }
.line .step { height: 38px; }
.line .step button { width: 34px; }
textarea.in { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 16px; resize: vertical; min-height: 70px; outline: none; }
textarea.in:focus { border-color: var(--navy-2); }

.done { text-align: center; padding: 10px 0 6px; }
.done .tick { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%; background: #e6f4ec; color: var(--ok); display: grid; place-items: center; font-size: 34px; }
.done .no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; font-size: 18px; color: var(--navy); }

.menu { display: flex; flex-direction: column; }
.menu button { text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 14px 2px; font-size: 15px; font-weight: 600; }
.menu button:first-child { border-top: 0; }
.menu button.cur { color: var(--navy); }
.menu button small { display: block; font-weight: 400; color: var(--mute); font-size: 12px; }

.req { border-top: 1px solid var(--line); padding: 12px 0; }
.req:first-child { border-top: 0; }
.req .hd { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.req .no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; }
.req .sub { color: var(--mute); font-size: 13px; margin-top: 2px; }
.pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #eef1f4; color: var(--mute); white-space: nowrap; }
.pill.new { background: #fff1d6; color: #8a5a00; }
.pill.contacted { background: #e6eef8; color: var(--navy-2); }
.pill.ordered { background: #e6f4ec; color: var(--ok); }
.pill.cancelled { background: #fbe9e7; color: var(--bad); }

.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; max-width: calc(100% - 32px);
}
.loading { padding: 60px 0; text-align: center; color: var(--mute); }
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
  .row { grid-template-columns: 56px 1fr 120px; }
  .row .th { width: 56px; height: 56px; }
}
