:root { --hdr1: #0a1124; --hdr2: #1e3a8a; --bg: #f6f3ee; --surface: #fff; --text: #1f2937; --muted: #6b7280; --line: #e7e2d9; --accent: #c2410c; --accent2: #9a3412; --ok: #15803d; --danger: #b91c1c; --navy: #0f1f45; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Sarabun', 'Prompt', Tahoma, sans-serif; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
.top { position: sticky; top: 0; z-index: 20; background: linear-gradient(135deg, var(--hdr1), var(--hdr2)); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.top h1 { margin: 0; font-size: 20px; flex: 1; letter-spacing: .2px; }
.top .sub { font-size: 12px; opacity: .8; font-weight: 400; display: block; }
.cart-btn { position: relative; border: 0; background: #fff; color: var(--navy); border-radius: 999px; padding: 9px 16px; font-weight: 800; font-size: 15px; }
.cart-btn .n { position: absolute; top: -6px; right: -6px; background: var(--accent); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.my-btn { border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 14px 14px 120px; }
.note { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; white-space: pre-wrap; }
.closed { background: #fee2e2; border-color: #fecaca; color: var(--danger); font-weight: 700; }
.search { width: 100%; padding: 12px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 16px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.cats button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; white-space: nowrap; font-weight: 700; color: #374151; }
.cats button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06); display: flex; flex-direction: column; }
.card .pic { aspect-ratio: 9 / 16; background: linear-gradient(135deg, #e0e7ff, #fde68a); display: grid; place-items: center; font-size: 46px; overflow: hidden; position: relative; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card.out .pic { filter: grayscale(.9); opacity: .6; }
.badge { position: absolute; left: 8px; top: 8px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; background: rgba(15,31,69,.85); color: #fff; }
.badge.low { background: #d97706; } .badge.out { background: #6b7280; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-weight: 800; font-size: 15.5px; line-height: 1.3; }
.card .desc { color: var(--muted); font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.price { color: var(--price, var(--accent)); font-weight: 900; font-size: 18px; }
.add { border: 0; background: var(--accent); color: #fff; border-radius: 10px; padding: 8px 12px; font-weight: 800; }
.add:disabled { background: #d1d5db; color: #6b7280; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 900; font-size: 17px; }
.stepper b { min-width: 22px; text-align: center; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); display: none; backdrop-filter: blur(6px); }
.bar.show { display: block; }
.bar button { width: 100%; max-width: 640px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 14px; padding: 14px 18px; background: var(--navy); color: #fff; font-weight: 800; font-size: 17px; }
.mask { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); display: none; align-items: flex-end; justify-content: center; }
.mask.show { display: flex; }
.sheet { background: #fff; width: 100%; max-width: 640px; max-height: 94vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) { .mask { align-items: center; } .sheet { border-radius: 20px; } }
.sheet h2 { margin: 0 0 10px; font-size: 20px; display: flex; justify-content: space-between; align-items: center; }
.x { border: 0; background: #f3f4f6; border-radius: 999px; width: 36px; height: 36px; font-size: 18px; }
.ci { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f1f1f1; }
.ci img, .ci .ph { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: #eef2ff; display: grid; place-items: center; font-size: 24px; flex: 0 0 auto; }
.ci .nm { flex: 1; font-weight: 700; font-size: 14.5px; }
.ci .nm small { display: block; color: var(--muted); font-weight: 400; }
.sum { margin-top: 10px; display: grid; gap: 4px; }
.sum div { display: flex; justify-content: space-between; }
.sum .tot { font-size: 20px; font-weight: 900; color: var(--price, var(--accent)); border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.form { display: grid; gap: 10px; margin-top: 14px; }
.form label { font-weight: 700; font-size: 14px; display: grid; gap: 4px; }
.form input, .form textarea, .form select { padding: 11px 12px; border-radius: 10px; border: 1px solid #d6d3cc; font-size: 16px; background: #fff; width: 100%; min-width: 0; }
.form select:disabled { background: #f3f4f6; color: #9ca3af; }
.form input[readonly] { background: #f8fafc; }
.form small { color: var(--muted); font-weight: 400; }
.big { width: 100%; border: 0; border-radius: 14px; padding: 15px; font-size: 18px; font-weight: 900; background: var(--accent); color: #fff; margin-top: 12px; }
.big:disabled { opacity: .6; }
.msg { margin-top: 10px; padding: 10px 12px; border-radius: 10px; display: none; }
.msg.show { display: block; } .msg.err { background: #fee2e2; color: var(--danger); } .msg.ok { background: #dcfce7; color: var(--ok); }
/* หน้าออเดอร์ */
.box { background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-bottom: 12px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 2px; }
.steps span { font-size: 12.5px; padding: 4px 10px; border-radius: 999px; background: #f3f4f6; color: #9ca3af; font-weight: 700; }
.steps span.done { background: #dcfce7; color: var(--ok); } .steps span.cur { background: var(--navy); color: #fff; }
.qrwrap { text-align: center; }
.qrwrap .qr { display: inline-block; background: #fff; padding: 10px; border-radius: 14px; border: 2px solid #0f3b8f; }
.qrwrap .qr svg, .qrwrap .qr img { width: 240px; height: 240px; display: block; }
.pp-head { background: #0f3b8f; color: #fff; border-radius: 10px; padding: 6px 12px; font-weight: 800; display: inline-block; margin-bottom: 8px; }
.amt { font-size: 30px; font-weight: 900; color: var(--accent); margin: 8px 0 2px; }
.upl { display: block; border: 2px dashed #94a3b8; border-radius: 14px; padding: 18px; text-align: center; font-weight: 800; color: #334155; cursor: pointer; background: #f8fafc; margin-top: 10px; }
.slip-prev { max-width: 100%; max-height: 360px; border-radius: 10px; margin-top: 10px; }
.status-pill { display: inline-block; padding: 5px 12px; border-radius: 999px; font-weight: 800; background: #e0e7ff; color: #1e3a8a; }
.status-pill.cancelled { background: #fee2e2; color: var(--danger); } .status-pill.shipped { background: #dcfce7; color: var(--ok); }
.copy { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 13px; }

/* ที่อยู่จัดส่ง */
.addr { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 8px; cursor: pointer; background: #fff; }
.addr.sel { border-color: var(--navy); background: #eef2ff; }
.addr input[type=radio] { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--navy); }
.addr-b { flex: 1; font-size: 14.5px; line-height: 1.45; } .addr-b span { color: #4b5563; }
.addr-act { display: flex; flex-direction: column; gap: 4px; }
.def { background: #dcfce7; color: var(--ok); border-radius: 999px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; }

/* หัวเว็บ: ชื่อร้าน + ลูกค้า + ปุ่ม */
.top { flex-wrap: wrap; }
.top-l { flex: 1; min-width: 180px; }
.top-r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who { font-size: 13.5px; margin-top: 3px; background: rgba(255,255,255,.14); display: inline-block; padding: 3px 10px; border-radius: 999px; }
@media (max-width: 560px) { .top-r { width: 100%; } .top-r .my-btn { flex: 1; padding: 8px 6px; font-size: 12.5px; } }
/* ขั้นตอนเริ่มต้น */
.gate { padding: 16px 14px 60px; }
.gate-in { max-width: 560px; margin: 0 auto; }
.wsteps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.wsteps span { flex: 1; text-align: center; font-size: 12.5px; padding: 7px 6px; border-radius: 999px; background: #e5e7eb; color: #9ca3af; font-weight: 800; white-space: nowrap; }
.wsteps span.done { background: #dcfce7; color: var(--ok); } .wsteps span.cur { background: var(--navy); color: #fff; }
.wt { margin: 0 0 6px; font-size: 21px; } .wd { color: #4b5563; margin: 4px 0 10px; font-size: 14.5px; }
.hintline { font-size: 14px; min-height: 1.3em; } .okc { color: var(--ok); font-weight: 800; } .bad { color: var(--danger); font-weight: 700; font-size: 13.5px; }
.big.navy { background: var(--navy); } .big.ghost { background: #fff; color: var(--navy); border: 2px solid var(--navy); }
.two { display: flex; gap: 10px; } .two > * { flex: 1; min-width: 0; }
.review { border: 2px solid var(--navy); border-radius: 14px; padding: 12px 14px; background: #eef2ff; display: grid; gap: 8px; }
.review div { display: grid; grid-template-columns: 96px 1fr; gap: 8px; } .review span { color: #4b5563; font-size: 14px; } .review b { font-size: 15.5px; }
.chips-s { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.addbtn { margin-top: 10px; padding: 9px 14px; font-size: 14px; }
.mini-acts { margin-top: 12px; display: grid; gap: 6px; font-size: 13.5px; }
.mini-acts div { display: flex; gap: 6px; align-items: center; } .mini-acts div span:first-child { flex: 1; color: #4b5563; }
/* แถบส่งถึง + โปรโมชั่น */
.shipto { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 14px; }
.shipto > div { flex: 1; } .shipto span { color: #4b5563; font-size: 13px; }
.promos { background: linear-gradient(135deg, #fff7ed, #ffedd5); border: 1px solid #fed7aa; border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; font-size: 14px; }
.promos span { background: #fff; border-radius: 999px; padding: 3px 10px; border: 1px solid #fdba74; } .promos i { color: var(--accent); font-style: normal; font-weight: 800; }
.ptag { position: absolute; left: 8px; bottom: 8px; right: 8px; background: rgba(194,65,12,.92); color: #fff; border-radius: 8px; padding: 3px 8px; font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum .disc { color: var(--ok); font-weight: 700; }
.shipcard { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; background: #f8fafc; }
.shipcard > div { flex: 1; } .shipcard span { color: #4b5563; font-size: 13px; }
.hist { display: flex; gap: 10px; align-items: center; padding: 12px 4px; border-bottom: 1px solid #f1f1f1; text-decoration: none; }
.hist > div:first-child { flex: 1; } .hist small { display: block; color: var(--muted); margin-top: 3px; } .hist .status-pill { font-size: 12px; padding: 2px 8px; }
.hamt { font-weight: 900; color: var(--accent); white-space: nowrap; }
/* ปุ่มบันทึกรูป QR */
.savebtn { display: inline-flex; gap: 6px; align-items: center; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 900; font-size: 16px; background: #0f3b8f; color: #fff; margin-top: 10px; }
.savehint { font-size: 13px; color: #4b5563; margin-top: 6px; }

/* iPhone: หน้าต่างเลื่อนขึ้นใช้ความสูงจริงของจอ (dvh) และเลื่อนในตัวได้ */
.mask { height: 100%; }
.sheet { max-height: 92vh; max-height: 92dvh; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pg-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; } .pg-head .wt { margin: 0; }

/* โปรโมชั่นใต้ชื่อสินค้า */
.ptxt { color: var(--accent); font-weight: 800; font-size: 13px; line-height: 1.3; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; padding: 3px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ยกเลิกตะกร้า / ยกเลิกออเดอร์ก่อนชำระ */
.cart-tools { display: flex; justify-content: flex-end; margin: -4px 0 4px; } .cart-tools .copy { color: var(--danger); border-color: #fecaca; }
.cancelbox { font-size: 14px; color: #4b5563; } .cancelbtn { display: block; width: 100%; margin-top: 10px; border: 2px solid #fecaca; background: #fff; color: var(--danger); border-radius: 12px; padding: 11px; font-weight: 800; font-size: 15px; }

/* 🎨 ธีมเทศกาล: แถบคำอวยพร + ลายอีโมจิบนหัวเว็บ + อีโมจิค่อย ๆ ลอยลง (ไม่บังการกด) */
.fest-banner { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fff; text-align: center; font-weight: 800; padding: 7px 12px; font-size: 14.5px; letter-spacing: .2px; }
.top.fest { position: sticky; overflow: hidden; }
.top.fest::after { content: attr(data-deco); position: absolute; right: 8px; bottom: -6px; font-size: 44px; opacity: .22; pointer-events: none; letter-spacing: 6px; }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 15; overflow: hidden; }
.fx span { position: absolute; top: -40px; animation: fxfall linear forwards; opacity: .85; user-select: none; }
@keyframes fxfall { to { transform: translateY(110vh) rotate(260deg); opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .fx { display: none; } }

/* QR เป็นรูปจริง (กดค้างบันทึกได้) + หน้าต่างบันทึกรูป */
.qrwrap .qr img.qrimg { width: 240px; height: 240px; display: block; image-rendering: pixelated; -webkit-touch-callout: default; user-select: auto; }
.savesheet { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.72); display: flex; align-items: center; justify-content: center; padding: 14px; overflow-y: auto; }
.ss-in { background: #fff; border-radius: 18px; padding: 16px; width: 100%; max-width: 420px; text-align: center; }
.ss-h { font-size: 19px; font-weight: 900; margin-bottom: 8px; }
.ss-how { background: #fff7ed; border: 2px solid #fdba74; color: #9a3412; border-radius: 12px; padding: 10px 12px; font-size: 16px; line-height: 1.45; }
.ss-img { width: 100%; max-width: 340px; margin: 12px auto 8px; display: block; border: 1px solid #e5e7eb; border-radius: 10px; -webkit-touch-callout: default; }
.ss-next { color: #374151; font-size: 14px; line-height: 1.45; } .ss-tip { margin-top: 8px; font-size: 13px; color: #b45309; }
/* 🔎 ติดตามพัสดุ */
.trk-btn { display: block; text-align: center; margin-top: 12px; padding: 13px; border-radius: 12px; background: var(--accent, #2563eb); color: #fff; font-weight: 800; font-size: 17px; text-decoration: none; }
.trk-hint { font-size: 12.5px; color: #64748b; margin-top: 6px; text-align: center; }
.trk-mini { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 700; color: var(--accent, #2563eb); border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; cursor: pointer; }
/* 🔍 ดูสินค้า: รูปใหญ่ + ข้อมูลสินค้า */
.card .pic, .card .name { cursor: pointer; }
.card .pic .zoom-hint { position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.88); display: grid; place-items: center; font-size: 15px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.pd { position: relative; }
.pd-x { position: absolute; top: 4px; right: 4px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); box-shadow: 0 1px 6px rgba(0,0,0,.25); font-size: 18px; cursor: pointer; }
.pd-pic { position: relative; margin: -16px -16px 0; background: linear-gradient(135deg, #e0e7ff, #fde68a); display: flex; justify-content: center; cursor: zoom-in; border-radius: 20px 20px 0 0; overflow: hidden; }
.pd-pic img { width: 100%; max-height: 50vh; max-height: 50dvh; object-fit: contain; display: block; background: #f8fafc; }
.pd-pic.out img { filter: grayscale(.85); opacity: .7; }
.pd-zoom { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(15,23,42,.72); color: #fff; font-size: 12.5px; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.pd-noimg { font-size: 80px; padding: 50px 0; }
.pd-info { padding: 14px 2px 4px; display: flex; flex-direction: column; gap: 8px; }
.pd-name { margin: 0; font-size: 21px; line-height: 1.3; display: block !important; }
.pd-price { display: flex; align-items: center; gap: 10px; }
.pd-price .price { font-size: 26px; }
.pd-stock { font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.pd-stock.in { background: #dcfce7; color: #166534; } .pd-stock.low { background: #fef3c7; color: #92400e; } .pd-stock.out { background: #fee2e2; color: #991b1b; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13.5px; }
.pd-meta:empty { display: none; }
.pd-desc { white-space: pre-wrap; line-height: 1.6; font-size: 15px; color: var(--text); border-top: 1px solid var(--line); padding-top: 10px; }
.pd-desc.muted { color: var(--muted); font-size: 13px; text-align: center; }
.pd-act { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: #fff; padding: 12px 0 calc(6px + env(safe-area-inset-bottom)); margin-top: 6px; border-top: 1px solid var(--line); }
.pd-row { display: flex; gap: 10px; align-items: center; }
.pd-add { flex: 1; width: 100%; padding: 14px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 800; cursor: pointer; }
.pd-add:disabled { background: #cbd5e1; color: #475569; }
.stepper.pd-step { flex: none; } .stepper.pd-step button { width: 46px; height: 46px; font-size: 22px; } .stepper.pd-step b { min-width: 36px; font-size: 18px; text-align: center; }
.pd-row .pd-add { white-space: nowrap; }
.zoomer { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.zoom-box { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; -webkit-overflow-scrolling: touch; }
.zoom-box img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.zoom-box.big { display: block; }
.zoom-box.big img { max-width: none; max-height: none; width: 250%; cursor: zoom-out; }
.zoom-x { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); font-size: 20px; cursor: pointer; }
.zoom-tip { color: #cbd5e1; text-align: center; font-size: 13px; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) {
  .sheet.pd-sheet { max-width: 900px; padding: 0; overflow: hidden; display: flex; }
  .pd-sheet .pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: 1fr auto; width: 100%; max-height: 88vh; }
  .pd-sheet .pd-pic { grid-row: 1 / span 2; margin: 0; border-radius: 20px 0 0 20px; align-items: center; }
  .pd-sheet .pd-pic img { max-height: 88vh; height: 100%; }
  .pd-sheet .pd-info { overflow: auto; padding: 22px 22px 8px; }
  .pd-sheet .pd-act { position: static; padding: 12px 22px 18px; }
}
/* 🖼️ รูปปกหน้าร้าน 3:1 — กล่องล็อกสัดส่วน รูปไม่ยืด/ไม่บีบในทุกขนาดจอ */
.site-cover { width: 100%; aspect-ratio: 3 / 1; border-radius: 16px; overflow: hidden; margin: 0 0 12px; background: #e5e7eb; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.site-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
@media (max-width: 600px) { .site-cover { border-radius: 12px; margin-bottom: 10px; } }
.top h1 .shop-logo { height: 40px; width: 40px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; vertical-align: middle; margin-right: 10px; float: left; }
/* 💬 ติดต่อร้าน */
.contact-btn { border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.14); color: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.ct-mask { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .ct-mask { align-items: center; } .ct-box { border-radius: 20px !important; } }
.ct-box { background: #fff; width: 100%; max-width: 460px; border-radius: 20px 20px 0 0; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; max-height: 90dvh; overflow: auto; }
.ct-h { display: flex; justify-content: space-between; align-items: center; font-size: 19px; }
.ct-x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #f1f5f9; font-size: 16px; cursor: pointer; }
.ct-sub { color: var(--muted); font-size: 13.5px; margin-top: -4px; }
.ct-order { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.ct-small { font-size: 12px; color: #9a3412; margin-top: 3px; }
.ct-cp { border: 1px solid #fdba74; background: #fff; border-radius: 8px; padding: 2px 8px; font-size: 12px; margin-left: 4px; cursor: pointer; }
.ct-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--text); border: 1.5px solid var(--line); }
.ct-ic { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 21px; flex: none; }
.ct-t { flex: 1; display: flex; flex-direction: column; } .ct-t b { font-size: 16px; } .ct-t small { color: var(--muted); font-size: 13px; word-break: break-all; }
.ct-go { font-size: 13px; font-weight: 800; padding: 7px 12px; border-radius: 999px; color: #fff; white-space: nowrap; }
.ct-tel .ct-ic { background: #dbeafe; } .ct-tel .ct-go { background: #2563eb; } .ct-tel { border-color: #bfdbfe; }
.ct-line .ct-ic { background: #dcfce7; } .ct-line .ct-go { background: #06c755; } .ct-line { border-color: #bbf7d0; }
.ct-msg .ct-ic { background: #e0e7ff; } .ct-msg .ct-go { background: #0866ff; } .ct-msg { border-color: #c7d2fe; }
.ct-info { font-size: 13.5px; color: #334155; background: #f8fafc; border-radius: 10px; padding: 8px 12px; white-space: pre-wrap; }
.ct-empty { text-align: center; color: var(--muted); padding: 14px; }
.ct-step { display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; font-weight: 700; color: #0f172a; }
.ct-step select, .ct-step textarea { font: inherit; font-weight: 400; font-size: 15px; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; width: 100%; box-sizing: border-box; }
.ct-topics { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-topic { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; font-weight: 700; color: #334155; }
.ct-topic.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.ct-small2 { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.ct-msgbox { margin: 0; white-space: pre-wrap; font: 400 13.5px/1.55 'Sarabun', Tahoma, sans-serif; background: #f8fafc; border: 1px dashed #94a3b8; border-radius: 10px; padding: 10px 12px; color: #0f172a; }
.ct-copy { display: block; text-align: center; border: 1.5px solid var(--accent); color: var(--accent); background: #fff; border-radius: 10px; padding: 9px; font-weight: 800; font-size: 14px; cursor: pointer; text-decoration: none; }
.ct-imgwrap { display: flex; flex-direction: column; gap: 6px; }
.ct-imgwrap img { width: 100%; max-width: 360px; align-self: center; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ct-box { max-width: 520px !important; }
.ct-st { font-size: 14.5px; font-weight: 800; color: #0f172a; } .ct-st b { color: var(--accent); }

/* ป้ายสินค้า (แนะนำ/ขายดี/สุดคุ้ม …) — มุมซ้ายบนของรูป + ปุ่มกรอง */
.pbadges { position: absolute; left: 6px; top: 6px; right: 42px; display: flex; flex-wrap: wrap; gap: 4px; align-items: flex-start; pointer-events: none; }
.pbadges .badge { position: static; }
.tagp { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 11.5px; font-weight: 800; color: #fff; background: var(--tc, #d97706); box-shadow: 0 1px 3px rgba(0,0,0,.25); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; line-height: 1.5; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pd-tags .tagp { font-size: 13px; padding: 3px 11px; }
#cats button.tagf { border-color: var(--tc); color: var(--tc); font-weight: 800; }
#cats button.tagf.on { background: var(--tc); color: #fff; border-color: var(--tc); }

/* ตัวเลือกสินค้า (เช่น รสชาติ: ปู / กุ้ง) */
.card .optline { font-size: 12px; color: #6b7280; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .add.opt { font-size: 13px; padding-left: 10px; padding-right: 10px; }
.pd-opt { margin: 12px 0 4px; padding: 12px; border: 1.5px solid var(--line, #e5e7eb); border-radius: 14px; background: #fafafa; }
.pd-opt-h { font-weight: 800; margin-bottom: 8px; } .pd-opt-h span { font-weight: 400; color: #6b7280; font-size: 13px; }
.pd-opt-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-ch { border: 1.5px solid #d1d5db; background: #fff; border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 700; color: #374151; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pd-ch.on { border-color: var(--navy, #1e3a8a); background: var(--navy, #1e3a8a); color: #fff; }
.pd-ch b { background: #f97316; color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; }
.pd-opt-cart { margin-top: 8px; font-size: 13px; color: #374151; }
.pd-opt.shake { animation: optShake .45s; border-color: #f97316; }
@keyframes optShake { 0%,100% { transform: none; } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.ci .nm .copt { display: block; font-size: 13px; color: #c2410c; font-weight: 700; }

/* สินค้าหมดยังสั่งได้ (ดึงจากสาขาอื่น) */
.badge.back { background: #c2410c; }
.pd-stock.back { background: #ffedd5; color: #9a3412; }
.backnote { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 13.5px; font-weight: 600; }
small.backnote { display: block; margin: 4px 0 0; padding: 3px 8px; font-size: 12px; }
.ci .nm .cback { display: block; font-size: 12px; color: #9a3412; background: #fff7ed; border-radius: 6px; padding: 2px 6px; margin-top: 3px; font-weight: 600; }

/* สินค้าหมด → ติดต่อแอดมิน */
.card .add.ask { background: #fff7ed; color: #9a3412; border: 1.5px solid #fdba74; font-size: 13px; padding-left: 8px; padding-right: 8px; white-space: normal; line-height: 1.2; }
.pd-add.ask { background: #ea580c; }
.ask-note { font-size: 13.5px; color: #9a3412; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; font-weight: 600; }
.pd-act .ask-note { width: 100%; }

/* ✨ อีโมจิลอยขึ้น / ลอยเบา ๆ ตลอดเวลา */
.fx.rise span { top: auto; bottom: -40px; animation-name: fxrise; }
@keyframes fxrise { to { transform: translateY(-110vh) rotate(-200deg); opacity: .15; } }
.fx.loop span { animation-iteration-count: infinite; opacity: .55; }
.fx.loop.fall span { animation-name: fxfall2; } .fx.loop.rise span { animation-name: fxrise2; }
@keyframes fxfall2 { 0% { transform: translateY(0) rotate(0); opacity: 0; } 8% { opacity: .55; } 92% { opacity: .5; } 100% { transform: translateY(110vh) rotate(220deg); opacity: 0; } }
@keyframes fxrise2 { 0% { transform: translateY(0) rotate(0); opacity: 0; } 8% { opacity: .55; } 92% { opacity: .5; } 100% { transform: translateY(-110vh) rotate(-220deg); opacity: 0; } }

/* สติกเกอร์ป้ายบนรูปใหญ่ (หน้ารายละเอียด) */
.pd-badges { left: 12px; top: 12px; right: 70px; gap: 6px; }
.pd-badges .tagp { font-size: 13.5px; padding: 4px 12px; }

/* 🧾 รายการ + ยอดสรุปในกล่อง QR ชำระเงิน */
.qrsum { text-align: left; margin: 10px auto 8px; max-width: 420px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; background: #fafafa; }
.qrsum > div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; } .qrsum > div > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.qrsum .qrsum-h { font-weight: 800; margin-bottom: 4px; } .qrsum .qrsum-t { border-top: 1px dashed var(--line); margin-top: 4px; padding-top: 6px; }
.qrsum .qrsum-d { color: #15803d; } .qrsum .qrsum-g { font-weight: 900; color: var(--price, var(--accent)); font-size: 16px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 6px; }

/* 🛍️ ดูสินค้าก่อน (ยังไม่กรอกเบอร์) */
.or-sep { display: flex; align-items: center; gap: 10px; color: #9ca3af; margin: 16px 0 6px; font-size: 13px; } .or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.wd.small { font-size: 13px; text-align: center; margin-top: 6px; }
.gnote { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; line-height: 1.5; }
.gnote span, .guestbar span { color: #b91c1c; font-size: 13px; font-weight: 700; }
.guestbar { font-size: 14px; line-height: 1.5; }

.sum small.shipnote { display: block; font-size: 12px; color: #9a3412; }
/* 🔗 มาจากลิงก์สินค้า: ปุ่มดูสินค้าทั้งหมด */
.pd-all { display: block; width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--primary, #1e3a8a); background: #fff; color: var(--primary, #1e3a8a); font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }

.hint-s { font-size: 12.5px; color: #6b7280; align-self: center; line-height: 1.4; }

.intl-btn { margin-top: 6px; font-size: 13px; }
