/* สั่งชา.com — หน้าร้าน */
:root {
  --bg: #f6f1e5;
  --paper: #fffdf8;
  --ink: #1f271f;
  --muted: #6a7266;
  --green: #2b5a3c;
  --green-d: #1b3a28;
  --green-l: #e2ecd9;
  --amber: #c0732a;
  --amber-l: #f8e8d2;
  --line: #e3dac6;
  --danger: #b0372d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(40, 50, 30, .06), 0 6px 20px rgba(40, 50, 30, .07);
  --sans: 'Noto Sans Thai', 'Sarabun', 'Leelawadee UI', Tahoma, system-ui, sans-serif;
  --serif: 'Noto Serif Thai', 'Noto Sans Thai', Georgia, serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.3; margin: 0 0 .5em; color: var(--green-d); }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 6px; }

/* header */
.topbar { background: var(--green-d); color: #fff; font-size: .82rem; text-align: center; padding: 5px 12px; }
.stick { position: sticky; top: 0; z-index: 30; }
.header { position: relative; background: linear-gradient(180deg, var(--green), var(--green-hi)); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.hd { display: flex; align-items: center; gap: 18px; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-weight: 700; font-size: 1.4rem; color: #fff; flex: 0 0 auto; }
.logo:hover { text-decoration: none; }
.logo-img { height: 56px; width: auto; max-width: 240px; object-fit: contain; background: #fff; border-radius: 8px; padding: 2px; }
.logo small { font-family: var(--sans); font-weight: 500; font-size: .8rem; opacity: .85; margin-left: 2px; }
.hsearch { flex: 1 1 auto; max-width: 640px; margin: 0 auto; display: flex; background: #fff; border-radius: 6px; padding: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.hsearch input { border: 0; background: transparent; padding: 9px 12px; border-radius: 4px; min-width: 0; color: var(--ink); }
.hsearch input:focus { box-shadow: none; }
.hsearch button { flex: 0 0 auto; width: 56px; border: 0; border-radius: 4px; background: var(--amber); color: #fff; cursor: pointer; display: grid; place-items: center; }

.nav { display: flex; align-items: center; gap: 2px; font-size: .92rem; flex: 0 0 auto; }
.nav a, .nav button.link { color: #fff; padding: 8px 10px; border-radius: 8px; background: none; border: 0; cursor: pointer; font: inherit; }
.nav a:hover, .nav button.link:hover { background: rgba(255, 255, 255, .16); text-decoration: none; }
.cart-btn { position: relative; display: inline-grid; place-items: center; padding: 6px 8px !important; }
.n { position: absolute; top: -3px; right: -5px; background: #fff; color: var(--green); border-radius: 99px; min-width: 20px; height: 20px; font-size: .72rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; box-shadow: 0 0 0 1px var(--green); }
.n:empty, .n[data-n="0"] { display: none; }
@media (max-width: 700px) {
  .hd { height: 56px; gap: 10px; }
  .logo .lt { display: none; } .logo svg { width: 40px; height: 40px; } .logo-img { height: 42px; max-width: 140px; }
  #nav-user, #nav-bell { display: none; }
}

/* แถบเมนูล่าง (มือถือ) + แถบหัวหน้าย่อย */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; font-size: .7rem; color: var(--muted); position: relative; }
.tabbar a:hover { text-decoration: none; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current] { color: var(--green); }
.tabbar a[aria-current] svg { fill: color-mix(in srgb, var(--green) 14%, transparent); }
.tabbar .n { top: 3px; right: auto; left: calc(50% + 6px); background: var(--green); color: #fff; box-shadow: none; font-style: normal; }
@media (max-width: 700px) {
  .tabbar { display: flex; }
  body { padding-bottom: 62px; }
  body[data-route="p"], body[data-route="cart"], body[data-route="checkout"], body[data-route="order"] { padding-bottom: 0; }
  body[data-route="p"] .tabbar, body[data-route="cart"] .tabbar, body[data-route="checkout"] .tabbar, body[data-route="order"] .tabbar { display: none; }
}
.mbar { display: none; position: sticky; top: 0; z-index: 25; align-items: center; gap: 6px; height: 52px; padding: 0 8px; background: #fff; border-bottom: 1px solid var(--line); }
.mbar b { font-size: 1.05rem; font-weight: 600; flex: 1; text-align: center; margin-right: 36px; }
.mbar a.bk { width: 40px; height: 40px; display: grid; place-items: center; color: var(--green); }
.mbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) { body:is([data-route="cart"],[data-route="checkout"],[data-route="order"]) .mbar { display: flex; } body:is([data-route="cart"],[data-route="checkout"],[data-route="order"]) .page > h1:first-child { display: none; } .page > h1:first-child, .page > .desk-title { font-size: 1.35rem; margin: 6px 0 12px; } }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 20px; font: 500 1rem var(--sans); background: var(--green); color: #fff; cursor: pointer; transition: background .15s, transform .05s; text-decoration: none; }

.btn:active { transform: translateY(1px); }
.btn:disabled { background: #c9cfc4; color: #fff; cursor: not-allowed; }
.btn.amber { background: var(--amber); }
.btn.ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 1.5px var(--green); }

.btn.sm { padding: 7px 12px; font-size: .88rem; border-radius: 10px; }
.btn.block { width: 100%; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: 4px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 3px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(43, 90, 60, .15); }
textarea { resize: vertical; min-height: 80px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .grid2 { grid-template-columns: 1fr; } }
.form-error { color: var(--danger); background: #fbe9e6; border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: .92rem; }
.form-error:empty { display: none; }

/* hero */
.hero { background: radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--amber) 22%, transparent), transparent 60%), linear-gradient(135deg, var(--green-dd), var(--green) 55%, var(--green-hi)); color: #f3f6ec; }
.hero .wrap { padding-top: 48px; padding-bottom: 52px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; }
.hero h1 { color: #fff; }
.hero p { color: #d7e4cf; max-width: 34em; font-size: 1.05rem; }
.hero .perks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0 24px; padding: 0; list-style: none; font-size: .92rem; color: #cfe0c6; }
.hero .art { display: flex; justify-content: center; }
.hero .art img { width: min(300px, 70%); border-radius: 28px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); transform: rotate(3deg); }
@media (max-width: 760px) { .hero .wrap { grid-template-columns: 1fr; padding-top: 32px; padding-bottom: 34px; } .hero .art { display: none; } }

/* shop */
.section { padding-block: 18px 56px; }
.catbox { background: #fff; border-radius: var(--radius); padding: 10px 6px 6px; margin-bottom: 12px; }
.cats { display: flex; overflow-x: auto; scrollbar-width: none; gap: 2px; padding-bottom: 4px; }
.cats::-webkit-scrollbar { display: none; }
.cat-tile { flex: 0 0 82px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 2px; border: 0; background: none; font: inherit; font-size: .78rem; line-height: 1.25; color: var(--ink); cursor: pointer; text-align: center; border-radius: 10px; }
.cat-tile i { font-style: normal; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 1.5rem; background: var(--green-l); transition: transform .12s; }

.cat-tile[aria-pressed="true"] { color: var(--green); font-weight: 600; }
.cat-tile[aria-pressed="true"] i { box-shadow: 0 0 0 2.5px var(--green); background: #fff; }
.sortbar { display: flex; background: #fff; border-radius: var(--radius); margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.sortbar::-webkit-scrollbar { display: none; }
.stab { flex: 1 0 auto; padding: 13px 16px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; border-bottom: 2.5px solid transparent; white-space: nowrap; }
.stab[aria-pressed="true"] { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.count { color: var(--muted); font-size: .85rem; margin: 0 0 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
@media (max-width: 700px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 6px; } }
.card { position: relative; background: #fff; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border: 1px solid transparent; transition: border-color .12s, box-shadow .12s, transform .12s; }

.card-img { position: relative; display: block; aspect-ratio: 1; background: var(--green-l); }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.tags { position: absolute; bottom: 0; left: 0; display: flex; gap: 4px; }
.tag { font-size: .72rem; font-weight: 500; padding: 2px 8px; background: var(--amber); color: #fff; border-radius: 0 6px 0 0; }
.tag.dark { background: rgba(0, 0, 0, .7); } .tag.warn { background: #fff; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.off { position: absolute; top: 0; right: 0; background: color-mix(in srgb, var(--amber) 16%, #fff); color: var(--amber); font-size: .76rem; font-weight: 700; padding: 3px 7px 4px; border-radius: 0 0 0 8px; }
.card-body { padding: 8px 10px 11px; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.card h3 { margin: 0; font-family: var(--sans); font-size: .92rem; font-weight: 400; line-height: 1.4; height: 2.8em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ink); }
.card h3 a { color: inherit; }
.card h3 a::after { content: ''; position: absolute; inset: 0; }
.card-foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.sold { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.price { font-weight: 600; color: var(--amber); font-size: 1.08rem; }
.price s { color: #999; font-weight: 400; font-size: .78rem; margin-left: 5px; }
.price .sale { color: var(--amber); }
.empty { text-align: center; padding: 56px 16px; color: var(--muted); }

/* product page */
.crumbs { font-size: .88rem; color: var(--muted); padding: 18px 0 8px; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .94rem; margin: 0 0 18px; padding: 14px 16px; background: var(--paper); border-radius: 12px; }
.meta dt { color: var(--muted); } .meta dd { margin: 0; }
.buy { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.qty button { width: 38px; height: 42px; border: 0; background: none; font-size: 1.2rem; cursor: pointer; color: var(--green-d); }

.qty input { width: 48px; border: 0; text-align: center; padding: 8px 0; border-radius: 0; box-shadow: none !important; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.box { background: var(--paper); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.brew { background: var(--green-l); border-radius: 12px; padding: 14px 16px; margin-top: 18px; }
.brew h3 { margin-bottom: 4px; }
.stock-ok { color: var(--green); } .stock-low { color: var(--amber); } .stock-out { color: var(--danger); }

/* cart / checkout */
.page { padding-block: 28px 64px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }
.summary { position: sticky; top: 112px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.row.total { font-size: 1.2rem; font-weight: 700; color: var(--green-d); border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; }
.free-note { font-size: .85rem; color: var(--amber); background: var(--amber-l); padding: 8px 12px; border-radius: 10px; margin: 10px 0; }
.radio { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; background: #fff; }
.radio:has(input:checked) { border-color: var(--green); background: var(--green-l); }
.radio input { width: auto; margin-top: 5px; accent-color: var(--green); }
.radio b { display: block; } .radio span { font-size: .85rem; color: var(--muted); }
.success { text-align: center; padding: 8px 0 20px; }
.success .check { width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 12px; }
.code { font-family: ui-monospace, Menlo, monospace; background: var(--green-l); border-radius: 8px; padding: 2px 10px; font-weight: 700; letter-spacing: .04em; }
.bank { background: var(--amber-l); border-radius: 12px; padding: 14px 16px; margin: 16px 0; }

/* auth + account */
.auth { max-width: 440px; margin: 0 auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 16px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--green-d); background: var(--paper); box-shadow: inset 0 -3px 0 var(--green); }
.tabs a:hover { text-decoration: none; color: var(--green-d); }
.order { margin-bottom: 16px; }
.order header { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.order .items { font-size: .92rem; color: var(--muted); margin: 0 0 8px; padding-left: 18px; }
.badge { display: inline-block; padding: 2px 11px; border-radius: 99px; font-size: .8rem; font-weight: 500; }
.badge.amber { background: var(--amber-l); color: var(--amber-dd); } .badge.blue { background: #dfeaf7; color: #1f4f86; }
.badge.teal { background: #d9f0ec; color: #14675c; } .badge.green { background: var(--green-l); color: var(--green-d); }
.badge.red { background: #f8dfdc; color: var(--danger); }

/* misc */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--green-d); color: #fff; padding: 11px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 92vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--danger); }
.footer { background: var(--green-d); color: #cfdcc7; padding: 32px 0; font-size: .92rem; }
.footer .ft-top { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; }
.footer .ft-contact { margin-left: auto; text-align: right; }
.footer .ft-contact .lineadd-row { justify-content: flex-end; }
.footer .ft-bot { margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.16); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; }
@media (max-width: 700px) { .footer .ft-contact { margin-left: 0; width: 100%; text-align: left; } .footer .ft-contact .lineadd-row { justify-content: flex-start; } }
.footer a { color: #e9f0e0; } .footer b { color: #fff; }
.skeleton { height: 320px; border-radius: var(--radius); background: linear-gradient(90deg, #eee6d3 25%, #f6f0e2 50%, #eee6d3 75%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ป้องกันบอต / ที่อยู่ / นโยบาย */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; margin: 14px 0 6px; cursor: pointer; }
.consent input { width: auto; margin-top: 4px; accent-color: var(--green); }
.cf-box { margin: 8px 0; min-height: 0; }
.fhint { font-size: .8rem; color: var(--muted); margin: -8px 0 12px; }
.fhint.warn { color: #b45309; font-weight: 500; min-height: 0; }
.fhint:empty { display: none; }
.radio.disabled { opacity: .55; cursor: not-allowed; background: #f4f1e8; }
.legal { max-width: 760px; }
.legal h2 { font-size: 1.1rem; margin: 22px 0 6px; color: var(--green-d); }
.legal ul { padding-left: 20px; } .legal li { margin: 4px 0; } .legal p, .legal li { line-height: 1.7; }

/* รายการแนะนำที่อยู่ (autocomplete) */
.acw { position: relative; }
.ac { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; margin: 4px 0 0; padding: 4px; list-style: none; background: #fff; border: 1.5px solid var(--green); border-radius: 12px; box-shadow: 0 10px 30px rgba(30, 60, 40, .18); max-height: 280px; overflow-y: auto; }
.ac li { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: .92rem; line-height: 1.4; }
.ac li b { color: var(--green-d); }
.ac li:hover, .ac li.on { background: var(--green-l); }
.ac.up { top: auto; bottom: 100%; margin: 0 0 4px; }

/* PromptPay QR + แนบสลิป */
.qrbox { display: flex; gap: 16px; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px; margin: 12px 0; }
.qrbox .qr { flex: 0 0 168px; width: 168px; } .qrbox .qr svg { display: block; width: 100%; height: auto; border-radius: 6px; }
.slipbox { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: #fff7e6; border: 1.5px dashed #e0b25a; border-radius: 14px; padding: 14px; margin: 12px 0; }
.slipbox.ok { background: var(--green-l); border: 1.5px solid #b9d3b0; color: var(--green-d); flex-direction: row; flex-wrap: wrap; align-items: center; }
.slipbox .btn { cursor: pointer; } .slipre { margin-left: auto; text-decoration: underline; cursor: pointer; font-size: .88rem; }
@media (max-width: 520px) { .qrbox { flex-direction: column; text-align: center; } .qrbox .qr { flex-basis: auto; width: 200px; } }

.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; font-size: .9rem; } .share .chip { text-decoration: none; cursor: pointer; }

/* ตัวเลือกสินค้า */
.price small { font-size: .7em; font-weight: 500; color: var(--muted); }
.opts { margin: 4px 0 14px; display: grid; gap: 12px; padding: 4px; border-radius: 12px; border: 1.5px solid transparent; }
.opts.need { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 6%, transparent); }
.opt-name { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.opt-vals { display: flex; flex-wrap: wrap; gap: 8px; }
.optb { font: inherit; font-size: .95rem; padding: 7px 16px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }

.optb[aria-pressed="true"] { border-color: var(--green); background: var(--green-l); color: var(--green-d); font-weight: 700; }
.optb:disabled { color: #aaa; background: #f3f3f0; text-decoration: line-through; cursor: not-allowed; }

/* แบนเนอร์สไลด์ */
.slider-wrap { padding-top: 18px; }
.slider { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--green-l); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; display: block; aspect-ratio: 2 / 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
a.slide:hover { text-decoration: none; }
.sl-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); color: var(--green-d); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .2); }
.sl-nav:hover { background: #fff; }
.sl-nav.prev { left: 10px; } .sl-nav.next { right: 10px; }
@media (max-width: 700px) { .sl-nav { display: none; } }
.sl-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.sl-dots button { pointer-events: auto; width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .6); box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); cursor: pointer; }
.sl-dots button[aria-current] { background: #fff; width: 22px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { .slides { scroll-behavior: auto; } }

/* ───── หน้าสินค้า (สไตล์มาร์เก็ตเพลส) ───── */
.pdp { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 32px; padding: 0 0 24px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
.pdp .pic { aspect-ratio: 1; background: var(--green-l); border-radius: var(--radius) 0 0 var(--radius); overflow: hidden; }
.pdp .pic img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { padding: 24px 24px 0 0; min-width: 0; }
.pinfo h1 { font-family: var(--sans); font-size: 1.35rem; font-weight: 600; color: var(--ink); margin: 0 0 4px; }
.pshort { color: var(--muted); font-size: .92rem; margin: 0 0 10px; }
.pricebox { background: color-mix(in srgb, var(--amber) 7%, #fafafa); padding: 12px 16px; border-radius: 6px; color: var(--amber); font-size: 1.75rem; font-weight: 600; line-height: 1.3; }
.pricebox small { font-size: .55em; color: var(--muted); font-weight: 400; }
.psold { font-size: .85rem; margin: 8px 0 12px; }
.optrow { display: none; width: 100%; align-items: center; gap: 10px; padding: 14px 16px; border: 0; border-top: 8px solid var(--bg); background: #fff; font: inherit; text-align: left; cursor: pointer; }
.optrow span { flex: 1; } .optrow b { font-weight: 500; color: var(--amber); } .optrow i { font-style: normal; color: var(--muted); }
.qrow { display: flex; align-items: center; gap: 16px; margin: 12px 0; }
.ql { color: var(--muted); min-width: 56px; font-size: .92rem; }
.stock { font-size: .85rem; color: var(--muted); }
.inline-buy .buy .btn { min-width: 190px; }
.inline-buy .buy .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; margin-right: 6px; vertical-align: -3px; }
.svc { display: grid; grid-template-columns: 28px 1fr; gap: 8px 4px; margin: 18px 0 8px; padding: 14px 0 0; border-top: 1px solid var(--line); font-size: .9rem; }
.svc dt, .svc dd { margin: 0; }
.pdp-top, .buybar, .sheet-bg { display: none; }
.pdesc { margin-top: 16px; } .pdesc h2 { font-family: var(--sans); font-size: 1.1rem; background: var(--bg); margin: -4px -4px 12px; padding: 10px 14px; border-radius: 6px; color: var(--ink); }
.sec-h { font-family: var(--sans); font-size: 1.05rem; color: var(--muted); text-transform: none; margin: 8px 0 12px; }
.share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; font-size: .88rem; }
.vchip { display: inline-block; margin-top: 4px; padding: 1px 8px; background: #f3f3f3; color: var(--muted); border-radius: 3px; font-size: .8rem; }

/* ───── ตะกร้า ───── */
.ck { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .95rem; }
.ck input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; flex: none; }
.cartbox { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.store { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.store svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--green); }
.line { display: grid; grid-template-columns: 28px 84px minmax(0, 1fr) 110px 120px 110px 64px; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.l-img img { width: 84px; height: 84px; object-fit: cover; border-radius: 4px; }
.line .name { color: var(--ink); font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.l-price { color: var(--muted); }
.l-sum { color: var(--amber); font-weight: 700; text-align: right; }
.rm { background: none; border: 0; color: var(--muted); cursor: pointer; font: .85rem var(--sans); display: inline-flex; align-items: center; gap: 4px; padding: 6px; }
.rm:hover { color: var(--danger); }
.rm svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.line .qty button { height: 32px; width: 30px; } .line .qty input { padding: 4px 0; width: 42px; height: 32px; }
.cartw { padding-bottom: 130px; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); padding-bottom: env(safe-area-inset-bottom); }
.cb { display: flex; align-items: center; gap: 14px; height: 60px; }
.cb .ctot { margin-left: auto; text-align: right; line-height: 1.3; }
.cb .ctot b { color: var(--amber); font-size: 1.2rem; }
.cb .ctot small { color: var(--muted); font-size: .78rem; }
.cb .btn { min-width: 150px; border-radius: 4px; }
.cb .btn:disabled { opacity: .5; cursor: not-allowed; }
.bar-note { position: fixed; left: 0; right: 0; bottom: 60px; z-index: 34; margin: 0; border-radius: 0; text-align: center; padding: 5px 12px; }

/* ───── หน้าสมาชิก ───── */
.acc-hero { background: linear-gradient(135deg, var(--green-hi), var(--green)); color: #fff; padding: 28px 0 44px; }
.ah { display: flex; align-items: center; gap: 14px; }
.av { width: 60px; height: 60px; border-radius: 50%; background: #fff; color: var(--green); display: grid; place-items: center; font-size: 1.6rem; font-weight: 700; flex: none; }
.ai { display: grid; min-width: 0; } .ai b { font-size: 1.15rem; } .ai small { opacity: .9; overflow: hidden; text-overflow: ellipsis; }
.accb { margin-top: -26px; padding-bottom: 40px; display: grid; gap: 12px; }
.osts-h { display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--ink); }
.osts-h span { font-size: .85rem; color: var(--muted); } .osts-h:hover { text-decoration: none; }
.osts { display: grid; grid-template-columns: repeat(4, 1fr); padding-top: 14px; text-align: center; font-size: .82rem; }
.osts a { color: var(--ink); display: grid; gap: 6px; justify-items: center; } .osts a:hover { text-decoration: none; }
.oi { position: relative; display: inline-block; } .oi svg { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.bdg { position: absolute; top: -6px; left: 18px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: var(--amber); border: 1px solid var(--amber); font: normal 700 .7rem/16px var(--sans); text-align: center; }
.bdg[hidden] { display: none; }
.menu { padding: 0; }
.menu a { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; color: var(--ink); border-bottom: 1px solid var(--line); }
.menu a:last-child { border-bottom: 0; } .menu a:hover { background: var(--bg); text-decoration: none; }
.otabs { margin-bottom: 12px; overflow-x: auto; white-space: nowrap; }
.otabs .stab[aria-current] { color: var(--green); border-color: var(--green); }
.otabs a { text-decoration: none; }
.accw .accb { max-width: 760px; }

/* ───── มือถือ ───── */
@media (max-width: 800px) {
  .pdpw { padding: 0; position: relative; }
  .crumbs { display: none; }
  .pdp { display: block; border-radius: 0; box-shadow: none; padding: 0; }
  .pdp .pic { border-radius: 0; }
  .pinfo { padding: 0; }
  .pinfo h1, .pshort, .psold { padding: 0 14px; }
  .pinfo h1 { margin-top: 12px; font-size: 1.1rem; }
  .pricebox { border-radius: 0; font-size: 1.5rem; padding: 10px 14px; }
  .optrow { display: flex; }
  .inline-buy { display: none; }
  .pdp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: fixed; top: 0; left: 0; right: 0; z-index: 30; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: transparent; transition: background .2s, box-shadow .2s; }
  .pdp-top .pt { flex: 1; min-width: 0; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; }
  .pdp-top.solid { background: #fff; box-shadow: 0 1px 0 var(--line); }
  .pdp-top.solid .pt { opacity: 1; }
  .rb { width: 36px; height: 36px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; display: grid; place-items: center; transition: background .2s, color .2s; flex: none; }
  .pdp-top.solid .rb { background: transparent; color: var(--green); }
  .rb svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .svc, .meta, .share { margin: 0; padding: 12px 14px; border-top: 8px solid var(--bg); border-radius: 0; background: #fff; }
  .meta { margin: 0; }
  .pdesc, .section { margin-left: 0; margin-right: 0; border-radius: 0; }
  .pdpw > .pdesc { margin-top: 8px; }
  .pdpw > .section { padding: 0 8px; }
  .pdpw { padding-bottom: 70px; }
  .buybar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 54px; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box; }
  .buybar > * { border: 0; font: inherit; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
  .bb-chat { flex: 0 0 22%; flex-direction: column; color: var(--green); font-size: .72rem; border-right: 1px solid var(--line) !important; }
  .bb-chat:hover { text-decoration: none; }
  .bb-chat svg, .bb-add svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .bb-add { flex: 1; flex-direction: column; background: color-mix(in srgb, var(--green) 10%, #fff); color: var(--green); font-size: .72rem; gap: 0; }
  .bb-buy { flex: 1; background: var(--green); color: #fff; font-weight: 600; }
  .buybar button:disabled { opacity: .5; }
  .sheet-bg { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .5); align-items: flex-end; }
  .sheet-bg:not([hidden]) { display: flex; }
  .sheet { position: relative; width: 100%; max-height: 85vh; overflow-y: auto; background: #fff; border-radius: 14px 14px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }
  .sx { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 1.8rem; line-height: 1; color: var(--muted); width: 40px; height: 40px; }
  .sh { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 14px; padding-right: 36px; }
  .sh img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; margin-top: -30px; border: 2px solid #fff; background: var(--green-l); }
  .sh .js-price { color: var(--amber); font-size: 1.3rem; font-weight: 600; }
  body.sheet-open { overflow: hidden; }
  .line { grid-template-columns: 24px 76px minmax(0, 1fr) auto; grid-template-areas: "ck img info rm" "ck img price qty"; gap: 4px 10px; padding: 12px; align-items: start; }
  .l-ck { grid-area: ck; align-self: center; } .l-img { grid-area: img; } .l-info { grid-area: info; } .l-rm { grid-area: rm; } .l-price { grid-area: price; color: var(--amber); font-weight: 600; align-self: end; } .l-qty { grid-area: qty; justify-self: end; align-self: end; }
  .l-sum { display: none; } .l-rm span { display: none; }
  .l-img img { width: 76px; height: 76px; }
  .cb .btn { min-width: 112px; padding-inline: 12px; }
  .cb { gap: 8px; }
  .cartw { padding-bottom: 150px; }
  .cartw .cartbox { border-radius: 0; margin: 0 -20px; }
  .acc-hero { padding-top: 22px; }
  .slider-wrap { padding: 0; } .slider { border-radius: 0; box-shadow: none; }
  .grid { gap: 6px; }
}

@media (max-width: 700px) {
  /* แถบประกาศแสดงทุกหน้าบนมือถือ: หน้าอื่นไม่ใช่หน้าแรกให้เลื่อนหายตามหน้า (ไม่ตรึง) เพื่อไม่ชนแถบหัวของแต่ละหน้า — ถ้าไม่ชอบ ให้เปลี่ยนกลับเป็น: body:not([data-route="home"]) .topbar { display: none; } */
  body:not([data-route="home"]) .stick { display: contents; }
  body:not([data-route="home"]) .header { position: sticky; top: 0; z-index: 30; }
  body:is([data-route="p"],[data-route="cart"],[data-route="checkout"],[data-route="order"]) .header { display: none; }
  body[data-route="cart"] .footer, body[data-route="p"] .footer, body[data-route="checkout"] .footer { display: none; }
  .hero .wrap { grid-template-columns: 1fr; padding-top: 18px; padding-bottom: 20px; gap: 0; }
  .hero h1 { font-size: 1.4rem; margin-bottom: 6px; }
  .hero p, .hero .art { display: none; }
  .hero .perks { margin: 6px 0 12px; font-size: .8rem; }
}
.pricebox .price { font-size: inherit; margin: 0; font-weight: 600; }
.pdp .pic { align-self: start; }
@media (max-width: 700px) { .toast { bottom: 76px; } }
.rb { position: relative; }
.rb .n { top: -4px; right: -4px; background: var(--amber); color: #fff; box-shadow: 0 0 0 2px #fff; font-style: normal; }

/* หมวดหมู่: แถวเดียวเลื่อนข้าง (ไอคอนสุดท้ายโผล่ครึ่งหนึ่งให้รู้ว่าเลื่อนต่อได้) + แถบบอกตำแหน่ง */
.cats { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; gap: 4px; padding-bottom: 2px; }
.cats .cat-tile { scroll-snap-align: start; flex: 0 0 76px; min-width: 0; font-size: .8rem; }
.cats .cat-tile:first-child { margin-left: auto; } .cats .cat-tile:last-child { margin-right: auto; }
.cat-tile i { width: 56px; height: 56px; border-radius: 16px; overflow: hidden; font-size: 1.6rem; }
.cat-tile i img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-tile i.all svg { width: 100%; height: 100%; display: block; }
.cat-tile[aria-pressed="true"] i { box-shadow: 0 0 0 2.5px var(--green); }
.catbar { position: relative; width: 44px; height: 4px; border-radius: 4px; background: #0000001a; margin: 6px auto 2px; overflow: hidden; }
.catbar i { position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: 4px; background: var(--green); }
@media (max-width: 700px) { .catbox { padding: 8px 4px 6px; } .cats .cat-tile { flex-basis: 72px; } .cat-tile i { width: 54px; height: 54px; } }
/* แถวเรียงสินค้า 4 ตัว ให้กว้างเท่ากัน */
.sortbar .stab { flex: 1 1 0; padding-inline: 8px; text-align: center; }
.stab .arr { display: inline-block; min-width: 1em; opacity: .75; font-size: .9em; }
/* แกลเลอรี่รูปสินค้า */
.pdp .pic { aspect-ratio: auto; background: none; position: relative; overflow: hidden; }
.gal-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--green-l); aspect-ratio: 1; overscroll-behavior-x: contain; }
.gal-track::-webkit-scrollbar { display: none; }
.gal-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; }
.gal-n { position: absolute; right: 10px; top: calc(100% - 0px); transform: translateY(-100%); margin-top: 0; background: rgba(0, 0, 0, .55); color: #fff; font-size: .8rem; padding: 1px 10px; border-radius: 99px; display: none; }
.gal-th { display: flex; gap: 8px; padding: 10px; background: var(--paper); overflow-x: auto; }
.gal-th button { flex: none; width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; background: none; cursor: pointer; opacity: .75; }
.gal-th button[aria-current] { border-color: var(--green); opacity: 1; }
.gal-th img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 800px) {
  .gal-th { display: none; }
  .gal-n { display: block; top: auto; bottom: 10px; transform: none; }
}

/* แถบประกาศ: ข้อความวิ่ง */
.topbar { overflow: hidden; }
.topbar a { color: inherit; } .topbar a:hover { text-decoration: underline; }
.mq-item { display: inline-block; }
.topbar.run .mq-t { white-space: nowrap; }
.topbar.run .mq { text-align: left; }
.topbar.run .mq-track { display: inline-flex; white-space: nowrap; animation: mq var(--dur, 20s) linear infinite; will-change: transform; }
.topbar.run .mq-item { padding-right: 4rem; }
.topbar.run:hover .mq-track, .topbar.run:active .mq-track, .topbar.run:focus-within .mq-track { animation-play-state: paused; }
@keyframes mq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .topbar.run .mq-track { animation: none; } }

/* แบนเนอร์โปรโมชันทับขอบล่างรูปสินค้า (1200x150 = 8:1) */
.gal-main { position: relative; overflow: hidden; }
.promo { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: auto; aspect-ratio: 8 / 1; pointer-events: none; }
.gal-main.has-promo .gal-n { bottom: calc(100% / 8 + 8px); }
@media (min-width: 801px) { .gal-main { border-radius: var(--radius) 0 0 var(--radius); } }
.pdp .pic img.promo { width: 100%; height: auto; object-fit: cover; }

/* ป้ายโปรโมชันสั้นที่ขอบล่างรูปบนการ์ด (ข้อความจากแบนเนอร์) */
.ptag { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 8px; background: color-mix(in srgb, var(--green) 92%, transparent); color: #fff; font-size: .8rem; font-weight: 600; text-align: center; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-img.has-pt .tags { bottom: 24px; }

/* ปุ่มหัวใจ (สินค้าที่ถูกใจ) */
.heart { position: absolute; top: 6px; left: 6px; z-index: 3; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .88); color: #777; cursor: pointer; padding: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); transition: transform .15s; }
.heart svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.heart[aria-pressed="true"] { color: #e0243b; }
.heart[aria-pressed="true"] svg { fill: currentColor; }
.heart.pop { animation: hpop .35s ease; }
@keyframes hpop { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .heart.pop { animation: none; } }
.ttl { display: flex; align-items: flex-start; gap: 10px; }
.ttl h1 { flex: 1; min-width: 0; }
.ttl .heart { position: static; flex: none; box-shadow: none; border: 1px solid var(--line); background: #fff; width: 38px; height: 38px; margin: 0; }
.hd .wl { margin-right: -4px; }
@media (max-width: 700px) { .ttl { padding-right: 14px; } .pinfo .ttl h1 { padding-right: 0; } .ttl .heart { margin-top: 10px; } }
.note { margin-bottom: 12px; font-size: .92rem; }

/* เพิ่มเพื่อน LINE + QR */
.lineadd{margin-top:12px}.lineadd p{margin:0 0 8px}.lineadd-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.qr-th{padding:4px;background:#fff;border:1px solid var(--line);border-radius:10px;cursor:zoom-in;line-height:0}.qr-th img{width:88px;height:88px;object-fit:contain;display:block}
.btn.btn-line{background:#057f39;color:#fff}.btn.btn-line:hover{background:#046a2f}
.qrz{position:fixed;inset:0;z-index:100;background:rgba(0,0,0,.6);display:flex;align-items:center;justify-content:center;padding:20px}
.qrz-in{background:#fff;color:var(--green-d);border-radius:16px;padding:18px;text-align:center;max-width:340px;width:100%}
.qrz-in img{width:100%;max-width:280px;height:auto;aspect-ratio:1;object-fit:contain}.qrz-in p{margin:8px 0 12px}
.btn.btn-line{white-space:nowrap;flex:0 0 auto}

/* เลขพัสดุในหน้า "การซื้อของฉัน" */
.trackbox{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;margin-top:10px;padding:10px 12px;background:var(--green-l);border-radius:10px}
.trackbox b{word-break:break-all}.trackbtn{display:flex;gap:8px;flex-wrap:wrap}

/* ปุ่มล้างคำค้นหา */
.hsearch input::-webkit-search-cancel-button,.hsearch input::-webkit-search-decoration{-webkit-appearance:none;appearance:none;display:none}
.hsearch .hq-clear{display:none;width:40px;height:auto;margin:0;background:transparent;color:#7a7466;border-radius:4px;flex:0 0 40px}
.hsearch .hq-clear:hover{background:#f0ece0;color:var(--ink)}
.hsearch.has-q .hq-clear{display:grid;place-items:center}

/* วงกลมตัวเลขตะกร้า: สีแดงตัวเลขขาว (สีเดียวกับปุ่มค้นหา) — หัวใจคงเดิม */
.cart-btn:not(.wl) .n, .tabbar .n { background: var(--amber); color: #fff; box-shadow: 0 0 0 2px #fff; }
.over-note { font-size: .85rem; color: #8a1c1c; background: #fdecec; border: 1px solid #f2c3c3; padding: 8px 12px; border-radius: 10px; margin: 10px 0; }

/* ศูนย์แจ้งเตือน */
.nlist{padding:0;overflow:hidden}
.nitem{display:flex;gap:12px;align-items:flex-start;padding:12px 16px;border-bottom:1px solid var(--line,#e3dac6);color:inherit;text-decoration:none}
.nitem:last-child{border-bottom:0}.nitem.unread{background:var(--amber-l,#fff4e0);border-left:4px solid var(--amber)}
.nitem b{font-size:1rem}.nitem span{color:var(--ink)}.nitem small{color:#8a8574}
.nbdg{font-style:normal;display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:99px;background:var(--amber);color:#fff;font-size:.72rem;font-weight:700;vertical-align:middle;margin-left:4px}
.nbdg:empty,.nbdg[data-n="0"]{display:none}
.cart-btn.bell .n{background:var(--amber);color:#fff;box-shadow:0 0 0 2px #fff}

/* หมวดย่อย (ขั้นที่ 2) */
.subs{display:flex;gap:8px;overflow-x:auto;padding:4px 0 10px;scrollbar-width:none}.subs::-webkit-scrollbar{display:none}.subs .chip{flex:none;white-space:nowrap}
.subs .chip{padding:7px 14px;border:1px solid var(--line,#e3dac6);border-radius:999px;background:#fff;font:inherit;font-size:.88rem;color:var(--ink);cursor:pointer}
.subs .chip[aria-pressed="true"]{background:var(--green);border-color:var(--green);color:#fff}

/* เอฟเฟกต์ hover เฉพาะอุปกรณ์ที่มีเมาส์ — บนมือถือ (iOS) hover จะค้างหลังแตะ ทำให้การ์ด/ไอคอนมีกรอบค้าง */
@media (hover: hover) {
  .cat-tile:hover i { transform: scale(1.06); }
  .card:hover { border-color: var(--green); box-shadow: 0 4px 14px rgba(0, 0, 0, .1); transform: translateY(-1px); }
  .qty button:hover { background: var(--green-l); }
  .optb:hover:not(:disabled) { border-color: var(--green); }
  .heart:hover { transform: scale(1.08); }
  .btn:hover { background: var(--green-d); text-decoration: none; }
  .btn.ghost:hover { background: var(--green-l); }
  .hsearch button:hover { background: var(--amber-d); }
  .btn.amber:hover { background: var(--amber-d); }
}

.sortbar.subtabs .stab { flex: none; white-space: nowrap; padding-inline: 16px; }
.subs[hidden] { display: none; }

/* หน้าแรกแบบ Shopee: คอม = สไลด์ + แบนเนอร์นิ่ง 2 ใบ · มือถือ = คลิป + แบนเนอร์นิ่ง 3 ใบ */
.hpc { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; align-items: stretch; }
.hpc .slider { min-width: 0; }
.hpc-bn { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hb { display: block; flex: 1 1 0; min-height: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--green-l); }
.hb img { width: 100%; height: 100%; object-fit: cover; display: block; }
a.hb:hover { text-decoration: none; }
.hm { display: grid; grid-template-columns: 1fr 1.05fr; gap: 6px; padding: 6px; align-items: stretch; }
.hm-bn { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hm .hb { border-radius: 10px; box-shadow: none; aspect-ratio: 2 / 1; flex: 1 0 auto; }
.hm-clip { position: relative; display: block; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #1c1c1c; cursor: pointer; aspect-ratio: 5 / 8; width: 100%; -webkit-tap-highlight-color: transparent; }
.hm-clip img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.hm-clip img.on { opacity: 1; }
.hm-clip .play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; font-size: 18px; line-height: 46px; text-align: center; padding-left: 3px; box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.hm-clip .vtag { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .72rem; padding: 2px 8px; border-radius: 99px; }
.clipov { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .78); display: flex; align-items: center; justify-content: center; padding: 12px; }
.clipbox { position: relative; width: min(100%, 380px); max-height: 100%; display: flex; flex-direction: column; background: #111; border-radius: 14px; overflow: hidden; }
.clipbox iframe { width: 100%; aspect-ratio: 9 / 16; max-height: calc(100vh - 150px); border: 0; display: block; background: #000; }
.clipx { position: absolute; right: 8px; top: 8px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 16px; cursor: pointer; }
.clipft { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 12px; color: #fff; }
.clipft p { margin: 0; font-size: .85rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.clipft .btn { flex: none; }
body.noscroll { overflow: hidden; }
.hpc .slider { aspect-ratio: 2 / 1; } .hpc .slides { height: 100%; } .hpc .slide { aspect-ratio: auto; height: 100%; }
@media (max-width: 700px) { .hpc { display: block; } .hpc-bn { display: none; } }

.hm-clip iframe.cf { position: absolute; left: 50%; top: 50%; width: 100%; height: auto; aspect-ratio: 9 / 16; border: 0; transform: translate(-50%, -50%); pointer-events: none; opacity: 0; transition: opacity .5s ease; background: #000; }
.hm-clip iframe.cf.on { opacity: 1; }
.hm-clip .play, .hm-clip .vtag { z-index: 2; }
.hm-clip.playing .play { display: none; }

/* แถบรับประกัน · แถวสินค้าแนวนอน · เฟดตอนเลื่อน */
.trustw { padding-top: 14px; }
.trust { list-style: none; margin: 0; padding: 4px 2px 8px; display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.trust::-webkit-scrollbar { display: none; }
.cp { flex: 0 0 auto; min-width: 210px; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line, #e6dfd2); border-radius: 12px; padding: 9px 10px; scroll-snap-align: start; }
.cp-i { width: 38px; height: 38px; border-radius: 9px; background: #fbeee0; display: grid; place-items: center; font-size: 1.2rem; }
.cp-t { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cp-t b { font-size: .95rem; color: var(--ink, #222); }
.cp-t small { font-size: .72rem; color: var(--green-d); background: #e8f1ec; border-radius: 4px; padding: 1px 6px; align-self: flex-start; }
.cp-b { border: 0; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: .85rem; font-weight: 600; background: #dff0e5; color: var(--green-d); cursor: pointer; }
.cp-b.on { background: #eee; color: #888; }
@media (max-width: 700px) { .trustw { padding: 8px 6px 0; } .cp { min-width: 190px; } }
@media (min-width: 701px) { .cp { min-width: 250px; } .trust > .cp:first-child { margin-left: auto; } .trust > .cp:last-child { margin-right: auto; } }
.cp-t small.cp-m { background: #fdf0d8; color: #8a5a00; }
.walletl { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 520px; }
.walletl .cp { min-width: 0; }
.hrow { margin: 4px 0 18px; }
.hrow-h { margin: 0 0 8px; font-size: 1.15rem; color: var(--green-d); }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 2px 10px; margin: 0 -2px; scrollbar-width: none; overscroll-behavior-x: contain; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll .card { flex: 0 0 158px; width: 158px; scroll-snap-align: start; }
@media (min-width: 701px) { .hscroll .card { flex-basis: 196px; width: 196px; } }
@media (prefers-reduced-motion: no-preference) {
  .rv { opacity: 0; transform: translateY(14px); transition: opacity .4s ease, transform .4s ease; }
  .rv.in { opacity: 1; transform: none; }
}

.cpn { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line, #e2dccd); }
.cpn-in { display: flex; gap: 8px; } .cpn-in input { flex: 1; min-width: 0; text-transform: uppercase; }
.cpn-on { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #e8f1ec; border-radius: 10px; padding: 9px 12px; font-size: .9rem; }
.cpn-mine { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cpn-chip { border: 1px dashed var(--green-d); background: #fff; color: var(--green-d); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .82rem; cursor: pointer; }
.cpn-chip small { opacity: .7; }
.cpn-on .link { background: none; border: 0; color: var(--green-d); text-decoration: underline; cursor: pointer; font: inherit; }

/* ───── สรุปราคาแบบ Shopee ───── */
.pay-h { font-size: 1.05rem; margin: 0 0 8px; }
.row .muted { color: var(--muted); }
.row.disc { color: var(--danger); } .row.disc small { color: var(--muted); font-size: .78rem; margin-left: 4px; }
.row.total { font-size: 1.15rem; }
.row.total span:last-child { color: var(--amber); font-size: 1.35rem; }
.fprog { background: var(--amber-l); border-radius: 10px; padding: 8px 12px; margin: 8px 0; font-size: .85rem; color: var(--amber); }
.fprog i { display: block; height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .08); margin-top: 6px; overflow: hidden; }
.fprog i b { display: block; height: 100%; background: var(--amber); border-radius: 3px; }
.cpn { margin: 0 0 12px; padding: 0 0 4px; border: 0; }
.cpn-row { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cpn-row.on { cursor: default; }
.cpn-ic { font-size: 1.15rem; } .cpn-l { font-weight: 600; }
.cpn-v { margin-left: auto; color: var(--muted); font-size: .88rem; }
.cpn-row.on .cpn-v { color: var(--danger); } .cpn-row.on .cpn-v small { color: var(--muted); }
.cpn-row .link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }
.cpn-panel { padding: 10px 0 2px; }
.cpn-mine { margin-top: 8px; }
@media (max-width: 900px) { .cartsum .sum-btn { display: none; } .cartsum { position: static; } }
@media (min-width: 901px) { #cart-bar { display: none; } .cartw { padding-bottom: 64px; } }

.cpn-mine { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; }
.cpn-mine::-webkit-scrollbar { display: none; }
.cpn-card { flex: 0 0 auto; min-width: 128px; text-align: left; background: #fff; border: 1.5px dashed var(--green-d, #2f6b47); border-radius: 10px; padding: 8px 12px; font: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: var(--ink, #222); }
.cpn-card b { font-size: .95rem; } .cpn-card small { font-size: .72rem; color: var(--muted); }
.cpn-card:hover { background: var(--green-l, #e8f1ec); }

.cpn-pw { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.cpn-pw.open { grid-template-rows: 1fr; }
.cpn-pw > div { overflow: hidden; min-height: 0; }
.cpn-card { transition: background .25s, border-color .25s, box-shadow .25s; }
.cpn-card.on { border-style: solid; border-color: var(--green-d, #2f6b47); background: var(--green-l, #e8f1ec); box-shadow: 0 0 0 2px var(--green-d, #2f6b47) inset; }
.cpn-v b { color: var(--green-d, #2f6b47); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .cpn-pw, .cpn-card { transition: none; } }
/* โค้ดที่เก็บไว้ แสดงครบทุกใบ ไม่ต้องเลื่อน */
.cpn-mine { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; overflow: visible; padding: 10px 0 4px; }
.cpn-card { min-width: 0; }

/* ───── การ์ดโค้ดแบบใบคูปอง ───── */
.cpn-mine { display: flex; flex-direction: column; gap: 10px; overflow: visible; padding: 10px 0 4px; }
.cpn-card { display: block; width: 100%; min-width: 0; padding: 0; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; text-align: left; font: inherit; color: inherit; cursor: pointer; overflow: hidden; flex-direction: initial; gap: 0; box-shadow: none; }
.cpn-card.ro { cursor: default; }
.cc-main { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.cc-ic { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; color: #fff; background: var(--amber); }
.cc-ic.k-pct { background: #d9534f; } .cc-ic.k-ship { background: var(--green-d, #2f6b47); font-size: 1.25rem; }
.cc-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cc-b b { font-size: 1.02rem; } .cc-b small { font-size: .8rem; color: var(--muted); }
.cc-ft { font-style: normal; font-size: .75rem; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 5px; padding-top: 5px; }
.cc-r { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c9c4b8; display: grid; place-items: center; color: #fff; font-size: .85rem; transition: all .25s; }
.cc-r.on { background: var(--green-d, #2f6b47); border-color: var(--green-d, #2f6b47); }
.cc-need { display: block; background: #fdecea; color: var(--danger); font-size: .8rem; padding: 6px 12px; }
.cpn-card.on { border-color: var(--green-d, #2f6b47); background: var(--green-l, #e8f1ec); box-shadow: 0 0 0 1px var(--green-d, #2f6b47) inset; }
.cpn-card.dis { cursor: not-allowed; } .cpn-card.dis .cc-main { opacity: .55; }
.walletl { max-width: 520px; }
.cpn-v { white-space: nowrap; }

/* ป้ายโค้ดแบบกะทัดรัด */
.cpn-mine { gap: 6px; padding: 8px 0 2px; }
.cpn-card { border-radius: 10px; }
.cc-main { gap: 10px; padding: 7px 10px; }
.cc-ic { width: 34px; height: 34px; border-radius: 9px; font-size: 1.05rem; } .cc-ic.k-ship { font-size: 1rem; }
.cc-b { gap: 0; }
.cc-t { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.cc-b b { font-size: .95rem; } .cc-b small { font-size: .76rem; }
.cc-t em { font-style: normal; font-size: .68rem; background: #fdf0d8; color: #8a5a00; border-radius: 4px; padding: 0 5px; }
.cc-ft { border: 0; margin: 0; padding: 0; font-size: .74rem; }
.cc-r { width: 20px; height: 20px; font-size: .75rem; border-width: 1.5px; }
.cc-need { padding: 4px 10px; font-size: .76rem; }

/* รายการสินค้าในหน้าชำระเงิน (แบบ Shopee) */
.ckitem { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ckitem:last-of-type { border-bottom: 0; }
.ckitem img { flex: 0 0 auto; width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #f3efe6; }
.ci-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ci-n { font-size: .92rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.ci-v { font-size: .78rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.ci-p { display: flex; justify-content: space-between; align-items: baseline; margin-top: auto; }
.ci-p b { color: var(--amber); font-size: .98rem; } .ci-p span { color: var(--muted); font-size: .85rem; }

/* หน้าสั่งซื้อสำเร็จ */
.success .check { background: #1f8a4c; box-shadow: 0 0 0 8px rgba(31, 138, 76, .14); }
.success h1 { font-size: 1.5rem; line-height: 1.35; margin: 6px 0 8px; }
.success h1 span { font-size: 1.05rem; font-weight: 500; color: var(--muted); }
.box-in { margin-top: 18px; }
.addr-card { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; font-size: .92rem; }
.addr-card svg { flex: 0 0 auto; width: 22px; height: 22px; fill: none; stroke: var(--amber); stroke-width: 1.8; margin-top: 2px; }
.success p { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 10px; margin: 0 0 4px; }
.eta { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; padding: 10px 12px; background: #eaf5ee; color: #17613a; border-radius: 10px; font-weight: 600; font-size: .92rem; }
.success + .eta { margin: 0 0 4px; }
.oitems { margin: 6px 0 4px; }
.oitems .ckitem:last-child { border-bottom: 0; }
.omore > summary { cursor: pointer; list-style: none; padding: 8px 0; text-align: center; color: var(--green); font-weight: 600; font-size: .9rem; }
.omore > summary::-webkit-details-marker { display: none; }
.omore[open] > summary { display: none; }

.ntx{display:grid;gap:2px;min-width:0;flex:1}
.nth{position:relative;flex:0 0 56px;width:56px;height:56px;border-radius:10px;background:#f1ead9;overflow:hidden;display:grid;place-items:center}
.nth img{width:100%;height:100%;object-fit:cover;display:block}
.nth em{font-style:normal;font-size:1.6rem}
.nth i{position:absolute;right:0;bottom:0;padding:1px 6px;background:rgba(0,0,0,.62);color:#fff;font-style:normal;font-size:.72rem;font-weight:600;border-top-left-radius:8px}

/* ═══ ป้ายโค้ดส่วนลดแบบตั๋ว (.tk) — แถบสีซ้ายขอบหยัก + เส้นประ/รอยบาก + วันหมดอายุ/เงื่อนไข ═══ */
.tk { --tk-a: color-mix(in srgb, var(--amber, #e08a1e) 82%, #fff); --tk-b: var(--amber, #d9791a); filter: drop-shadow(0 2px 4px rgba(120, 80, 10, .17)); position: relative; text-align: left; color: var(--ink, #3a2a0e); }
.tk-main { display: flex; height: 104px; border-radius: 12px; overflow: hidden; }
.tk-st { flex: 0 0 84px; position: relative; color: #fff; display: grid; place-content: center; text-align: center; background: linear-gradient(160deg, var(--tk-a), var(--tk-b)); }
.tk-st::after { content: ""; position: absolute; top: 0; bottom: 0; right: -5px; width: 10px; background: radial-gradient(circle at 5px 7px, #fff 4.5px, transparent 5px) 0 0 / 10px 14px repeat-y; }
.tk-st b { font-size: 1.6rem; line-height: 1.05; } .tk-st small { font-size: .72rem; opacity: .95; }
.tk-st.k-ship b { font-size: 1.9rem; }
.tk-st.k-ship { background: linear-gradient(160deg, color-mix(in srgb, var(--green, #2f7d4f) 80%, #fff), var(--green, #2f7d4f)); }
.tk-bd { flex: 1; min-width: 0; position: relative; padding: 0 14px 0 18px; border-radius: 0 12px 12px 0; background: radial-gradient(circle at 100% 70px, transparent 8px, #fff 8.5px); }
.tk-tp { height: 70px; display: flex; align-items: center; gap: 10px; }
.tk-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.tk-tx strong { font-size: 1.05rem; line-height: 1.25; }
.tk-chip { max-width: 100%; line-height: 1.3; padding: 2px 7px; border-radius: 6px; font-size: .72rem; background: #e6f2e9; color: #2f6b45; }
.tk-chip.m { background: #fff0cf; color: #8a5a14; }
.tk-btn { border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: .88rem; font-weight: 600; white-space: nowrap; cursor: pointer; background: var(--amber, #e08a1e); color: #fff; }
.tk-btn.got { background: #ececec; color: #888; } .tk-btn.lock { background: #fff3d6; color: #8a5a14; }
.tk-ft { position: absolute; left: 18px; right: 14px; top: 70px; height: 34px; border-top: 2px dashed #eadfc6; display: flex; justify-content: space-between; align-items: center; font-size: .74rem; color: var(--muted, #8a8168); }
.tk-ft b { color: var(--brown, #8a5a14); }
.tk-more { border: 0; background: none; padding: 6px 0 6px 10px; font: inherit; font-size: .74rem; color: var(--muted, #8a8168); cursor: pointer; }
.tk-more:hover { color: var(--ink); text-decoration: underline; }
.tk-r { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #c9c4b8; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 700; transition: background .2s, border-color .2s; }
.tk-r.on { background: var(--green-d, #2f6b47); border-color: var(--green-d, #2f6b47); }
.tk-cond { margin: 0; padding: 12px 16px 12px 34px; background: #fffdf7; border-top: 2px dashed #eadfc6; border-radius: 0 0 12px 12px; list-style: disc; font-size: .8rem; color: #5a4a2a; display: grid; gap: 3px; }
.tk.open .tk-main { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.tk-cond[hidden] { display: none; }
.tk-need { margin-top: -2px; padding: 5px 12px; background: #fdecea; color: var(--danger, #c0392b); font-size: .78rem; border-radius: 0 0 10px 10px; }
.tk.dis { opacity: .6; cursor: not-allowed; }
.tk[role=button] { cursor: pointer; } .tk[role=button]:focus-visible { outline: 2px solid var(--green-d, #2f6b47); outline-offset: 2px; border-radius: 12px; }
.tk.on { filter: drop-shadow(0 0 0 var(--green-d, #2f6b47)) drop-shadow(0 0 2px var(--green-d, #2f6b47)) drop-shadow(0 2px 4px rgba(47, 107, 71, .3)); }
/* วางในหน้าแรก (แถวเลื่อนแนวนอน) · รายการกระเป๋า/ชำระเงิน (คอลัมน์) */
.trust .cp { background: none; border: 0; padding: 0; box-shadow: none; display: block; flex: 0 0 auto; width: min(352px, 88vw); min-width: 0; align-self: flex-start; }
.trust { align-items: flex-start; padding-bottom: 12px; }
.cpn-mine { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; } .walletl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 560px; } .walletl li { list-style: none; }
.cpn-mine .tk, .walletl .tk { width: 100%; }
@media (prefers-reduced-motion: reduce) { .tk-r { transition: none; } }

/* ═══ มือถือ: ป้ายโค้ดหน้าแรกเล็กลง ~25% · หมวดหมู่ใหญ่ขึ้น ~25% ═══ */
@media (max-width: 700px) {
  .cats .cat-tile { flex-basis: 90px; font-size: 1rem; gap: 7px; }
  .cat-tile i { width: 68px; height: 68px; border-radius: 20px; }
  .catbar { width: 54px; }
  .trust .cp { width: min(264px, 70vw); }
  .trust .tk { filter: drop-shadow(0 1.5px 3px rgba(120, 80, 10, .17)); }
  .trust .tk-main { height: 78px; border-radius: 9px; }
  .trust .tk-st { flex-basis: 63px; }
  .trust .tk-st::after { right: -4px; width: 8px; background: radial-gradient(circle at 4px 5px, #fff 3.4px, transparent 3.8px) 0 0 / 8px 10.5px repeat-y; }
  .trust .tk-st b { font-size: 1.2rem; } .trust .tk-st.k-ship b { font-size: 1.45rem; } .trust .tk-st small { font-size: .62rem; }
  .trust .tk-bd { padding: 0 10px 0 13px; border-radius: 0 9px 9px 0; background: radial-gradient(circle at 100% 52px, transparent 6px, #fff 6.4px); }
  .trust .tk-tp { height: 52px; gap: 7px; } .trust .tk-tx { gap: 2px; }
  .trust .tk-tx strong { font-size: .84rem; }
  .trust .tk-chip { font-size: .62rem; padding: 1px 5px; border-radius: 5px; }
  .trust .tk-btn { padding: 6px 10px; font-size: .72rem; }
  .trust .tk-ft { left: 13px; right: 10px; top: 52px; height: 26px; font-size: .62rem; border-top-width: 1.5px; }
  .trust .tk-more { font-size: .62rem; padding: 5px 0 5px 8px; }
  .trust .tk-cond { padding: 9px 12px 9px 26px; font-size: .68rem; border-radius: 0 0 9px 9px; }
}

/* ปุ่มกลับขึ้นบนสุด: เฉพาะมือถือ */
.totop { display: none; }
@media (max-width: 700px) {
  .totop { display: grid; place-items: center; position: fixed; right: 14px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 36; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--green-d, #1d3a28); color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .28); cursor: pointer; opacity: .94; }
  .totop[hidden] { display: none; }
  .totop:active { transform: scale(.94); }
}
@media (max-width: 700px) { body:has(.cartbar) .totop { bottom: calc(132px + env(safe-area-inset-bottom)); } }

/* สรุปจัดส่งถึง/ชำระโดย เหนือปุ่มยืนยัน */
.shipsum { margin: 14px 0 0; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: .9rem; display: grid; gap: 8px; }
.shipsum > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0 8px; }
.shipsum span { color: var(--muted); grid-row: span 2; }
.shipsum b { font-weight: 600; overflow-wrap: anywhere; }
.shipsum em { font-style: normal; color: var(--muted); overflow-wrap: anywhere; }
.shipsum i { color: #b0372d; font-style: normal; font-weight: 400; }
.shipsum > div:last-child { grid-template-columns: 76px minmax(0, 1fr); } .shipsum > div:last-child span { grid-row: auto; }
@media (max-width: 700px) { body:has(form[data-form=checkout]) .totop { display: none; } } /* ไม่ให้ปุ่มลอยไปบังปุ่มยืนยันสั่งซื้อ */

/* Sticky footer: หน้าที่เนื้อหาสั้น footer ยังอยู่ล่างสุดของจอ (ทั้งจอคอม/มือถือ) */
body > main#app { flex: 1 0 auto; width: 100%; }
body > footer.footer { flex: none; }
/* หน้าว่าง (ตะกร้า/รายการโปรด/ไม่พบหน้า): กล่องข้อความอยู่กึ่งกลางพื้นที่ที่เหลือ ไม่ใช่แถบเตี้ยติดหัวหน้า */
main#app:has(.page > .box.empty) { display: flex; flex-direction: column; }
main#app:has(.page > .box.empty) > .page { flex: 1; display: flex; flex-direction: column; }
.page > .box.empty { margin-block: auto; width: 100%; padding-block: 48px; }

/* ===== หัวมือถือแบบแถวเดียว (โลโก้/ย้อน + ค้นหา + ตะกร้า + หัวใจ) ===== */
.hb-back{display:none}
@media (max-width:700px){
  .hd{height:60px;gap:8px}
  .logo{flex:0 0 44px;width:44px;justify-content:center}
  .logo-img{height:44px;max-width:44px;object-fit:contain}
  .hb-back{width:40px;height:44px;flex:0 0 40px;margin-left:-6px;display:none;place-items:center;color:#fff}
  .hb-back svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
  body:not([data-route="home"]) .hb-back{display:grid}
  body:not([data-route="home"]) .hd .logo{display:none}
  .hsearch{margin:0;max-width:none;min-width:0}
  .hsearch input{padding:9px 8px 9px 10px;font-size:16px}
  .hsearch button[type="submit"]{width:44px}
  .nav{display:flex;align-items:center;gap:0;flex:0 0 auto}
  .cart-btn{width:48px;height:48px;padding:0 !important}
  .cart-btn svg{width:28px;height:28px}
  .cart-btn .n{top:2px;right:0;min-width:20px;height:20px}
  .hd .wl{display:inline-grid;margin:0;width:0;min-width:0;opacity:0;overflow:hidden;pointer-events:none;transition:width .25s ease,opacity .2s ease}
  .header.has-wish .wl{width:48px;opacity:1;pointer-events:auto;overflow:visible}
  .tabbar .n{min-width:18px;height:18px;font-size:.66rem}
}

/* ===== แถบแจ้งคุกกี้ (PDPA) ===== */
.ckb{position:fixed;left:12px;right:12px;bottom:12px;z-index:45;max-width:760px;margin:0 auto;display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 6px 24px rgba(0,0,0,.18);padding:12px 14px;animation:ckin .3s ease}
.ckb p{margin:0;font-size:.88rem;line-height:1.5;flex:1}
.ckb-btns{display:flex;gap:8px;flex:0 0 auto}
@keyframes ckin{from{transform:translateY(20px);opacity:0}to{transform:none;opacity:1}}
@media (max-width:700px){
  .ckb{flex-direction:column;align-items:stretch;gap:10px;bottom:calc(68px + env(safe-area-inset-bottom))}
  .ckb-btns .btn{flex:1}
  body[data-route="p"] .ckb{bottom:calc(62px + env(safe-area-inset-bottom))}
  body[data-route="cart"] .ckb,body[data-route="checkout"] .ckb,body[data-route="order"] .ckb{display:none}
}
body[data-route="checkout"] .ckb{display:none}
@media (prefers-reduced-motion:reduce){.ckb{animation:none}}

/* รายการสินค้า/หมวดแบบ HTML ล้วนสำหรับบอทที่ไม่รัน JavaScript — ซ่อนจากสายตา (หน้า JS เขียนทับเมื่อโหลดเสร็จ) */
.seo-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}

/* ชวนสมัครสมาชิก */
.joinpill { background: var(--amber); color: #fff !important; border-radius: 999px; padding: 6px 12px !important; font-weight: 600; white-space: nowrap; }
.joinc { max-width: 1180px; margin: 14px auto 2px; padding: 0 20px; }
.joinc .in { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 16px; background: linear-gradient(135deg, var(--green-d), var(--green)); color: #fff; text-decoration: none; box-shadow: 0 6px 20px rgba(27, 58, 40, .18); }
.joinc .in:hover { text-decoration: none; filter: brightness(1.05); }
.joinc .ic { font-size: 2rem; line-height: 1; flex: none; }
.joinc .t { flex: 1; min-width: 0; line-height: 1.3; } .joinc .t b { display: block; font-size: 1.2rem; } .joinc .t span { display: block; opacity: .85; font-size: .9rem; margin-top: 2px; }
.joinc .btn { flex: none; white-space: nowrap; }
@media (max-width: 700px) {
  #nav-user:has(.joinpill) { display: inline-flex !important; } #nav-user .hide-sm { display: none; } #nav-user .joinpill { font-size: .82rem; padding: 5px 10px !important; }
  .joinc { margin-top: 10px; } .joinc .in { padding: 14px; gap: 10px; } .joinc .ic { font-size: 1.6rem; } .joinc .t b { font-size: 1.02rem; } .joinc .btn { padding: 9px 12px; font-size: .9rem; }
}
.joinb { position: fixed; right: 20px; bottom: 20px; z-index: 44; max-width: 400px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 14px; background: var(--paper); border: 1.5px solid var(--amber); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); font-size: .9rem; animation: ckin .3s ease; }
.joinb .t { flex: 1; min-width: 0; line-height: 1.3; text-decoration: none; color: inherit; } .joinb .t b { display: block; color: var(--green-d); } .joinb .t span { color: var(--muted); font-size: .8rem; }
.joinb .btn { flex: none; } .joinb .x { flex: none; width: 30px; height: 30px; border: 0; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; border-radius: 8px; } .joinb .x:hover { background: var(--line); }
@media (max-width: 700px) { .joinb { left: 10px; right: 10px; max-width: none; bottom: calc(64px + env(safe-area-inset-bottom)); } body[data-route="p"] .joinb { bottom: calc(76px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .joinb { animation: none; } }
.badge.purple { background: #ece4f7; color: #4d2d85; }

/* LINE เป็นช่องทางหลัก */
.linecta { margin: 14px 0 4px; padding: 14px 16px; border-radius: 14px; background: #e9f7ee; border: 1.5px solid #06c755; }
.linecta .lc-h { display: flex; align-items: center; gap: 8px; color: #04863b; font-size: 1.05rem; } .linecta .lc-h svg { width: 22px; height: 22px; }
.linecta p { margin: 6px 0 10px; line-height: 1.5; } .linecta p b { color: var(--green-d); }
.lc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .lc-row .qr-th img { border-radius: 8px; border: 1px solid var(--line); display: block; }
.co-line { text-align: center; margin: 10px 0 0; font-size: .9rem; color: var(--muted); } .co-line a { color: #04863b; font-weight: 600; }
#linefab { position: fixed; right: 16px; bottom: 16px; z-index: 43; display: flex; align-items: center; gap: 8px; padding: 10px 14px 10px 10px; border-radius: 999px; background: #06c755; color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 6px 18px rgba(6, 199, 85, .35); }
#linefab svg { width: 26px; height: 26px; } #linefab:hover { text-decoration: none; filter: brightness(1.05); }
@media (max-width: 700px) { #linefab { bottom: calc(70px + env(safe-area-inset-bottom)); right: 12px; padding: 10px; } #linefab span { display: none; } body[data-route="p"] #linefab { bottom: calc(82px + env(safe-area-inset-bottom)); } }
.joinb ~ #linefab, #linefab ~ .joinb { } /* เมื่อมีแถบชวนสมัคร ปุ่ม LINE ขยับขึ้น */
body:has(.joinb) #linefab { bottom: calc(96px + env(safe-area-inset-bottom)); } @media (min-width: 701px) { body:has(.joinb) #linefab { bottom: 110px; } }

/* ออเดอร์ถูกแก้ไข / ต้องชำระเพิ่ม */
.oedit { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--paper, #f6f3ea); color: var(--muted); font-size: .85rem; }
.odue { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: #fde8e8; border: 1.5px solid #e3a3a3; color: #8a1f1f; display: grid; gap: 3px; font-size: .9rem; } .odue b { font-size: 1.02rem; } .odue.ref { background: #e6f1ff; border-color: #9cc0ee; color: #1f4f86; } .odue a { font-weight: 600; color: inherit; text-decoration: underline; }
/* มือถือ: ปุ่มกลับขึ้นบนวางซ้อนเหนือปุ่ม LINE (เดิมสองปุ่มอยู่ตำแหน่งเดียวกันจนทับกัน) */
@media (max-width: 700px) {
  body:has(#linefab) .totop { bottom: calc(128px + env(safe-area-inset-bottom)); }
  body[data-route="p"]:has(#linefab) .totop, body:has(.cartbar):has(#linefab) .totop { bottom: calc(142px + env(safe-area-inset-bottom)); }
}

/* แถบโค้ดส่วนลด: ปุ่มลูกศร/ลาก/ขอบจาง (PC) */
.trustw { position: relative; }
.trust { cursor: grab; }
.trust.drag { cursor: grabbing; scroll-snap-type: none; user-select: none; scroll-behavior: auto; }
.rl-b { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fff; color: var(--green-d, #2f6b45); font-size: 1.5rem; line-height: 1; display: grid; place-items: center; padding: 0 0 3px; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.rl-b[hidden] { display: none; }
.rl-b:hover { background: #f4f1ea; }
.rl-b.prev { left: 0; } .rl-b.next { right: 0; }
.trustw::before, .trustw::after { content: ""; position: absolute; top: 14px; bottom: 8px; width: 28px; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .15s; }
.trustw::before { left: 0; background: linear-gradient(90deg, var(--bg, #f7f3ea), transparent); }
.trustw::after { right: 0; background: linear-gradient(270deg, var(--bg, #f7f3ea), transparent); }
.trustw.fl::before, .trustw.fr::after { opacity: 1; }
@media (hover: none), (max-width: 700px) { .rl-b { display: none; } .trust { cursor: auto; } }
