/* Catalog โกดังบ้านวัสดุ — CI: Navy #212739 / Red #FF0000 / Kanit + Sarabun */
:root {
  --shadow: 0 8px 30px rgba(33,39,57,.08);
  --shadow-lg: 0 18px 44px rgba(33,39,57,.14);
  --navy: #212739;
  --mid-navy: #2D3A5F;
  --red: #FF0000;
  --red-light: #FF3B47;
  --off-white: #F8F9FB;
  --gray: #6B7280;
  --border: #E5E7EB;
  --green: #22C55E;
  --font-heading: 'Kanit', sans-serif;
  --font-body: 'Sarabun', sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
/* ⚠ hidden ต้องหายจริงเสมอ — UA stylesheet ให้ [hidden]{display:none} มา "แบบอ่อน" คลาสที่ตั้ง
   display:flex/inline-flex ทับได้ทันที (specificity เท่ากันแต่มาทีหลัง) → element ที่ JS สั่งซ่อนยังโผล่
   เจอจริง 11 ก.ย.: .card-terms (งวดผ่อนโผล่ตอนเลือก "บัตรเครดิต จ่ายเต็มจำนวน"),
   ปุ่ม "สร้าง QR ใหม่" (.btn), แถบ "กำลังโหลด..." (.more-loading) */
[hidden] { display: none !important; }
body { font-family: var(--font-body); color: var(--navy); background: var(--off-white); line-height: 1.7; }
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.3; }
a { color: inherit; }
img { max-width: 100%; height: auto; }   /* height:auto — attribute width/height เป็น hint ทั้งสองแกน ถ้า CSS คุมแค่ width รูปจะยืดตามเลข height */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Topbar + header + footer (ร่วมกับหน้าแรก) */
.topbar { background: var(--navy); color: #fff; font-size: 14px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; }
.topbar a { color: #fff; text-decoration: none; font-weight: 500; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; padding-bottom: 12px; }
.site-header .logo img { height: 48px; display: block; }
.site-header nav { display: flex; gap: 24px; font-family: var(--font-heading); font-weight: 600; font-size: 15px; }
.site-header nav a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover, .site-header nav a.active { color: var(--red); border-color: var(--red); }
.site-footer { background: var(--navy); color: #9CA3AF; padding: 36px 0; text-align: center; font-size: 14px; margin-top: 64px; }
.site-footer img { height: 60px; margin-bottom: 12px; }
.site-footer .slogan { font-family: var(--font-heading); color: var(--red-light); font-size: 18px; margin-bottom: 6px; }

/* Buttons */
.btn { font-family: var(--font-heading); font-weight: 600; font-size: 16px; padding: 12px 26px; border-radius: 999px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; border: none; cursor: pointer; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: #D90000; }
.btn-outline-navy { border: 2px solid var(--navy); color: var(--navy); }

/* Catalog hero */
.catalog-hero { background: linear-gradient(135deg, var(--navy) 0%, var(--mid-navy) 100%); color: #fff; padding: 36px 0; }
.catalog-hero h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 900; }
.catalog-hero p { color: #C7CCDA; }

/* Layout */
.catalog-layout { display: grid; grid-template-columns: 250px 1fr; gap: 32px; padding-top: 32px; }

/* Filters */
.filters { position: sticky; top: 90px; align-self: start; }
.filter-block { margin-bottom: 24px; }
.filter-label { font-family: var(--font-heading); font-weight: 700; font-size: 15px; margin-bottom: 8px; display: block; }
.search-row { display: flex; gap: 6px; }
.search-row input { flex: 1; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-body); font-size: 15px; }
.search-row input:focus { outline: 2px solid var(--red-light); border-color: transparent; }
.btn-search { background: var(--red); border: none; border-radius: 8px; padding: 0 14px; cursor: pointer; font-size: 16px; }
.filter-list { list-style: none; }
.filter-list li a { display: flex; justify-content: space-between; text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.filter-list li a:hover { background: var(--off-white); }
.filter-list li a.active { background: var(--navy); color: #fff; font-weight: 700; }
.filter-list .count { color: var(--gray); font-size: 13px; }
.filter-list li a.active .count { color: #C7CCDA; }
.brand-list { max-height: 320px; overflow-y: auto; }

/* Product grid */
.active-filters { background: #fff; border: none; box-shadow: var(--shadow); border-radius: 12px; padding: 10px 16px; margin-bottom: 18px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.active-filters .clear { color: var(--red); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.active-filters .clear svg.lucide { width: 15px; height: 15px; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.product-card { border: none; box-shadow: var(--shadow); border-radius: 18px; overflow: hidden; text-decoration: none; background: #fff; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.card-image { position: relative; aspect-ratio: 1; background: #fff; border-bottom: 1px solid var(--off-white); display: flex; align-items: center; justify-content: center; }
.card-image > img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.no-image { opacity: .18; width: 44%; }
.no-image.big { opacity: .15; width: 38%; margin: 0 auto; }
.flag { position: static; font-family: var(--font-heading); font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #FEF9C3; color: #854D0E; display: inline-block; }
.card-image .flag { position: absolute; top: 8px; left: 8px; }
.card-image .flag + .flag { top: 34px; }
.flag-net { background: #FEF08A; color: #713F12; }
.flag-no-vat { background: #DBEAFE; color: #1E40AF; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-brand { font-size: 12px; font-weight: 700; color: var(--gray); letter-spacing: .5px; }
.card-name { font-family: var(--font-heading); font-weight: 600; font-size: 15px; line-height: 1.4; flex: 1; }
.card-price { color: var(--red); font-family: var(--font-heading); font-weight: 700; font-size: 17px; margin-top: 4px; }
.card-price .baht { font-size: 12px; color: var(--gray); font-weight: 400; }
/* CTA แทนราคาสำหรับ guest ที่ยังไม่มีราคาปลีก (การ์ด + การ์ดลอย) — ตัวเล็กสีแดง ไม่ตัวหนา */
.card-member-cta { font-family: var(--font-body); font-weight: 500; font-size: 12.5px; color: var(--red); line-height: 1.3; }
.fc-price .card-member-cta { font-size: 11px; }
/* CTA ในช่องราคาตารางสินค้า (ลิงก์ไป /register) */
.member-price-cta { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--red); color: var(--red); border-radius: 999px; padding: 4px 12px; font-family: var(--font-heading); font-weight: 600; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.member-price-cta:hover { background: var(--red); color: #fff; }
.member-price-cta svg.lucide { width: 13px; height: 13px; }
.vt-cta-cell { text-align: center; vertical-align: middle; background: #FFF9F9 !important; }
.vt-cta-box { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 20px 12px; }
.vt-cta-box > svg.lucide { width: 28px; height: 28px; color: var(--red); }
.vt-cta-title { font-family: var(--font-heading); font-weight: 700; font-size: 15.5px; color: var(--navy); }
.vt-cta-btn { padding: 11px 24px; font-size: 15px; }
.vt-cta-sub { font-size: 12.5px; color: var(--gray); }
.vt-cta-sub a { color: var(--red); font-weight: 600; }
.price-cta-login { font-size: 13px; color: var(--gray); align-self: center; }
.price-cta-login a { color: var(--red); font-weight: 600; }
.vt-no-order { color: var(--gray); }
/* สถานะ pending: แทน CTA "สมัครสมาชิก" ด้วยข้อความ "รอทีมงานติดต่อกลับเปิดระบบ" */
.card-pending-note { font-family: var(--font-body); font-weight: 500; font-size: 12.5px; color: #A16207; line-height: 1.3; }
.fc-price .card-pending-note { font-size: 11px; }
.member-price-note { display: inline-flex; align-items: center; gap: 5px; background: #FEF9C3; border: 1px solid #FDE68A; color: #854D0E; border-radius: 999px; padding: 4px 12px; font-family: var(--font-heading); font-weight: 600; font-size: 12.5px; }
.member-price-note svg.lucide { width: 13px; height: 13px; flex-shrink: 0; }
.vt-cta-box--pending > svg.lucide { color: #A16207; }
.vt-cta-box--card.vt-cta-box--pending { background: #FEFCE8; border-color: #FDE68A; }
/* ป้ายส่วนลดในตาราง/การ์ดราคา (เดิมเป็น inline style ซ้ำ 3 ที่) */
.flag-discount { background: #FEE2E2; color: #B91C1C; font-size: 11px; }

/* ── ตารางราคาแบบการ์ดสำหรับมือถือ (แสดงเฉพาะ ≤600px — ดู media query ท้ายไฟล์) ──
   เดิมตารางถูกบังคับ min-width 520px บนจอ 390px → ปุ่มสั่งซื้อ/CTA หลุดนอกจอ
   จึงเปลี่ยนเป็นการ์ดต่อ variant: ขนาด/บรรจุ/ราคา/ปุ่ม ซ้อนกันในความกว้างจอจริง */
.vt-cards { display: none; }
.vt-card { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.vt-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vt-card-size { font-family: var(--font-heading); font-weight: 700; font-size: 16px; color: var(--navy); }
.vt-card-pack { font-size: 13px; color: var(--gray); text-align: right; }
.vt-card-rows { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--off-white); display: flex; flex-direction: column; gap: 5px; }
.vt-card-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.vt-card-label { font-size: 13px; color: var(--gray); flex-shrink: 0; }
.vt-card-val { text-align: right; font-family: var(--font-heading); font-weight: 700; color: var(--red); overflow-wrap: anywhere; }
.vt-card-val .price-note { font-size: 12px; color: var(--gray); font-weight: 400; font-family: var(--font-body); }
.vt-card-row--special .vt-card-label { color: var(--red); font-weight: 600; }
.vt-card-order { margin-top: 10px; display: flex; justify-content: flex-end; }
.vt-card-order .vt-order-form { display: flex; align-items: center; gap: 8px; width: 100%; }
.vt-card-order .vt-cart-btn--wide { flex: 1; width: auto; height: 40px; gap: 7px; padding: 0 14px; font-family: var(--font-heading); font-weight: 600; font-size: 14.5px; border-radius: 12px; }
.vt-cta-box--card { background: #FFF9F9; border: 1px solid #FCA5A5; border-radius: 14px; text-align: center; }
.vt-cta-box--card .vt-cta-btn { max-width: 100%; }
.card-meta { font-size: 12px; color: var(--gray); }

.empty-state { text-align: center; padding: 64px 0; color: var(--gray); }
.empty-state .btn { margin-top: 16px; }
.pagination-wrap { margin-top: 28px; display: flex; justify-content: center; }

/* Product detail */
.product-page { padding-top: 24px; }
.breadcrumb { font-size: 14px; color: var(--gray); margin-bottom: 20px; }
.breadcrumb a { color: var(--gray); text-decoration: none; }
.breadcrumb a:hover { color: var(--red); }
.product-detail { display: grid; grid-template-columns: 1fr 1.3fr; gap: 36px; align-items: start; }
/* กัน grid blowout: ลูก grid มี min-width:auto โดย default → min-content ของตาราง (5 คอลัมน์)
   ดันคอลัมน์กว้างเกิน viewport ทำให้หน้าล้นแนวนอน; min-width:0 ให้ track หดได้ .vt-scroll จึงเลื่อนเองได้ */
.product-detail > * { min-width: 0; }
/* ตารางตัวเลือกสินค้าเลื่อนแนวนอนได้ทุกขนาดจอ (เดิมอยู่เฉพาะ ≤560px → tablet/แนวนอนล้น) */
.vt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.detail-image { border: none; box-shadow: var(--shadow); border-radius: 18px; background: var(--off-white); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.detail-image img { width: 100%; height: 100%; object-fit: contain; padding: 20px; }
.detail-brand { font-weight: 700; color: var(--gray); letter-spacing: 1px; font-size: 14px; }
.detail-info h1 { font-size: clamp(24px, 3vw, 34px); font-weight: 700; margin: 4px 0 10px; }
.detail-flags { display: flex; gap: 8px; margin-bottom: 14px; }
.detail-desc { color: var(--gray); margin-bottom: 18px; }
.variant-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.variant-table th { font-family: var(--font-heading); background: var(--navy); color: #fff; text-align: left; padding: 10px 14px; font-weight: 600; }
.variant-table th.special { background: var(--red); }
.variant-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.variant-table tr:nth-child(even) td { background: var(--off-white); }
.variant-table .price { color: var(--red); font-weight: 700; font-family: var(--font-heading); white-space: nowrap; }
.variant-table .price-note { font-size: 12px; color: var(--gray); font-weight: 400; font-family: var(--font-body); }
.sku-tag { display: block; font-size: 11px; color: var(--gray); font-weight: 400; font-family: var(--font-body); margin-top: 2px; }
.detail-source { font-size: 13px; color: var(--gray); margin-top: 10px; }
.detail-cta { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.related { margin-top: 56px; }
.related h2 { font-size: 24px; margin-bottom: 18px; }

/* สินค้าอื่นๆ (สุ่มทั้งร้าน + infinite scroll) */
.more-products { margin-top: 40px; }
.more-products h2 { font-size: 24px; margin-bottom: 18px; }
.section-divider { border: 0; border-top: 1px solid var(--off-white, #EEF0F4); margin: 44px 0 32px; }
.more-status { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 26px; min-height: 44px; }
.more-loading { display: inline-flex; align-items: center; gap: 8px; color: var(--gray, #667); font-size: 15px; }
.more-loading i, .more-loading svg { width: 18px; height: 18px; animation: spin 0.9s linear infinite; }
.more-btn { min-width: 180px; }
.more-sentinel { height: 1px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .product-detail { grid-template-columns: 1fr; }
  .site-header nav { gap: 14px; font-size: 13px; }
  .site-header .logo img { height: 38px; }
}

/* Lucide icons */
svg.lucide { width: 1em; height: 1em; stroke-width: 2; vertical-align: -0.12em; }
.btn-search svg.lucide { color: #fff; }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; font-family: var(--font-heading); }   /* wrap: หน้าเยอะๆ ปุ่มเลขจะไม่ทะลุขอบจอมือถือ */
.pager-btn { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border-radius: 12px; box-shadow: var(--shadow); text-decoration: none; font-weight: 600; font-size: 15px; transition: transform .12s, box-shadow .12s; }
.pager-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); color: var(--red); }
.pager-btn.current { background: var(--navy); color: #fff; }
.pager-btn.disabled { opacity: .35; pointer-events: none; }
.pager-dots { color: var(--gray); padding: 0 4px; }

/* Footer แบบเว็บเดิม: ข้อมูลบริษัท + DBD */
.footer-grid { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 32px; text-align: left; align-items: start; }
.footer-col h4 { color: #fff; font-family: var(--font-heading); font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.footer-brand { text-align: center; }
.footer-brand .f-logo { height: 84px; margin-bottom: 10px; }
.footer-info { list-style: none; }
.footer-info li { display: flex; gap: 9px; align-items: baseline; padding: 5px 0; font-size: 14px; line-height: 1.6; }
.footer-info svg.lucide { color: var(--red-light); flex-shrink: 0; transform: translateY(2px); }
.footer-info a { color: #fff; text-decoration: none; font-weight: 600; }
.footer-info a:hover { color: var(--red-light); }
.footer-trust { text-align: center; }
.dbd-card { background: #fff; border-radius: 12px; padding: 10px 16px; display: inline-block; }
.dbd-card img { height: 58px; display: block; }
.f-channels { font-size: 12.5px; margin-top: 12px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; text-align: center; font-size: 13px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; text-align: center; } .footer-info li { justify-content: center; text-align: left; } }

/* Header เหมือนหน้าแรก */
.announce { background: var(--navy); color: #fff; font-family: var(--font-heading); font-size: 13px; }
.announce .container { display: flex; justify-content: center; gap: 34px; padding: 8px 20px; flex-wrap: wrap; }
.announce span { display: flex; align-items: center; gap: 6px; }
.announce .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red-light); display: inline-block; }
.site-header { box-shadow: 0 1px 0 var(--border); border-bottom: none; }
.site-header .container { padding-top: 14px; padding-bottom: 14px; gap: 20px; }
.site-header .logo img { height: 46px; }
.site-header nav { gap: 26px; font-weight: 500; align-items: center; }
.site-header nav a { border-bottom: none; position: relative; }
.site-header nav a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; border-radius: 2px; background: var(--red); }
.site-header nav a:hover, .site-header nav a.active { color: var(--red); }
/* a.nav-cta ต้อง specificity สูงกว่า .site-header nav a (padding 4px 0) ไม่งั้นเลขชนขอบมนของ pill */
.site-header nav a.nav-cta { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; background: var(--red); color: #fff !important; padding: 9px 20px; border-radius: 999px; font-weight: 600; }
.site-header nav a.nav-cta:hover { background: #D90000; }
.site-header nav a.nav-cta::after { display: none !important; }
@media (max-width: 900px) { .site-header nav { gap: 12px; } .site-header nav a.nav-cta { padding: 7px 14px; } }

/* Gallery admin */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, 110px); gap: 10px; }
.g-item { position: relative; width: 110px; height: 110px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; cursor: grab; }
.g-item img { width: 100%; height: 100%; object-fit: contain; }
.g-item.dragging { opacity: .4; }
.g-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; border-radius: 50%; background: rgba(33,39,57,.75); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.g-cover { display: none; position: absolute; left: 4px; bottom: 4px; background: var(--red); color: #fff; font-family: var(--font-heading); font-size: 10.5px; padding: 1px 8px; border-radius: 999px; }
.g-item.is-cover .g-cover { display: block; }
.g-drop { width: 110px; height: 110px; border: 2px dashed var(--border); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--gray); font-size: 11.5px; text-align: center; cursor: pointer; }
.g-drop.over { border-color: var(--red); color: var(--red); background: #FFF1F2; }
.g-drop svg.lucide { width: 22px; height: 22px; }
.variant-table .vi { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; }

/* เทียบราคาคู่แข่ง: แถวปุ่มเปิดผลค้นหา (หน้าแก้ไขสินค้า) */
.competitor-compare .cc-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cc-input { flex: 1 1 240px; min-width: 200px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-body); font-size: 15px; }
.cc-input:focus { outline: 2px solid var(--red-light); border-color: transparent; }
.cc-btn { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--navy); color: var(--navy); background: #fff; border-radius: 8px; padding: 8px 14px; font-family: var(--font-body); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cc-btn:hover { background: var(--navy); color: #fff; }
.cc-btn svg.lucide { width: 15px; height: 15px; }

/* คอลัมน์ราคาตลาด (คู่แข่ง) ในตารางราคา */
.variant-table td.market-col { background: #F8FAFC; vertical-align: top; }
.variant-table tr:nth-child(even) td.market-col { background: #F1F5F9; }
.variant-table td.market-col .vi { display: block; }
.v-market-info { margin-top: 5px; }
.mk-badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; line-height: 1.4; white-space: normal; }
.mk-lower { background: #DCFCE7; color: #15803D; }        /* เราถูกกว่า = เขียว */
.mk-higher { background: #FEE2E2; color: #B91C1C; }       /* เราแพงกว่า = แดงอ่อน */
.mk-eq { background: #E5E7EB; color: #374151; }
.mk-hint { display: inline-block; font-size: 11.5px; color: var(--gray); }
.mk-use { border: 1px solid var(--red); color: var(--red); background: #fff; border-radius: 6px; padding: 2px 8px; font-family: var(--font-body); font-size: 11.5px; font-weight: 600; cursor: pointer; margin-top: 3px; }
.mk-use:hover { background: var(--red); color: #fff; }
.mk-old { font-size: 11px; font-weight: 700; color: #92400E; background: #FEF3C7; border-radius: 5px; padding: 2px 7px; margin-top: 5px; display: inline-block; }

/* Gallery หน้าลูกค้า */
.gallery-strip { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gs-thumb { width: 64px; height: 64px; border: 2px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; cursor: pointer; padding: 0; }
.gs-thumb.active { border-color: var(--red); }
.gs-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* ราคาตั้งขีดฆ่า */
.list-price { text-decoration: line-through; color: var(--gray); font-weight: 400; font-size: 13px; }

/* Page loader: กันฟอนต์/เลย์เอาต์กระพริบตอนโหลด */
#page-loader { position: fixed; inset: 0; background: #fff; z-index: 999; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; transition: opacity .35s; }
#page-loader.done { opacity: 0; pointer-events: none; }
#page-loader img { width: 150px; animation: loaderPulse 1.1s ease-in-out infinite; }
#page-loader .bar { width: 120px; height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
#page-loader .bar::after { content: ""; display: block; width: 40%; height: 100%; background: var(--red); border-radius: 999px; animation: loaderBar 1s ease-in-out infinite; }
@keyframes loaderPulse { 0%,100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes loaderBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }
.card-image { background: linear-gradient(100deg, #F1F3F7 40%, #E9ECF2 50%, #F1F3F7 60%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.card-image:has(img[data-loaded]), .card-image:not(:has(img)) { animation: none; background: #fff; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Footer v2: LINE + social */
.footer-grid { display: grid; grid-template-columns: 1fr 1.5fr .85fr .85fr; gap: 30px; text-align: left; align-items: start; }
.footer-col h4 { color: #fff; font-family: var(--font-heading); font-size: 15.5px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.footer-col h4 svg.lucide { color: var(--red-light); }
.footer-brand { text-align: center; }
.footer-brand .f-logo { height: 76px; margin-bottom: 8px; }
footer .slogan { font-family: var(--font-script); color: var(--red-light); font-size: 19px; margin-bottom: 14px; line-height: 1.5; }
.f-social { display: flex; gap: 10px; justify-content: center; }
.f-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: #fff; text-decoration: none; transition: background .15s, transform .15s; }
.f-social a:hover { background: var(--red); transform: translateY(-2px); }
.f-social svg.lucide { width: 17px; height: 17px; }
.footer-info { list-style: none; }
.footer-info li { display: flex; gap: 9px; align-items: baseline; padding: 4px 0; font-size: 14px; line-height: 1.6; }
.footer-info svg.lucide { color: var(--red-light); flex-shrink: 0; transform: translateY(2px); }
.footer-info a { color: #fff; text-decoration: none; font-weight: 600; }
.footer-info a:hover { color: var(--red-light); }
.f-channels { font-size: 12.5px; margin-top: 10px; line-height: 1.6; color: var(--gray-light); }
.f-channels span { color: #fff; font-family: var(--font-heading); }
.footer-line, .footer-trust { text-align: center; }
.footer-line h4, .footer-trust h4 { justify-content: center; }
.line-card, .dbd-card { background: #fff; border-radius: 14px; padding: 10px; display: inline-block; }
.line-card img { width: 128px; display: block; border-radius: 6px; }
.dbd-card img { height: 54px; display: block; }
.f-hint { font-size: 12.5px; margin-top: 10px; line-height: 1.6; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 28px; padding-top: 18px; text-align: center; font-size: 13px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-col:first-child { grid-column: 1 / -1; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } .footer-info li { justify-content: flex-start; } }

/* Admin panel */
.admin-body { display: flex; min-height: 100vh; background: var(--off-white); }
.admin-side { width: 232px; background: var(--navy); color: #C7CCDA; display: flex; flex-direction: column; position: fixed; left: 0; top: 0; height: 100vh; flex-shrink: 0; overflow-y: auto; z-index: 60; }
.admin-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px 18px; text-decoration: none; color: #fff; font-family: var(--font-heading); font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.08); }
.admin-logo img { height: 58px; width: auto; }
.admin-nav { display: flex; flex-direction: column; padding: 12px 10px; gap: 2px; flex: 1; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; color: #C7CCDA; text-decoration: none; font-family: var(--font-heading); font-size: 14.5px; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a.active { background: var(--red); color: #fff; }
.admin-nav svg.lucide { width: 17px; height: 17px; }
.admin-side-foot { padding: 12px 14px 18px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.admin-side-foot a, .admin-side-foot button { color: #9CA3AF; text-decoration: none; background: none; border: none; cursor: pointer; font-family: var(--font-heading); font-size: 13.5px; display: flex; align-items: center; gap: 8px; padding: 0; }
.admin-side-foot a:hover, .admin-side-foot button:hover { color: #fff; }
.admin-main { flex: 1; min-width: 0; margin-left: 232px; }
.admin-top { background: #fff; box-shadow: 0 1px 0 var(--border); padding: 14px 26px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 40; }
.admin-top-title { font-family: var(--font-heading); font-weight: 700; font-size: 19px; }
.admin-top-user { color: var(--gray); font-size: 14px; display: flex; gap: 7px; align-items: center; }
.admin-content { padding: 24px 26px 48px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; text-decoration: none; display: block; }
.stat-card .stat-num { font-family: var(--font-heading); font-weight: 900; font-size: 28px; color: var(--navy); }
.stat-card .stat-label { font-size: 13px; color: var(--gray); }
a.stat-card:hover { box-shadow: var(--shadow-lg); }
.admin-content .variant-table { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
/* Admin form building blocks (shared desktop + used by mobile collapse) */
.admin-panel { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px 18px; }
.admin-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-body); font-size: 15px; }
.admin-input:focus { outline: 2px solid var(--red-light); border-color: transparent; }
.edit-top-grid { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.admin-panel summary, .row-edit summary { list-style: none; cursor: pointer; }
.admin-panel summary::-webkit-details-marker, .row-edit summary::-webkit-details-marker { display: none; }
.row-edit { display: inline-block; }
.row-edit > summary { display: inline-flex; }
.row-edit-form { display: flex; flex-direction: column; gap: 5px; width: 280px; max-width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.row-edit-form .filter-label { margin: 4px 0 0; }
@media (max-width: 800px) { .admin-side { position: fixed; left: -240px; } .admin-main { margin-left: 0; } }
.v-del { border: none; background: #FEF2F2; color: #B91C1C; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.v-del:hover { background: #FEE2E2; }

/* ===== Mobile app-style (≤900px) ===== */
.hamburger { display: none; border: none; background: none; cursor: pointer; color: var(--navy); padding: 6px; }
.hamburger svg.lucide { width: 26px; height: 26px; }

/* Drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(15,18,28,.5); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 90; }
.drawer-overlay.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; bottom: 0; left: -300px; width: 288px; background: #fff; z-index: 95; transition: left .28s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; box-shadow: 4px 0 24px rgba(33,39,57,.18); }
.drawer.open { left: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 12px; border-bottom: 1px solid var(--border); }
.drawer-head img { height: 40px; }
.drawer-head button { border: none; background: var(--off-white); border-radius: 50%; width: 34px; height: 34px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.drawer-nav { flex: 1; overflow-y: auto; padding: 10px 12px; }
.drawer-nav a, .drawer-nav button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; text-decoration: none; font-family: var(--font-heading); font-weight: 500; font-size: 15px; color: var(--navy); border: none; background: none; width: 100%; cursor: pointer; }
.drawer-nav a:active, .drawer-nav a:hover { background: var(--off-white); color: var(--red); }
.drawer-nav svg.lucide { width: 18px; height: 18px; color: var(--gray); }
.drawer-label { font-size: 12px; color: var(--gray-light, #9CA3AF); font-family: var(--font-heading); letter-spacing: 1px; padding: 12px 12px 4px; }
.drawer-sub { font-size: 14px !important; padding: 8px 12px 8px 18px !important; font-weight: 400 !important; }
.drawer-sub svg.lucide { width: 14px !important; height: 14px !important; }
.drawer-call { margin: 12px 16px calc(16px + env(safe-area-inset-bottom)); justify-content: center; }

/* Bottom nav */
.bottom-nav { display: none; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; box-shadow: 0 -4px 20px rgba(33,39,57,.1); z-index: 80; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 4px 7px; text-decoration: none; color: var(--gray); font-family: var(--font-heading); font-size: 11px; }
.bottom-nav a.active { color: var(--red); }
.bottom-nav a.active svg.lucide { color: var(--red); }
.bottom-nav svg.lucide { width: 21px; height: 21px; }

@media (max-width: 900px) {
  .hamburger { display: inline-flex; }
  .bottom-nav { display: flex; }
  body { padding-bottom: 64px; }
  .site-header nav { display: none; }
  .site-header .container { justify-content: flex-start; gap: 12px; }
  .site-header .logo { margin-right: auto; }
  .site-header .logo img { height: 38px; }
  .announce { display: none; }

  /* Catalog มือถือ: การ์ด 2 คอลัมน์ + filter เป็น bottom sheet */
  .catalog-layout { grid-template-columns: 1fr; padding-top: 16px; gap: 0; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-name { font-size: 13.5px; }
  .card-price { font-size: 15px; }
  .catalog-hero { padding: 22px 0; }
  .catalog-hero h1 { font-size: 24px; }

  .filters { position: fixed; left: 0; right: 0; bottom: -100%; top: auto; max-height: 78vh; overflow-y: auto; background: #fff; z-index: 95; border-radius: 20px 20px 0 0; padding: 18px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(33,39,57,.2); transition: bottom .3s cubic-bezier(.4,0,.2,1); }
  .filters.open { bottom: 0; }
  .filter-fab { display: inline-flex !important; }

  /* หน้า detail */
  .product-detail { grid-template-columns: 1fr; gap: 20px; }
  .variant-table { font-size: 13.5px; }
  .variant-table th, .variant-table td { padding: 8px 10px; }
  .detail-cta .btn { flex: 1 1 auto; justify-content: center; white-space: nowrap; }
}
.filter-fab { display: none; align-items: center; gap: 8px; font-family: var(--font-heading); font-weight: 600; background: var(--navy); color: #fff; border: none; border-radius: 999px; padding: 10px 22px; margin-bottom: 14px; cursor: pointer; }
.filter-fab svg.lucide { width: 16px; height: 16px; }
.filter-sheet-head { display: none; }
@media (max-width: 900px) {
  .filter-sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-family: var(--font-heading); font-weight: 700; font-size: 17px; }
  .filter-sheet-head button { border: none; background: var(--off-white); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; }
}

/* Admin มือถือ: sidebar เป็น drawer */
.admin-burger { color: var(--navy); }
@media (min-width: 801px) { .admin-burger { display: none; } }
@media (max-width: 800px) {
  .admin-side { position: fixed; left: -260px; z-index: 95; transition: left .28s; height: 100vh; }
  .admin-side.open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .admin-burger { display: inline-flex; }
  .admin-content { padding: 16px 14px 40px; }
  .admin-top { padding: 12px 14px; gap: 10px; }
  .admin-content .variant-table { display: block; overflow-x: auto; white-space: nowrap; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  /* ฟอร์ม grid 2 คอลัมน์ → 1 คอลัมน์ */
  .admin-form-grid, .edit-top-grid { grid-template-columns: 1fr; }
  /* ปุ่ม/อินพุตขนาดนิ้วกด */
  .admin-content .btn, .admin-content .btn-search, .admin-content .admin-input,
  .admin-content .search-row input, .admin-content .search-row select,
  .admin-content details.admin-panel > summary { min-height: 42px; }
  .admin-content .btn-search { min-width: 46px; }
}

/* Admin: ตาราง list → การ์ดบนมือถือ (≤560px) — scope แคบที่ .admin-cards เท่านั้น
   (variant-table หน้าบ้าน + ตารางราคาในหน้าแก้ไขสินค้าไม่โดน) */
@media (max-width: 560px) {
  .admin-content .admin-cards { display: block; background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
  .admin-content .admin-cards thead { display: none; }
  .admin-content .admin-cards tbody { display: block; }
  .admin-content .admin-cards tr { display: block; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 12px; }
  .admin-content .admin-cards td { display: block; border: none; padding: 6px 0; white-space: normal; }
  .admin-content .admin-cards tr:nth-child(even) td { background: transparent; }
  .admin-content .admin-cards td::before { content: attr(data-label); display: block; font-family: var(--font-heading); font-weight: 600; font-size: 11.5px; letter-spacing: .3px; color: var(--gray); margin-bottom: 3px; }
  .admin-content .admin-cards td[data-label=""]::before,
  .admin-content .admin-cards td:not([data-label])::before { content: none; }
  .row-edit, .row-edit > summary { display: block; }
  .row-edit > summary { width: 100%; justify-content: center; }
  .row-edit-form { width: 100%; }
  /* กันปุ่มล้นขวาในฟอร์มแถวเดียว (add/search/in-card): input เต็มแถว ปุ่มตกบรรทัดถัดไป */
  .admin-content .search-row { flex-wrap: wrap; }
  .admin-content .search-row > input { flex: 1 1 100% !important; min-width: 0 !important; }
  .admin-content .admin-cards td form { flex-wrap: wrap; }
  .admin-content .admin-cards td form > input { flex: 1 1 100% !important; min-width: 0 !important; }
  .admin-content .detail-cta { flex-wrap: wrap; }
  .admin-content .detail-cta > .btn { flex: 1 1 auto; justify-content: center; }
}

/* Footer v3: กล่องขาว LINE/DBD จัดกลางจริง (รูป crop ขอบขาวแล้ว) + มือถือกระชับกลางจอ */
@media (min-width: 901px) { .footer-grid { grid-template-columns: 1.15fr 1.45fr .85fr .85fr; } }
footer .slogan { font-size: 15px; white-space: nowrap; letter-spacing: 0; }
.line-card { width: 148px; height: 148px; display: flex; align-items: center; justify-content: center; margin: 0 auto; padding: 0; }
.line-card img { width: 120px; height: 120px; object-fit: contain; border-radius: 0; }
.dbd-card { width: auto; height: auto; display: inline-flex; align-items: center; justify-content: center; padding: 14px 18px; margin: 0 auto; }
.dbd-card img { height: 50px; width: auto; max-width: none; display: block; }
.f-channels .ch { display: inline-block; background: rgba(255,255,255,.08); border-radius: 999px; padding: 2px 11px; margin: 2px 1px; color: #E5E7EB; font-size: 12px; }
.f-line-btn { display: none; align-items: center; justify-content: center; gap: 9px; background: #06C755; color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 16px; border-radius: 999px; padding: 13px 22px; max-width: 300px; margin: 0 auto; text-decoration: none; }
.f-line-btn svg.lucide { width: 20px; height: 20px; }
/* ปุ่มเข้าสู่ระบบ/สมัครด้วย LINE ในหน้า login/register — full-width pill เขียว LINE */
.line-login-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; background: #06C755; color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 16px; border-radius: 999px; padding: 12px 22px; text-decoration: none; }
.line-login-btn:hover { background: #05b148; }
.line-login-btn svg.lucide { width: 20px; height: 20px; }
.or-sep { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--gray); font-size: 14px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.footer-info .nb { white-space: nowrap; }
html, body { overflow-x: hidden; max-width: 100vw; }

/* มือถือ: เรียงกลางจอ กระชับ + ปุ่ม LINE แทน QR (สแกนจอตัวเองไม่ได้) */
@media (max-width: 560px) {
  .site-footer { padding: 28px 0 24px; }
  .footer-grid { gap: 22px; }
  footer .slogan { white-space: normal; font-size: 19px; line-height: 1.45; }
  .footer-brand .f-logo { height: 62px; }
  .footer-col { text-align: center; }
  .footer-col h4 { justify-content: center; }
  .footer-info { display: inline-block; text-align: left; }
  .line-card { display: none; }
  .f-line-btn { display: flex; }
  .f-hint-add { display: none; }
  .footer-bottom { margin-top: 20px; padding-top: 14px; font-size: 12.5px; }
}

/* Lightbox ดูรูปสินค้าเต็มจอ */
.lightbox { position: fixed; inset: 0; background: rgba(15,18,28,.94); z-index: 200; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 10px; background: #fff; }
.lb-btn { position: absolute; width: 46px; height: 46px; border-radius: 50%; border: none; background: rgba(255,255,255,.12); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-btn svg.lucide { width: 24px; height: 24px; }
.lb-close { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: calc(18px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #fff; font-family: var(--font-heading); font-size: 14px; background: rgba(255,255,255,.12); padding: 3px 14px; border-radius: 999px; }
.detail-image { cursor: zoom-in; }

/* Admin มือถือ v2: การ์ดกระชับ (สินค้า/หมวดหมู่/แบรนด์) */
@media (max-width: 560px) {
  .admin-content { padding: 12px 12px 36px; }
  .admin-content h1 { font-size: 22px; }

  /* หมวดหมู่ + แบรนด์: ชื่อ+บันทึกบรรทัดบน · slug · N สินค้า · ปุ่มลบ บรรทัดล่าง */
  .admin-content .ac-line tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 12px; margin-bottom: 8px; }
  .admin-content .ac-line td { display: block; padding: 0; }
  .admin-content .ac-line td::before { content: none; }
  .admin-content .ac-line td:first-child { flex: 1 1 100%; }
  .admin-content .ac-line td:first-child form { flex-wrap: nowrap; }
  .admin-content .ac-line td:first-child form > input { flex: 1 1 auto !important; }
  .admin-content .ac-line td[data-label="slug"] { font-size: 12px; color: var(--gray); }
  .admin-content .ac-line td[data-label="จำนวนสินค้า"] { font-size: 12px; color: var(--gray); }
  .admin-content .ac-line td[data-label="จำนวนสินค้า"]::after { content: " สินค้า"; }
  .admin-content .ac-line td:last-child { margin-left: auto; }
  .admin-content .ac-line td:last-child > div { flex-wrap: nowrap !important; gap: 8px !important; }

  /* สินค้า: รูปซ้าย + ชื่อ · meta เทาบรรทัดเดียว · ปุ่มแถวล่าง */
  .admin-content .ac-products tr { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; padding: 10px 12px; margin-bottom: 8px; }
  .admin-content .ac-products td { display: block; padding: 0; }
  .admin-content .ac-products td::before { content: none; }
  .admin-content .ac-products td[data-label="รูป"] { order: 1; }
  .admin-content .ac-products td[data-label="สินค้า"] { order: 2; flex: 1 1 calc(100% - 66px); font-family: var(--font-heading); font-weight: 600; font-size: 14.5px; line-height: 1.35; }
  .admin-content .ac-products td[data-label="หน้า"] { order: 3; font-size: 12px; color: var(--gray); }
  .admin-content .ac-products td[data-label="หน้า"]::before { content: "หน้า "; display: inline; font-family: inherit; font-size: inherit; font-weight: inherit; color: inherit; letter-spacing: 0; margin: 0; }
  .admin-content .ac-products td[data-label="แบรนด์"] { order: 4; font-size: 12px; color: var(--gray); }
  .admin-content .ac-products td[data-label="ขนาด/ราคา"] { order: 5; font-size: 12px; color: var(--gray); flex: 1 1 auto; }
  /* ตัวคั่นบังคับขึ้นบรรทัดใหม่ก่อนกลุ่มปุ่ม — ::after ของ flex container นับเป็น flex item
     เดิมความยาว "ขนาด/ราคา" ไม่เท่ากันทำให้จุด wrap เลื่อน ปุ่มแต่ละใบจึงเรียงเป็นขั้นบันได */
  .admin-content .ac-products tr::after { content: ""; flex: 0 0 100%; height: 0; order: 6; }
  .admin-content .ac-products td[data-label="ข้อมูล"] { order: 7; margin-top: 4px; }
  .admin-content .ac-products td[data-label="แสดงบนเว็บ"] { order: 8; margin-top: 4px; }
  .admin-content .ac-products td[data-label="จัดการ"] { order: 9; margin-top: 4px; margin-left: auto; }
}

/* ============================================================
   ตะกร้าสินค้า (Phase 1) — badge / stepper / cart page / toast
   ============================================================ */

/* Badge ตัวเลขบนไอคอนตะกร้า (header desktop + bottom nav) */
.cart-badge { position: absolute; top: -7px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-family: var(--font-heading); font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px #fff; }
.cart-badge[hidden] { display: none; }

/* ไอคอนตะกร้าใน header (เฉพาะ desktop nav) */
.header-cart { position: relative; display: inline-flex; align-items: center; color: var(--navy); }
.header-cart:hover { color: var(--red); }
.header-cart svg.lucide { width: 22px; height: 22px; }

/* Account dropdown (เมนูบัญชี — desktop; มือถือ nav ถูกซ่อน) */
.acct-menu { position: relative; display: inline-flex; }
.acct-btn { display: inline-flex; align-items: center; gap: 2px; background: none; border: none; cursor: pointer; color: var(--navy); font-family: var(--font-heading); font-weight: 500; font-size: 15px; padding: 4px 2px; }
.acct-btn:hover { color: var(--red); }
.acct-btn svg.lucide { width: 21px; height: 21px; }
.acct-btn .acct-caret { width: 15px; height: 15px; transition: transform .18s ease; }
.acct-menu.open .acct-btn .acct-caret { transform: rotate(180deg); }
.acct-menu.open .acct-btn { color: var(--red); }
.acct-dropdown { position: absolute; top: calc(100% + 12px); right: 0; min-width: 200px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 34px rgba(33,39,57,.16); padding: 6px; z-index: 60; }
.acct-dropdown[hidden] { display: none; }
.acct-menu .acct-dropdown a, .acct-menu .acct-dropdown button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--navy); font-family: var(--font-heading); font-weight: 500; font-size: 14.5px; background: none; border: none; cursor: pointer; text-align: left; white-space: nowrap; }
.acct-menu .acct-dropdown a:hover, .acct-menu .acct-dropdown button:hover { background: var(--off-white); color: var(--red); }
.acct-dropdown svg.lucide { width: 17px; height: 17px; flex-shrink: 0; }
.acct-name { display: block; padding: 8px 12px 6px; font-family: var(--font-heading); font-weight: 700; font-size: 14px; color: var(--navy); overflow: hidden; text-overflow: ellipsis; }
.acct-divider { height: 1px; background: var(--border); margin: 5px 4px; }

/* wrap ไอคอน bottom nav ให้ badge เกาะมุม */
.bn-icon { position: relative; display: inline-flex; }

/* Stepper −/+ (ใช้ทั้งหน้าตะกร้าและตารางสินค้า) */
.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 999px; overflow: hidden; background: #fff; }
.qty-stepper .qty-btn { width: 34px; height: 34px; border: none; background: #fff; color: var(--navy); font-size: 18px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.qty-stepper .qty-btn:hover { background: var(--off-white); color: var(--red); }
.qty-stepper .qty-input { width: 40px; height: 34px; border: none; border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border); text-align: center; font-family: var(--font-heading); font-weight: 600; font-size: 15px; color: var(--navy); background: #fff; -moz-appearance: textfield; }
.qty-stepper .qty-input::-webkit-outer-spin-button, .qty-stepper .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-stepper.sm .qty-btn { width: 28px; height: 28px; font-size: 16px; }
.qty-stepper.sm .qty-input { width: 32px; height: 28px; font-size: 13.5px; }

/* คอลัมน์ "สั่งซื้อ" ในตารางสินค้า */
.vt-order-cell { white-space: nowrap; }
.vt-order-form { display: inline-flex; align-items: center; gap: 6px; }
.vt-cart-btn { width: 34px; height: 34px; border: none; border-radius: 10px; background: var(--red); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.vt-cart-btn:hover { background: #D90000; }
.vt-cart-btn svg.lucide { width: 17px; height: 17px; }

/* หน้าตะกร้า */
.cart-page { padding-top: 30px; padding-bottom: 56px; }   /* longhand: อย่าใช้ shorthand — จะล้าง padding ซ้ายขวา 20px ของ .container ที่อยู่ element เดียวกัน */
.cart-page h1 { font-size: 26px; margin-bottom: 6px; }
.cart-page .cart-sub { color: var(--gray); font-size: 14.5px; margin-bottom: 20px; }
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.cart-item-img { width: 84px; height: 84px; border-radius: 12px; background: var(--off-white); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-img .no-img { width: 46px; opacity: .5; }
.cart-item-name { font-family: var(--font-heading); font-weight: 600; font-size: 15.5px; color: var(--navy); line-height: 1.35; }
.cart-item-variant { font-size: 13px; color: var(--gray); margin-top: 2px; }
.cart-item-unit { font-size: 13px; color: var(--gray); margin-top: 4px; }
.cart-item-controls { display: flex; align-items: center; gap: 14px; }
.cart-item-line { font-family: var(--font-heading); font-weight: 700; color: var(--red); font-size: 16px; white-space: nowrap; min-width: 78px; text-align: right; }
.cart-remove { border: none; background: none; color: var(--gray); cursor: pointer; padding: 6px; display: inline-flex; border-radius: 8px; }
.cart-remove:hover { color: var(--red); background: #FFF1F2; }
.cart-remove svg.lucide { width: 18px; height: 18px; }

.cart-summary { background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); position: sticky; top: 20px; }
.cart-summary h2 { font-size: 18px; margin-bottom: 14px; }
.cart-summary-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; padding: 6px 0; color: var(--navy); }
.cart-summary-row.muted { color: var(--gray); font-size: 14px; }
.cart-summary-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px dashed var(--border); margin-top: 10px; padding-top: 12px; font-family: var(--font-heading); font-weight: 700; }
.cart-summary-total .amt { color: var(--red); font-size: 22px; }
.cart-summary .btn { width: 100%; justify-content: center; margin-top: 16px; }
.cart-summary .coupon-form .btn { width: auto; margin-top: 0; }
/* Popup สั่งซื้อสำเร็จ */
.order-success-overlay { position: fixed; inset: 0; background: rgba(15,18,28,.55); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; transition: opacity .3s; }
.order-success-overlay.is-out { opacity: 0; pointer-events: none; }
.order-success-modal { background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); max-width: 430px; width: 100%; padding: 34px 28px 28px; text-align: center; animation: osPop .3s cubic-bezier(.34,1.4,.64,1); }
@keyframes osPop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.order-success-modal .os-icon { width: 74px; height: 74px; border-radius: 50%; background: #F0FDF4; color: #16A34A; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.order-success-modal .os-icon svg.lucide { width: 40px; height: 40px; }
.order-success-modal h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.order-success-modal .os-no { font-family: var(--font-heading); font-weight: 900; font-size: 26px; color: var(--red); margin: 6px 0 10px; }
.order-success-modal p { color: var(--gray); font-size: 14.5px; line-height: 1.6; margin-bottom: 18px; }
.order-success-modal .btn { width: 100%; justify-content: center; }
.cart-summary-note { font-size: 12.5px; color: var(--gray); text-align: center; margin-top: 10px; line-height: 1.5; }
.cart-continue { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--gray); font-size: 14px; text-decoration: none; }
.cart-continue:hover { color: var(--red); }

/* ตะกร้าว่าง */
.cart-empty { text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 54px 24px; box-shadow: var(--shadow); }
.cart-empty .ce-icon { width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%; background: var(--off-white); display: flex; align-items: center; justify-content: center; color: var(--gray); }
.cart-empty .ce-icon svg.lucide { width: 36px; height: 36px; }
.cart-empty h2 { font-size: 21px; margin-bottom: 6px; }
.cart-empty p { color: var(--gray); font-size: 15px; margin-bottom: 20px; }

/* Toast แจ้งเตือน "เพิ่มลงตะกร้าแล้ว" */
.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: var(--navy); color: #fff; font-family: var(--font-heading); font-weight: 500; font-size: 14.5px; padding: 11px 20px; border-radius: 999px; box-shadow: var(--shadow-lg); display: inline-flex; align-items: center; gap: 8px; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg.lucide { width: 18px; height: 18px; color: var(--green); }

@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-summary { position: static; }
}
/* ตารางราคาหน้าสินค้า: ≤600px สลับจากตาราง (ล้นนอกจอ) เป็นการ์ดต่อ variant
   เดสก์ท็อป >600px ใช้ตารางเดิมทุกประการ */
@media (max-width: 600px) {
  .vt-desktop { display: none; }
  .vt-cards { display: flex; flex-direction: column; gap: 10px; }
}
@media (max-width: 560px) {
  .cart-item { grid-template-columns: 68px 1fr; gap: 12px; }
  .cart-item-img { width: 68px; height: 68px; }
  .cart-item-controls { grid-column: 1 / -1; justify-content: space-between; }
  .cart-page h1 { font-size: 22px; }
  .toast { bottom: 76px; }
}

/* =====================================================================
   Phase 2 — Checkout / ออเดอร์ / Admin orders
   mobile-first; กฎ desktop อยู่ใน @media (min-width:901px) ท้ายบล็อก
   ===================================================================== */

/* --- Checkout --- */
.checkout-page { padding-top: 28px; padding-bottom: 60px; }   /* longhand — เหตุผลเดียวกับ .cart-page */
.checkout-page > h1 { font-size: 24px; display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.checkout-page > h1 svg.lucide { color: var(--red); }
.checkout-errors { display: flex; gap: 10px; background: #FEF2F2; border: 1px solid #FCA5A5; color: #991B1B; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.checkout-errors svg.lucide { flex-shrink: 0; margin-top: 2px; }
.checkout-layout { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: start; }
.checkout-form { display: flex; flex-direction: column; gap: 16px; }
.co-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 18px 20px; }
.co-card h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.co-card h2 svg.lucide { color: var(--red); width: 19px; height: 19px; }
.co-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.co-field { display: flex; flex-direction: column; gap: 5px; }
.co-field > span { font-size: 13.5px; font-weight: 600; color: var(--navy); }
.co-field > span b { color: var(--red); }
.co-field > span em { font-weight: 400; font-style: normal; color: var(--gray); font-size: 12.5px; }
.co-field input, .co-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: var(--font-body); font-size: 15px; background: #fff; }
.co-field input:focus, .co-field textarea:focus { outline: 2px solid var(--red-light); border-color: transparent; }
.co-field textarea { resize: vertical; }
.co-account { border: 1.5px dashed #FCA5A5; }
.co-account-note { font-size: 13px; color: var(--gray); margin: -4px 0 12px; }
.co-login-link { font-size: 13.5px; color: var(--gray); margin-top: 10px; }
.co-login-link a { color: var(--red); font-weight: 700; }

/* การรับสินค้า (checkout): เลือกให้ร้านส่ง / มารับเอง */
.ship-modes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ship-mode { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.ship-mode:hover { border-color: var(--navy); }
.ship-mode input { margin-top: 3px; accent-color: var(--red); width: 17px; height: 17px; flex: none; }
.ship-mode:has(input:checked) { border-color: var(--red); background: #FFF5F5; box-shadow: inset 0 0 0 1px var(--red); }
.ship-mode-body { display: flex; flex-direction: column; gap: 3px; }
.ship-mode-title { font-family: var(--font-heading); font-weight: 600; font-size: 15px; color: var(--navy); display: flex; align-items: center; gap: 7px; }
.ship-mode-title svg.lucide { width: 17px; height: 17px; color: var(--red); }
.ship-mode-desc { font-size: 12.5px; color: var(--gray); line-height: 1.5; }
.ship-carrier { margin-top: 14px; }
.ship-carrier.ship-carrier--hidden { display: none; }
.ship-carrier em { font-weight: 400; font-style: normal; color: var(--red); font-size: 12.5px; }

/* สมุดที่อยู่ (checkout) + บล็อกกรอกใหม่ */
.addr-picker { margin-bottom: 14px; }
.addr-default-tag { background: var(--navy); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; margin-left: 6px; }
.addr-new.addr-new--hidden { display: none; }

/* ใบกำกับภาษี */
.tax-toggle, .tax-same { display: flex; align-items: flex-start; gap: 9px; cursor: pointer; font-size: 15px; color: var(--navy); }
.tax-toggle input, .tax-same input { margin-top: 2px; accent-color: var(--red); width: 17px; height: 17px; flex: none; }
.tax-toggle em { font-weight: 400; font-style: normal; color: var(--gray); font-size: 12.5px; }
.tax-same { margin-top: 14px; }
.tax-fields { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
.tax-fields.tax-fields--hidden { display: none; }
.tax-entity { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.tax-radio { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14.5px; color: var(--navy); }
.tax-radio input { accent-color: var(--red); width: 16px; height: 16px; flex: none; }
.tax-branch { border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.tax-branch.tax-branch--hidden { display: none; }
.tax-branch-label { font-weight: 600; color: var(--navy); font-size: 14px; }
.tax-branch-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.tax-branch-code { max-width: 180px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 9px; font-size: 14px; }
.tax-branch-code.tax-branch-code--hidden { display: none; }
.tax-addr.tax-addr--hidden { display: none; }
.tax-new.tax-new--hidden { display: none; }
.tax-picker { margin-bottom: 4px; }
.tax-lookup-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; width: 100%; }
.tax-lookup-status { display: block; font-size: 12.5px; color: var(--gray); margin-top: 6px; }
/* เลขผู้เสียภาษี + ปุ่มแว่นขยายดึงข้อมูลกรมสรรพากร (ช่องแรกสุดของฟอร์มใบกำกับ) */
.tax-id-row { display: flex; align-items: stretch; gap: 8px; }
.tax-id-row input { flex: 1 1 auto; min-width: 0; }
.tax-lookup-btn { flex: none; width: 46px; min-height: 42px; border: 1.5px solid var(--border); border-radius: 8px; background: #fff; color: var(--navy); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .15s, color .15s; }
.tax-lookup-btn:hover { border-color: var(--red); color: var(--red); }
.tax-lookup-btn:focus-visible { outline: 2px solid var(--red-light); outline-offset: 1px; }
.tax-lookup-btn:disabled { opacity: .5; cursor: default; }
.tax-lookup-btn .lucide { width: 20px; height: 20px; }
.tax-lookup-btn--hidden, .tax-lookup-status--hidden { display: none; }
/* ดึงไม่สำเร็จ = ต้องเห็นชัดว่ากรอกเองต่อได้ (เทาจางเกินไป ลูกค้าไม่ทันเห็น) */
.tax-lookup-status--err { color: #B45309; font-weight: 600; }
.tax-lookup-status--ok { color: #15803D; font-weight: 600; } /* เขียวเข้ม — var(--green) #22C55E อ่อนไปสำหรับตัวเล็ก */

/* บัญชีของฉัน */
.account-page { max-width: 860px; padding-top: 24px; padding-bottom: 60px; }
.account-page h1 { display: flex; align-items: center; gap: 10px; }
.acct-count { font-family: var(--font-body); font-size: 13px; font-weight: 400; color: var(--gray); background: var(--off-white); border: 1px solid var(--border); padding: 2px 10px; border-radius: 999px; }
.acct-empty { font-size: 13.5px; color: var(--gray); line-height: 1.6; margin: 4px 0 14px; }
.acct-addr-list { display: flex; flex-direction: column; gap: 12px; }
.acct-addr { border: 1.5px solid var(--border); border-radius: 12px; padding: 13px 15px; }
.acct-addr-title { font-family: var(--font-heading); font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 7px; }
.acct-addr-title svg.lucide { width: 17px; height: 17px; color: var(--red); }
.acct-addr-line { font-size: 13.5px; color: var(--gray); margin-top: 4px; line-height: 1.55; }
.acct-addr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.acct-del { background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5; }
.acct-edit, .acct-add { margin-top: 11px; }
.acct-edit summary, .acct-add summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--navy); display: flex; align-items: center; gap: 6px; }
.acct-add { margin-top: 16px; border-top: 1px dashed var(--border); padding-top: 16px; }
.acct-addr-form { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.acct-tax-addr-label { font-size: 13.5px; font-weight: 600; color: var(--navy); margin-bottom: 8px; }
.acct-tax-addr-label em { font-weight: 400; font-style: normal; color: var(--gray); font-size: 12px; }
.od-tax { background: #FFFBEB; border: 1px solid #FDE68A; }
.ud-book { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.ud-book-head { font-weight: 600; font-size: 13px; color: var(--navy); display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ud-book-head svg.lucide { width: 15px; height: 15px; color: var(--red); }
.ud-book-item { font-size: 13px; color: var(--gray); line-height: 1.6; padding: 3px 0; }
.co-account--in { border-style: solid; border-color: #BBF7D0; background: #F0FDF4; }
.co-loggedin { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #15803D; }
.co-loggedin svg.lucide { color: #15803D; }
.co-member-tag { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; margin-left: 4px; }

/* dropdown ที่อยู่ไทย */
.addr-field { position: relative; }
.addr-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 30; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); margin-top: 4px; max-height: 320px; overflow-y: auto; }
.addr-suggest-item { padding: 9px 13px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--off-white); }
.addr-suggest-item:last-child { border-bottom: none; }
.addr-suggest-item.active, .addr-suggest-item:hover { background: var(--off-white); }
.addr-suggest-item strong { color: var(--navy); font-weight: 700; }
.addr-suggest-path { color: var(--gray); font-size: 12.5px; }

/* สรุป checkout */
.checkout-summary { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 18px 20px; }
.checkout-summary h2 { font-size: 17px; margin: 0 0 14px; }
.co-sum-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; max-height: 320px; overflow-y: auto; }
.co-sum-line { display: grid; grid-template-columns: 46px 1fr auto; gap: 10px; align-items: center; }
.co-sum-thumb { position: relative; width: 46px; height: 46px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.co-sum-thumb img { width: 100%; height: 100%; object-fit: contain; }
.co-sum-qty { position: absolute; top: -6px; right: -6px; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.co-sum-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.co-sum-variant { font-size: 12px; color: var(--gray); }
.co-sum-amt { font-family: var(--font-heading); font-weight: 700; font-size: 14px; }
.co-sum-rows { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.co-sum-row { display: flex; justify-content: space-between; font-size: 14px; }
.co-sum-row.muted { color: var(--gray); }
.co-sum-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; font-weight: 700; }
.co-sum-total .amt { font-family: var(--font-heading); font-weight: 900; font-size: 20px; color: var(--red); }
.co-submit { width: 100%; margin-top: 14px; justify-content: center; }
.co-submit-note { display: flex; gap: 6px; font-size: 12.5px; color: var(--gray); margin-top: 10px; }
.co-submit-note svg.lucide { flex-shrink: 0; width: 15px; height: 15px; margin-top: 1px; }
.co-back { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; color: var(--gray); text-decoration: none; font-size: 14px; }
.cart-myorders { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; color: var(--navy); font-weight: 600; text-decoration: none; font-size: 14px; }

/* --- status pill (ใช้ทั้ง tracking / admin) --- */
.status-pill { display: inline-flex; align-items: center; font-size: 12.5px; font-weight: 700; padding: 4px 12px; border-radius: 999px; white-space: nowrap; }
.status-new { background: #FEF3C7; color: #92400E; }
.status-awaiting_payment { background: #FEE2E2; color: #B91C1C; }
.status-payment_review { background: #E0E7FF; color: #3730A3; }
.status-paid { background: #DCFCE7; color: #15803D; }
.status-shipped { background: #DBEAFE; color: #1D4ED8; }
.status-done { background: #D1FAE5; color: #065F46; }
.status-payment_rejected { background: #FEF2F2; color: #991B1B; }
.status-cancelled { background: #F3F4F6; color: #6B7280; }

/* --- Order tracking --- */
.track-page { padding-top: 28px; padding-bottom: 60px; }   /* longhand — เหตุผลเดียวกับ .cart-page */
.track-flash { display: flex; align-items: center; gap: 8px; background: #F0FDF4; border: 1px solid #BBF7D0; color: #15803D; border-radius: 12px; padding: 12px 16px; margin-bottom: 18px; }
.track-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.track-label { font-size: 12.5px; color: var(--gray); }
.track-head h1 { font-size: 26px; margin: 2px 0 0; }
.track-cancel { display: flex; align-items: center; gap: 8px; background: #F9FAFB; border: 1px solid var(--border); color: var(--gray); border-radius: 12px; padding: 14px 18px; margin-bottom: 20px; font-weight: 600; }

.order-timeline { display: flex; justify-content: space-between; position: relative; margin: 0 0 26px; padding: 6px 0; }
.order-timeline::before { content: ""; position: absolute; top: 24px; left: 24px; right: 24px; height: 3px; background: var(--border); z-index: 0; }
.ot-step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; flex: 1; text-align: center; }
.ot-dot { width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 3px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--gray); }
.ot-dot svg.lucide { width: 18px; height: 18px; }
.ot-text { font-size: 11.5px; color: var(--gray); font-weight: 600; line-height: 1.25; }
.ot-step.done .ot-dot { border-color: var(--green); background: var(--green); color: #fff; }
.ot-step.done .ot-text { color: #15803D; }
.ot-step.current .ot-dot { border-color: var(--red); background: var(--red); color: #fff; box-shadow: 0 0 0 5px rgba(255,0,0,.14); }
.ot-step.current .ot-text { color: var(--red); font-weight: 700; }

.track-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.track-main { display: flex; flex-direction: column; gap: 18px; }
.track-side { display: flex; flex-direction: column; gap: 18px; }
.track-main h2, .track-side h2 { font-size: 16px; display: flex; align-items: center; gap: 7px; margin: 0 0 12px; }
.track-main h2 svg.lucide, .track-side h2 svg.lucide { color: var(--red); width: 18px; height: 18px; }
.pay-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 18px 20px; border: 1.5px solid #FCA5A5; }
.pay-placeholder { display: flex; gap: 12px; align-items: flex-start; }
.pay-placeholder > svg.lucide { color: var(--green); flex-shrink: 0; margin-top: 2px; }
.pay-placeholder p { font-size: 13.5px; color: var(--gray); margin: 4px 0 12px; }
.track-items, .track-info-card { background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 18px 20px; }
.track-item { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--off-white); }
.track-item-name { font-size: 14.5px; font-weight: 600; }
.track-item-variant { font-size: 12.5px; color: var(--gray); }
.track-item-amt { font-family: var(--font-heading); font-weight: 700; white-space: nowrap; }
.track-totals { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 7px; }
.tt-row { display: flex; justify-content: space-between; font-size: 14px; }
.tt-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; font-weight: 700; }
.tt-total .amt { font-family: var(--font-heading); font-weight: 900; font-size: 20px; color: var(--red); }
.track-addr { font-size: 14px; line-height: 1.7; }
.track-carrier, .track-note { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--gray); margin-top: 10px; }
.track-carrier svg.lucide, .track-note svg.lucide { width: 15px; height: 15px; color: var(--red); }
.track-help { font-size: 13.5px; color: var(--gray); text-align: center; margin-top: 4px; }
.track-help a { color: var(--red); font-weight: 700; }

/* --- ออเดอร์ของฉัน --- */
.mine-page { padding-top: 28px; padding-bottom: 60px; }   /* longhand — เหตุผลเดียวกับ .cart-page */
.mine-page > h1 { font-size: 24px; display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.mine-list { display: flex; flex-direction: column; gap: 12px; }
.mine-card { display: block; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; text-decoration: none; color: var(--navy); position: relative; }
.mine-card:hover { box-shadow: var(--shadow-lg); }
.mine-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mine-no { font-family: var(--font-heading); font-weight: 700; }
.mine-card-mid { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--gray); }
.mine-total { font-family: var(--font-heading); font-weight: 700; color: var(--navy); }
.mine-card-go { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--border); }
.mine-item { display: flex; flex-direction: column; gap: 8px; }
.mine-reorder { display: flex; justify-content: flex-end; }
.mine-reorder .btn, .track-reorder .btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 7px 14px; }
.mine-reorder .btn svg.lucide, .track-reorder .btn svg.lucide { width: 15px; height: 15px; }
.track-reorder { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--off-white); }
/* pickup (มารับเอง) — ป้ายเขียวทั้งหน้า track ลูกค้า และหน้า admin */
.track-carrier--pickup { color: var(--navy); font-weight: 600; }
.track-carrier--pickup svg.lucide { color: var(--green); }
.od-carrier--pickup { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.od-carrier--pickup svg.lucide { color: #059669; }

/* --- Admin: order list --- */
.order-filter-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.ofp { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; background: #fff; box-shadow: var(--shadow); text-decoration: none; color: var(--navy); font-size: 13.5px; font-weight: 600; }
.ofp span { background: var(--off-white); color: var(--gray); font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.ofp.active { background: var(--navy); color: #fff; }
.ofp.active span { background: rgba(255,255,255,.2); color: #fff; }
.admin-badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }

/* --- Admin: order detail --- */
.admin-back { display: inline-flex; align-items: center; gap: 6px; color: var(--gray); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.admin-back:hover { color: var(--red); }
.od-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.od-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.od-main { display: flex; flex-direction: column; gap: 16px; }
.od-side { display: flex; flex-direction: column; gap: 16px; }
.od-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; }
.od-card h3 { font-size: 15px; display: flex; align-items: center; gap: 7px; margin: 0 0 12px; }
.od-card h3 svg.lucide { color: var(--red); width: 17px; height: 17px; }
.od-cust { font-size: 14px; line-height: 1.7; }
.od-note { color: var(--gray); font-size: 13px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.od-carrier { margin-top: 12px; padding: 10px 12px; background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 10px; font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.od-carrier svg.lucide { color: #C2410C; width: 16px; height: 16px; }
.od-carrier--none { background: var(--off-white); border-color: var(--border); color: var(--gray); }
.od-carrier--none svg.lucide { color: var(--gray); }
.od-totals { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.odt-row { display: flex; justify-content: space-between; font-size: 14px; }
.odt-total { display: flex; justify-content: space-between; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; font-family: var(--font-heading); font-weight: 700; }
.od-ship-form { display: flex; gap: 8px; }
.od-ship-form input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px; }
.od-ship-form input:focus { outline: 2px solid var(--red-light); border-color: transparent; }
.od-hint { font-size: 12.5px; color: var(--gray); margin: 8px 0 0; }
.od-copy { display: flex; gap: 8px; }
.od-copy input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: var(--gray); background: var(--off-white); }

/* --- Phase 3: กล่องชำระเงิน (tracking) --- */
.pay-amount { font-size: 14px; color: var(--navy); margin-bottom: 14px; }
.pay-amount b { font-family: var(--font-heading); font-weight: 900; color: var(--red); font-size: 18px; margin-left: 4px; }
.pay-channel { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }
.pay-channel:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.pay-channel-head { font-size: 13.5px; font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 7px; margin-bottom: 12px; }
.pay-channel-head svg.lucide { width: 17px; height: 17px; color: var(--red); }
.qr-box { display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--off-white); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.qr-render { width: 240px; max-width: 100%; line-height: 0; }
.qr-render img { width: 100%; height: auto; image-rendering: pixelated; border-radius: 6px; background: #fff; }
.qr-amount { font-family: var(--font-heading); font-weight: 900; font-size: 22px; color: var(--navy); }
.qr-name { font-size: 13.5px; color: var(--gray); text-align: center; margin-top: -4px; }
.pay-slip { margin-top: 14px; }
.pay-slip-head { font-size: 13px; color: var(--gray); margin-bottom: 8px; }
/* กล่องโอนเข้าบัญชีธนาคาร */
.bank-box { display: flex; flex-direction: column; align-items: center; gap: 8px; background: var(--off-white); border: 1px solid var(--border); border-radius: 14px; padding: 18px; text-align: center; }
.bank-name { font-size: 14px; font-weight: 700; color: var(--navy); }
.bank-no { font-family: var(--font-heading); font-weight: 900; font-size: 24px; letter-spacing: 1px; color: var(--navy); word-break: break-word; }
.bank-acct-name { font-size: 13.5px; color: var(--gray); margin-top: -2px; }
.bank-amount { font-family: var(--font-heading); font-weight: 900; font-size: 20px; color: var(--red); margin-top: 2px; }
.bank-box .btn { margin-top: 6px; }
@media (max-width: 480px) { .bank-no { font-size: 21px; letter-spacing: .5px; } }
.slip-form { display: flex; flex-direction: column; gap: 10px; }
.slip-input { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border: 1.5px dashed var(--border); border-radius: 10px; cursor: pointer; font-size: 13.5px; color: var(--gray); background: #fff; }
.slip-input:hover { border-color: var(--red); color: var(--navy); }
.slip-input svg.lucide { width: 18px; height: 18px; flex-shrink: 0; }
.slip-input input[type=file] { display: none; }
.slip-input-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slip-err, .od-err { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #B91C1C; background: #FEF2F2; border: 1px solid #FCA5A5; border-radius: 8px; padding: 8px 12px; }
.slip-err svg.lucide, .od-err svg.lucide { width: 15px; height: 15px; }
.slip-preview { display: block; text-decoration: none; }
.slip-preview img { width: 100%; max-width: 320px; border-radius: 12px; border: 1px solid var(--border); }
.slip-preview span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--red); font-weight: 600; margin-top: 8px; }
.slip-preview span svg.lucide { width: 15px; height: 15px; }
.slip-reupload { margin-top: 14px; }
.slip-reupload summary { font-size: 13px; color: var(--gray); cursor: pointer; }
.slip-reupload[open] summary { margin-bottom: 10px; }
.reject-note { display: flex; gap: 10px; align-items: flex-start; background: #FEF2F2; border: 1.5px solid #FCA5A5; color: #991B1B; border-radius: 14px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; }
.reject-note svg.lucide { flex-shrink: 0; margin-top: 2px; width: 18px; height: 18px; }
.pay-omise-wait { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--gray); background: var(--off-white); border-radius: 10px; padding: 12px 14px; }
.pay-omise-wait svg.lucide { width: 17px; height: 17px; color: #C2410C; }
.pay-line-box { display: flex; gap: 12px; align-items: flex-start; }
.pay-line-box > svg.lucide { color: var(--green); flex-shrink: 0; margin-top: 2px; }
.pay-line-box p { font-size: 13.5px; color: var(--gray); margin: 4px 0 12px; }

/* --- Phase 3: admin สลิป + payment-settings --- */
.od-slip { display: block; }
.od-slip img { width: 100%; max-width: 260px; border-radius: 10px; border: 1px solid var(--border); }
.od-reject-form { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; border-top: 1px solid var(--border); padding-top: 14px; }
.od-reject-form input { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.od-reject-form input:focus { outline: 2px solid var(--red-light); border-color: transparent; }
.pay-settings { display: flex; flex-direction: column; gap: 18px; max-width: 640px; }
.ps-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 18px 20px; }
.ps-toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.ps-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.ps-switch { flex-shrink: 0; width: 46px; height: 26px; border-radius: 999px; background: var(--border); position: relative; transition: background .18s; margin-top: 2px; }
.ps-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.ps-toggle input:checked + .ps-switch { background: var(--green); }
.ps-toggle input:checked + .ps-switch::after { transform: translateX(20px); }
.ps-toggle input:focus-visible + .ps-switch { outline: 2px solid var(--red); outline-offset: 2px; }
.ps-toggle-label b { display: block; font-size: 15px; color: var(--navy); }
.ps-toggle-label small { display: block; font-size: 12.5px; color: var(--gray); margin-top: 2px; line-height: 1.5; }
.ps-fields { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.ps-field span { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.ps-field input { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 15px; }
.ps-field input:focus { outline: 2px solid var(--red-light); border-color: transparent; }
.ps-err { display: block; color: #B91C1C; font-size: 12.5px; margin-top: 5px; font-style: normal; }
.ps-note { display: flex; align-items: flex-start; gap: 6px; font-size: 12.5px; color: var(--gray); margin: 12px 0 0; line-height: 1.5; }
.ps-note svg.lucide { width: 15px; height: 15px; flex-shrink: 0; margin-top: 1px; }
.ps-note code { background: var(--off-white); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.ps-omise-status { margin-top: 14px; }
.ps-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.ps-badge svg.lucide { width: 15px; height: 15px; }
.ps-badge--ok { background: #DCFCE7; color: #15803D; }
/* ช่องทางย่อยของ Beam (เปิด/ปิดรายช่อง + งวดผ่อน) */
.ps-beam-channels { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.ps-beam-head { font-size: 14px; font-weight: 700; color: var(--navy); }
.ps-toggle--sub .ps-switch { width: 40px; height: 23px; }
.ps-toggle--sub .ps-switch::after { width: 17px; height: 17px; }
.ps-toggle--sub input:checked + .ps-switch::after { transform: translateX(17px); }
.ps-toggle--sub .ps-toggle-label b { font-size: 14.5px; }
.ps-beam-terms { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 14px; background: var(--off-white); border-radius: 12px; }
.ps-beam-terms-label { font-size: 13px; font-weight: 600; color: var(--navy); width: 100%; }
.ps-chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; color: var(--navy); }
.ps-chk input { accent-color: var(--red); width: 16px; height: 16px; flex: none; }
.ps-chk em { font-style: normal; color: var(--gray); font-size: 12.5px; }
/* หมายเหตุเงื่อนไขขั้นต่ำ ก่อนลูกค้าเลือกช่องทางชำระเงิน (หน้า track) */
/* เงื่อนไขขั้นต่ำ: ไอคอน i มุมขวาบนของการ์ด hover/แตะค่อยกาง (ไม่กินพื้นที่ถาวร) */
.pay-card { position: relative; }
.pay-hint { position: absolute; top: 15px; right: 16px; display: flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: var(--gray); cursor: help; }
.pay-hint:hover, .pay-hint:focus-visible { color: var(--red); background: var(--off-white); outline: none; }
.pay-hint > svg.lucide { width: 17px; height: 17px; }
.pay-hint-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 6; display: flex; flex-direction: column; gap: 4px; width: max-content; max-width: min(330px, 76vw); padding: 11px 13px; background: var(--navy); color: #fff; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 12.5px; font-weight: 400; line-height: 1.65; text-align: left; cursor: auto; opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; }
.pay-hint:hover .pay-hint-pop, .pay-hint:focus .pay-hint-pop, .pay-hint:focus-within .pay-hint-pop { opacity: 1; visibility: visible; transform: none; }
.pay-hint-pop b { color: #fff; font-weight: 700; }
.pay-hint-ok { color: #86EFAC; font-weight: 700; font-style: normal; }
@media (prefers-reduced-motion: reduce) { .pay-hint-pop { transition: none; } }
/* เลือกช่องทางชำระเงินในหน้าออเดอร์ — กล่องสี่เหลี่ยมจัตุรัสสูงสุด 3 กล่อง */
/* กล่องสี่เหลี่ยมจัตุรัส — คุมความกว้างต่อกล่องไว้ ไม่งั้นจอกว้างกล่องจะยืดจนสูงเกินหน้าจอ */
.pay-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 146px)); gap: 10px; }
.pay-pick--2 { grid-template-columns: repeat(2, minmax(0, 146px)); }
.pay-pick--1 { grid-template-columns: minmax(0, 320px); }
.pay-opt { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; text-align: center; padding: 12px 10px; background: #fff; border: 1.5px solid var(--border); border-radius: 16px; cursor: pointer; font: inherit; color: var(--navy); text-decoration: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.pay-opt:hover { border-color: var(--red); box-shadow: 0 4px 14px rgba(0, 0, 0, .07); color: var(--navy); }
.pay-opt:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.pay-opt svg.lucide { width: 30px; height: 30px; color: var(--red); flex-shrink: 0; }
.pay-opt-body { display: flex; flex-direction: column; gap: 3px; }
.pay-opt-title { font-size: 15px; font-weight: 700; line-height: 1.3; }
.pay-opt-desc { font-size: 12.5px; color: var(--gray); line-height: 1.4; }
.pay-opt.is-active { border-color: var(--red); background: #FFF5F5; box-shadow: 0 4px 14px rgba(255, 0, 0, .1); }
/* ช่องทางที่ยังใช้ไม่ได้ — ยังโชว์ให้เห็นว่ามีทางเลือกนี้ พร้อมบอกเงื่อนไข แต่กดไม่ได้ */
.pay-opt--off { background: var(--off-white); border-style: dashed; cursor: not-allowed; }
.pay-opt--off:hover { border-color: var(--border); box-shadow: none; }
.pay-opt--off svg.lucide { color: #B9BEC9; }
.pay-opt--off .pay-opt-title { color: var(--gray); }
.pay-opt--off .pay-opt-desc { color: #B45309; font-weight: 600; }
.pay-pick--1 .pay-opt { aspect-ratio: auto; flex-direction: row; gap: 12px; justify-content: flex-start; text-align: left; padding: 16px 18px; }
@media (max-width: 480px) {
  .pay-pick, .pay-pick--2 { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
  .pay-pick--1 { grid-template-columns: 1fr; }
  .pay-opt { padding: 10px 6px; gap: 7px; border-radius: 13px; }
  .pay-opt svg.lucide { width: 26px; height: 26px; }
  .pay-opt-title { font-size: 13.5px; }
  .pay-opt-desc { font-size: 11.5px; }
}
/* ฟอร์มบัตรในหน้าเรา — ช่องกรอกไม่มี name และไม่อยู่ใน form ใดๆ (เลขบัตรไปหา gateway ตรง) */
.card-pay { display: flex; flex-direction: column; gap: 14px; background: var(--off-white); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.card-terms { display: flex; flex-direction: column; gap: 8px; }
.card-terms-label { font-size: 13px; font-weight: 700; color: var(--navy); }
.card-terms-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.card-term { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 9px 14px; background: #fff; border: 1.5px solid var(--border); border-radius: 11px; cursor: pointer; font: inherit; color: var(--navy); }
.card-term b { font-size: 13.5px; }
.card-term span { font-size: 11.5px; color: var(--gray); }
.card-term.is-active { border-color: var(--red); background: #FFF5F5; }
.card-term:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
/* บัตรที่บันทึกไว้ — โชว์แค่ยี่ห้อ/4 ตัวท้าย/วันหมดอายุ (ไม่มีข้อมูลลับอยู่ในหน้าเว็บ) */
.saved-cards { display: flex; flex-direction: column; gap: 10px; }
.saved-card-list { display: flex; flex-direction: column; gap: 8px; }
.saved-card { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: #fff; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; }
.saved-card:has(input:checked) { border-color: var(--red); background: #FFF5F5; }
.saved-card input { accent-color: var(--red); width: 17px; height: 17px; flex: none; }
.saved-card-body { display: flex; flex-direction: column; gap: 1px; }
.saved-card-body b { font-size: 14px; letter-spacing: .3px; }
.saved-card-body span { font-size: 12px; color: var(--gray); }
.card-field--half { max-width: 190px; }
.card-switch { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 0; background: none; border: none; font: inherit; font-size: 13px; color: var(--mid-navy); text-decoration: underline; cursor: pointer; }
.card-switch i, .card-switch svg { width: 15px; height: 15px; }
/* ยินยอมบันทึกบัตร — บรรทัดเดียว คำอธิบายยาวซ่อนหลังปุ่ม i (ดู track.blade.php) */
.card-save { display: flex; gap: 10px; align-items: center; padding: 11px 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.card-save-main { display: flex; gap: 10px; align-items: center; flex: 1; min-width: 0; cursor: pointer; }
.card-save input { accent-color: var(--red); width: 17px; height: 17px; flex: none; }
.card-save-main b { font-size: 13.5px; }
/* ปุ่ม i + คำอธิบาย: hover/โฟกัสสำหรับเมาส์-คีย์บอร์ด, .is-open สำหรับแตะบนมือถือ */
.card-info { position: relative; flex: none; display: inline-flex; }
.card-info-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: none; border-radius: 50%; background: none; color: var(--gray); cursor: pointer; }
.card-info-btn:hover, .card-info-btn:focus-visible { background: var(--off-white); color: var(--mid-navy); }
.card-info-btn i, .card-info-btn svg { width: 17px; height: 17px; }
.card-info-pop { position: absolute; right: -6px; bottom: calc(100% + 10px); z-index: 30; width: min(300px, 74vw); padding: 11px 13px; background: var(--navy); color: #fff; border-radius: 11px; font-size: 11.5px; line-height: 1.6; box-shadow: 0 10px 28px rgba(33,39,57,.28); opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s; }
.card-info-pop b { color: #fff; font-weight: 700; }
.card-info-pop::after { content: ''; position: absolute; right: 15px; top: 100%; border: 6px solid transparent; border-top-color: var(--navy); }
.card-info:hover .card-info-pop, .card-info:focus-within .card-info-pop, .card-info.is-open .card-info-pop { opacity: 1; visibility: visible; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .card-info-pop { transition: none; } }
.card-dead-tag { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5; font-size: 11.5px; font-weight: 600; }
.card-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card-field { display: flex; flex-direction: column; gap: 5px; }
.card-field--full { grid-column: 1 / -1; }
.card-field > span { font-size: 13px; font-weight: 600; color: var(--navy); }
.card-field > span em { font-weight: 400; color: var(--gray); font-style: normal; }
.card-field input { width: 100%; padding: 11px 13px; border: 1.5px solid var(--border); border-radius: 10px; font: inherit; font-size: 15px; background: #fff; color: var(--navy); }
.card-field input:focus { outline: none; border-color: var(--red); }
.card-field input::placeholder { color: #9CA3AF; font-size: 14px; }
.card-submit { width: 100%; justify-content: center; }
.card-submit:disabled { opacity: .6; cursor: not-allowed; }
.card-secure { display: flex; align-items: flex-start; gap: 7px; font-size: 12px; color: var(--gray); line-height: 1.55; }
.card-secure svg.lucide { width: 15px; height: 15px; flex-shrink: 0; margin-top: 2px; color: #15803D; }
.card-fallback { font-size: 12.5px; color: var(--gray); text-align: center; text-decoration: underline; text-underline-offset: 3px; }
.card-fallback:hover { color: var(--red); }
@media (max-width: 420px) { .card-fields { grid-template-columns: 1fr; } }
/* ปุ่มรอง — ลูกค้าส่วนใหญ่ไม่ต้องกด (ระบบยืนยันให้เอง) จึงไม่ควรเด่นแข่งกับกล่องเลือกช่องทาง */
.pay-recheck { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 0; background: none; border: 0; font: inherit; font-size: 13px; color: var(--gray); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pay-recheck:hover { color: var(--red); }
.pay-recheck svg.lucide { width: 14px; height: 14px; }
/* แผง QR ที่เปิดในหน้าเรา (Beam Charges API) */
.pay-panel { margin-top: 14px; }
.pay-panel[hidden] { display: none; }
.qr-live-status { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; color: var(--gray); text-align: center; line-height: 1.6; }
.qr-live-status svg.lucide { width: 15px; height: 15px; flex-shrink: 0; }
.qr-live-status--err { color: #B45309; font-weight: 600; }
.qr-live-status--ok { color: #15803D; font-weight: 700; }
.qr-expiry { font-size: 12.5px; color: var(--gray); }
.qr-expiry b { font-variant-numeric: tabular-nums; color: var(--navy); }
.qr-spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: qr-spin .8s linear infinite; }
@keyframes qr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .qr-spin { animation-duration: 3s; } }
/* วงกลมหมุนในกล่อง "กำลังดำเนินการ" ตอนกดชำระเงิน (ดู track.blade.php #payBusy)
   ใช้กรอบ .order-success-modal ร่วมกับป๊อปอัปสั่งซื้อ/ชำระสำเร็จ — ที่เพิ่มมีแค่วงหมุน */
.pay-busy-spin { width: 46px; height: 46px; margin: 0 auto 16px; border: 4px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: qr-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .pay-busy-spin { animation-duration: 2.4s; } }
.ps-badge--warn { background: #FEF3C7; color: #92400E; }

@media (min-width: 901px) {
  .checkout-layout { grid-template-columns: 1.6fr 1fr; }
  .checkout-summary { position: sticky; top: 90px; }
  .co-grid { grid-template-columns: 1fr 1fr; }
  .co-col-2 { grid-column: 1 / -1; }
  .track-layout { grid-template-columns: 1.7fr 1fr; }
  .od-layout { grid-template-columns: 1.7fr 1fr; }
}

@media (max-width: 560px) {
  .track-head h1 { font-size: 22px; }
  .ot-dot { width: 32px; height: 32px; }
  .order-timeline::before { top: 21px; left: 18px; right: 18px; }
  .ot-text { font-size: 10.5px; }
  .co-sum-items { max-height: none; }
}

/* --- คูปองส่วนลด (Phase 4) --- */
.coupon-box { margin: 12px 0; padding-top: 12px; border-top: 1px dashed var(--border); }
.coupon-form { display: flex; gap: 8px; }
.coupon-form input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-family: inherit; font-size: 14px; text-transform: uppercase; }
.coupon-form input::placeholder { text-transform: none; }
.coupon-form .btn { white-space: nowrap; padding: 9px 16px; }
.coupon-applied { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 12px; padding: 10px 12px; }
.coupon-applied-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.coupon-applied-info > svg.lucide { color: var(--green); flex-shrink: 0; }
.coupon-applied-code { font-family: var(--font-heading); font-weight: 700; color: #15803D; letter-spacing: .5px; }
.coupon-applied-amt { font-size: 13px; color: #15803D; }
.coupon-remove { background: none; border: none; cursor: pointer; color: #6B7280; padding: 4px; display: flex; }
.coupon-remove:hover { color: var(--red); }
.coupon-error { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 13px; color: #B91C1C; }
.coupon-error > svg.lucide { width: 16px; height: 16px; flex-shrink: 0; }

/* --- admin: pill สถานะคูปอง (ปุ่ม toggle) + หมายเหตุ --- */
.status-pill.pill-on { background: #DCFCE7; color: #15803D; border: 1px solid #BBF7D0; cursor: pointer; gap: 5px; }
.status-pill.pill-off { background: #F3F4F6; color: #6B7280; border: 1px solid var(--border); cursor: pointer; gap: 5px; }
.status-pill.pill-on > svg.lucide, .status-pill.pill-off > svg.lucide { width: 14px; height: 14px; }
.pill-note { font-size: 11.5px; color: #B45309; margin-top: 4px; }

/* ===== ระบบอนุมัติสมาชิก (B2B ราคาพิเศษ) ===== */
/* หน่วยราคาต่อท้าย เช่น /ตัว */
.price-unit { font-size: 0.82em; font-weight: 400; color: var(--gray); }

/* กล่อง CTA ใต้ตารางราคา (guest = สมัคร / pending = รออนุมัติ) */
.price-cta { border-radius: 12px; padding: 14px 16px; margin-top: 14px; font-size: 14.5px; }
.price-cta > svg.lucide, .price-cta-text > svg.lucide { width: 20px; height: 20px; flex-shrink: 0; }
.price-cta--guest { background: #FFF1F2; border: 1px solid #FECDD3; }
.price-cta-text { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.price-cta-text b { color: var(--red); }
.price-cta-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.price-cta--pending { background: #FEF9C3; border: 1px solid #FDE68A; color: #854D0E; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.price-cta--pending a { color: #854D0E; font-weight: 700; }

/* แถบ pending ใต้ header */
.pending-banner { background: #FEF3C7; border-bottom: 1px solid #FDE68A; color: #92400E; font-size: 13.5px; }
.pending-banner .container { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 8px; padding-bottom: 8px; }
.pending-banner span { display: flex; align-items: center; gap: 7px; }
.pending-banner svg.lucide { width: 16px; height: 16px; }
.pending-banner button { background: none; border: none; color: #92400E; cursor: pointer; padding: 2px; line-height: 0; }

/* บรรทัดราคาต่อหน่วยในสรุป checkout */
.co-sum-unit { font-size: 12.5px; color: var(--gray); margin-top: 2px; }

/* ===== admin: ผู้ใช้ + อนุมัติ ===== */
/* หัวหน้า users: การ์ดสถิติซ้าย + ปุ่มเพิ่มผู้ใช้ขวาบน */
.users-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.users-head-stats { display: flex; gap: 14px; flex-wrap: wrap; }
.user-status-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.u-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--gray); font-size: 13.5px; text-decoration: none; }
.u-pill.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.u-pill-count { background: rgba(0,0,0,.08); border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.u-pill.active .u-pill-count { background: rgba(255,255,255,.22); }

.user-tel { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; color: var(--navy); text-decoration: none; }
.user-tel svg.lucide { width: 15px; height: 15px; color: var(--green); }
.user-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.shop-tag { margin-left: 6px; font-size: 11.5px; padding: 2px 10px; vertical-align: middle; }
.user-note-hint { display: flex; align-items: flex-start; gap: 5px; font-size: 12px; color: var(--gray); margin-top: 3px; max-width: 280px; line-height: 1.4; }
.user-note-hint svg.lucide { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; }
.user-name-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.user-name-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-line-name { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #06843C; font-weight: 600; line-height: 1.4; }
.user-line-name svg.lucide { width: 13px; height: 13px; flex-shrink: 0; }

.user-approve-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.btn-approve { background: var(--green); color: #fff; border: none; padding: 5px 16px; font-size: 13px; }
.btn-approve:disabled { background: #D1D5DB; color: #6B7280; cursor: not-allowed; }
.btn-reject { background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5; padding: 5px 16px; font-size: 13px; }
.approve-hint { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: #B45309; margin-bottom: 6px; }
.approve-hint svg.lucide { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }

/* ===== หน้ารายละเอียดผู้ใช้ (admin.users.show) — sw v30 ===== */
.user-name-link { color: var(--navy); font-weight: 700; text-decoration: none; }
.user-name-link:hover { color: var(--red); text-decoration: underline; }
.user-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.ud-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.ud-head-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* ชื่อลูกค้าต้องเด่น (เจ้าของสั่ง) */
.ud-head-title h2 { font-family: var(--font-heading); font-size: clamp(24px, 3vw, 32px); font-weight: 900; color: var(--navy); line-height: 1.2; }
.ud-quick { display: inline-flex; gap: 6px; align-items: center; }
.ud-quick select { max-width: 150px; font-size: 13px; padding: 4px 8px; }
.ud-quick button { padding: 4px 10px; font-size: 13px; }
.ud-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ud-approve { margin-bottom: 18px; }
.user-detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; margin-bottom: 18px; }
.ud-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 16px 18px; }
.ud-card h3 { font-size: 15px; display: flex; align-items: center; gap: 7px; margin: 0 0 12px; }
.ud-card h3 svg.lucide { color: var(--red); width: 17px; height: 17px; }
.ud-list { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.ud-list > div { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: baseline; font-size: 14px; }
.ud-list dt { color: var(--gray); font-size: 13px; margin: 0; }
.ud-list dd { margin: 0; color: var(--navy); font-weight: 500; }
.ud-empty { color: #9CA3AF; }
.ud-yes { display: inline-flex; align-items: center; gap: 4px; color: #15803D; font-weight: 600; }
.ud-yes svg.lucide { width: 14px; height: 14px; }
.ud-line-name { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #E7F9EE; color: #06843C; font-size: 12.5px; font-weight: 600; }
/* ป้ายบอกว่าชื่อไลน์ = ชื่อบัญชี (มาจากฟอร์มสมัครเดิมที่เติมให้อัตโนมัติ) — เงียบกว่าชื่อ ไม่แย่งสายตา */
.ud-line-same { margin-left: 6px; font-size: 11.5px; color: var(--gray); }
.ud-card .user-tel { font-size: 15px; }
/* ปุ่มโทรพอดีคำ — เจ้าของบ่นแบบเต็มแถวกินพื้นที่ */
.ud-call-btn { margin-top: 12px; display: inline-flex; padding: 7px 18px; font-size: 14.5px; }
.ud-note { margin: 0; font-size: 14px; line-height: 1.7; color: var(--navy); white-space: pre-wrap; }
.ud-order-stats { display: flex; gap: 26px; flex-wrap: wrap; padding: 4px 0 2px; }
.ud-order-stats > div { display: flex; flex-direction: column; }
.ud-stat-num { font-family: var(--font-heading); font-weight: 700; font-size: 24px; color: var(--navy); line-height: 1.1; }
.ud-stat-label { font-size: 12.5px; color: var(--gray); margin-top: 2px; }
.ud-orders { margin-bottom: 18px; }
.ud-danger { border: 1px solid #FCA5A5; margin-bottom: 18px; }
.ud-hint { font-size: 13px; color: var(--gray); margin: 0 0 10px; }
@media (min-width: 780px) {
  .user-detail-grid { grid-template-columns: 1fr 1fr; }
}

/* Dialog (popup แก้ไข) — native <dialog> */
/* margin:auto จำเป็น — reset `* { margin:0 }` ของเราฆ่าค่า UA ที่จัด dialog กลางจอ (เจอจริง: popup ไปเกาะมุมซ้ายบน) */
dialog.admin-dlg { width: 560px; max-width: 92vw; margin: auto; max-height: calc(100dvh - 48px); overflow-y: auto; border: none; border-radius: 16px; padding: 20px 22px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.admin-dlg::backdrop { background: rgba(0,0,0,.45); }
.admin-dlg-title { font-size: 17px; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding-right: 34px; }
.admin-dlg-title svg.lucide { color: var(--red); width: 19px; height: 19px; }
.admin-dlg-x { position: absolute; top: 12px; right: 12px; margin: 0; }
.admin-dlg-x button { background: none; border: none; cursor: pointer; color: var(--gray); padding: 6px; display: flex; border-radius: 8px; }
.admin-dlg-x button:hover { background: var(--off-white); color: var(--navy); }
.admin-dlg-x svg.lucide { width: 20px; height: 20px; }
.admin-dlg-errors { background: #FEF2F2; border: 1px solid #FCA5A5; color: #B91C1C; border-radius: 10px; padding: 10px 14px; font-size: 13.5px; margin-bottom: 12px; }
.admin-dlg-form .filter-label { display: block; font-family: var(--font-heading); font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.admin-dlg-form .reg-input { width: 100%; }
.dlg-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) {
  dialog.admin-dlg { padding: 16px 16px 18px; }
}

/* OTP (login/register) — sw v23 */
.otp-phone-row { display: flex; gap: 8px; }
.otp-phone-row input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; }
.otp-request-btn { flex-shrink: 0; background: var(--navy); color: #fff; border: none; border-radius: 8px; padding: 0 16px; font-size: 14.5px; white-space: nowrap; cursor: pointer; justify-content: center; }
.otp-request-btn:hover { background: #2E3650; }
.otp-request-btn:disabled { opacity: .55; cursor: default; }
.otp-boxes { display: flex; gap: 8px; max-width: 340px; }
.otp-box { flex: 1; min-width: 0; height: 54px; text-align: center; font-size: 24px; font-weight: 700; font-family: var(--font-heading); color: var(--navy); border: 1px solid var(--border); border-radius: 10px; padding: 0; }
.otp-box:focus { border-color: var(--navy); outline: 2px solid rgba(33, 39, 57, .18); outline-offset: 1px; }
.otp-msg { margin: -4px 0 12px; padding: 10px 14px; border-radius: 8px; font-size: 14px; background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.otp-msg.otp-msg-error { background: #FEF2F2; border-color: #FCA5A5; color: #991B1B; }
.otp-msg a { color: inherit; text-decoration: underline; }
.reg-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
/* .reg-2col คง 2 คอลัมน์ทุกจอ — หน้าสมัครกระชับ (รหัสผ่านคู่กัน) */

/* Register page (สมัครสมาชิก) — compact + ที่อยู่แถวเดียว + ปุ่มเปิดตารหัสผ่าน (sw v25) */
.reg-intro { text-align: center; color: var(--gray); margin-bottom: 18px; }
.reg-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; font-family: inherit; }
.reg-sec { font-size: 17px; margin: 16px 0 10px; display: flex; align-items: center; gap: 6px; }
.reg-sec svg.lucide { width: 18px; height: 18px; color: var(--red); }
.reg-hint { font-size: 13px; color: var(--gray); margin: 0 0 12px; }
.reg-page .filter-block { margin-bottom: 14px; }
.reg-page .filter-label { margin-bottom: 5px; }
.addr-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr .9fr; gap: 8px; }
.addr-grid > div { min-width: 0; }
.addr-grid label { display: block; font-family: var(--font-heading); font-weight: 700; font-size: 13px; margin-bottom: 4px; white-space: nowrap; }
.addr-grid .reg-input { padding: 9px 10px; font-size: 15px; }
.pw-wrap { position: relative; }
.pw-wrap .reg-input { padding-right: 42px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; padding: 6px; cursor: pointer; color: var(--gray); display: flex; align-items: center; }
.pw-eye svg.lucide { width: 20px; height: 20px; }
@media (max-width: 560px) {
  .reg-page h1 { font-size: 24px; }
  .reg-intro { font-size: 13.5px; margin-bottom: 12px; }
  .reg-page .filter-block { margin-bottom: 10px; }
  .reg-page .reg-input { padding: 9px 12px; }
  .reg-sec { margin: 12px 0 8px; font-size: 16px; }
  .addr-grid { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
}

/* ===== โปรโมชั่น (public /promotions) ===== */
.promo-wrap { max-width: 860px; margin: 0 auto; padding-top: 8px; padding-bottom: 8px; }
.promo-head { text-align: center; margin: 28px 0 24px; }
.promo-head h1 { font-size: clamp(26px, 4vw, 38px); font-weight: 900; color: var(--navy); }
.promo-head p { color: var(--gray); font-size: 15.5px; margin-top: 6px; }
.promo-list { display: flex; flex-direction: column; gap: 22px; margin-bottom: 40px; }
.promo-card { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 4px 24px rgba(0,0,0,.07); }
.promo-card img { display: block; width: 100%; height: auto; }
.promo-card-title { font-family: var(--font-heading); font-weight: 700; font-size: 17px; color: var(--navy); padding: 14px 18px; }
.promo-empty { text-align: center; background: #fff; border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 48px 24px; margin: 20px 0 44px; }
.promo-empty svg.lucide { width: 46px; height: 46px; color: var(--red); margin-bottom: 12px; }
.promo-empty p { font-family: var(--font-heading); font-weight: 600; font-size: 18px; color: var(--navy); margin-bottom: 18px; }

/* ===== โปรโมชั่น (หลังบ้าน) ===== */
.promo-upload { background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; margin-bottom: 20px; }
.promo-upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.promo-file { position: relative; display: inline-flex; align-items: center; gap: 8px; background: var(--off-white); border: 1px dashed var(--border); border-radius: 10px; padding: 9px 16px; font-family: var(--font-heading); font-weight: 600; font-size: 14px; color: var(--navy); cursor: pointer; }
.promo-file svg.lucide { width: 18px; height: 18px; color: var(--red); }
/* ซ่อนแบบ focusable — display:none + required จะทำให้ browser บล็อกฟอร์มโดยไม่โชว์ bubble */
.promo-file input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.promo-upload-hint { color: var(--gray); font-size: 13px; margin: 10px 0 0; }
.promo-thumb { width: 160px; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); display: block; }
.promo-edit-form { display: flex; gap: 8px; align-items: center; }
.promo-sort { width: 70px; flex-shrink: 0; text-align: center; }
.promo-state { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-heading); font-weight: 600; font-size: 13.5px; }
.promo-state svg.lucide { width: 16px; height: 16px; }
.promo-state--on { color: #15803D; }
.promo-state--off { color: var(--gray); }
.promo-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== หน้าแก้ไขสินค้า (/admin/products/{id}/edit): ตารางตัวเลือกสินค้า / ราคา =====
   ⚠ ทุกกฎ scope ที่ .vt-edit / .vt-scroll-edit / .vt-area เท่านั้น
     คลาส .variant-table ถูกใช้ร่วมกับหน้าสินค้าฝั่งลูกค้า + ตารางหลังบ้านอีก 6 หน้า ห้ามให้หลุดไปโดน */

/* หน้านี้กว้างเต็ม .admin-content — แต่บล็อกฟอร์มด้านบนต้อง cap ไว้
   ช่องชื่อสินค้า/รายละเอียดยาว 1600px อ่านยากกว่าเดิม ตารางเท่านั้นที่ได้ประโยชน์จากความกว้าง */
.edit-page .edit-top-grid,
.edit-page > form > .filter-block,
.edit-page .competitor-compare { max-width: 1100px; }

.vt-area { margin-bottom: 4px; }
.vt-help { font-size: 13px; color: var(--gray); margin-bottom: 10px; }
.vt-help code { background: var(--off-white); border-radius: 4px; padding: 1px 5px; }

/* chip พับ/กางกลุ่มคอลัมน์ */
.vt-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.vt-chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: #fff; color: var(--gray); border-radius: 999px; padding: 6px 14px; font-family: var(--font-body); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.vt-chip:hover { border-color: var(--navy); color: var(--navy); }
.vt-chip svg.lucide { width: 15px; height: 15px; }
.vt-chip[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.vt-chip-count { font-size: 11.5px; font-weight: 700; background: #FEF3C7; color: #92400E; border-radius: 999px; padding: 1px 7px; }
.vt-chip[aria-pressed="true"] .vt-chip-count { background: rgba(255,255,255,.22); color: #fff; }
/* ยืนยัน "ตรวจหน่วยใหญ่แล้ว" ทั้งหน้า — อยู่ในกลุ่ม col-pack จึงโผล่/หายพร้อมคอลัมน์หน่วยใหญ่
   ⚠ ให้ display เฉพาะตอนกลุ่มถูกกาง (.show-pack) ไม่พึ่งกฎซ่อน .col-pack ด้านล่างอย่างเดียว —
     ช่องนี้ยืนยันค่าที่ระบบเดาไว้ทั้งหน้า ถ้าโผล่ตอนคอลัมน์ซ่อนอยู่ = ยืนยันของที่มองไม่เห็น */
.vt-area .pack-confirm { align-items: flex-start; gap: 9px; margin: 0 0 12px; padding: 10px 14px; border: 1.5px solid #BBF7D0; background: #F6FAF7; border-radius: 10px; font-size: 14px; font-weight: 400; cursor: pointer; }
.vt-area.show-pack .pack-confirm { display: flex; }
.vt-area .pack-confirm input[type="checkbox"] { width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0; }
.vt-area .pack-confirm em { display: block; font-style: normal; font-size: 12.5px; color: var(--gray); margin-top: 3px; line-height: 1.5; }
.vt-area:not(.show-retail) .col-retail,
.vt-area:not(.show-market) .col-market,
.vt-area:not(.show-pack) .col-pack { display: none; }
.vt-area .competitor-compare { margin-bottom: 14px; }

/* กรอบการ์ด + ตัวเลื่อนแนวนอน อยู่ที่ div ครอบ ไม่ใช่ <table> (ดูคอมเมนต์ในบเลด) */
.vt-scroll-edit { background: #fff; border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; margin-bottom: 16px; scrollbar-width: thin; }
.vt-scroll-edit::-webkit-scrollbar { height: 9px; }
.vt-scroll-edit::-webkit-scrollbar-thumb { background: #C9D0DC; border-radius: 999px; }

/* (0,2,0) เท่ากฎ .admin-content .variant-table ด้านบน แต่มาทีหลังจึงชนะ — ล้างกรอบ/overflow ออกจาก table */
.admin-content .vt-edit { width: 100%; margin: 0; font-size: 14px; background: transparent; box-shadow: none; border-radius: 0; overflow: visible;
  /* sticky ใช้กับ border-collapse:collapse ไม่ได้ — เส้นถูกวาดที่ระดับ table จะไม่เลื่อนตาม cell ที่ตรึง */
  border-collapse: separate; border-spacing: 0; }
.admin-content .vt-edit th { padding: 7px 8px; font-size: 13px; vertical-align: bottom; line-height: 1.35; }
.admin-content .vt-edit td { padding: 5px 8px; vertical-align: top; }
.admin-content .vt-edit .th-sub { display: block; font-family: var(--font-body); font-size: 10.5px; font-weight: 400; opacity: .7; margin-top: 2px; }
.admin-content .vt-edit .col-note { width: 100%; }   /* ดูดที่ว่างที่เหลือไว้ที่คอลัมน์นี้คอลัมน์เดียว */
.admin-content .vt-edit .col-del { width: 40px; }

/* คอลัมน์ "ขนาด" ตรึงซ้ายสุด — ต้องระบุพื้นหลังทึบทั้งแถวคี่และแถวคู่
   (กฎเดิม .variant-table tr:nth-child(even) td = (0,2,2) จึงต้องใช้ selector ที่แรงกว่า) */
.admin-content .vt-edit td.v-fix { position: sticky; left: 0; z-index: 2; background: #fff; }
.admin-content .vt-edit tr:nth-child(even) td.v-fix { background: var(--off-white); }
.admin-content .vt-edit th.v-fix { position: sticky; left: 0; z-index: 3; background: var(--navy); }
.vt-scroll-edit.is-scrolled .v-fix { box-shadow: 6px 0 8px -6px rgba(33,39,57,.25); }

/* ช่องกรอก: ความกว้างมาจากคลาส ไม่ใช่ inline style (เดิมแก้ทีต้องตามแก้ 32 จุด) */
.admin-content .vt-edit .vi { box-sizing: border-box; font: inherit; font-size: 14px; padding: 6px 8px; }
.admin-content .vt-edit .vi:focus { outline: 2px solid var(--red-light); outline-offset: -2px; border-color: transparent; }
.admin-content .vt-edit .vi::placeholder { color: #C4C8D0; }
.admin-content .vt-edit .vi-size { width: 96px; }
.admin-content .vt-edit .vi-txt { width: 88px; }
.admin-content .vt-edit .vi-pack { width: 104px; }
.admin-content .vt-edit .vi-unit { width: 60px; }
.admin-content .vt-edit .vi-money { width: 84px; }
.admin-content .vt-edit .vi-pct { width: 60px; }
.admin-content .vt-edit .vi-note { width: 100%; min-width: 100px; }
/* ตัวเลขชิดขวา + ความกว้างตัวเลขเท่ากัน → กวาดตาลงแนวตั้งเทียบราคาข้ามแถวได้ */
.admin-content .vt-edit .vi-num { text-align: right; font-variant-numeric: tabular-nums; }
/* ลูกศร spinner กินที่ ~16px ต่อช่อง และกดโดนแล้วราคาเปลี่ยน */
.admin-content .vt-edit .vi-num { -moz-appearance: textfield; appearance: textfield; }
.admin-content .vt-edit .vi-num::-webkit-outer-spin-button,
.admin-content .vt-edit .vi-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* ช่องที่สูตรคำนวณให้ — พื้นเทาบอกว่าเป็นผลลัพธ์ (พิมพ์ทับเองได้) */
.admin-content .vt-edit .vi-out { font-weight: 700; background: #F4F5F7; }
.admin-content .vt-edit .vi-out.is-calc { background: #FEF08A; transition: background .7s ease-out; }

/* แรเงากลุ่มคอลัมน์ที่พับได้ ให้เห็นว่าเป็นชุดเดียวกัน (เดิมใช้ .market-col ทำหน้าที่นี้) */
.admin-content .vt-edit td.col-market { background: #F8FAFC; }
.admin-content .vt-edit tr:nth-child(even) td.col-market { background: #F1F5F9; }
.admin-content .vt-edit td.col-pack { background: #F6FAF7; }
.admin-content .vt-edit tr:nth-child(even) td.col-pack { background: #EDF3EE; }
/* ค่าที่ระบบเดาจากข้อความบรรจุ ยังไม่มีคนตรวจ — ต้องต่างจากที่ทีมงานยืนยันแล้วให้เห็นชัด */
.admin-content .vt-edit .vi.is-guess { background: #FEF3C7; border-color: #FCD34D; }
.admin-content .vt-edit td.col-retail { background: #FCFCFD; }
.admin-content .vt-edit tr:nth-child(even) td.col-retail { background: #F4F5F7; }

.admin-content .vt-edit .v-del { border: none; background: transparent; color: var(--gray); cursor: pointer; padding: 6px; border-radius: 6px; }
.admin-content .vt-edit .v-del:hover { color: var(--red); background: #FEF2F2; }
.admin-content .vt-edit .mk-old,
.admin-content .vt-edit .v-market-info { white-space: normal; }

/* ปุ่มบันทึกติดขอบล่าง — สินค้าที่มี 30 ตัวเลือก ไม่ต้องเลื่อนสุดหน้าเพื่อกดบันทึก */
.edit-page .detail-cta { position: sticky; bottom: 0; z-index: 5; margin-top: 0; padding: 12px 0; background: rgba(248,249,251,.95); border-top: 1px solid var(--border); }

@media (max-width: 800px) {
  /* กฎรวมของหลังบ้านทำให้ table เป็น display:block = เป็น scroll container เอง → sticky ตาย
     หน้านี้ให้ div ครอบเป็นตัวเลื่อนแทน คอลัมน์ "ขนาด" จะได้ยังตรึงอยู่ตอนจอแคบ (ซึ่งจำเป็นที่สุด) */
  .admin-content .vt-edit { display: table; overflow: visible; white-space: nowrap; }
  .vt-scroll-edit { border-radius: 10px; }
}

/* ===== หน้ากรอกหน่วยใหญ่ (/admin/pack-units) — ทีมงานไล่กรอกทีละสินค้า ===== */
.pk-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; margin-bottom: 18px; }
.pk-progress { min-width: 260px; flex: 0 1 340px; }
.pk-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.pk-bar span { display: block; height: 100%; background: #22C55E; border-radius: 999px; transition: width .3s; }
.pk-count { font-size: 13px; color: var(--gray); margin-top: 6px; font-variant-numeric: tabular-nums; }
.pk-count b { color: var(--navy); }
.pk-guess-note { color: #92400E; }

.pk-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; }
.pk-title { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.pk-title h2 { font-size: 21px; margin: 2px 0 0; }
.pk-cat { font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--gray); text-transform: uppercase; }
.pk-edit-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--gray); text-decoration: none; white-space: nowrap; }
.pk-edit-link:hover { color: var(--red); }
.pk-edit-link svg.lucide { width: 14px; height: 14px; }

/* ⚠ ตารางนี้ต้องไม่ยืดเต็มความกว้าง — ช่องกรอกต้องอยู่ติดข้อความบรรจุที่ทีมงานใช้อ่านประกอบ
   ไม่งั้นสายตาต้องวิ่งข้ามจอทุกแถว (ตารางราคาใช้ width:100% เพราะคนละงาน) */
.pk-card .vt-edit { width: auto; min-width: 0; }
/* อยู่ในการ์ดอยู่แล้ว ไม่ต้องมีกรอบการ์ดซ้อนอีกชั้น */
.pk-card .vt-scroll-edit { background: transparent; box-shadow: none; border-radius: 8px; margin-bottom: 0; }
/* คอลัมน์อ่านอย่างเดียว — ต้องดูออกทันทีว่าแก้ไม่ได้ */
.admin-content .vt-edit .pk-pack-text { color: var(--navy); white-space: normal; min-width: 200px; max-width: 380px; }
.admin-content .vt-edit .pk-unit { font-weight: 700; color: var(--gray); }
.admin-content .vt-edit .pk-in { font-size: 15px; padding: 8px 10px; }
.admin-content .vt-edit .pk-qty { width: 150px; }
.admin-content .vt-edit .pk-sku { width: 180px; }
.admin-content .vt-edit .pk-in.pk-bad { border-color: #F59E0B; background: #FFFBEB; }
.pk-warn { font-size: 11.5px; color: #92400E; margin-top: 4px; white-space: normal; max-width: 170px; line-height: 1.4; }

.pk-legend { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--gray); margin-top: 12px; }
.pk-swatch { width: 14px; height: 14px; border-radius: 4px; background: #FEF3C7; border: 1px solid #FCD34D; flex-shrink: 0; }

.pk-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; position: sticky; bottom: 0; z-index: 5; padding: 12px 0; background: rgba(248,249,251,.95); border-top: 1px solid var(--border); }
.pk-actions-main { display: flex; gap: 10px; flex-wrap: wrap; }
.pk-actions .btn svg.lucide { width: 16px; height: 16px; }

@media (max-width: 800px) {
  .pk-progress { flex: 1 1 100%; }
  .pk-actions-main { flex: 1 1 100%; }
  .pk-actions-main .btn { flex: 1 1 auto; justify-content: center; }
}

/* ===== ของแถมจากโปรโมชั่น (ตะกร้า / checkout / หน้าติดตาม / หลังบ้าน) =====
   ⚠ ทุกที่ต้องแสดงเป็น "ฟรี" ไม่ใช่ 0.00 — ของแถมเป็นแถวราคา 0 ที่ไม่แตะยอดบิล */
.gift-line { display: flex; align-items: center; gap: 12px; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.gift-line > svg.lucide { width: 22px; height: 22px; color: #15803D; flex-shrink: 0; }
.gift-line-body { flex: 1; min-width: 0; }
.gift-line-body b { font-family: var(--font-heading); }
.gift-line-note { font-size: 12.5px; color: var(--gray); margin-top: 2px; }
.gift-qty { font-size: 13px; color: #15803D; font-weight: 700; margin-left: 4px; }
.gift-free { color: #15803D; font-weight: 700; font-family: var(--font-heading); white-space: nowrap; }

.gift-hint { display: flex; align-items: center; gap: 9px; background: #FFFBEB; border: 1px dashed #FCD34D; border-radius: 12px; padding: 10px 14px; margin-top: 10px; font-size: 14px; color: #92400E; }
.gift-hint svg.lucide { width: 18px; height: 18px; flex-shrink: 0; }
.gift-hint b { color: #B45309; }

.co-sum-gift .co-sum-thumb { background: #F0FDF4; display: flex; align-items: center; justify-content: center; color: #15803D; }
.co-sum-gift .co-sum-thumb svg.lucide { width: 20px; height: 20px; }

.track-item-gift { background: #F0FDF4; border-radius: 10px; padding-left: 10px; padding-right: 10px; }
.track-item-gift .track-item-name svg.lucide { width: 16px; height: 16px; color: #15803D; vertical-align: -2px; }

/* แถบชวนลงทะเบียน/ยืนยันการนับ บนหน้าติดตามออเดอร์ */
.track-loyalty { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.tl-card { display: flex; gap: 12px; align-items: flex-start; border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.55; }
.tl-card b { font-family: var(--font-heading); display: block; margin-bottom: 2px; }
.tl-ico { flex-shrink: 0; display: flex; }
.tl-ico svg.lucide { width: 22px; height: 22px; }
.tl-invite { background: #FFFBEB; border: 1px solid #FCD34D; color: #92400E; }
.tl-invite .tl-ico { color: #B45309; }
.tl-done { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.tl-done .tl-ico { color: #15803D; }
.tl-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 8px 18px; font-size: 14px; }
.tl-btn svg.lucide { width: 16px; height: 16px; }

/* ขาดอีกเท่าไร / เหลือกี่วัน ใต้แถบยอดสะสม (/loyalty/{token}) */
.ly-bar-left { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; margin-top: 8px; font-size: 13.5px; }
.ly-need { color: var(--navy); }
.ly-need b { font-family: var(--font-heading); font-size: 15px; }
.ly-need.is-hit { color: #15803D; font-weight: 700; }
.ly-days { display: inline-flex; align-items: center; gap: 5px; color: var(--gray); }
.ly-days svg.lucide { width: 14px; height: 14px; }
.ly-days.is-soon { color: var(--red); font-weight: 700; }

/* ป้ายของแถมในตารางออเดอร์หลังบ้าน */
.gift-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-family: var(--font-heading); font-weight: 700; font-size: 11.5px; color: #92400E; background: #FEF3C7; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.gift-badge svg.lucide { width: 12px; height: 12px; }

.admin-content .od-gift-row td { background: #FEFCE8; }
.od-gift-x { border: 1px solid #FCD34D; background: #fff; color: #92400E; border-radius: 8px; padding: 3px 6px; cursor: pointer; display: inline-flex; }
.od-gift-x:hover { background: #FEF2F2; border-color: #FCA5A5; color: var(--red); }
.od-gift-x svg.lucide { width: 14px; height: 14px; }
.od-gift-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 13.5px; }
.od-gift-add label { font-family: var(--font-heading); font-weight: 700; color: var(--navy); }
.od-gift-add select { flex: 1; min-width: 200px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; background: #fff; }
.od-gift-add input { width: 64px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; text-align: center; }
.od-gift-add button { padding: 7px 14px; font-size: 13.5px; }
.od-gift-tag { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-heading); font-weight: 700; font-size: 12px; color: #92400E; background: #FEF3C7; border-radius: 999px; padding: 2px 9px; margin-bottom: 4px; }
.od-gift-tag svg.lucide { width: 13px; height: 13px; }

/* โปรแถมบนหน้าสินค้า (สมาชิกเห็นเท่านั้น) */
.detail-promo { display: flex; align-items: center; gap: 9px; background: #F0FDF4; border: 1px solid #BBF7D0; border-radius: 12px; padding: 10px 14px; margin: 12px 0; font-size: 14.5px; color: #166534; }
.detail-promo svg.lucide { width: 19px; height: 19px; color: #15803D; flex-shrink: 0; }
.detail-promo b { font-family: var(--font-heading); }

/* ความพร้อมแปลงหน่วยของโปร (รายงาน) */
.uc-box { border: 1px solid #BBF7D0; background: #F0FDF4; border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.uc-box.is-low { border-color: #FCD34D; background: #FFFBEB; }
.uc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.uc-pct { font-family: var(--font-heading); font-size: 19px; color: #15803D; font-variant-numeric: tabular-nums; }
.uc-box.is-low .uc-pct { color: #B45309; }
.uc-bar { height: 7px; background: #E5E7EB; border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.uc-bar > span { display: block; height: 100%; background: #22C55E; border-radius: 99px; }
.uc-box.is-low .uc-bar > span { background: #F59E0B; }
.uc-note { font-size: 13px; color: var(--gray); }
.uc-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-family: var(--font-heading); font-weight: 700; font-size: 11.5px; color: #92400E; background: #FEF3C7; border: 1px solid #FDE68A; border-radius: 999px; padding: 2px 9px; text-decoration: none; }
.uc-chip.is-low { color: #B91C1C; background: #FEF2F2; border-color: #FCA5A5; }
.uc-chip svg.lucide { width: 12px; height: 12px; }

/* ===== เลือกสินค้าเข้าโปร (/admin/loyalty/{id}/targets) ===== */
.ct-chosen { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ct-chip-form { display: inline-block; }
.ct-chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--navy); border-radius: 999px; padding: 5px 8px 5px 14px; font-size: 13.5px; }
.ct-chip button { border: none; background: transparent; color: var(--gray); cursor: pointer; display: flex; padding: 2px; border-radius: 50%; }
.ct-chip button:hover { color: var(--red); background: #FEF2F2; }
.ct-chip svg.lucide { width: 14px; height: 14px; }

.ct-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.ct-product { background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 14px 16px; }
.ct-product-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.ct-product-head b { font-family: var(--font-heading); font-size: 16px; }
.ct-hidden-tag { font-size: 11.5px; color: var(--gray); background: var(--off-white); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.ct-all { border: 1.5px solid var(--border); background: #fff; color: var(--gray); border-radius: 8px; padding: 5px 12px; font-family: var(--font-body); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ct-all:hover { border-color: var(--navy); color: var(--navy); }

.ct-variants { display: flex; flex-direction: column; gap: 4px; }
.ct-variant { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.ct-variant:hover { background: var(--off-white); }
.ct-variant.is-picked { background: #FFF1F2; }
.ct-variant.is-on { background: #F0FDF4; cursor: default; }
.ct-size { font-weight: 700; min-width: 90px; }
.ct-unit, .ct-pack { color: var(--gray); font-size: 12.5px; }
.ct-pack { background: var(--off-white); border-radius: 6px; padding: 1px 8px; }
.ct-on { font-size: 12px; font-weight: 700; color: #15803D; margin-left: auto; }
.ct-warn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #92400E; background: #FEF3C7; border-radius: 999px; padding: 2px 9px; }
.ct-warn svg.lucide { width: 13px; height: 13px; }
.ct-warn-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; background: #fff; border: 1px solid #FCD34D; border-radius: 999px; padding: 3px 10px; color: #92400E; text-decoration: none; }
.ct-warn-chip svg.lucide { width: 12px; height: 12px; }

/* เลือกวิธีนับในฟอร์มกิจกรรม/โปรแถม */
.lm-modes { display: flex; flex-direction: column; gap: 8px; }
.lm-mode { display: flex; gap: 9px; align-items: flex-start; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 400; }
.lm-mode:has(input:checked) { border-color: var(--navy); background: var(--off-white); }
.lm-mode b { font-family: var(--font-heading); font-size: 14.5px; display: block; }
.lm-mode em { font-style: normal; font-size: 12.5px; color: var(--gray); }

/* ==========================================================================
   /links — หน้ารวมทุกช่องทาง (ลิงก์ใน bio โซเชียล)
   ⚠ ทุกคลาส prefix .lk- เท่านั้น — catalog.css เป็นไฟล์เดียวทั้งเว็บ ชนคลาสเดิม = พังหน้าอื่น
   เขียนแบบ mobile-first (กลับทางกับส่วนอื่นของไฟล์นี้) เพราะคนกดจาก bio คือมือถือเกือบ 100%
   พื้นขาว + โลโก้สีแบรนด์จริง: สีให้โลโก้เป็นคนถือ ส่วนหน้าเว็บอยู่นิ่งๆ
   ========================================================================== */

/* ฟอนต์สโลแกน — เดิมประกาศไว้ใน <style> ของหน้าแรกเท่านั้น หน้าอื่นเรียกใช้ไม่ได้ */
@font-face { font-family: 'BanThuek'; src: url('/fonts/SP_BanThuek.ttf') format('truetype'); font-display: swap; }

/* ซ่อน chrome ของเว็บหลัก — หน้านี้ต้องมี "ทางออกเดียวต่อปุ่ม" */
.lk-body { background: #fff; padding-bottom: 0 !important; }
.lk-body #page-loader,
.lk-body .announce,
.lk-body .site-header,
.lk-body .site-footer,
.lk-body .bottom-nav { display: none !important; }

.lk-page { max-width: 480px; margin: 0 auto; padding: 0 16px; color: var(--navy); }
.lk-tape { height: 5px; background: var(--red); border-radius: 0 0 3px 3px; margin: 0 -16px 24px; }

/* ---- หัวหน้า ---- */
.lk-head { text-align: center; padding-bottom: 24px; }
.lk-logo { width: 178px; height: auto; margin: 0 auto 4px; display: block; }
.lk-slogan { font-family: 'BanThuek', var(--font-heading), sans-serif; font-size: 21px; color: var(--red); line-height: 1.5; }
.lk-lot { font-family: var(--font-heading); font-size: 11.5px; letter-spacing: 1.3px; color: #9198A6; margin-top: 8px; }
.lk-status { display: inline-flex; align-items: center; gap: 7px; margin-top: 11px; padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.lk-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.lk-status.is-open { background: #E8F7EE; color: #12864A; }
.lk-status.is-shut { background: #F1F2F5; color: #6B7280; }

/* หัวหมวดแบบป้ายสเตนซิล — ได้ความรู้สึกจากการจัดตัวอักษร ไม่ต้องเพิ่มฟอนต์ */
.lk-sec { display: inline-block; font-family: var(--font-heading); font-weight: 700; font-size: 11.5px; letter-spacing: 3px; color: #7B8395; border: 1px solid #DCE0E7; border-radius: 5px; padding: 5px 12px 4px; margin: 0 0 13px 2px; }

/* ---- การ์ดช่องทาง ---- */
.lk-card { display: flex; align-items: center; gap: 13px; background: #fff; color: var(--navy); border: 1px solid #E7E9EE; border-radius: 18px; padding: 13px; text-decoration: none; box-shadow: 0 2px 10px rgba(33,39,57,.05); margin-bottom: 11px; }
.lk-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; background: var(--navy); color: #fff; display: grid; place-items: center; overflow: hidden; }
.lk-ic svg { width: 24px; height: 24px; }
.lk-ic svg.lucide { width: 21px; height: 21px; }
.lk-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lk-t { font-family: var(--font-heading); font-weight: 600; font-size: 16.5px; line-height: 1.35; }
.lk-s { font-size: 12.5px; line-height: 1.45; color: var(--gray); }
.lk-go { flex: 0 0 auto; color: #C2C8D2; display: grid; }
.lk-go svg.lucide { width: 19px; height: 19px; }

/* สีกล่องโลโก้ = สีแบรนด์จริง (โลโก้เป็นคนถือสีทั้งหน้า) */
.lk-ic.is-line { background: #06C755; }
.lk-ic.is-tiktok { background: #000; }
.lk-ic.is-youtube { background: #FF0000; }
.lk-ic.is-facebook { background: #1877F2; }
.lk-ic.is-instagram { background: linear-gradient(45deg, #FEDA75 0%, #FA7E1E 25%, #D62976 55%, #962FBF 78%, #4F5BD5 100%); }
.lk-ic.is-shopee { background: #EE4D2D; }
.lk-ic.is-lazada { background: #0F146D; }

/* ปุ่มหลัก — ปุ่มเดียวที่เป็นพื้นทึบ
   ⚠ พื้นเป็น navy ไม่ใช่เขียว LINE: ขาวบนเขียว #06C755 ได้คอนทราสต์ ~2.4:1 ตกเกณฑ์ทุกขนาด
   กล่องโลโก้ข้างในเป็นเขียวแท้ ทำหน้าที่บอกว่าเป็น LINE อยู่แล้ว */
.lk-primary { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 6px 18px rgba(33,39,57,.18); }
.lk-primary .lk-t { font-weight: 700; font-size: 18px; }
.lk-primary .lk-s { color: #D6DBE4; }
.lk-primary .lk-go { color: rgba(255,255,255,.65); }

/* การ์ดคู่ */
.lk-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-bottom: 11px; }
.lk-duo .lk-card { flex-direction: column; align-items: flex-start; gap: 9px; margin-bottom: 0; min-height: 110px; }
.lk-duo .lk-ic { width: 38px; height: 38px; border-radius: 11px; }
.lk-duo .lk-ic svg.lucide { width: 18px; height: 18px; }
.lk-duo .lk-t { font-size: 15px; }
.lk-duo .lk-s { font-size: 12px; }

/* เส้นประรอยฉีกตั๋ว คั่นหมวด */
.lk-tear { position: relative; border-top: 2px dashed #DEE2E8; margin: 26px 0 24px; }
.lk-tear::before, .lk-tear::after { content: ''; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #DEE2E8; }
.lk-tear::before { left: -24px; }
.lk-tear::after { right: -24px; }

/* ---- การ์ดเปิดบัญชีราคาส่ง ---- */
.lk-acct { background: #F7F8FA; border: 1px solid #E7E9EE; border-radius: 18px; padding: 18px; }
.lk-acct-h { font-family: var(--font-heading); font-weight: 800; font-size: 19px; }
.lk-acct-p { font-size: 13.5px; color: var(--gray); margin-top: 4px; }
.lk-steps { list-style: none; margin: 14px 0 16px; }
.lk-steps li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.5; padding: 6px 0; }
.lk-steps li span { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; background: var(--navy); color: #fff; font-family: var(--font-heading); font-size: 12px; display: grid; place-items: center; }
/* ⚠ ปุ่มนี้ต้อง "เบา" กว่าปุ่ม LINE เสมอ — ถ้าทำเป็นพื้นแดงทึบมันจะตะโกนดังกว่าปุ่มหลัก
   แล้วลำดับที่ตั้งใจไว้ (ทักไลน์ก่อน ค่อยสมัคร) จะกลับหัวทันที */
.lk-acct-btn { display: block; text-align: center; background: #fff; color: var(--navy); border: 2px solid var(--navy); font-family: var(--font-heading); font-weight: 700; font-size: 16px; padding: 11px; border-radius: 999px; text-decoration: none; }
.lk-acct-note { text-align: center; font-size: 12.5px; color: var(--gray); margin-top: 11px; }

/* ---- TikTok 3 ช่อง (บอกด้วยว่าของจริงมีเท่านี้ กันบัญชีปลอมแอบอ้าง) ---- */
.lk-tt { background: #fff; border: 1px solid #E7E9EE; border-radius: 18px; padding: 3px 15px 7px; box-shadow: 0 2px 10px rgba(33,39,57,.05); }
.lk-tt-h { font-family: var(--font-heading); font-weight: 700; font-size: 14px; padding: 13px 0 10px; border-bottom: 1px solid #EDEFF3; }
.lk-tt-row { display: flex; align-items: center; gap: 11px; padding: 11px 0; text-decoration: none; color: inherit; border-bottom: 1px dashed #EDEFF3; }
.lk-tt-row:last-child { border-bottom: 0; }
.lk-ic-sm { width: 34px; height: 34px; border-radius: 10px; }
.lk-ic-sm svg { width: 18px; height: 18px; }
.lk-tt-row .lk-t { font-size: 15px; }
.lk-tt-row .lk-s { font-size: 12.5px; }
.lk-here { flex: 0 0 auto; font-size: 11px; background: #F1F2F5; color: #6B7280; border-radius: 999px; padding: 3px 9px; }

/* ---- โซเชียลอื่น — การ์ดสี่เหลี่ยม โลโก้เด่น ---- */
.lk-social { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 13px; }
.lk-social a { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--navy); font-family: var(--font-heading); font-size: 12.5px; font-weight: 500; background: #fff; border: 1px solid #E7E9EE; border-radius: 16px; padding: 14px 6px 12px; }
.lk-social .lk-ic { width: 40px; height: 40px; border-radius: 12px; }
.lk-social .lk-ic svg { width: 21px; height: 21px; }

/* ---- ร้านบนแอป — pill ล่างสุด จงใจให้จม ---- */
.lk-apps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lk-apps a { display: flex; align-items: center; justify-content: center; gap: 8px; background: #fff; border: 1px solid #E7E9EE; color: var(--navy); border-radius: 999px; padding: 10px 8px; text-decoration: none; font-size: 12.5px; }
.lk-apps .lk-ic { width: 26px; height: 26px; border-radius: 8px; }
.lk-apps .lk-ic svg { width: 15px; height: 15px; }

.lk-foot { text-align: center; color: #8A93A8; font-size: 12px; line-height: 1.85; padding: 28px 0 36px; }
.lk-foot-sel { user-select: text; -webkit-user-select: text; }   /* in-app browser บางตัว tel: ไม่ยิงโทร → ต้องก๊อปเบอร์ได้ */

/* สถานะกด + โฟกัสคีย์บอร์ด */
.lk-card, .lk-tt-row, .lk-acct-btn, .lk-apps a, .lk-social a { transition: transform .12s ease; }
.lk-card:active, .lk-tt-row:active, .lk-acct-btn:active, .lk-apps a:active, .lk-social a:active { transform: scale(.985); }
.lk-page a:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) {
  .lk-card, .lk-tt-row, .lk-acct-btn, .lk-apps a, .lk-social a { transition: none; }
  .lk-card:active, .lk-tt-row:active, .lk-acct-btn:active, .lk-apps a:active, .lk-social a:active { transform: none; }
}

@media (min-width: 560px) {
  .lk-page { padding-top: 10px; }
  .lk-tape { margin-left: 0; margin-right: 0; border-radius: 3px; }
}
