/* UnionPlus สั่งของ (M9) · มือถือก่อน · ตัวใหญ่ อ่านง่าย */
:root { --pri: #0f766e; --pri2: #115e59; --bg: #f1f5f9; --card: #fff; --ink: #0f172a; --mut: #64748b; --line: #e2e8f0;
  --g: #16a34a; --y: #d97706; --r: #dc2626; --rad: 14px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 "Sarabun", "Leelawadee UI", "Noto Sans Thai", Tahoma, system-ui, sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 14px; }
button.pri { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 700; }
button.big { padding: 14px 16px; font-size: 18px; width: 100%; }
button.link { border: 0; background: none; color: var(--pri); padding: 6px; }
button:disabled { opacity: .5; }
.view { min-height: 100vh; padding-bottom: 110px; }
.muted { color: var(--mut); } .small { font-size: 14px; }
.card { background: var(--card); border-radius: var(--rad); padding: 18px; margin: 12px; box-shadow: 0 1px 3px #0001; }
.brand { display: flex; gap: 12px; align-items: center; padding: 28px 18px 6px; }
.brand img { width: 56px; height: 56px; border-radius: 14px; }
.brand b { font-size: 22px; display: block; } .brand small { color: var(--mut); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--pri); color: #fff; }
.top b { font-size: 18px; } .top .sp { flex: 1; }
.top .who { flex: 1; min-width: 0; } .top .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .top .who small { opacity: .8; }
.top .ico { background: transparent; border: 0; color: #fff; font-size: 22px; padding: 6px 10px; position: relative; }
.top .link { color: #ccfbf1; }
.dot { position: absolute; top: 4px; right: 4px; width: 10px; height: 10px; border-radius: 50%; background: #fbbf24; }
.searchbar { display: flex; gap: 8px; padding: 10px 12px; background: #fff; position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 4; border-bottom: 1px solid var(--line); }
.searchbar input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 17px; background: var(--bg); }
.searchbar .cam { background: var(--pri); border-color: var(--pri); color: #fff; font-weight: 700; white-space: nowrap; }
.hint { padding: 18px; color: var(--mut); text-align: center; }
.last { margin: 10px 12px 0; padding: 10px 12px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.last.bad { background: #fef2f2; border-color: #fecaca; }
.results { padding: 4px 0; }
.it { display: flex; gap: 10px; align-items: center; background: #fff; margin: 8px 12px; padding: 10px; border-radius: var(--rad); box-shadow: 0 1px 2px #0001; }
.it .th { width: 64px; height: 64px; border-radius: 10px; background: var(--bg) center/contain no-repeat; flex: none; }
.it .info { flex: 1; min-width: 0; }
.it .nm { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.it .meta { font-size: 14px; color: var(--mut); }
.it .pr { font-weight: 700; color: var(--pri2); }
.it .per { font-size: 13px; color: var(--mut); }
.it .add { min-width: 54px; height: 54px; font-size: 26px; font-weight: 700; background: var(--pri); color: #fff; border: 0; border-radius: 14px; flex: none; }
.it .add.in { background: #ccfbf1; color: var(--pri2); font-size: 18px; }
.st { display: inline-block; font-size: 13px; padding: 1px 8px; border-radius: 99px; font-weight: 600; }
.st.g { background: #dcfce7; color: var(--g); } .st.y { background: #fef3c7; color: var(--y); } .st.r { background: #e2e8f0; color: #334155; }   /* 0 หรือติดลบใน Bplus = สอบถามร้าน (ผู้ใช้ 1 พ.ย.) */
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: #fffc; backdrop-filter: blur(6px); z-index: 6; }
.cartbar button { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--pri); color: #fff; border: 0; padding: 14px 16px; font-size: 18px; border-radius: 16px; }
.cartbar b { flex: 1; text-align: left; }
.sheet .foot { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); z-index: 6; }
.sheet .foot .sum { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 18px; }
.sheet .foot textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.row2 { display: flex; gap: 8px; } .row2 > * { flex: 1; }
#vCart, #vReview { padding-bottom: 200px; } #vReview { padding-bottom: 260px; }
.ci { background: #fff; margin: 8px 12px; padding: 12px; border-radius: var(--rad); box-shadow: 0 1px 2px #0001; }
.ci .hd { display: flex; gap: 10px; }
.ci .th { width: 52px; height: 52px; border-radius: 10px; background: var(--bg) center/contain no-repeat; flex: none; }
.ci .nm { flex: 1; font-weight: 600; line-height: 1.3; }
.ci .x { border: 0; background: none; color: var(--r); font-size: 20px; padding: 0 4px; align-self: flex-start; }
.ci .ctl { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.ci select { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: #fff; max-width: 100%; }
.qty { display: flex; align-items: center; gap: 0; margin-left: auto; }
.qty button { width: 48px; height: 48px; font-size: 24px; padding: 0; border-radius: 12px; }
.qty .n { min-width: 70px; height: 48px; margin: 0 6px; font-size: 22px; font-weight: 700; background: var(--bg); }
.ci .ln { display: flex; justify-content: space-between; margin-top: 6px; color: var(--mut); font-size: 15px; }
.ci .ln b { color: var(--ink); }
.review { padding: 4px 12px; }
.review .big1 { font-size: 22px; font-weight: 700; margin: 10px 0 2px; }
.review .warn { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 10px; margin: 8px 0; }
.review table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; font-size: 17px; }
.review td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.review td.n { text-align: right; white-space: nowrap; font-weight: 700; }
.review tfoot td { font-size: 20px; font-weight: 700; }
.ord { background: #fff; margin: 10px 12px; border-radius: var(--rad); box-shadow: 0 1px 2px #0001; overflow: hidden; }
.ord .hd { padding: 12px; display: flex; gap: 10px; align-items: center; }
.ord .hd .t { flex: 1; } .ord .hd small { color: var(--mut); display: block; }
.badge { font-size: 14px; padding: 3px 10px; border-radius: 99px; font-weight: 700; background: #e0f2fe; color: #075985; white-space: nowrap; }
.badge.act { background: #fef3c7; color: #92400e; } .badge.ok { background: #dcfce7; color: #166534; } .badge.bad { background: #fee2e2; color: #991b1b; }
.ord .bd { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.steps { list-style: none; margin: 10px 0; padding: 0; }
.steps li { position: relative; padding: 4px 0 10px 28px; color: var(--mut); }
.steps li::before { content: ''; position: absolute; left: 6px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; }
.steps li::after { content: ''; position: absolute; left: 11px; top: 22px; bottom: -4px; width: 2px; background: #e2e8f0; }
.steps li:last-child::after { display: none; }
.steps li.done { color: var(--ink); } .steps li.done::before { background: var(--g); }
.steps li.cur { color: var(--ink); font-weight: 700; } .steps li.cur::before { background: #f59e0b; box-shadow: 0 0 0 4px #fde68a; }
.steps small { display: block; color: var(--mut); font-weight: 400; }
.ord table { width: 100%; border-collapse: collapse; font-size: 15px; margin-top: 6px; }
.ord td { padding: 6px 4px; border-bottom: 1px solid var(--line); } .ord td.n { text-align: right; white-space: nowrap; }
.ord .short { color: var(--r); font-weight: 700; }
.ord .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; } .ord .acts button { flex: 1; }
.pay { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 12px; margin-top: 10px; }
.pay b.amt { font-size: 24px; display: block; }
.modal { position: fixed; inset: 0; background: #0f172a99; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.modal .in { background: #fff; width: 100%; max-width: 520px; border-radius: 20px 20px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; }
.modal h3 { margin: 0 0 8px; }
.pad .val { font-size: 40px; font-weight: 700; text-align: center; padding: 10px; background: var(--bg); border-radius: 14px; margin: 8px 0; letter-spacing: 2px; min-height: 70px; }
.pad .err { color: var(--r); text-align: center; min-height: 22px; }
.pad .keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pad .keys button { height: 64px; font-size: 28px; font-weight: 700; border-radius: 14px; background: #f8fafc; }
.pad .keys .ok { background: var(--pri); color: #fff; border-color: var(--pri); font-size: 22px; }
.pad .keys .del { font-size: 20px; }
.pad .cx { width: 100%; margin-top: 8px; }
.pinbox .dots { display: flex; justify-content: center; gap: 12px; margin: 12px 0; }
.pinbox .dots i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--pri); }
.pinbox .dots i.on { background: var(--pri); }
.fld { display: block; margin: 10px 0; } .fld span { display: block; color: var(--mut); font-size: 15px; margin-bottom: 4px; }
.fld input, .fld textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 18px; background: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; } .chips button.on { background: var(--pri); color: #fff; border-color: var(--pri); }
.camwrap { position: fixed; inset: 0; background: #000; z-index: 30; }
.camwrap video { width: 100%; height: 100%; object-fit: cover; }
.camwrap .frame { position: absolute; left: 10%; right: 10%; top: 32%; height: 22%; border: 3px solid #5eead4; border-radius: 16px; box-shadow: 0 0 0 9999px #0006; }
.camwrap.hit .frame { border-color: #fde047; }
.camtop { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 0; right: 0; text-align: center; color: #fff; font-size: 17px; }
.camlast { position: absolute; left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom)); color: #fff; background: #0009; border-radius: 12px; padding: 10px 12px; min-height: 22px; }
.camlast:empty { display: none; }
.cambar { position: absolute; left: 12px; right: 12px; bottom: calc(18px + env(safe-area-inset-bottom)); display: flex; gap: 10px; }
.cambar button { flex: 1; padding: 16px; font-size: 18px; border-radius: 16px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 40; max-width: 92vw; text-align: center; }
.menu .in button { width: 100%; text-align: left; margin: 4px 0; padding: 14px; font-size: 18px; }
.empty { text-align: center; color: var(--mut); padding: 40px 20px; }
