/* pakmud — mobile first, big clear type for older eyes. Text size: html[data-size] 1–6 (14/16/18/20/24/28 px), the
   pages start at 4 so the buttons go both ways.
   Colours from the ปักหมุด brand (brand/brand.mjs): แดงพริก #f2553d, ครีมข้าวเหนียว #fff3e2, โกโก้ #3b2620. The brand red is
   3.4:1 against white, so it carries the mascot, lines and fills, while text and button fills use --accent, a deeper
   chili (≥ 4.7:1 on the cream, 5.2:1 under white text); --soft is ≥ 7.9:1 for small text. */
:root { --fs: 20px; --ink: #3b2620; --bg: #fff3e2; --brand: #f2553d; --accent: #c8381f; --line: #f0dcc3; --soft: #5c463e; --card: #FFFFFF; --blush: #ffe3dc; --butter: #fff0c2; }
html[data-size="1"] { --fs: 14px; }
html[data-size="2"] { --fs: 16px; }
html[data-size="3"] { --fs: 18px; }
html[data-size="5"] { --fs: 24px; }
html[data-size="6"] { --fs: 28px; }
* { box-sizing: border-box; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs)/1.6 Sarabun, 'Noto Sans Thai', Thonburi, system-ui, sans-serif; }
/* Everything people read is Sarabun (looped Thai, the user's choice 2026-11-01); Mitr, the brand face, is used only for the
   ปักหมุด wordmark next to the mascot. */
img { max-width: 100%; display: block; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
h1 { font-size: 1.5em; line-height: 1.3; margin: 18px 0 10px; font-weight: 700; }
h2 { font-size: 1.25em; line-height: 1.3; margin: 26px 0 10px; font-weight: 700; }
h3 { font-size: 1.1em; line-height: 1.3; margin: 10px 0 6px; font-weight: 600; }
p { margin: 8px 0; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--soft); font-size: 0.9em; }
.note { color: var(--soft); font-size: 0.92em; }

/* header */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 3px solid var(--brand); }
.top .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.35em; font-family: Mitr, Sarabun, 'Noto Sans Thai', Thonburi, system-ui, sans-serif; }
.logo svg { width: 36px; height: 45px; flex: none; }
.size { display: flex; gap: 8px; }
.size button { min-width: 56px; min-height: 56px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.size button:active { background: var(--line); }

/* buttons */
.btn { min-height: 56px; display: flex; align-items: center; justify-content: center; width: 100%; padding: 0 16px; margin: 10px 0;
  border: 2px solid var(--accent); border-radius: 14px; font: inherit; font-size: 1.05em; font-weight: 600; line-height: 1.3;
  color: var(--accent); background: var(--card); text-decoration: none; text-align: center; cursor: pointer; }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.secondary { border-color: var(--line); color: var(--ink); }
.btn:disabled { opacity: .6; cursor: wait; }

/* home */
.tagline { font-size: 1.1em; font-weight: 600; margin: 16px 0 12px; }
.notfound { background: var(--blush); border: 2px solid var(--brand); border-radius: 12px; padding: 10px 14px; margin-top: 16px; }
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
@media (min-width: 480px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { display: block; background: var(--card); border: 2px solid var(--line); border-radius: 16px; overflow: hidden; color: var(--ink); text-decoration: none; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.card .body { padding: 12px 14px 14px; }
.card h2 { font-size: 1.1em; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.guide { padding: 16px; }
.card.guide h2 { margin-top: 0; }
.price { margin: 0; color: var(--accent); font-weight: 700; font-size: 1.15em; }
.price small { color: var(--soft); font-weight: 400; font-size: 0.75em; }

/* product page */
.gallery { margin-top: 12px; }
#main { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--card); border: 2px solid var(--line); border-radius: 16px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; -webkit-overflow-scrolling: touch; }
.thumb { flex: 0 0 auto; border: 2px solid transparent; border-radius: 10px; overflow: hidden; }
.thumb.active { border-color: var(--brand); }
.thumb img { width: 72px; height: 72px; object-fit: cover; }
.pricebox { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.pricebox .price { font-size: 1.35em; }
.buy { margin: 4px 0 8px; }
.buy .btn { font-size: 1.15em; min-height: 60px; margin: 10px 0 6px; }
.buy .muted { margin: 0; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.options.priced { grid-template-columns: 1fr; }
.opt { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px; margin: 0; }
.opt img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 10px; }
.opt h3 { margin: 8px 0 2px; text-align: center; }
.opt .names { margin: 0; text-align: center; color: var(--soft); font-size: 0.9em; }
.opt .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.opt .row .amount { font-weight: 700; color: var(--accent); white-space: nowrap; text-align: right; }
.stock { display: block; color: var(--accent); font-weight: 400; font-size: 0.85em; white-space: normal; }
.hint { font-size: 0.9em; color: var(--soft); margin: 4px 0 0; }
.details .board { white-space: pre-line; }
.details dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 0 10px; }
.details dt { color: var(--soft); }
.details dd { margin: 0; }
.howto { background: var(--card); border: 2px solid var(--brand); border-radius: 16px; padding: 16px; margin: 26px 0 16px; }
#howto { scroll-margin-top: 84px; }   /* the sticky header is 64 px + the brand line */
.howto h2 { margin-top: 0; }
.howto ol { padding-left: 1.3em; margin: 0 0 6px; }
.howto li { margin: 8px 0; }
.howto .btn.share { margin-top: 14px; }
.bar { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin: 0 -16px;   /* the question label is the longer one */
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); }
.bar .btn { margin: 0; padding: 0 8px; font-size: 0.95em; }   /* "สั่งไม่เป็น? ถามเพจ" on one line at 390 px */

/* footer */
footer { padding: 24px 0 40px; text-align: center; font-size: 0.95em; border-top: 1px solid var(--line); margin-top: 24px; }
footer .btn { max-width: 420px; margin: 0 auto 10px; }
