:root {
  /* Pangtopia: กรมท่าเข้ม + ทองโบราณ + ครีม */
  --bg: #f6f1e7;
  --card: #fffdf8;
  --line: #e5dac5;
  --line-2: #efe7d6;
  --text: #17152b;
  --text-2: #4d4a5c;
  --muted: #6f6b64;
  --navy: #14122b;
  --navy-2: #24214a;
  --gold: #b08d57;
  --gold-hi: #d9be8a;
  --gold-text: #7a5c27;
  --gold-soft: #efe5cf;
  --charcoal: #1f2228;
  --ok: #0b7352;
  --ok-soft: #e3f2ea;
  --bad: #b42318;
  --bad-soft: #fbeceb;
  --warn: #8a5300;
  --warn-soft: #fbf0d8;
  --info: #2b3a8c;
  --info-soft: #e8ebf7;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 "IBM Plex Sans Thai", "Leelawadee UI", "Thonburi", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
body.lock { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-text); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.3; margin: 0; text-wrap: balance; letter-spacing: -.005em; }
p { margin: 0; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.narrow { max-width: 520px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.ico { width: 20px; height: 20px; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ปุ่ม */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 12px; font: inherit; font-weight: 600; border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--gold); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.danger { background: transparent; color: var(--bad); border-color: #efc2bd; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(176, 141, 87, .5); outline-offset: 2px; }
.link { background: none; border: 0; padding: 8px 2px; font: inherit; color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 40px; }

/* ฟอร์ม */
label.f { display: block; margin-top: 16px; font-weight: 600; font-size: 15px; }
input, select, textarea { width: 100%; margin-top: 6px; min-height: 48px; padding: 0 14px; border: 1px solid #d9ccb3; border-radius: 12px; background: #fff; font: inherit; color: inherit; }
textarea { min-height: 88px; padding: 10px 14px; resize: vertical; }
input[aria-invalid="true"] { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: center; margin-top: 16px; font-size: 15px; color: var(--text-2); min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 0; flex: none; accent-color: var(--navy); }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; }
.err:empty { display: none; }

/* การ์ด */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--gold-soft); color: var(--gold-text); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.gray { background: #ebe5d9; color: var(--text-2); }
.pill.dark { background: var(--navy); color: var(--gold-hi); }
.alert { border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.alert.bad { background: var(--bad-soft); color: #7f1d16; }
.alert.warn { background: var(--warn-soft); color: #6b4200; }
.alert.ok { background: var(--ok-soft); color: #075e41; }

/* แถบบน */
.top { background: rgba(246, 241, 231, .92); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; min-width: 0; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand img.wm { width: auto; height: 18px; border-radius: 0; }
.top nav { margin-left: auto; display: flex; gap: 4px; align-items: center; }
.top nav a, .top nav button { color: var(--text-2); text-decoration: none; font: inherit; font-size: 15px; padding: 0 10px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 8px; white-space: nowrap; background: none; border: 0; cursor: pointer; }
.top nav a:hover, .top nav button:hover { background: var(--gold-soft); color: var(--text); }
@media (max-width: 520px) { .brand img.wm { height: 14px; } .top nav a, .top nav button { padding: 0 8px; font-size: 14px; } .hide-sm { display: none !important; } }

/* หน้าร้าน: hero */
.hero { background: var(--navy) url(img/arch-pattern-navy.svg) repeat; background-size: 64px 96px; color: #fff; position: relative; overflow: hidden; }
.hero-in { position: relative; padding-top: 56px; padding-bottom: 56px; }
.hero .wm { height: 22px; width: auto; opacity: .95; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); margin: 18px 0 10px; max-width: 14em; }
.hero h1 em { font-style: normal; color: var(--gold-hi); }
.hero p { color: #cfcade; font-size: 17px; max-width: 32em; }
.hero .frame { position: absolute; right: 6%; bottom: -2px; height: 86%; width: auto; opacity: .85; }
.hero .notice { display: inline-block; margin-top: 18px; padding: 8px 14px; border-radius: 10px; background: rgba(217, 190, 138, .14); color: var(--gold-hi); font-size: 15px; }
@media (max-width: 760px) { .hero .frame { display: none; } .hero-in { padding-top: 36px; padding-bottom: 40px; } }

/* สินค้า */
.products { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-top: 32px; padding-bottom: 48px; }
.card.prod { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.prod .body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.prod h2 { font-size: 22px; }
.prod .price { font-size: 30px; font-weight: 700; margin-top: 6px; }
.prod .price small { font-size: 15px; color: var(--muted); font-weight: 500; }
.prod ul { margin: 12px 0 20px; padding: 0; list-style: none; color: var(--text-2); }
.prod li { padding-left: 22px; position: relative; margin: 6px 0; }
.prod li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 10px; height: 6px; border-left: 1.75px solid var(--gold); border-bottom: 1.75px solid var(--gold); transform: rotate(-45deg); }
.prod .btn.primary { margin-top: auto; }
.prod .why { margin-top: 10px; font-size: 14px; color: var(--warn); }
.visual { aspect-ratio: 16 / 8; display: grid; place-items: center; }
.visual.cream { background: var(--bg) url(img/arch-pattern-ink.svg) repeat; background-size: 48px 72px; border-bottom: 1px solid var(--line); }
.visual.charcoal { background: var(--charcoal); }
.visual.charcoal img { width: 62%; max-width: 300px; }
/* บัตรสมาชิก (HTML/CSS) */
.pass { width: min(68%, 300px); aspect-ratio: 1.586; border-radius: 14px; background: var(--navy); position: relative; color: var(--gold-hi); padding: 7%; display: flex; flex-direction: column; justify-content: space-between; }
.pass::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgba(217, 190, 138, .55); border-radius: 9px; pointer-events: none; }
.pass img { width: 22%; border-radius: 18%; }
.pass b { font-size: clamp(11px, 2.6vw, 15px); letter-spacing: .32em; font-weight: 600; }
.pass span { font-size: clamp(9px, 2vw, 11px); letter-spacing: .24em; color: #a9a3c2; }
.plans { display: grid; gap: 10px; margin: 16px 0 4px; }
.plan { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; background: #fff; min-height: 56px; }
.plan input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--navy); flex: none; }
.plan b { font-size: 16px; display: block; }
.plan span { color: var(--muted); font-size: 14px; }
.plan .pp { margin-left: auto; font-weight: 700; font-size: 17px; }
.plan:has(input:checked) { border-color: var(--navy); }
.prod .more { margin-top: 10px; font-size: 14px; display: inline-flex; align-items: center; min-height: 40px; }

/* ขั้นตอน + FAQ */
.section-h { font-size: 22px; margin-bottom: 14px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding-bottom: 48px; margin: 0; padding-left: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--navy); color: var(--gold-hi); font-weight: 700; font-size: 14px; }
.steps b { display: block; font-size: 15px; }
.steps span { display: block; font-size: 13px; color: var(--muted); }
.faq { padding-bottom: 48px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; min-height: 48px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-text); font-weight: 700; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--text-2); padding: 0 0 16px; }

footer { color: var(--muted); font-size: 14px; padding: 24px 0 36px; border-top: 1px solid var(--line); }
footer nav { display: flex; flex-wrap: wrap; gap: 0 16px; }
footer a { color: var(--text-2); display: inline-flex; align-items: center; min-height: 40px; }
footer p { margin-top: 4px; }

/* แผ่นสั่งซื้อ */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 18, 43, .5); z-index: 20; display: grid; place-items: end center; }
.sheet { background: var(--card); width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 20px 20px 24px; }
@media (min-width: 640px) { .sheet-bg { place-items: center; } .sheet { border-radius: 20px; } }
.sheet-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet-h h2 { font-size: 19px; }
.sheet-h .price { font-size: 24px; font-weight: 700; }
.x { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; color: var(--text-2); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }

/* หน้าออเดอร์ */
.page { padding-top: 24px; padding-bottom: 48px; }
.page > * + * { margin-top: 14px; }
.ohead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ohead h1 { font-size: 20px; margin-top: 2px; }
.meta { color: var(--muted); font-size: 14px; margin-top: 4px; }
.saved { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--muted); margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.step-h { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.step-h i { font-style: normal; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--gold-hi); font-size: 13px; flex: none; }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 16px auto 0; width: fit-content; }
.qr canvas, .qr img { width: 208px !important; height: 208px !important; }
.amount { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 14px; }
.amount b { font-size: 34px; letter-spacing: -.01em; }
.amount span { color: var(--muted); }
.payto { text-align: center; font-size: 14px; color: var(--text-2); margin-top: 2px; }
.deadline { text-align: center; font-size: 13px; color: var(--warn); margin-top: 8px; }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font: inherit; font-size: 14px; color: var(--text-2); cursor: pointer; text-decoration: none; }
.iconbtn:hover { border-color: var(--gold); color: var(--text); }
.row-c { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.drop { display: grid; place-items: center; gap: 4px; border: 1.5px dashed #cdb98f; border-radius: 14px; padding: 22px; text-align: center; cursor: pointer; margin-top: 14px; color: var(--gold-text); }
.drop:hover { background: #fbf7ee; }
.drop svg { width: 34px; height: 34px; }
.drop b { color: var(--text); font-size: 15px; }
.drop img.pv { max-height: 240px; border-radius: 10px; }
.more-d { margin-top: 14px; font-size: 14px; color: var(--text-2); }
.more-d summary { cursor: pointer; color: var(--gold-text); min-height: 40px; display: flex; align-items: center; gap: 6px; list-style: none; }
.more-d summary::-webkit-details-marker { display: none; }
.more-d summary::after { content: ""; width: 7px; height: 7px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.more-d[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.more-d[open] summary { margin-bottom: 6px; }
.state { text-align: center; }
.state svg.big { width: 48px; height: 48px; color: var(--gold); margin: 4px auto 10px; display: block; }
.state h2 { font-size: 21px; }
.state p { color: var(--text-2); margin-top: 6px; }
.code { font: 700 32px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .08em; text-align: center; background: var(--navy); color: var(--gold-hi); padding: 16px; border-radius: 12px; margin-top: 18px; }
.code.key { font-size: 16px; letter-spacing: .02em; word-break: break-all; }
.howto { margin: 16px 0 0; padding-left: 20px; color: var(--text-2); text-align: left; }
.howto li { margin: 4px 0; }
.wait { display: flex; align-items: center; gap: 14px; text-align: left; }
.spin { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--gold-soft); border-top-color: var(--navy); animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ค้นหาออเดอร์ */
.mine { display: grid; gap: 8px; margin-top: 12px; }
.mine a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); min-height: 52px; background: #fff; }
.mine a .l { flex: 1; min-width: 0; }
.mine a .l b { display: block; font-size: 15px; }
.mine a .l span { display: block; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* เอกสาร */
.doc h1 { font-size: 24px; }
.doc h2 { font-size: 17px; margin-top: 22px; }
.doc p, .doc li { color: var(--text-2); margin-top: 6px; }
.doc ul { padding-left: 20px; margin: 0; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 60; font-size: 15px; max-width: 90vw; }

@media (max-width: 860px) {
  .products { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .products { padding-top: 24px; padding-bottom: 36px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-bottom: 36px; }
  .steps li { padding: 12px; gap: 10px; }
  .card { padding: 20px 18px; }
  .prod .body { padding: 18px 18px 20px; }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } .btn { transition: none; } }
