/* ============ Content pages: policy / contact / about / faq + toast + devbar + print ============ */
mark.todo { background: #fff3cd; color: #7a5200; padding: 0 8px; border-radius: 6px; font-weight: 600; font-size: 0.92em; }
.notice--draft { background: #fff3cd; color: #7a5200; margin-bottom: 16px; }

.policy { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; padding-block: 24px 8px; }
.side-nav { position: sticky; top: 96px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 12px; }
.side-nav h2 { font-size: 14px; color: var(--muted); font-weight: 500; padding: 4px 12px 8px; }
.side-nav a { display: block; padding: 9px 12px; border-radius: 10px; font-weight: 500; }
.side-nav a:hover { background: var(--brand-50); }
.side-nav a[aria-current="page"] { background: var(--brand-100); color: var(--brand-900); font-weight: 600; }
@media (max-width: 860px) {
  .policy { grid-template-columns: minmax(0, 1fr); }
  .side-nav { position: static; display: flex; overflow-x: auto; padding: 8px; gap: 4px; }
  .side-nav h2 { display: none; }
  .side-nav a { white-space: nowrap; }
}

.prose { background: #fff; border-radius: var(--r-lg); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 36px); }
.prose h1 { font-size: clamp(26px, 4vw, 34px); line-height: 1.3; color: var(--brand-900); margin-bottom: 6px; }
.prose .lead { color: var(--muted); font-size: 16.5px; margin-bottom: 20px; }
.prose h2 { font-size: 21px; color: var(--brand-900); margin: 28px 0 8px; }
.prose h3 { font-size: 17px; margin: 18px 0 6px; }
.prose p { margin-bottom: 12px; }
.prose ul, .prose ol { margin: 0 0 14px 22px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 6px; }
.prose a:not(.btn) { color: var(--brand-700); text-decoration: underline; }
.prose table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--brand-50); color: var(--brand-900); }
.prose .callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--brand-50); border: 1px solid var(--brand-100); margin: 12px 0 16px; }
.prose .callout .icon { font-size: 24px; color: var(--brand-600); flex: none; margin-top: 2px; }
.prose .callout--warn { background: var(--action-soft); border-color: #ffd9ac; }
.prose .callout--warn .icon { color: var(--action-strong); }
.steps-list { counter-reset: s; display: grid; gap: 14px; margin: 12px 0 8px !important; list-style: none !important; padding: 0; }
.steps-list li { counter-increment: s; position: relative; padding-left: 52px; min-height: 40px; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-600); color: #fff; font-weight: 700; }
.steps-list strong { display: block; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 8px 0 8px; }
.contact-card { display: grid; gap: 10px; align-content: start; }
.contact-card h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; margin: 0; }
.contact-card h2 .brand-icon, .contact-card h2 .icon { font-size: 28px; }
.contact-card p { color: var(--muted); font-size: 15px; margin: 0; }
.faq details { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; line-height: 1; color: var(--brand-600); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding-top: 10px; color: var(--muted); }
.page-head { padding-block: 24px 4px; }
.page-head h1 { font-size: clamp(26px, 4vw, 36px); color: var(--brand-900); }
.page-head p { color: var(--muted); }
/* ของตกแต่งตาม Brand Guideline (sparkle/blob) — ย้ายมาจากหน้าแรกตอนเปลี่ยน hero เป็น carousel ภาพสำเร็จรูป 18 ต.ค. 2026 (ของเดิมไม่ได้ใช้ที่ไหนแล้ว) */
.page-head--categories { position: relative; overflow: visible; }
.page-head__deco { position: absolute; pointer-events: none; z-index: 0; }
.page-head__deco--sparkle { top: -6px; right: 4px; width: 46px; }
.page-head__deco--blob { bottom: -14px; right: 110px; width: 72px; opacity: 0.55; }
.page-head--categories h1, .page-head--categories p { position: relative; z-index: 1; }
@media (max-width: 760px) { .page-head__deco { display: none; } }
.error-page { text-align: center; padding: 64px 16px; }
.error-page .code { font-size: 96px; font-weight: 700; line-height: 1; color: var(--brand-600); }

