/* ตะกร้า / ชำระเงิน / หน้าคำสั่งซื้อ / กล่องสั่งซื้อ (22/11/2026) — คู่กับ store.js */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: .88rem; }

/* ไอคอนตะกร้าหัวเว็บ */
.scart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; color: #fff; }
.scart-link:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.scart-link .i { width: 24px; height: 24px; }
.scart-n { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font: 700 .72rem/20px var(--body); text-align: center; }

/* กล่องสั่งซื้อหน้าสินค้า */
.buybox { margin: 16px 0 8px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.bb-price { margin: 0; color: var(--red); font: 600 1.6rem/1.2 var(--head); }
.bb-price small { color: var(--muted); font: 400 .9rem var(--body); }
.bb-tiers { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; }
.bb-tiers li { background: var(--red-50); color: var(--red-600); border-radius: 999px; padding: 2px 10px; }
.bb-label { margin: 14px 0 6px; font-size: .92rem; color: var(--ink-2); }
.bb-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-color { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px 4px 6px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); }
.bb-color[aria-checked="true"] { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-50); font-weight: 600; }
.bb-color:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.bb-color:focus-visible, .bb-size input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.bb-sw { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #0002; flex: none; }
.bb-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.bb-sizes { margin-top: 0; border: 0; border-radius: 0; overflow: visible; }
.bb-size { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 8px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--soft); text-align: center; }
.bb-size.is-off { opacity: .5; }
.bb-sz { font-weight: 700; }
.bb-size small { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.bb-size input { width: 100%; max-width: 76px; min-height: 40px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font: 600 1rem var(--body); background: #fff; }
.bb-off { font-style: normal; font-size: .78rem; color: var(--red-600); }
.bb-sum { display: block; margin: 14px 0 0; font-size: 1rem; }
.bb-sum b { font-size: 1.15rem; }
.bb-sum b[data-bb-total] { color: var(--red); }
.bb-sum b { font-variant-numeric: tabular-nums; }
.bb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.bb-actions .btn { width: 100%; justify-content: center; }
.bb-actions .btn:disabled { opacity: .45; cursor: not-allowed; }
.bb-msg { min-height: 1.4em; margin: 8px 0 0; font-size: .92rem; color: var(--ink-2); }
.bb-note { margin: 4px 0 0; font-size: .82rem; color: var(--muted); }

/* ตะกร้า / ชำระเงิน */
.store h1 { margin-bottom: 18px; }
.store h2 { font-size: 1.12rem; margin: 22px 0 10px; }
.store-grid { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .store-grid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); } .store-side { position: sticky; top: 96px; } }
.store-side { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.store-side h2 { margin-top: 0; }
.store-empty { padding: 40px 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.sc-lines { list-style: none; margin: 0; padding: 0; }
.sc-line { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: 'img info total' 'img qty qty'; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.sc-line > img, .sc-noimg { grid-area: img; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--soft); }
.store-side .sc-line, .od-box .sc-line { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'info x total'; }
.store-side .sc-line > img, .store-side .sc-noimg { display: none; }
.sc-info { grid-area: info; min-width: 0; }
.sc-info a { color: var(--ink); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sc-info small { display: block; color: var(--muted); }
.sc-qty { grid-area: qty; display: flex; gap: 8px; align-items: center; }
.sc-qty input { width: 84px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; text-align: center; font: 600 1rem var(--body); }
.sc-del { min-height: 40px; padding: 0 12px; border: 0; background: none; color: var(--red-600); font: inherit; cursor: pointer; text-decoration: underline; }
.sc-x { grid-area: x; color: var(--muted); white-space: nowrap; }
.sc-total { grid-area: total; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-line.has-err { background: var(--red-50); }
.sc-err { color: #b42318; font-size: .9rem; margin: 4px 0; }
.sc-sum { margin: 12px 0; }
.sc-sum > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.sc-sum dt { color: var(--ink-2); }
.sc-sum dd { margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sc-grand { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px !important; font: 600 1.15rem var(--head); }
.sc-grand dd { color: var(--red); }
.btn.is-disabled { opacity: .45; }
.btn-block { width: 100%; justify-content: center; }

.co-form label { display: block; margin-bottom: 12px; font-size: .9rem; color: var(--ink-2); }
.co-form input:not([type=checkbox]):not([type=radio]), .co-form textarea { display: block; width: 100%; margin-top: 4px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); font: 1rem var(--body); background: #fff; color: var(--ink); }
.co-form label.invalid input, .co-form label.invalid textarea { border-color: #d92d20; background: #fff6f5; }
.co-row { display: grid; gap: 0 12px; }
@media (min-width: 600px) { .co-row { grid-template-columns: 1fr 1fr; } }
.co-form .hp { position: absolute; left: -9999px; }
.co-accept { display: flex !important; gap: 8px; align-items: flex-start; }
.co-accept input { width: 20px; height: 20px; margin-top: 2px; }
.co-form button[type=submit]:disabled { opacity: .5; cursor: not-allowed; }
.carriers { display: grid; gap: 8px; margin-bottom: 14px; }
.carrier { display: grid !important; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 14px; margin: 0 !important; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.carrier:has(input:checked) { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-50); }
.carrier input { width: 20px; height: 20px; accent-color: var(--red); }
.carrier b { display: block; color: var(--ink); }
.carrier small { color: var(--muted); }
.carrier strong { font-variant-numeric: tabular-nums; color: var(--ink); }
.pay-how { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--soft); border: 1px solid var(--line); }

/* หน้าคำสั่งซื้อ */
.od-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.od-head h1 { margin: 0; font-size: clamp(1.3rem, 1rem + 1.2vw, 1.8rem); }
.od-status { padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .92rem; background: #fef3c7; color: #92400e; }
.od-status.ok { background: #dcfce7; color: #166534; }
.od-status.bad { background: #fee2e2; color: #991b1b; }
.od-track { padding: 10px 14px; background: #ecfdf3; border-radius: var(--radius-sm); }
.od-pay { margin: 18px 0; padding: 18px; border: 2px solid var(--red); border-radius: var(--radius); background: #fff; }
.od-pay h2 { margin-top: 0; }
.od-pay-grid { display: grid; gap: 16px; align-items: center; }
@media (min-width: 600px) { .od-pay-grid { grid-template-columns: 240px 1fr; } }
.od-qr img { width: 100%; max-width: 240px; height: auto; display: block; margin: 0 auto; border-radius: 12px; border: 1px solid var(--line); }
.od-amount { margin: 0 0 6px; font: 700 2rem/1.1 var(--head); color: var(--red); font-variant-numeric: tabular-nums; }
.od-slip { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); display: grid; gap: 10px; }
.od-file { display: grid; gap: 6px; font-weight: 600; }
.od-file input { font: inherit; padding: 10px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: var(--soft); width: 100%; }
.od-preview { max-width: 200px; border-radius: 10px; border: 1px solid var(--line); }
.ok-note { padding: 10px 14px; background: #ecfdf3; color: #166534; border-radius: var(--radius-sm); }
.od-box { margin: 18px 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.od-box h2 { margin-top: 0; }
.od-box ul:not(.sc-lines) { margin: 0; padding-left: 18px; }
.lookup { margin-top: 10px; }

/* ปุ่ม LINE ลอยบังปุ่มสั่งซื้อในหน้าตะกร้า/ชำระเงิน/คำสั่งซื้อ — ในหน้ามีลิงก์ LINE อยู่แล้ว */
body:has(.store) .float-line { display: none; }
