/* TangChang.art — หมึก กระดาษ ตราประทับ */
:root {
  --ink: #141210;
  --ink-2: #2a2622;
  --paper: #f7f4ee;
  --card: #ffffff;
  --text: #1d1a17;
  --muted: #6e675e;
  --line: #e4ddd2;
  --seal: #a3281d;
  --seal-dark: #861f16;
  --ok: #2f6b3a;
  --warn: #8a5a00;
  --err: #a3281d;
  --radius: 10px;
  --serif: "Noto Serif Thai", "Songti SC", Georgia, serif;
  --sans: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1180px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 16px/1.7 var(--sans); }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.3; margin: 0 0 .6em; }
h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: #fff; padding: 8px 12px; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.site-header { background: var(--ink); color: #f2eee6; position: sticky; top: 0; z-index: 40; }
.header-row { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand img { height: 30px; width: auto; filter: invert(1); }
.main-nav { display: flex; gap: 22px; font-size: .95rem; }
.main-nav a { text-decoration: none; color: #cfc8bc; padding: 6px 0; border-bottom: 1px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current] { color: #fff; border-bottom-color: var(--seal); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.search input { background: var(--ink-2); border: 1px solid #3a352f; color: #fff; border-radius: 99px; padding: 7px 14px; width: 200px; font: inherit; font-size: .9rem; }
.search input::placeholder { color: #8f877b; }
.lang { text-decoration: none; font-size: .85rem; color: #cfc8bc; padding: 6px 8px; border: 1px solid #3a352f; border-radius: 6px; margin: 0 4px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: #e9e4da; background: none; border: 0; border-radius: 8px; cursor: pointer; }
.icon-btn:hover { background: var(--ink-2); }
.cart-count { position: absolute; top: 3px; right: 1px; background: var(--seal); color: #fff; font-size: .7rem; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; font-weight: 600; }
.menu-btn { display: none; }

@media (max-width: 920px) {
  .header-row { gap: 12px; height: 60px; }
  .brand img { height: 24px; }
  .search { display: none; }
  .menu-btn { display: inline-flex; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 60px; background: var(--ink); flex-direction: column; gap: 0; padding: 8px 20px 18px; border-top: 1px solid #2c2824; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid #2c2824; }
  .main-nav::after { content: ""; }
}

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 500; padding: 11px 22px; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; transition: background .15s, transform .05s; }
.btn:hover { background: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn-seal { background: var(--seal); border-color: var(--seal); }
.btn-seal:hover { background: var(--seal-dark); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: rgba(0,0,0,.04); }
.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--seal); text-decoration: underline; cursor: pointer; }

label { display: block; font-size: .9rem; font-weight: 500; margin-bottom: 4px; }
.field { margin-bottom: 14px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search]:not(.search input), input[type=password], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(163, 40, 29, .25); border-color: var(--seal); }
textarea { min-height: 90px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 6px; accent-color: var(--seal); }
.req::after { content: " *"; color: var(--seal); }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- flash / toast ---------- */
.flash-stack { margin-top: 16px; display: grid; gap: 8px; }
.flash { padding: 12px 16px; border-radius: 8px; background: #eef5ee; color: var(--ok); border: 1px solid #cfe3d1; }
.flash-err { background: #fbeeec; color: var(--err); border-color: #f0cfca; }
.flash-warn { background: #fdf5e6; color: var(--warn); border-color: #f1dfb8; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
.toast a { color: #fff; font-weight: 600; margin-left: 10px; }

/* ---------- home ---------- */
.hero { background: #0d0c0b; }
.hero picture img { width: 100%; max-height: 640px; object-fit: cover; object-position: 70% 30%; }
.hero-bar { background: var(--ink); color: #e8e2d8; }
.hero-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 20px; flex-wrap: wrap; }
.hero-bar p { margin: 0; max-width: 640px; color: #c9c1b4; }
.section { padding: 56px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head a { color: var(--seal); text-decoration: none; font-weight: 500; white-space: nowrap; }
.about-band { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.about-grid .quote { font-family: var(--serif); font-size: 1.25rem; line-height: 1.7; }
.link-cards { display: grid; gap: 12px; }
.link-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--paper); transition: border-color .15s; }
.link-card:hover { border-color: var(--seal); }
.link-card strong { display: block; font-family: var(--serif); }
.link-card span { color: var(--muted); font-size: .9rem; }
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 32px 24px; }
.card { display: flex; flex-direction: column; text-decoration: none; }
.card-img { position: relative; aspect-ratio: 3 / 4; background: #ebe6dc; border-radius: 6px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card-img::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); border-radius: 6px; pointer-events: none; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: .75rem; padding: 3px 9px; border-radius: 99px; z-index: 1; }
.badge-ebook { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.badge-out { background: #fff; color: var(--muted); }
.card-body { padding-top: 12px; }
.card-title { font-family: var(--serif); font-size: 1.02rem; line-height: 1.45; margin: 0 0 4px; }
.card-sub { color: var(--muted); font-size: .85rem; margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 600; }
.price s { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: .9em; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 24px 14px; } .card-title { font-size: .95rem; } }

/* ---------- shop ---------- */
.page-head { padding: 36px 0 8px; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 12px 0 28px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { text-decoration: none; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--line); background: #fff; font-size: .9rem; }
.chip[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
.toolbar select { width: auto; padding: 7px 10px; }
.empty { text-align: center; padding: 60px 0; color: var(--muted); }

/* ---------- product ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; padding: 28px 0 56px; align-items: start; }
.gallery-main { background: #ebe6dc; border-radius: 8px; overflow: hidden; aspect-ratio: 3 / 4; display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden; width: 68px; aspect-ratio: 3/4; cursor: pointer; background: #ebe6dc; }
.thumbs button[aria-current=true] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-info { position: sticky; top: 96px; }
.product-info h1 { margin-bottom: .3em; }
.product-sub { color: var(--muted); margin-bottom: 18px; }
.formats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.format { border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; text-align: left; font: inherit; }
.format small { display: block; color: var(--muted); font-size: .8rem; }
.format strong { font-size: 1.15rem; }
.format[aria-pressed=true] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.big-price { font-size: 1.6rem; font-weight: 600; margin: 8px 0 4px; }
.stock-note { font-size: .9rem; color: var(--muted); }
.stock-note.low { color: var(--warn); }
.buy-row { display: flex; gap: 10px; margin: 18px 0 10px; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qty button { width: 40px; border: 0; background: none; font-size: 1.1rem; cursor: pointer; }
.qty input { width: 48px; text-align: center; border: 0; padding: 10px 0; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy-row .btn { flex: 1; }
.perks { list-style: none; padding: 16px 0 0; margin: 18px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; font-size: .92rem; color: var(--muted); }
.perks li::before { content: "—"; color: var(--seal); margin-right: 8px; }
.prose { max-width: 720px; }
.prose img { border-radius: 6px; margin: 1em 0; }
.prose a { color: var(--seal); }
.prose table { border-collapse: collapse; width: 100%; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; }
.desc { padding: 0 0 56px; }
.desc h2 { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 18px; }
.sku { font-size: .85rem; color: var(--muted); margin-top: 12px; }
@media (max-width: 860px) {
  .product { grid-template-columns: 1fr; gap: 24px; padding-top: 16px; }
  .product-info { position: static; }
  .gallery-main { aspect-ratio: auto; max-height: 70vh; }
}

/* ---------- cart / checkout ---------- */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; padding: 24px 0 64px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.panel + .panel { margin-top: 18px; }
.panel h2 { font-size: 1.15rem; }
.summary { position: sticky; top: 96px; }
.lines { list-style: none; padding: 0; margin: 0; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line:last-child { border-bottom: 0; }
.line img { width: 72px; aspect-ratio: 3/4; object-fit: cover; border-radius: 4px; background: #ebe6dc; }
.line-title { font-family: var(--serif); text-decoration: none; display: block; line-height: 1.4; }
.line .qty { margin-top: 6px; }
.line-sm { grid-template-columns: 48px 1fr auto; padding: 10px 0; font-size: .92rem; }
.line-sm img { width: 48px; }
.totals { margin: 14px 0 0; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.15rem; font-weight: 600; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.free-meter { font-size: .88rem; margin: 12px 0 0; color: var(--muted); }
.free-meter .bar { height: 4px; background: var(--line); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.free-meter .bar span { display: block; height: 100%; background: var(--seal); }
.options { display: grid; gap: 10px; }
.option { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; font-weight: 400; margin: 0; background: #fff; }
.option input { margin-top: 6px; accent-color: var(--ink); }
.option:has(input:checked) { border-color: var(--ink); }
.option .opt-main { flex: 1; }
.option .opt-price { font-weight: 600; white-space: nowrap; }
.option small { display: block; color: var(--muted); }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .summary { position: static; } }

/* ---------- order ---------- */
.status-pill { display: inline-block; padding: 4px 12px; border-radius: 99px; font-size: .85rem; background: #eee8de; }
.st-pending { background: #fdf0d5; color: #7a5200; }
.st-review { background: #e7eefb; color: #23468a; }
.st-paid, .st-completed { background: #e2f0e4; color: var(--ok); }
.st-shipped { background: #e0eef0; color: #1d5b63; }
.st-cancelled { background: #f1e3e1; color: var(--err); }
.pay-box { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; }
.qr-head { background: #113566; color: #fff; border-radius: 6px; padding: 6px; font-weight: 600; font-size: .85rem; letter-spacing: .03em; }
.qr canvas, .qr img { margin: 10px auto; width: 190px; height: 190px; image-rendering: pixelated; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.copy { font-size: .8rem; margin-left: 8px; }
.timeline { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); }
.timeline li { padding: 0 0 12px 16px; position: relative; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li:last-child::before { background: var(--seal); }
.upload { border: 1.5px dashed #cfc6b8; border-radius: 10px; padding: 18px; text-align: center; background: var(--paper); }
.upload input[type=file] { margin: 10px auto; max-width: 100%; }
.thanks { text-align: center; padding: 28px 0 8px; }
.thanks .seal-icon { width: 64px; margin: 0 auto 12px; opacity: .9; }
@media (max-width: 640px) { .pay-box { grid-template-columns: 1fr; } .qr { max-width: 240px; margin: 0 auto; } }

/* ---------- auth / small pages ---------- */
.narrow { max-width: 460px; margin: 48px auto 72px; }
.code-input { font-size: 1.6rem !important; letter-spacing: .5em; text-align: center; font-family: ui-monospace, Menlo, monospace !important; }
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-weight: 500; color: var(--muted); font-size: .85rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #b9b1a4; margin-top: 0; padding: 48px 0 0; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-brand img { width: 150px; margin-bottom: 12px; opacity: .9; }
.site-footer h3 { color: #fff; font-family: var(--sans); font-size: .95rem; font-weight: 600; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { text-decoration: none; color: #b9b1a4; }
.site-footer a:hover { color: #fff; }
.site-footer .muted { color: #8d857a; }
.footer-legal { border-top: 1px solid #2c2824; margin-top: 36px; padding-top: 20px; padding-bottom: 28px; text-align: center; font-size: .82rem; color: #8d857a; }
.footer-legal p { margin: 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }

/* ---------- โหมดทดสอบ / แถบแอดมิน ---------- */
.test-bar { background: repeating-linear-gradient(45deg, #ffe08a, #ffe08a 12px, #ffd45c 12px, #ffd45c 24px); color: #3d2e00; font-size: .88rem; padding: 8px 16px; display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.test-bar form { margin: 0; }
.test-bar button { font: inherit; background: #3d2e00; color: #fff; border: 0; border-radius: 6px; padding: 3px 10px; cursor: pointer; }
.test-bar a { color: #3d2e00; }
.admin-strip { background: #2a2622; text-align: right; padding: 2px 16px; font-size: .78rem; }
.admin-strip a { color: #cfc8bc; text-decoration: none; }

/* แถบ Tang Chang หน้าแรก: พื้นหมึกต่อจากแบนเนอร์ */
.about-band { background: var(--ink); color: #f2eee6; border: 0; }
.about-band h2 { color: #fff; margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.about-years { color: #9a9286; margin: 0 0 6px; }
.about-band .link-card { background: #1f1c19; border-color: #34302b; color: #f2eee6; }
.about-band .link-card span { color: #9a9286; }
.about-band .link-card:hover { border-color: var(--seal); }
.site-footer .footer-brand img { width: 170px; height: auto; }
.about-band + .site-footer, main:has(.about-band:last-child) + .site-footer { border-top: 1px solid #2c2824; }
.about-sign { width: 190px; height: auto; margin-top: 18px; opacity: .9; }

/* ---------- แกลเลอรี + lightbox ---------- */
.gallery { position: relative; }
.gallery-main { cursor: zoom-in; aspect-ratio: 3 / 4; touch-action: pan-y; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-count { position: absolute; top: 10px; right: 10px; background: rgba(20,18,16,.7); color: #fff; font-size: .78rem; padding: 2px 9px; border-radius: 99px; pointer-events: none; }
@media (max-width: 860px) {
  .gallery-main { aspect-ratio: 3 / 4; max-height: none; width: min(100%, 68vh); margin: 0 auto; }
  .thumbs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .thumbs button { flex: 0 0 60px; width: 60px; }
}
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10,9,8,.97); display: flex; flex-direction: column; color: #fff; }
.lightbox[hidden] { display: none; }
.lb-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; flex: 0 0 auto; }
.lb-count { font-size: .9rem; color: #cfc8bc; letter-spacing: .05em; }
.lb-stage { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; justify-items: center; padding: 0 8px; }
.lb-stage img { grid-column: 2; max-width: 100%; max-height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; cursor: pointer; }
.lightbox button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lb-close { width: 42px; height: 42px; font-size: 18px; }
.lb-prev, .lb-next { width: 52px; height: 52px; font-size: 32px; line-height: 1; padding-bottom: 4px; }
.lb-prev { grid-column: 1; grid-row: 1; } .lb-next { grid-column: 3; grid-row: 1; }
.lb-thumbs { flex: 0 0 auto; display: flex; gap: 8px; justify-content: center; padding: 10px 12px 14px; overflow-x: auto; scrollbar-width: none; }
.lightbox .lb-thumbs button { flex: 0 0 auto; width: 48px; height: 64px; border-radius: 6px; padding: 0; overflow: hidden; background: #222; opacity: .55; border: 2px solid transparent; }
.lightbox .lb-thumbs button.on { opacity: 1; border-color: #fff; }
.lb-thumbs img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 600px) {
  .lb-stage { grid-template-columns: 40px minmax(0, 1fr) 40px; padding: 0 4px; }
  .lb-prev, .lb-next { width: 38px; height: 38px; font-size: 26px; }
}
body.lb-open { overflow: hidden; }

/* แถบ Tang Chang: ลายเซ็นเป็นจุดเด่น + ลิงก์แบบรายการ */
.about-band { padding: 72px 0; }
.about-band .about-grid { grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.about-id { text-align: center; }
.about-id .about-sign { width: min(250px, 70%); margin: 0 auto 18px; opacity: .95; }
.about-id h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: .04em; margin: 0; }
.about-id .about-years { margin: 10px 0 0; letter-spacing: .08em; font-size: .92rem; }
.about-id .about-years::before { content: ""; display: block; width: 28px; height: 2px; background: var(--seal); margin: 0 auto 12px; }
.about-links { display: grid; border-top: 1px solid #34302b; }
.about-links a { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 16px; padding: 18px 4px; border-bottom: 1px solid #34302b; text-decoration: none; color: #f2eee6; transition: padding .2s, color .2s; }
.about-links strong { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; }
.about-links span { color: #8f877b; font-size: .88rem; grid-column: 1; }
.about-links i { grid-row: 1 / 3; grid-column: 2; align-self: center; font-style: normal; color: #8f877b; transition: transform .2s, color .2s; }
.about-links a:hover { padding-left: 10px; }
.about-links a:hover i { color: var(--seal); transform: translateX(3px); }
@media (max-width: 800px) {
  .about-band { padding: 56px 0 40px; }
  .about-band .about-grid { grid-template-columns: 1fr; gap: 40px; }
}

/* iPhone: กันซูมอัตโนมัติตอนแตะช่องกรอก (ต้อง ≥16px) และกันซูมจากแตะปุ่มสองครั้ง */
a, button, input, select, textarea, label, .format, .option { touch-action: manipulation; }
@media (max-width: 900px) {
  input, select, textarea, .search input, .qty input, .toolbar select { font-size: 16px !important; }
}

.product > *, .two-col > *, .about-grid > * { min-width: 0; }

/* หน้าเนื้อหายาว: สารบัญ + เลื่อนไปหัวข้อไม่ให้โดนแถบเมนูบัง */
html { scroll-behavior: smooth; }
.prose h2, .prose h3 { scroll-margin-top: 90px; }
.prose h2 { margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--line); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; max-width: 720px; }
.toc a { text-decoration: none; font-size: .88rem; padding: 5px 12px; border: 1px solid var(--line); border-radius: 99px; background: #fff; }
.toc a:hover { border-color: var(--seal); color: var(--seal); }

/* หน้า About: แถวรูปซ้าย-ข้อมูลขวา แบบหน้าเดิมใน PrestaShop */
.prose .row { display: flex; gap: 32px; margin: 28px 0; }
.prose .row.align-items-center { align-items: center; }
.prose .col-md-3 { flex: 0 0 25%; }
.prose .col-md-9 { flex: 1; min-width: 0; }
.prose .text-center { text-align: center; }
.prose .col-md-3 img { max-width: 200px; width: 100%; margin: 0 auto; }
.prose .label-accent { color: var(--seal); font-weight: 600; font-size: .92rem; letter-spacing: .02em; margin-bottom: 4px; }
.prose .row h2 { border: 0; padding: 0; margin: 4px 0 12px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose h5 { font-size: .8rem; letter-spacing: .08em; color: var(--muted); margin: 0 0 4px; }
@media (max-width: 700px) {
  .prose .row { flex-direction: column; gap: 14px; }
  .prose .col-md-3 { flex: none; }
  .prose .col-md-3 img { max-width: 160px; }
}

/* ช่องค้นหาที่อยู่ */
.area-search-field { position: relative; }
.area-results { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; list-style: none; margin: 4px 0 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 280px; overflow: auto; }
.area-results li { padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: .92rem; }
.area-results li.active, .area-results li:hover { background: var(--paper); }
.area-picked [data-area] { background: #f6f9f4; }

/* หน้า About */
.prose .about-intro { font-family: var(--serif); font-size: 1.18rem; line-height: 1.8; padding: 4px 0 12px; }
.prose .about-intro p { margin: 0 0 .5em; }
.prose .about-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px; margin: 22px 0; }
.prose .about-card img { border-radius: 10px; margin: 0 auto; }
.prose .about-card p { margin: 0 0 .8em; }
.prose .about-card p:last-child { margin-bottom: 0; }
.prose .about-names { display: grid; gap: 2px; margin: 2px 0 14px; }
.prose .about-names span { font-family: var(--serif); font-size: 1.05rem; line-height: 1.45; }
.prose .about-names span:first-child { font-size: 1.35rem; font-weight: 600; }
.prose .about-names .zh { color: var(--muted); }
.prose .doc-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.prose .doc-list li { margin: 0; }
.prose .doc-list a { display: flex; gap: 10px; align-items: center; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--text); font-size: .95rem; height: 100%; }
.prose .doc-list a::before { content: "PDF"; flex: 0 0 auto; font-size: .7rem; font-weight: 600; color: #fff; background: var(--seal); border-radius: 4px; padding: 2px 6px; }
.prose .doc-list a:hover { border-color: var(--seal); }
.prose .about-contact { margin-top: 28px; }
.prose .about-contact a { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; padding: 11px 24px; border-radius: 8px; }
.prose .about-contact a:hover { background: var(--ink-2); }
@media (max-width: 700px) { .prose .about-card { padding: 20px; } .prose .about-intro { font-size: 1.05rem; } }

/* รูปหลักพอดีกรอบเสมอ (เดิมรูปสูงเกินกรอบแล้วโดนตัด) */
.gallery-main { position: relative; }
.gallery-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* ปุ่มหยิบใส่ตะกร้าบนการ์ด */
.card-wrap { display: flex; flex-direction: column; }
.card-wrap .card { flex: 1; }
.quick-add { margin-top: 10px; }
.quick-add .btn { border-color: var(--line); background: #fff; }
.quick-add .btn:hover { border-color: var(--ink); background: #fff; }

/* แผงตะกร้าด้านขวา */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(20,18,16,.4); z-index: 80; opacity: 0; transition: opacity .25s; }
.drawer-backdrop.open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 92vw); background: var(--paper); z-index: 81; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease; box-shadow: -10px 0 30px rgba(0,0,0,.15); }
.drawer.open { transform: none; }
body.drawer-open { overflow: hidden; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
.drawer-close { background: none; border: 0; font-size: 18px; cursor: pointer; width: 36px; height: 36px; border-radius: 8px; }
.drawer-close:hover { background: var(--paper); }
.drawer-empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.drawer-lines { list-style: none; margin: 0; padding: 4px 20px; overflow-y: auto; flex: 1; }
.drawer-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; transition: opacity .15s; }
.drawer-line img { width: 56px; aspect-ratio: 3/4; object-fit: cover; border-radius: 4px; background: #ebe6dc; }
.drawer-line .line-title { font-size: .95rem; }
.drawer-qty { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.drawer-qty button[data-dq="-1"], .drawer-qty button[data-dq="1"] { width: 28px; height: 28px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.drawer-qty button[disabled] { opacity: .4; cursor: not-allowed; }
.drawer-qty span { min-width: 22px; text-align: center; }
.drawer-qty .link { margin-left: 8px; }
.drawer-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; }

/* หน้าเนื้อหาอยู่กึ่งกลาง */
.page-wrap { max-width: 820px; }
.page-wrap.page-about { max-width: 1140px; }
.page-wrap .prose { max-width: none; }
.cf-turnstile { margin: 4px 0 14px; min-height: 65px; }
.lb-stage img { max-height: calc(100dvh - 150px); }
@media (max-width: 600px) { .lb-stage img { max-height: calc(100dvh - 140px); } }

/* การตัดบรรทัด: ไม่ตัดกลางชื่อเฉพาะ และไม่เหลือคำเดียวโดด ๆ ท้ายย่อหน้า */
.nw { white-space: nowrap; }
@media (max-width: 420px) { .nw { white-space: normal; } }
p, li, .card-sub { text-wrap: pretty; }
h1, h2, h3, .card-title { text-wrap: balance; }

.more-row { display: flex; justify-content: center; margin-top: 36px; }
.more-row .btn { min-width: 240px; }

/* ชี้เมาส์ที่การ์ด → แสดงรูปที่สอง (เฉพาะอุปกรณ์ที่มีเมาส์) */
.card-img .card-img2 { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease, transform .4s ease; }
.card-img .card-img2:not([src]) { display: none; }
@media (hover: hover) { .card:hover .card-img .card-img2[src] { opacity: 1; } }

/* ชุดสินค้า / ซื้อคู่ */
.bundle-box { margin: 22px 0 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.bundle-box h3 { margin: 0 0 10px; font-size: 1rem; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mini-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mini-list a { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.mini-list a:hover span { text-decoration: underline; }
.mini-list img { width: 40px; height: 53px; object-fit: cover; border-radius: 4px; background: #ebe6dc; flex: none; }
.mini-list form { flex: none; }
.save-note { margin: 12px 0 0; font-size: .92rem; }
.deal { color: var(--seal); }

/* โฟกัสคีย์บอร์ดให้เห็นชัด */
:where(a, button, [role=button], summary, select, input[type=checkbox], input[type=radio]):focus-visible { outline: 2px solid var(--seal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* การ์ด: ราคา E-Book, ปุ่ม E-Book, สถานะในตะกร้า */
.price .price-alt { font-weight: 400; font-size: .85em; color: var(--muted); margin-left: 4px; white-space: nowrap; }
.quick-add.has-ebook { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.quick-add .ebook-btn { width: auto; padding-left: 12px; padding-right: 12px; white-space: nowrap; }
.quick-add .btn.in-cart { border-color: var(--ink); background: #f3efe7; }
.cart-count.bump { animation: bump .45s ease; }
@keyframes bump { 30% { transform: scale(1.45); } 100% { transform: scale(1); } }
@media (max-width: 560px) { .quick-add.has-ebook { grid-template-columns: 1fr; } .quick-add .ebook-btn { width: 100%; } .price .price-alt { display: block; margin-left: 0; } }
.price .price-alt::before { content: "· "; }
@media (max-width: 560px) { .price .price-alt::before { content: ""; } }

/* ตัวปรับจำนวนบนการ์ด */
.quick-stepper { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; border: 1px solid var(--ink); border-radius: 8px; background: #f3efe7; height: 38px; box-sizing: border-box; overflow: hidden; }
.quick-stepper button { height: 100%; border: 0; background: transparent; font: inherit; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.quick-stepper button:hover:not(:disabled) { background: rgba(0,0,0,.06); }
.quick-stepper button:disabled { opacity: .35; cursor: default; }
.quick-stepper [data-qty] { text-align: center; font-weight: 600; }
.quick-stepper[hidden], .quick-cart form[hidden] { display: none; }
.toast-action { margin-left: 14px; background: none; border: 0; color: #fff; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0; }

/* สรุปค่าส่ง/ชำระเงิน/คืนสินค้า ใต้ปุ่มซื้อ */
.buy-info { list-style: none; margin: 20px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; display: grid; gap: 9px; font-size: .92rem; }
.buy-info li { display: flex; gap: 10px; align-items: flex-start; }
.buy-info svg { width: 18px; height: 18px; flex: none; margin-top: 3px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.buy-info a { color: var(--seal); }

/* แกลเลอรี: แยกหมวดปก/หน้าด้านใน + ป้ายรูป */
.thumbs .thumb { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.thumbs .thumb figcaption { font-size: .72rem; color: var(--muted); max-width: 72px; text-align: center; line-height: 1.3; }
.thumbs.grouped { row-gap: 6px; }
.thumbs-head { flex: 0 0 100%; font-size: .82rem; font-weight: 600; color: var(--muted); margin-top: 6px; }
.gallery-caption { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: .9rem; }
.gallery-caption[hidden] { display: none; }
@media (max-width: 860px) { .thumbs.grouped { flex-wrap: wrap; overflow: visible; } }

.contrib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.contributors details { margin-top: 6px; }
.contributors summary { cursor: pointer; color: var(--seal); margin-bottom: 6px; }

/* ป๊อปอัปยืนยันนำสินค้าออกจากตะกร้า */
.confirm-dialog { border: 0; border-radius: 14px; padding: 22px 22px 18px; max-width: min(380px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.confirm-dialog::backdrop { background: rgba(13,12,11,.45); }
.confirm-dialog p { margin: 0 0 18px; font-size: 1.05rem; line-height: 1.5; }
.confirm-actions { display: grid; gap: 8px; }
.confirm-actions .btn-ghost { border-color: var(--line); color: var(--muted); }

/* การ์ด: ปุ่มชิดล่างให้แถวเดียวกันตรงกัน · E-Book เป็นลิงก์ใต้ราคา */
.card-wrap { display: flex; flex-direction: column; height: 100%; }
.card-wrap > .quick-add { margin-top: auto; padding-top: 10px; }
.ebook-link { display: inline-block; margin-top: 2px; font-size: .9rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; align-self: flex-start; }
.ebook-link:hover { color: var(--seal); }

.spec-table { border-collapse: collapse; width: 100%; max-width: 560px; font-size: .95rem; }
.spec-table th, .spec-table td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table th { width: 38%; font-weight: 500; color: var(--muted); padding-right: 16px; }
.badge-until { background: var(--seal); color: #fff; }