.footer-links--sub { width: 100%; margin-left: 0; font-size: 13px; color: var(--muted); }
.footer-links--sub a { padding: 2px 14px 2px 0; margin-right: 14px; border-left: 0 !important; }
.site-footer__inner .footer-links:not(.footer-links--sub) { margin-left: auto; }

/* toast */
.toasts { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 10px 18px; border-radius: var(--r-pill); background: var(--brand-900); color: #fff; font-size: 14.5px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); transition: opacity 0.3s, transform 0.3s; }
.toast--warn { background: #9a4d00; }
.toast.is-out { opacity: 0; transform: translateY(6px); }

/* devbar (เฉพาะ prototype) */
.devbar { position: fixed; left: 10px; bottom: 82px; z-index: 90; font-size: 13px; }
.devbar__toggle { padding: 5px 12px; border-radius: var(--r-pill); background: #111; color: #d7f5df; font-size: 12px; opacity: 0.75; }
.devbar__toggle:hover { opacity: 1; }
.devbar__panel { position: absolute; left: 0; bottom: 34px; display: grid; gap: 4px; width: 260px; padding: 10px; border-radius: 12px; background: #111; color: #d7f5df; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.devbar__panel p { padding: 2px 4px 6px; border-bottom: 1px solid #333; margin-bottom: 2px; }
.devbar__panel button, .devbar__panel a { text-align: left; padding: 7px 8px; border-radius: 8px; color: #fff; }
.devbar__panel button:hover, .devbar__panel a:hover { background: #2a2a2a; }
@media (min-width: 821px) { .devbar { bottom: 12px; } }
@media (max-width: 900px) { body[data-page="product"] .devbar { bottom: 150px; } }

/* พิมพ์ (ใบสรุปรายการสั่งซื้อ) */
@media print {
  .site-header, .site-footer, .nav, .devbar, .toasts, .no-print, .sticky-buy { display: none !important; }
  body { background: #fff !important; padding: 0 !important; }
  .panel, .prose { box-shadow: none !important; border: 1px solid #ddd; }
  .success-grid { grid-template-columns: 1fr !important; }
}

/* ============ หน้าใบเสร็จรับเงินของลูกค้า (receipt.html — 25 พ.ย. 2026) ============
   26 พ.ย.: ใบเสร็จเป็นฉบับ A4 (PAF_EMAIL.receiptDoc · คลาส fdoc ใน admin.css แบบเดียวกับใบเสร็จในหลังบ้าน) — ที่นี่แค่จัดกรอบบนจอ/พิมพ์ */
.rcpt-page { padding-bottom: 40px; }
.rcpt-page__bar { margin: 4px 0 16px; }
.rcpt { max-width: 820px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.rcpt-page__note { max-width: 820px; margin-top: 14px; font-size: 0.9rem; }
@media (max-width: 560px) { .rcpt { padding: 12px; } }
@media print {
  /* หัวหน้าเว็บซ้ำกับหัวในใบเสร็จ — พิมพ์เฉพาะใบเสร็จ */
  .rcpt-page .page-head, .rcpt-page__note { display: none; }
  .rcpt { max-width: none; padding: 0; border: 0; border-radius: 0; }
}

code { padding: 1px 6px; border-radius: 6px; background: var(--brand-100); font-size: 0.9em; word-break: break-all; }

/* ============ Side widget: แอด LINE + แชท AI ============ */
.sidew { position: fixed; right: 0; bottom: 170px; z-index: 70; }
.sidew__rail { display: grid; gap: 8px; justify-items: end; align-items: end; }
.sidew__btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 62px; height: 62px;
  border-radius: 16px 0 0 16px; background: #fff; border: 1px solid var(--line); border-right: 0;
  box-shadow: -2px 4px 16px rgba(2, 60, 38, 0.22); font-size: 11px; font-weight: 600; line-height: 1.1; color: var(--brand-900);
  transition: transform 0.15s;
}
.sidew__btn:hover { transform: translateX(-4px); }
.sidew__btn .brand-icon { width: 30px; height: 30px; }
.sidew__btn[aria-expanded="true"] { box-shadow: -2px 4px 16px rgba(2, 60, 38, 0.4); }
/* ปุ่มแชท AI เป็นตัวมาสคอตล้วนๆ แทนกล่องปุ่มแบบเดิม (ทีมขอ 12 ต.ค. 2026 — ให้ตัวมาสคอตเป็นปุ่มกด ไม่ใช่แค่ไอคอนในปุ่ม/ยืนข้างปุ่ม) */
.sidew__btn--ai { width: 86px; height: auto; background: none; border: none; box-shadow: none; padding: 0; border-radius: 0; }
.sidew__btn--ai img { width: 100%; height: auto; display: block; filter: drop-shadow(-2px 5px 10px rgba(2, 60, 38, 0.3)); }
.sidew__panel {
  position: fixed; right: 80px; bottom: 24px; z-index: 80; width: 340px; max-height: min(600px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden; background: #fff; border-radius: 20px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28); animation: sidew-in 0.18s ease-out;
}
.sidew__panel[hidden] { display: none; }
@keyframes sidew-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.sidew__head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--brand-600); color: #fff; }
.sidew__head--ai { background: var(--action); }
.sidew__head b { display: block; line-height: 1.25; }
.sidew__head small { display: block; opacity: 0.9; font-size: 12.5px; }
.sidew__head .brand-icon { width: 34px; height: 34px; }
.sidew__close { margin-left: auto; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.sidew__close:hover { background: rgba(255, 255, 255, 0.2); }
.sidew__avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--action); font-size: 22px; overflow: hidden; }
.sidew__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidew__body { display: grid; gap: 12px; padding: 16px; overflow-y: auto; }
.sidew__qr { display: grid; place-items: center; }
.sidew__qr .qr { width: 160px; height: 160px; }
.sidew__list { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.sidew__list li { position: relative; padding-left: 20px; }
.sidew__list li::before { content: ""; position: absolute; left: 4px; top: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); }
.sidew__express { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--action-soft); border: 1.5px dashed var(--action); font-size: 14px; }
.sidew__express strong { display: flex; align-items: center; gap: 6px; color: #9a4d00; font-size: 16px; }
.sidew__express textarea { width: 100%; border: 1px solid #ffd9ac; border-radius: 10px; padding: 8px 10px; font-size: 14px; resize: none; background: #fff; }
.sidew__express small { color: #7a3d00; }

.chat__log { flex: 1; min-height: 240px; overflow-y: auto; display: grid; align-content: start; gap: 10px; padding: 14px; background: var(--brand-50); }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.msg--bot { justify-self: start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg--me { justify-self: end; background: var(--brand-600); color: #fff; border-bottom-right-radius: 4px; }
.msg a:not(.btn):not(.mini-p) { color: var(--brand-700); text-decoration: underline; }
.msg .btn { margin-top: 6px; }
.mini-p { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; line-height: 1.35; }
.mini-p img { width: 46px; height: 38px; object-fit: contain; background: var(--brand-50); border-radius: 6px; flex: none; }
.chat__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 0; max-height: 96px; overflow-y: auto; }
.chat__chips .chip { padding: 4px 11px; font-size: 13px; }
.chat__form { display: flex; gap: 8px; padding: 10px 12px; }
.chat__form input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: var(--r-pill); padding: 8px 14px; font-size: 16px; outline: none; }
.chat__form input:focus { border-color: var(--action); }
.chat__send { width: 40px; height: 40px; border-radius: 50%; background: var(--action); color: #fff; display: grid; place-items: center; flex: none; }
.chat__note { padding: 0 14px 10px; }
.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--strike); animation: typing 1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; } .typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

@media (max-width: 820px) {
  .sidew { bottom: 100px; }
  .sidew__btn, .sidew__btn:hover { width: 44px; height: 44px; transform: translateX(8px); }  /* ปุ่มไอคอนเล็กชิดขอบ ไม่ทับตัวเลขในเนื้อหา */
  .sidew__btn > span { display: none; }
  .sidew__btn .brand-icon { width: 26px; height: 26px; margin-right: 8px; }
  .sidew__btn--ai, .sidew__btn--ai:hover { width: 54px; height: auto; transform: none; }
  .sidew__panel { left: 8px; right: 8px; width: auto; bottom: 76px; max-height: calc(100vh - 110px); }
  body[data-page="product"] .sidew { bottom: 176px; }
}
@media (min-width: 821px) { .devbar { left: 10px; } }

/* ตัวเลขตะกร้าเด้งเมื่อเพิ่มสินค้า */
.nav__badge.is-bump { animation: badge-bump 0.45s ease-out; }
@keyframes badge-bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* ปุ่มส่งด่วน */
.express { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--action-soft); border: 1.5px dashed var(--action); }
.express__title { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #9a4d00; }
.express__title .icon { font-size: 22px; }
.express small { color: #7a3d00; font-size: 12.5px; line-height: 1.4; }
.signup-card { display: grid; gap: 10px; }
.signup-card h2 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.signup-card h2 .icon { color: var(--brand-600); font-size: 26px; }
.slot-fixed { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--brand-50); font-weight: 500; }
.slot-fixed .icon { color: var(--brand-600); font-size: 22px; }
.totals__note { font-size: 13px; color: var(--muted); }
.price--tbd ins { font-size: 16px; font-weight: 600; color: var(--muted); }
.product-card__desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* หน้าลูกค้าองค์กร (29 ต.ค. 2026) — รูปโปรโมชั่น 2 รูปจากหลังบ้าน แสดงตามสัดส่วนจริงของรูป ไม่ครอป */
.corp__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin: 8px 0 24px; align-items: start; }
.corp__img { margin: 0; border-radius: var(--radius-lg, 16px); overflow: hidden; background: var(--brand-50, #f1f8f3); box-shadow: var(--shadow-sm, 0 2px 10px rgba(0,0,0,.06)); }
.corp__img img { display: block; width: 100%; height: auto; }
/* ยังไม่มีรูป: แถบแจ้งเตี้ยๆ แถบเดียว ปุ่มติดต่อ LINE ต่อท้ายเห็นได้โดยไม่ต้องเลื่อน (designer 29 ต.ค.: กรอบ 4:5 สองใบดัน CTA ตกจอ) */
.corp__soon { display: flex; align-items: center; gap: 12px; margin: 8px 0 20px; padding: 18px 20px; border: 2px dashed var(--brand-200, #b9dcc4); border-radius: var(--radius-lg, 16px); color: var(--brand-700); font-size: 16px; }
.corp__soon .icon { flex: none; width: 28px; height: 28px; color: var(--brand-600); }
.corp__grid--one { grid-template-columns: minmax(0, 640px); }
.corp__cta { display: grid; gap: 10px; justify-items: start; margin-bottom: 32px; }
.corp__cta h2 { color: var(--brand-900); font-size: 22px; }
.corp .page-head p { font-size: 17px; }
@media (max-width: 760px) { .corp__grid { grid-template-columns: minmax(0, 1fr); } }

/* หน้าโปรโมชั่นของแบนเนอร์ */
.promo-page__banner { margin: 16px 0 0; border-radius: var(--radius-lg, 16px); overflow: hidden; }
.promo-page__banner img { display: block; width: 100%; height: auto; }
.promo-page__desc { font-size: 17px; line-height: 1.6; }
.promo-page .crumbs { margin-top: 16px; }
.promo-page .crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-700); font-weight: 500; }
.promo-page .crumbs .icon { width: 18px; height: 18px; }
.promo-page__period { display: inline-flex; align-items: center; gap: 6px; color: var(--brand-700); font-weight: 500; }
.promo-page .grid-products { margin-top: 12px; }

/* ปุ่มข้อความยาว (โหมด EN) ห้ามดันหน้ามือถือให้เลื่อนแนวนอน — QA 29 ต.ค. */
#use-demo { white-space: normal; height: auto; min-height: 44px; padding-block: 8px; line-height: 1.35; text-align: center; max-width: 100%; }
@media (max-width: 760px) {
  .prose table { table-layout: fixed; font-size: 14px; }
  .prose th, .prose td { padding: 8px 6px; overflow-wrap: anywhere; }
}

/* === 2 พ.ย. logo/mascot/hero6/why === */
/* มาสคอต 3D ของแชท "มีชีวิต" (CSS ล้วน, ใส่ที่ img ไม่ใส่ที่ปุ่ม เพราะปุ่มมี transform ตอน hover) */
.sidew__btn--ai img { transform-origin: 50% 90%; animation: fng-bob 3.6s ease-in-out infinite; }
@keyframes fng-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  44% { transform: translateY(-5px) rotate(1.5deg); }
  88% { transform: translateY(0) rotate(-1.5deg); }
  92% { transform: translateY(-2px) rotate(-5deg); }
  96% { transform: translateY(-2px) rotate(4deg); }
}
.sidew__btn--ai[aria-expanded="true"] img { animation-play-state: paused; }
.sidew__avatar img { animation: fng-bob-sm 4s ease-in-out infinite; }
@keyframes fng-bob-sm {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) { .sidew__btn--ai img, .sidew__avatar img { animation: none; } }

/* === 2 พ.ย. coupon/toast/free-ship === */
/* คูปองลอย THANK100 — รายการแรก (บนสุด) ของสแตกขวา · เดสก์ท็อป 140×54 / มือถือ 124×48 (จุดตัดเดียวกับแถบล่าง 820px) */
.sidew__rail { gap: 10px; }
.sidew__coupon { position: relative; width: 140px; margin-right: 8px; }
.sidew__coupon-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 7px; filter: drop-shadow(0 4px 8px rgba(2, 60, 38, 0.28)); transition: transform 0.15s; }
.sidew__coupon-btn:hover { transform: translateY(-2px); }
.sidew__coupon-btn:focus-visible { outline: 3px solid var(--brand-900); outline-offset: 2px; }
.sidew__coupon-btn img { display: block; width: 100%; height: auto; }
.sidew__coupon-x { position: absolute; top: -8px; right: -6px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--brand-900); color: #fff; cursor: pointer; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.sidew__coupon-x .icon { width: 10px; height: 10px; stroke-width: 3; }
.sidew__coupon-x::after { content: ""; position: absolute; inset: -8px; } /* พื้นที่แตะใหญ่กว่าตัวปุ่ม */
/* EN: คูปองทำซ้ำด้วย CSS (ก้อนซ้ายขาว "100 THB" + ส่วนแดง) — ขนาดตัวอักษรอิงความกว้างคูปองด้วย cqw */
.cp-en { display: flex; width: 100%; aspect-ratio: 480 / 185; container-type: inline-size; border-radius: 7px; overflow: hidden; background: #f0141e; font-family: "Mitr", sans-serif; }
.cp-en__stub { flex: 0 0 23%; display: flex; align-items: center; justify-content: center; background: #fff; color: #0b4a22; writing-mode: vertical-rl; transform: rotate(180deg); gap: 3px; }
.cp-en__stub b { font-size: 13.5cqw; font-weight: 700; line-height: 1; }
.cp-en__stub small { font-size: 7.5cqw; font-weight: 700; line-height: 1; }
.cp-en__main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1cqw; border-left: 3px dotted #fff; color: #fff; text-align: center; min-width: 0; }
.cp-en__main b { font-size: 15.5cqw; font-weight: 700; line-height: 1.05; white-space: nowrap; }
.cp-en__main i { font-style: normal; font-size: 8.4cqw; font-weight: 700; line-height: 1.1; white-space: nowrap; }
body[data-page="checkout"] .sidew__coupon, body[data-page="success"] .sidew__coupon, body[data-page="track"] .sidew__coupon,
body[data-page="login"] .sidew__coupon, body[data-page="account"] .sidew__coupon, body[data-page="email-preview"] .sidew__coupon { display: none; }
/* หน้าตะกร้า: คูปองลอยทับตัวเลขยอดในกล่องสรุป (เห็นตอนทดสอบ 1280) → ซ่อนทุกขนาดจอ · 13 พ.ย. 2026: ตะกร้า/ชำระเงินแสดงเป็นกล่องคูปองในสรุปยอดแทน (.cpbox) */
body[data-page="cart"] .sidew__coupon { display: none; }
/* กล่องคูปองในสรุปยอด (widget.js couponBox) — ภาพคูปองกดได้ + เงื่อนไข · ข้อความเหตุผล/ลิงก์ใต้กล่อง */
.cpbox-wrap { display: grid; gap: 8px; margin-top: 12px; }
.cpbox-wrap[hidden] { display: none; }
.cpbox-wrap .notice { display: flex; align-items: flex-start; gap: 6px; }
.cpbox-wrap .notice .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.cpbox { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px; border: 1.5px dashed #f0141e; border-radius: 12px; background: #fff7f7; }
.cpbox__art { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 7px; filter: drop-shadow(0 3px 6px rgba(2, 60, 38, 0.22)); transition: transform 0.15s; }
.cpbox__art:hover { transform: translateY(-2px); }
.cpbox__art:focus-visible { outline: 3px solid var(--brand-900); outline-offset: 2px; }
.cpbox__art img { display: block; width: 100%; height: auto; }
.cpbox__text { display: grid; gap: 2px; min-width: 0; }
.cpbox__text b { font-size: 15px; color: #b40d15; }
.cpbox__text small { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.cpbox__why { font-size: 13.5px; color: #9a4d00; background: var(--promo-soft); padding: 8px 12px; border-radius: 10px; }
@media (max-width: 420px) { .cpbox { grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 10px; } }
@media (prefers-reduced-motion: reduce) { .cpbox__art { transition: none; } }
@media (max-width: 820px) {
  .sidew__rail { gap: 6px; }
  .sidew__coupon { width: 124px; margin-right: 4px; }
  .sidew__coupon-x { width: 24px; height: 24px; top: -10px; right: -2px; }
  .sidew__coupon-x::after { inset: -10px; }
  .cp-en, .sidew__coupon-btn { border-radius: 6px; }
  body:not([data-page="home"]) .sidew__coupon { display: none; } /* มือถือ: คูปองลอยเฉพาะหน้าแรก — หน้ารายการสินค้าคูปองทับปุ่ม "+" ของการ์ด (QA 2 พ.ย. B1) */
}

/* toast หน้าร้านชุดใหม่ (ล่างกลาง · มือถืออยู่เหนือแถบล่าง) — ใช้กับคูปองลอย */
.cptoast { position: fixed; left: 50%; bottom: 24px; z-index: 100; display: flex; align-items: center; gap: 14px; width: max-content; max-width: min(540px, calc(100vw - 32px)); padding: 10px 18px; border-radius: 14px; background: var(--brand-900); color: #fff; font-size: 14.5px; line-height: 1.45; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28); opacity: 0; transform: translate(-50%, 12px); transition: opacity 0.25s, transform 0.25s; }
.cptoast[hidden] { display: none; }
.cptoast.is-in { opacity: 1; transform: translate(-50%, 0); }
.cptoast a { flex: none; color: var(--accent-lime); font-weight: 600; text-decoration: underline; white-space: nowrap; }
@media (max-width: 820px) { .cptoast { bottom: 92px; } }
@media (prefers-reduced-motion: reduce) { .cptoast, .sidew__coupon-btn { transition: none; } }

/* ชิปโค้ดในแถวสรุปยอด (ตะกร้า/ชำระเงิน) */
.code-chip { display: inline-flex; align-items: center; gap: 2px; margin-left: 2px; padding: 1px 3px 1px 10px; border-radius: 999px; background: var(--promo-soft); border: 1px solid #f6c7c7; color: var(--promo); font-size: 13px; font-weight: 600; line-height: 1.6; }
.code-chip button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: none; color: inherit; cursor: pointer; }
.code-chip button:hover { background: #fff; }
.code-chip .icon { width: 12px; height: 12px; stroke-width: 3; }

/* แถบความคืบหน้าส่งฟรี (ตะกร้า) */
.fship { display: grid; gap: 8px; margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: var(--brand-50); border: 1px solid var(--brand-100); }
.fship[hidden] { display: none; }
.fship__row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; font-size: 14px; color: var(--brand-900); }
.fship__row .icon { width: 20px; height: 20px; color: var(--brand-600); }
.fship__row b { font-weight: 700; }
.fship__rule { font-size: 12.5px; color: var(--muted); }
.fship__bar { height: 8px; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.fship__fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-lime), var(--brand-600)); transition: width 0.3s; }
.fship.is-done { background: var(--brand-100); border-color: #cfe5d6; }
.fship.is-done .fship__bar { background: #fff; }
.code-hint { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.code-hint[hidden] { display: none; }
.code-hint .icon { width: 16px; height: 16px; color: var(--brand-600); }
@media (prefers-reduced-motion: reduce) { .fship__fill { transition: none; } }

/* หน้าดูตัวอย่างอีเมลยืนยัน (ต้นแบบ) */
.emailprev__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; }
.emailprev__lang { display: flex; gap: 8px; }
.emailprev__lang .is-on { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.emailprev__frame { display: block; width: 100%; min-height: 900px; border: 1px solid var(--line); border-radius: 12px; background: #f1f8f3; margin-bottom: 24px; }

/* === 2 พ.ย. ribbon/gallery/lightbox/B2B === (design-spec-20261102 §3,5,6) */
/* --- ribbon มุมซ้ายบนของรูปสินค้า: ขนาดผูกกับความกว้างกรอบรูปด้วย container query --- */
.product-card__media, .pdp__main { container-type: inline-size; }
.ribbon { position: absolute; top: 0; left: 0; z-index: 3; display: block; width: clamp(56px, 36cqw, 128px); line-height: 0; pointer-events: none; }
.pdp__main .ribbon { width: clamp(112px, 26cqw, 168px); }
.product-card--row .ribbon { width: 64px; }
.product-card__media .ribbon img, .pdp__main .ribbon img { display: block; width: 100%; height: auto; object-fit: contain; }
/* ป้ายเดิม: best/pack ลงซ้ายล่างเมื่อซ้ายบนเป็นของ ribbon · ป้ายลด % ไปขวาบน (ขวาล่างคือลายน้ำโลโก้ในรูปถ่าย) */
.product-card .tag.tag--low { top: auto; bottom: 10px; left: 10px; }
.product-card--row .tag { top: 6px; left: 6px; }
.product-card--row .tag.tag--low { top: auto; bottom: 6px; }
.discount-pill { top: 10px; right: 10px; bottom: auto; }
.pdp__cat { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pdp__chip { padding: 1px 10px; border-radius: var(--r-pill); background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-900); font-size: 12.5px; font-weight: 600; }
.pdp__chip--promo { background: var(--promo-soft); border-color: transparent; color: var(--promo); }

/* --- แกลเลอรีหน้าสินค้า: แถบเลื่อน scroll-snap (ปัดบนมือถือ / รูปย่อสั่งเลื่อนบนเดสก์ท็อป) --- */
.pdp__main { display: block; }
.pdp__track { display: flex; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.pdp__track::-webkit-scrollbar { display: none; }
.pdp__track > img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; }
.pdp__slide { flex: 0 0 100%; min-width: 0; height: 100%; padding: 0; border: 0; background: #fff; cursor: zoom-in; scroll-snap-align: start; scroll-snap-stop: always; }
.pdp__slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pdp__slide:focus-visible { outline: 3px solid var(--brand-600); outline-offset: -3px; }
.pdp__thumbs { gap: 10px; padding: 2px; }
.pdp__thumbs button { width: 96px; height: 72px; opacity: 0.85; transition: opacity 0.15s; }
.pdp__thumbs button:hover, .pdp__thumbs button[aria-current="true"] { opacity: 1; }
.pdp__dots, .pdp__count { display: none; }
@media (max-width: 760px) {
  .pdp__thumbs { display: none; }
  .pdp__dots { display: flex; gap: 6px; position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 3; pointer-events: none; }
  .pdp__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.7); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25); }
  .pdp__dots i.is-on { background: #fff; transform: scale(1.35); }
  .pdp__count { display: block; position: absolute; top: 10px; right: 10px; z-index: 3; margin: 0; padding: 2px 10px; border-radius: var(--r-pill); background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 12px; line-height: 1.5; pointer-events: none; }
}

/* --- lightbox (ใช้ซ้ำกับแกลเลอรีสินค้า + โบรชัวร์ B2B) --- */
html.lightbox-open { overflow: hidden; }
dialog.lightbox { padding: 0; border: 0; margin: 0; inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; overflow: hidden; background: transparent; color: #fff; }
dialog.lightbox:not([open]) { display: none; }
dialog.lightbox::backdrop { background: rgba(0, 30, 12, 0.78); }
.lightbox__stage { position: absolute; inset: 0; display: flex; overflow: auto; padding: 48px 72px; touch-action: pan-x pan-y pinch-zoom; }
.lightbox__img { display: block; margin: auto; width: auto; height: auto; max-width: calc(100vw - 144px); max-height: calc(100vh - 96px); max-height: calc(100dvh - 96px); border-radius: 8px; background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4); }
.lightbox.can-zoom .lightbox__img { cursor: zoom-in; }
.lightbox.is-zoom .lightbox__img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox__btn { position: absolute; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); color: var(--brand-900); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); cursor: pointer; }
.lightbox__btn .icon { width: 22px; height: 22px; }
.lightbox__btn:disabled { opacity: 0.35; cursor: default; }
.lightbox__btn[hidden], .lightbox__count[hidden] { display: none; }
.lightbox__close { top: 16px; right: 16px; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
.lightbox__count { position: absolute; z-index: 2; left: 50%; bottom: 16px; transform: translateX(-50%); margin: 0; font-size: 13px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
@media (max-width: 760px) {
  .lightbox__stage { padding: 0; }
  .lightbox__img { width: 100vw; max-width: none; max-height: none; border-radius: 0; box-shadow: none; }
  .lightbox.is-zoom .lightbox__img { width: 220vw; }
  .lightbox__close { top: max(12px, env(safe-area-inset-top)); right: 12px; }
  .lightbox__nav { width: 40px; height: 40px; background: rgba(255, 255, 255, 0.8); }
  .lightbox__prev { left: 8px; }
  .lightbox__next { right: 8px; }
  .lightbox__count { bottom: max(14px, env(safe-area-inset-bottom)); }
}

/* --- หน้าลูกค้าองค์กร: โบรชัวร์ 2 ภาพคู่กัน (≥761) / ซ้อน (≤760) + หมายเหตุราคา + ปุ่มขอใบเสนอราคาด่วน --- */
.corp__note { display: flex; align-items: flex-start; gap: 8px; margin: 4px 0 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.corp__note .icon { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--brand-600); }
.corp__quick { margin: 0 0 20px; }
.corp__grid { gap: 24px; margin-top: 0; }
.corp__item { margin: 0; }
.corp__open { display: block; position: relative; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.corp__open:focus-visible { outline: 3px solid var(--brand-600); outline-offset: 2px; }
.corp__zoom { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--brand-900); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.corp__zoom .icon { width: 20px; height: 20px; }
.corp__item figcaption { margin-top: 8px; text-align: center; font-size: 13px; color: var(--muted); }
@media (max-width: 899px) { .corp__grid { gap: 16px; } }
@media (max-width: 760px) { .corp__zoom { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .pdp__thumbs button { transition: none; } }
