/* Good Content Books — store.css
   โครงหน้าแบบร้านอีบุ๊กไทย (header ค้นหา + เมนูหมวด + ชั้นหนังสือ) ด้วยโทเคนแบรนด์ Good Content (Warm Ink)
   สี: paper #fff · ink #2c2320 · teal #1f5a55 · gold #ffb703   ฟอนต์: Prompt (หัวเรื่อง) + Noto Sans Thai (เนื้อความ) */

@font-face { font-family: "Prompt"; src: url("/assets/fonts/prompt-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("/assets/fonts/prompt-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("/assets/fonts/prompt-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Prompt"; src: url("/assets/fonts/prompt-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Noto Sans Thai"; src: url("/assets/fonts/noto-sans-thai-var.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62.5% 100%; font-display: swap; }

:root {
  --paper: #ffffff;
  --warm: #f7f4ef;
  --warm-2: #efe9e0;
  --line: #e3ddd4;
  --line-strong: #cfc6ba;
  --ink: #2c2320;
  --ink-2: #4a403b;
  --muted: #6b5e55;
  --teal: #1f5a55;
  --teal-deep: #17413e;
  --teal-tint: #eaf3f2;
  --gold: #ffb703;
  --gold-deep: #e5a500;
  --gold-tint: #fff6dc;
  --rust: #a8320a;
  --ok: #0f5f42;
  --ok-tint: #e8f5ef;
  --focus: #0a7d74;
  --f-display: "Prompt", "Noto Sans Thai", system-ui, sans-serif;
  --f-body: "Noto Sans Thai", "Prompt", system-ui, sans-serif;
  --wrap: 1180px;
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 14px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(44, 35, 32, .06), 0 6px 20px rgba(44, 35, 32, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--f-body); font-size: 16px; line-height: 1.65; color: var(--ink); background: var(--paper); }
img { max-width: 100%; display: block; }
a { color: var(--teal); text-underline-offset: 3px; }
h1, h2, h3, h4 { font-family: var(--f-display); line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 980px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r); z-index: 99; }
.skip:focus { top: 12px; }
.ic { flex: none; }
.kicker { font-family: var(--f-display); font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--teal); margin: 0 0 .4em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid transparent; font-family: var(--f-display); font-weight: 500; font-size: 16px; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--ink); border-color: var(--gold-deep); }
.btn-gold:hover { background: #ffc52e; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #3d322e; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-outline { background: var(--paper); color: var(--ink); border-color: var(--line-strong); }
.btn-outline:hover { border-color: var(--ink); }
.btn-pill { border-radius: var(--pill); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-lg { min-height: 52px; padding: 0 24px; font-size: 17px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.added { background: var(--teal-tint); border-color: var(--teal); color: var(--teal-deep); }

/* ---------- utility bar + masthead (Ookbee: แถบบน 21px + header 92px) ---------- */
.utility { background: var(--warm); font-size: 13px; color: var(--muted); }
.utility-in { display: flex; justify-content: space-between; align-items: center; min-height: 32px; gap: 16px; }
.utility nav { display: flex; gap: 18px; }
.utility a { color: var(--ink-2); text-decoration: none; }
.utility a:hover { text-decoration: underline; }
.masthead { background: var(--paper); border-bottom: 1px solid var(--line); }
.masthead-in { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1; font-family: var(--f-display); }
.brand-text b { font-size: 18px; font-weight: 700; letter-spacing: .06em; }
.brand-text small { font-size: 11px; letter-spacing: .32em; color: var(--teal); margin-top: 4px; }
.search { display: flex; height: 46px; border: 1.5px solid var(--ink); border-radius: var(--r); overflow: hidden; max-width: 620px; width: 100%; justify-self: center; }
.search input { flex: 1; min-width: 0; border: 0; padding: 0 14px; font-size: 15px; background: #fff; }
.search input:focus { outline: none; }
.search:focus-within { box-shadow: 0 0 0 3px rgba(10, 125, 116, .25); }
.search select { border: 0; border-left: 1px solid var(--line); padding: 0 10px; background: var(--warm); font-size: 14px; max-width: 170px; }
.search button { width: 52px; border: 0; background: var(--ink); color: #fff; cursor: pointer; display: grid; place-items: center; }
.mast-actions { display: flex; gap: 10px; }
.cart-btn { position: relative; }
.cart-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--pill); background: var(--ink); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }

/* ---------- category nav (Ookbee: แถบดำ 60px) ---------- */
.catnav { background: var(--teal); }
.catnav ul { list-style: none; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.catnav ul::-webkit-scrollbar { display: none; }
.catnav a { display: flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 16px; color: #fff; text-decoration: none;
  font-family: var(--f-display); font-weight: 500; white-space: nowrap; border-bottom: 3px solid transparent; }
.catnav a:hover { background: var(--teal-deep); }
.catnav a[aria-current="page"] { border-bottom-color: var(--gold); }
.nav-badge { font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: var(--pill); background: var(--gold); color: var(--ink); font-weight: 600; }

/* ---------- notice ---------- */
.notice { background: var(--gold-tint); border-bottom: 1px solid #f1d58a; }
.notice-in { display: flex; align-items: center; gap: 14px; min-height: 64px; padding-top: 8px; padding-bottom: 8px; }
.notice-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); flex: none; }
.notice-in b { font-family: var(--f-display); font-weight: 600; display: block; line-height: 1.4; }
.notice-in span { font-size: 14px; color: var(--ink-2); }
.notice-cta { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-display); font-weight: 500; color: var(--ink); white-space: nowrap; }

/* ---------- hero carousel ---------- */
.hero { background: var(--warm); border-bottom: 1px solid var(--line); }
.hero-in { position: relative; padding-top: 28px; padding-bottom: 46px; }
.slides { position: relative; min-height: 400px; }
.slide { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 32px; min-height: 400px; padding: 0 64px; animation: fadein .45s ease; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.slide-copy h2 { font-size: clamp(28px, 3.6vw, 44px); font-weight: 700; line-height: 1.22; margin-bottom: .45em; }
.slide-copy p { font-size: 18px; color: var(--ink-2); max-width: 32em; }
.slide-art { position: relative; height: 380px; }
.slide-art img { position: absolute; bottom: 0; width: 190px; height: auto; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 18px 40px rgba(44,35,32,.22); }
.slide-art.n1 img { width: 250px; left: 50%; transform: translateX(-50%) rotate(-2deg); bottom: 6px; }
.slide-art.n4 img:nth-child(1) { left: 2%; transform: rotate(-7deg); bottom: 14px; }
.slide-art.n4 img:nth-child(2) { left: 24%; transform: rotate(-2deg); bottom: 26px; z-index: 2; }
.slide-art.n4 img:nth-child(3) { left: 46%; transform: rotate(2deg); bottom: 22px; z-index: 3; }
.slide-art.n4 img:nth-child(4) { left: 66%; transform: rotate(7deg); bottom: 10px; z-index: 1; }
.slide-art.n5 img { width: 170px; }
.slide-art.n5 img:nth-child(1) { left: 0; transform: rotate(-9deg); bottom: 10px; }
.slide-art.n5 img:nth-child(2) { left: 17%; transform: rotate(-4deg); bottom: 26px; z-index: 2; }
.slide-art.n5 img:nth-child(3) { left: 35%; transform: rotate(0); bottom: 36px; z-index: 4; }
.slide-art.n5 img:nth-child(4) { left: 53%; transform: rotate(4deg); bottom: 26px; z-index: 3; }
.slide-art.n5 img:nth-child(5) { left: 70%; transform: rotate(9deg); bottom: 10px; z-index: 1; }
.hero-nav { position: absolute; top: calc(28px + 200px - 25px); width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: #fff; color: var(--ink); cursor: pointer; display: grid; place-items: center; box-shadow: var(--shadow); z-index: 5; }
.hero-nav.prev { left: 8px; } .hero-nav.next { right: 8px; }
.dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: var(--line-strong); cursor: pointer; }
.dot[aria-current="true"] { width: 28px; border-radius: var(--pill); background: var(--teal); }
.hero-pause { border: 0; background: none; font-size: 13px; color: var(--muted); cursor: pointer; text-decoration: underline; min-height: 24px; }

/* ---------- shelves (Ookbee: ชั้นหนังสือ 517px, การ์ด 170 ห่าง 185) ---------- */
.shelves { padding-top: 8px; }
.shelf { padding: 34px 0 10px; border-bottom: 1px solid var(--line); }
.shelf:last-child { border-bottom: 0; }
.shelf-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.shelf-head h2 { font-size: 26px; font-weight: 700; margin: 0; }
.shelf-head p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.shelf-more { display: inline-flex; align-items: center; gap: 2px; color: var(--ink); font-family: var(--f-display); font-weight: 500; text-decoration: none; white-space: nowrap; }
.shelf-more:hover { color: var(--teal); }
.shelf-track { position: relative; }
.shelf-row { display: grid; grid-auto-flow: column; grid-auto-columns: 170px; gap: 18px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 2px 18px; scrollbar-width: thin; }
.shelf-row > .card { scroll-snap-align: start; }
.shelf-nav { position: absolute; top: 88px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff;
  color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); z-index: 3; }
.shelf-nav.prev { left: -20px; } .shelf-nav.next { right: -20px; }
.shelf-nav[disabled] { opacity: 0; pointer-events: none; }

/* ---------- book card ---------- */
.card { display: flex; flex-direction: column; min-width: 0; }
.card-cover { display: block; aspect-ratio: 148 / 210; border-radius: 3px; overflow: hidden; background: var(--warm-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 6px 14px rgba(44,35,32,.12); transition: transform .2s, box-shadow .2s; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 14px 26px rgba(44,35,32,.18); }
.card-body { display: flex; flex-direction: column; flex: 1; padding-top: 12px; }
.card-title { font-size: 16px; font-weight: 600; line-height: 1.4; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--teal); }
.card-meta { font-size: 13px; color: var(--muted); margin: 0 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { margin: auto 0 10px; }
.price-now { font-family: var(--f-display); font-weight: 700; font-size: 20px; color: var(--teal); }
.card-actions { display: flex; flex-direction: column; gap: 6px; }
.card-actions .btn { width: 100%; }
.card-sample { font-size: 14px; text-align: center; color: var(--ink-2); padding: 4px 0; }

/* ---------- promo strip (Ookbee: แบนเนอร์คู่) ---------- */
.promo { padding: 34px 0 24px; border-bottom: 1px solid var(--line); }
.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bundle { display: grid; grid-template-columns: 210px 1fr; gap: 20px; align-items: center; padding: 22px; border-radius: var(--r-lg);
  background: var(--teal); color: #fff; overflow: hidden; }
.bundle .kicker { color: var(--gold); }
.bundle h3 { font-size: 22px; margin-bottom: .4em; }
.bundle-fan { position: relative; height: 150px; }
.bundle-fan img { position: absolute; bottom: 0; width: 82px; height: auto; border-radius: 2px; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.bundle-fan img:nth-child(1) { left: 0; transform: rotate(-8deg); }
.bundle-fan img:nth-child(2) { left: 30px; transform: rotate(-3deg); z-index: 2; bottom: 8px; }
.bundle-fan img:nth-child(3) { left: 62px; transform: rotate(2deg); z-index: 3; bottom: 12px; }
.bundle-fan img:nth-child(4) { left: 94px; transform: rotate(6deg); z-index: 2; bottom: 6px; }
.bundle-fan img:nth-child(5) { left: 122px; transform: rotate(9deg); z-index: 1; }
.bundle-fan img:nth-child(6) { display: none; }
.bundle-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.bundle .price-now { color: var(--gold); font-size: 26px; }
.bundle s { opacity: .75; }
.save { font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: var(--pill); background: var(--gold); color: var(--ink); }
.bundle-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.bundle .link-more { color: #fff; }
.bundle-launch { font-size: 14px; color: #f3e7c6; }
.bundle-big { grid-template-columns: 300px 1fr; padding: 30px; margin-bottom: 22px; }
.bundle-big .bundle-fan { height: 220px; }
.bundle-big .bundle-fan img { width: 112px; }
.bundle-big .bundle-fan img:nth-child(2) { left: 40px; } .bundle-big .bundle-fan img:nth-child(3) { left: 84px; }
.bundle-big .bundle-fan img:nth-child(4) { left: 128px; } .bundle-big .bundle-fan img:nth-child(5) { left: 170px; }
.bundle-why { color: #e6efee; max-width: 46em; }
.bundle-list { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 0 0 16px; }
.bundle-list a { display: inline-block; font-size: 14px; color: #fff; padding: 4px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: var(--pill); text-decoration: none; }
.bundle-list a:hover { background: rgba(255,255,255,.12); }
.bundle#bundle-F { background: var(--ink); }

/* ---------- services ---------- */
.services { background: var(--warm); border-top: 1px solid var(--line); margin-top: 30px; }
.services ul { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding: 30px 0; }
.services li { display: flex; gap: 14px; align-items: flex-start; }
.svc-ic { width: 48px; height: 48px; border-radius: 12px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--teal); flex: none; }
.services b { font-family: var(--f-display); font-weight: 600; display: block; margin-bottom: 2px; }
.services p { margin: 0; font-size: 14px; color: var(--muted); }

/* ---------- footer ---------- */
.foot-promo { background: var(--ink); color: #fff; overflow: hidden; }
.foot-promo-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; min-height: 360px; padding-top: 40px; padding-bottom: 40px; }
.foot-fan { position: relative; height: 260px; }
.foot-fan img { position: absolute; bottom: 0; width: 120px; border-radius: 2px; box-shadow: 0 10px 26px rgba(0,0,0,.45); }
.foot-fan img:nth-child(1) { left: 0; transform: rotate(-10deg); }
.foot-fan img:nth-child(2) { left: 13%; transform: rotate(-6deg); bottom: 14px; z-index: 2; }
.foot-fan img:nth-child(3) { left: 26%; transform: rotate(-2deg); bottom: 24px; z-index: 3; }
.foot-fan img:nth-child(4) { left: 39%; transform: rotate(1deg); bottom: 30px; z-index: 5; }
.foot-fan img:nth-child(5) { left: 52%; transform: rotate(4deg); bottom: 24px; z-index: 4; }
.foot-fan img:nth-child(6) { left: 65%; transform: rotate(7deg); bottom: 14px; z-index: 3; }
.foot-fan img:nth-child(7) { left: 78%; transform: rotate(10deg); z-index: 2; }
.foot-copy .kicker { color: var(--gold); }
.foot-copy h2 { font-size: clamp(34px, 4vw, 48px); font-weight: 700; margin-bottom: .2em; }
.foot-copy p { color: #e9e2db; font-size: 17px; }
.foot-price { display: flex; gap: 12px; align-items: baseline; }
.foot-price .price-now { color: var(--gold); font-size: 30px; }
.foot-links { background: #1d1715; color: #cfc6bd; font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-top: 40px; padding-bottom: 28px; }
.foot-grid h3 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.foot-grid ul { list-style: none; display: grid; gap: 8px; }
.foot-grid a { color: #cfc6bd; text-decoration: none; }
.foot-grid a:hover { color: #fff; text-decoration: underline; }
.brand-foot { color: #fff; margin-bottom: 12px; }
.foot-legal { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 26px; border-top: 1px solid #3a302c; font-size: 13px; color: #a89d93; }

/* ---------- page heads / crumbs / grid ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 18px 0 6px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.crumbs a { color: var(--ink-2); }
.page-head { padding: 10px 0 22px; }
.page-head h1 { font-size: clamp(28px, 3.2vw, 38px); font-weight: 700; margin-bottom: .2em; }
.page-head p { color: var(--ink-2); max-width: 46em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 28px 22px; padding-bottom: 30px; }
.sec-title { font-size: 24px; margin: 26px 0 16px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line-strong); background: #fff; cursor: pointer; font-size: 15px; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sort { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.sort select, input[type="email"], input[type="text"], input[type="password"], input:not([type]), .copyrow input {
  min-height: 46px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; font-size: 16px; }
.empty { text-align: center; padding: 48px 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--warm); }
.empty.big { border: 0; background: none; padding: 80px 20px; }
.empty .btn { margin: 4px; }

/* ---------- product detail ---------- */
.pdp { display: grid; grid-template-columns: 300px 1fr 300px; gap: 36px; padding: 8px 0 30px; align-items: start; }
.pdp-cover { position: sticky; top: 16px; display: grid; gap: 14px; }
.pdp-cover img { width: 100%; height: auto; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 20px 40px rgba(44,35,32,.2); }
.pdp-main h1 { font-size: clamp(30px, 3.4vw, 42px); font-weight: 700; margin-bottom: .2em; }
.pdp-sub { font-size: 19px; color: var(--ink-2); }
.pdp-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; margin: 20px 0; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pdp-facts dt { font-size: 13px; color: var(--muted); } .pdp-facts dd { margin: 0; font-weight: 500; }
.pdp-hook { font-size: 18px; line-height: 1.75; }
.honest { display: flex; gap: 10px; padding: 12px 14px; background: var(--warm); border-radius: var(--r); font-size: 15px; color: var(--ink-2); }
.honest .ic { color: var(--teal); margin-top: 3px; }
.buybox { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 12px; background: #fff; box-shadow: var(--shadow); }
.buybox-price .price-now { font-size: 34px; }
.buybox-notes { list-style: none; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); padding: 6px 0 2px; }
.buybox-notes li { display: flex; gap: 8px; align-items: center; } .buybox-notes .ic { color: var(--teal); }
.in-bundle { border-top: 1px solid var(--line); padding-top: 14px; font-size: 15px; }
.in-bundle p { margin-bottom: 10px; }
.pdp-tabs { border-top: 1px solid var(--line); margin-bottom: 20px; }
[role="tablist"] { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
[role="tab"] { min-height: 52px; padding: 0 18px; border: 0; background: none; font-family: var(--f-display); font-weight: 500; font-size: 17px; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
[role="tab"][aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
[role="tabpanel"] { padding: 26px 0; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.about-grid h2 { font-size: 20px; margin-top: 4px; }
.outcomes { list-style: none; display: grid; gap: 12px; }
.outcomes li { display: flex; gap: 10px; } .outcomes .ic { color: var(--ok); margin-top: 4px; }
.forwho { padding-left: 1.2em; display: grid; gap: 8px; margin-bottom: 22px; }
.fw { list-style: none; display: grid; gap: 10px; margin-bottom: 22px; }
.fw li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.fw b { display: block; font-family: var(--f-display); } .fw span { font-size: 14px; color: var(--muted); }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { display: inline-block; padding: 4px 12px; border-radius: var(--pill); background: var(--teal-tint); color: var(--teal-deep); text-decoration: none; font-size: 14px; }
.toc-sum { color: var(--muted); }
.toc { columns: 2; column-gap: 40px; }
.toc-part { break-inside: avoid; margin-bottom: 22px; }
.toc-part h4 { font-size: 16px; color: var(--teal); }
.toc-part ol { list-style: none; display: grid; gap: 6px; }
.toc-part li { display: flex; gap: 12px; }
.toc-n { font-family: var(--f-display); font-weight: 600; color: var(--muted); min-width: 24px; }
.spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.spec div { padding: 14px; background: var(--warm); border-radius: var(--r); }
.spec dt { font-size: 13px; color: var(--muted); } .spec dd { margin: 0; font-weight: 500; }

/* ---------- cart / checkout / order ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 30px; align-items: start; padding-bottom: 40px; }
.cart-list { list-style: none; display: grid; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); }
.cart-item img { width: 64px; border-radius: 2px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.cart-item h3 { font-size: 17px; margin: 0; } .cart-item p { margin: 0; font-size: 14px; color: var(--muted); }
.cart-item .price-now { font-size: 18px; }
.icon-btn { width: 44px; height: 44px; border-radius: var(--r); border: 1px solid transparent; background: none; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.icon-btn:hover { border-color: var(--line-strong); color: var(--rust); }
.cart-hint { margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: var(--gold-tint); font-size: 15px; }
.summary { position: sticky; top: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; background: var(--warm); }
.summary h2 { font-size: 20px; }
.sum-lines { list-style: none; display: grid; gap: 8px; margin-bottom: 14px; font-size: 15px; }
.sum-lines li { display: flex; justify-content: space-between; gap: 12px; }
.sum-total { display: grid; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line-strong); margin: 0 0 12px; }
.sum-total div { display: flex; justify-content: space-between; } .sum-total dd { margin: 0; }
.sum-total .save dd { color: var(--ok); font-weight: 600; }
.sum-total .total { font-family: var(--f-display); font-size: 22px; font-weight: 700; }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; margin-bottom: 20px; background: #fff; }
.panel h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.panel label { display: block; font-weight: 500; margin: 10px 0 6px; }
.panel input[type="email"] { width: 100%; }
.rail { display: flex !important; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--teal); border-radius: var(--r); background: var(--teal-tint); cursor: pointer; }
.rail span { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.rail small { grid-column: 2; color: var(--muted); font-weight: 400; }
.check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; margin: 18px 0 !important; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--teal); }
.field-err, .form-err { color: var(--rust); font-size: 15px; margin: 6px 0; }
.pay { display: grid; grid-template-columns: 300px 1fr; gap: 30px; align-items: start; }
.pay-qr { text-align: center; }
.qr { width: 260px; height: 260px; margin: 0 auto 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); }
.qr img, .qr canvas { width: 100% !important; height: auto !important; }
.pay-amount { font-size: 18px; } .pay-amount b { font-family: var(--f-display); font-size: 26px; color: var(--teal); }
.pay-steps ol { padding-left: 1.3em; display: grid; gap: 6px; margin-bottom: 18px; }
.drop { display: flex !important; align-items: center; gap: 12px; padding: 18px; border: 2px dashed var(--line-strong); border-radius: var(--r); cursor: pointer; font-weight: 400 !important; color: var(--ink-2); }
.drop:hover { border-color: var(--teal); }
#slip { position: absolute; opacity: 0; width: 1px; height: 1px; }
#slip:focus-visible + * , .drop:focus-within { outline: 3px solid var(--focus); }
form[data-slip] .btn { margin-top: 12px; }
.access-list { list-style: none; display: grid; gap: 10px; }
.access-list li { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); }
.access-list img { width: 52px; border-radius: 2px; }
.copyrow { display: flex; gap: 8px; } .copyrow input { flex: 1; min-width: 0; }
.keep { background: var(--gold-tint); border-color: #f1d58a; }
.order-list { list-style: none; display: grid; gap: 8px; }
.order-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); flex-wrap: wrap; }
.status { font-size: 13px; padding: 3px 10px; border-radius: var(--pill); background: var(--warm-2); white-space: nowrap; }
.status.issued { background: var(--ok-tint); color: var(--ok); } .status.pending_review { background: var(--gold-tint); }
.status.cancelled { background: #f6e6e1; color: var(--rust); }
.lib-grid .card-price { display: none; }

/* ---------- prose / help ---------- */
.prose { padding-bottom: 40px; } .prose h1 { font-size: 36px; } .prose h2 { font-size: 22px; margin-top: 30px; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.steps li { counter-increment: s; padding: 18px 18px 18px 64px; position: relative; border: 1px solid var(--line); border-radius: var(--r-lg); }
.steps li::before { content: counter(s); position: absolute; left: 18px; top: 16px; width: 32px; height: 32px; border-radius: 50%; background: var(--gold); display: grid; place-items: center; font-family: var(--f-display); font-weight: 700; }
.steps p { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; padding: 12px 0; font-family: var(--f-display); font-weight: 500; font-size: 17px; min-height: 44px; }
.faq p { color: var(--ink-2); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r);
  box-shadow: var(--shadow); z-index: 60; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); }
.toast a { color: var(--gold); font-weight: 600; }

/* ---------- reader ---------- */
body.reader { background: #3b3330; min-height: 100vh; }
.r-bar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; padding: 8px 16px; background: var(--ink); color: #fff; }
.r-back { display: flex; }
.r-title { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.r-title b { font-family: var(--f-display); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-title small { color: #cfc6bd; font-size: 13px; }
.r-tools { display: flex; align-items: center; gap: 8px; }
.r-btn { width: 40px; height: 40px; border-radius: var(--r); border: 1px solid #5a4e49; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; }
.r-zoom, .r-page { font-size: 14px; color: #e6ddd4; min-width: 52px; text-align: center; }
.r-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 12px 60px; outline: none; }
.r-pagebox { position: relative; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.r-pagebox canvas { display: block; }
.r-mark { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 11px; color: rgba(44,35,32,.45); pointer-events: none; font-family: var(--f-body); }
.r-end { color: #fff; text-align: center; max-width: 520px; padding: 30px 20px; }
.r-end h2 { color: #fff; } .r-end p { color: #e6ddd4; }
.r-err { position: fixed; inset: 64px 16px auto; max-width: 520px; margin: 40px auto; background: #fff; padding: 28px; border-radius: var(--r-lg); text-align: center; }

/* ---------- admin ---------- */
body.admin { background: var(--warm); }
.admin-bar { background: #fff; border-bottom: 1px solid var(--line); padding: 12px 0; }
.admin-login { max-width: 420px; margin: 60px auto; }
.admin-login input { width: 100%; margin-bottom: 14px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 26px 0 14px; }
.admin-head h1 { margin: 0; }
.a-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
.a-stats div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; } .a-stats dt { font-size: 13px; color: var(--muted); } .a-stats dd { margin: 0; font-weight: 600; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.a-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.a-table th, .a-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.a-table th { background: var(--warm); font-family: var(--f-display); font-weight: 500; white-space: nowrap; }
.a-table td.act { white-space: nowrap; } .a-table td.act .btn { margin: 2px; }
.slip-dlg { border: 0; border-radius: var(--r-lg); padding: 16px; max-width: min(520px, 92vw); }
.slip-dlg img { max-height: 70vh; margin: 0 auto 12px; }

/* ---------- mobile buy bar (หน้ารายละเอียดเล่ม) ---------- */
.buybar { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .pdp { grid-template-columns: 260px 1fr; }
  .buybox { grid-column: 2; position: static; }
}
@media (max-width: 900px) {
  .masthead-in { grid-template-columns: auto auto; gap: 12px 16px; padding-top: 12px; padding-bottom: 12px; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .mast-actions { justify-self: end; }
  .slide { grid-template-columns: 1fr; padding: 0 8px; gap: 8px; min-height: 0; }
  .slides { min-height: 0; }
  .slide-art { height: 230px; order: -1; }
  .slide-art img { width: 120px; } .slide-art.n1 img { width: 160px; } .slide-art.n5 img { width: 112px; }
  .hero-nav { display: none; }
  .promo-grid { grid-template-columns: 1fr; }
  .services ul { grid-template-columns: 1fr; gap: 16px; }
  .foot-promo-in { grid-template-columns: 1fr; }
  .foot-fan { height: 200px; } .foot-fan img { width: 92px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .pdp { grid-template-columns: 1fr; }
  .pdp-cover { position: static; max-width: 280px; margin: 0 auto; }
  .buybox { grid-column: auto; }
  .about-grid, .cart-layout, .pay { grid-template-columns: 1fr; }
  .toc { columns: 1; } .spec { grid-template-columns: 1fr 1fr; }
  .summary { position: static; }
  .steps { grid-template-columns: 1fr; }
  .shelf-nav { display: none; }
  .buybar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(44,35,32,.08); }
  .buybar > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
  .buybar b { font-family: var(--f-display); font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buybar .price-now { font-size: 20px; }
  body.pdp-page { padding-bottom: 76px; }
  body.pdp-page .toast { bottom: 90px; }
  .slide-art.n5 img:nth-child(1) { left: 2%; }
}
@media (max-width: 560px) {
  .utility-note { display: none; } .utility-in { justify-content: center; }
  .mast-actions .btn span:not(.cart-count) { display: none; }
  .mast-actions .btn { padding: 0 12px; }
  .search select { max-width: 92px; }
  .brand-text b { font-size: 16px; }
  .notice-cta { display: none; }
  .shelf-head h2 { font-size: 22px; }
  .shelf-row { grid-auto-columns: 142px; gap: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .bundle, .bundle-big { grid-template-columns: 1fr; padding: 20px; }
  .bundle-fan, .bundle-big .bundle-fan { height: 140px; }
  .bundle-big .bundle-fan img { width: 82px; }
  .bundle-big .bundle-fan img:nth-child(2) { left: 30px; } .bundle-big .bundle-fan img:nth-child(3) { left: 62px; }
  .bundle-big .bundle-fan img:nth-child(4) { left: 94px; } .bundle-big .bundle-fan img:nth-child(5) { left: 122px; }
  .cart-item { grid-template-columns: 52px 1fr auto; } .cart-item img { width: 52px; }
  .cart-item .price-now { grid-column: 2; grid-row: 2; }
  .cart-item .icon-btn { grid-column: 3; grid-row: 1 / span 2; }
  .access-list li { grid-template-columns: 44px 1fr; } .access-list li .btn { grid-column: span 1; }
  .foot-grid { grid-template-columns: 1fr; }
  .r-zoom, .r-tools [data-r-zoom] { display: none; }
  .r-tools .btn span { display: none; }
  .spec, .pdp-facts { grid-template-columns: 1fr; }
}
