/* ==========================================================================
   samo-shop.css — หน้าร้าน ED SHOP (รายการสินค้า / สินค้า / ตะกร้า / สั่งซื้อ / ชำระเงิน)
   ใช้ตัวแปรสีและฟอนต์จาก samo-site.css (โหลดผ่าน web-header.php)
   ========================================================================== */

.shop-page { padding: 2rem 0 5rem; }
.shop-page h1, .shop-page h2, .shop-page h3 { font-family: var(--font-heading); }
.shop-muted { color: var(--text-muted); }
.shop-back { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.92rem; color: var(--text-muted); margin-bottom: 1rem; }
.shop-back:hover { color: var(--accent-ink); text-decoration: none; }

/* ---------- แจ้งสถานะ (รอบ / ข้อความ) ---------- */
.shop-note {
  display: flex; gap: 0.75rem; align-items: flex-start;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  background: var(--bg-surface); padding: 0.9rem 1.1rem; margin-bottom: 1.25rem; line-height: 1.55;
}
.shop-note > i { margin-top: 0.2rem; color: var(--accent-ink); }
.shop-note b { color: var(--text-main); }
.shop-note small { display: block; color: var(--text-muted); }
.shop-note.is-open { background: #f1f8f2; border-color: #cfe6d3; }
.shop-note.is-open > i { color: #2e7d45; }
.shop-note.is-error { background: #fdf0ee; border-color: #f2c9c2; }
.shop-note.is-error > i { color: #b3261e; }
.shop-note-dot { width: 10px; height: 10px; border-radius: 50%; background: #2e7d45; margin-top: 0.45rem; flex: none; box-shadow: 0 0 0 4px rgba(46, 125, 69, 0.15); }

/* ---------- รายการสินค้า ---------- */
.shop-section { margin-top: 2.5rem; }
.shop-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.6rem; margin-bottom: 1.25rem; }
.shop-section-head h2 { font-size: 1.35rem; font-weight: 700; margin: 0; }
.shop-section-head span { color: var(--text-dim); font-size: 0.9rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.25rem; }
@media (max-width: 560px) { .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; } }

.shop-card { display: flex; flex-direction: column; color: var(--text-main); border-radius: var(--radius-md); }
.shop-card:hover { color: var(--text-main); text-decoration: none; }
.shop-card-img { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.shop-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.shop-card:hover .shop-card-img img { transform: scale(1.03); }
.shop-card:focus-visible { outline: 3px solid var(--border-glow); outline-offset: 3px; }
.shop-card-name { font-weight: 600; margin: 0.65rem 0 0.1rem; line-height: 1.35; }
.shop-card-price { font-family: var(--font-heading); font-weight: 700; color: var(--accent-ink); }
.shop-tag { position: absolute; left: 0.6rem; top: 0.6rem; background: var(--text-main); color: #fff; font-size: 0.78rem; padding: 0.15rem 0.6rem; border-radius: 999px; }
.shop-card.is-sold-out .shop-card-img img { filter: grayscale(1); opacity: 0.55; }
.shop-card.is-sold-out .shop-card-price { color: var(--text-dim); }
.shop-empty { color: var(--text-muted); padding: 1.5rem 0; }

/* ---------- หน้าสินค้า ---------- */
.shop-product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
@media (max-width: 860px) { .shop-product { grid-template-columns: 1fr; gap: 1.5rem; } }
.shop-product-img { border-radius: var(--radius-lg); overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.shop-product-img img { width: 100%; display: block; }
.shop-product h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; line-height: 1.25; margin: 0 0 0.35rem; }
.shop-product-price { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; color: var(--accent-ink); margin-bottom: 1rem; }
.shop-product-desc { color: var(--text-muted); margin-bottom: 1.25rem; }
.shop-set { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 0.9rem 1.1rem; margin-bottom: 1.5rem; }
.shop-set h2 { font-size: 1rem; font-weight: 700; margin: 0 0 0.4rem; }
.shop-set ul { list-style: none; padding: 0; margin: 0; }
.shop-set li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.25rem 0; color: var(--text-muted); }
.shop-set .shop-set-total { border-top: 1px dashed var(--border-subtle); margin-top: 0.35rem; padding-top: 0.5rem; color: var(--text-main); font-weight: 600; }

/* ตัวเลือก (ไซส์ / สี / แบบ) — ปุ่มเลือก เห็นจำนวนที่เหลือทันที */
.shop-option { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.shop-option legend { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; width: auto; }
.shop-choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.shop-choice { position: relative; margin: 0; }
.shop-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.shop-choice span {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 3.4rem; min-height: 2.9rem; padding: 0.35rem 0.9rem; cursor: pointer;
  border: 1.5px solid var(--border-subtle); border-radius: var(--radius-sm); background: #fff; line-height: 1.25; text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.shop-choice small { color: var(--text-dim); font-size: 0.75rem; }
.shop-choice:hover span { border-color: var(--border-glow); }
.shop-choice input:checked + span { border-color: var(--accent-ink); background: var(--accent-light); color: var(--accent-deep); font-weight: 600; }
.shop-choice input:focus-visible + span { outline: 3px solid var(--border-glow); outline-offset: 2px; }
.shop-choice input:disabled + span { cursor: not-allowed; color: var(--text-dim); background: #faf7f5; text-decoration: line-through; }
.shop-choice input:disabled + span small { text-decoration: none; }
.shop-option.has-error .shop-choices span { border-color: #d9534f; }
.shop-option-error { color: #b3261e; font-size: 0.88rem; margin-top: 0.35rem; }

.shop-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.5rem; }
.shop-actions .s-btn { min-width: 11rem; }
.shop-unavailable { font-weight: 600; color: var(--text-muted); }

/* ---------- ตะกร้า (ปุ่มลอย + ลิ้นชักด้านขวา) ---------- */
.shop-cart-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 1040;
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.7rem 1.15rem; border-radius: 999px; border: 1px solid var(--border-subtle);
  background: #fff; color: var(--text-main); font-weight: 600; box-shadow: var(--shadow-md); cursor: pointer;
}
.shop-cart-fab:hover { border-color: var(--border-glow); color: var(--accent-ink); }
.shop-cart-fab:focus-visible { outline: 3px solid var(--border-glow); outline-offset: 2px; }
.shop-cart-count { min-width: 1.5rem; height: 1.5rem; padding: 0 0.4rem; border-radius: 999px; background: var(--accent-ink); color: #fff; font-size: 0.82rem; display: inline-flex; align-items: center; justify-content: center; }
.shop-cart-fab .shop-cart-count:empty { display: none; }
.scroll-top { bottom: 84px !important; }

.shop-cart-backdrop { position: fixed; inset: 0; background: rgba(43, 27, 21, 0.35); z-index: 1045; opacity: 0; transition: opacity 0.2s; }
.shop-cart {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1050; width: min(400px, 100vw);
  display: flex; flex-direction: column; background: #fff; box-shadow: -10px 0 30px rgba(43, 27, 21, 0.12);
  transform: translateX(100%); transition: transform 0.25s ease;
}
.shop-cart-open .shop-cart { transform: none; }
.shop-cart-open .shop-cart-backdrop { opacity: 1; }
.shop-cart[hidden], .shop-cart-backdrop[hidden] { display: none; }
.shop-cart-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.shop-cart-head h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.shop-cart-close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bg-surface); font-size: 1.1rem; color: var(--text-main); cursor: pointer; }
.shop-cart-close:hover { background: var(--accent-light); color: var(--accent-ink); }
.shop-cart-body { flex: 1; overflow-y: auto; padding: 0.5rem 1.25rem 1rem; }
.shop-cart-empty { text-align: center; color: var(--text-muted); padding: 3rem 0; }
.shop-cart-empty i { display: block; font-size: 2rem; color: var(--border-glow); margin-bottom: 0.75rem; }
.shop-cart-line { display: grid; grid-template-columns: 64px 1fr; gap: 0.85rem; padding: 0.9rem 0; border-bottom: 1px solid var(--border-subtle); }
.shop-cart-line img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-surface); }
.shop-cart-line b { display: block; font-weight: 600; line-height: 1.35; }
.shop-cart-opt { display: block; color: var(--text-muted); font-size: 0.88rem; }
.shop-cart-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.5rem; }
.shop-qty { display: inline-flex; align-items: center; border: 1px solid var(--border-subtle); border-radius: 999px; }
.shop-qty button { width: 36px; height: 36px; border: 0; background: none; font-size: 1.1rem; color: var(--text-main); border-radius: 50%; cursor: pointer; }
.shop-qty button:hover { background: var(--accent-light); color: var(--accent-ink); }
.shop-qty output { min-width: 1.8rem; text-align: center; font-weight: 600; }
.shop-cart-price { font-family: var(--font-heading); font-weight: 700; }
.shop-link-btn { border: 0; background: none; padding: 0.25rem 0; color: var(--text-muted); font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.shop-link-btn:hover { color: #b3261e; }
.shop-cart-foot { border-top: 1px solid var(--border-subtle); padding: 1rem 1.25rem 1.25rem; background: #fff; }
.shop-cart-sub { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.2rem; }
.shop-cart-sub b { font-family: var(--font-heading); font-size: 1.35rem; }
.shop-cart-foot .s-btn { width: 100%; margin-top: 0.75rem; }
.shop-cart-foot details { margin-top: 0.6rem; text-align: center; }
.shop-cart-foot summary { display: inline; list-style: none; cursor: pointer; color: var(--text-muted); font-size: 0.85rem; text-decoration: underline; }
.shop-cart-foot summary::-webkit-details-marker { display: none; }
.shop-cart-foot details form { margin-top: 0.4rem; }
.shop-cart-foot details button { border: 1px solid #f2c9c2; background: #fdf0ee; color: #b3261e; border-radius: 999px; padding: 0.35rem 1rem; font-size: 0.88rem; }
body.shop-cart-lock { overflow: hidden; }

/* ---------- ขั้นตอนการสั่งซื้อ ---------- */
.shop-steps { display: flex; list-style: none; padding: 0; margin: 0 0 2rem; counter-reset: none; }
.shop-steps li { flex: 1; display: flex; align-items: center; gap: 0.55rem; color: var(--text-dim); font-weight: 500; font-size: 0.95rem; position: relative; }
.shop-steps li:not(:last-child)::after { content: ''; flex: 1; height: 2px; background: var(--border-subtle); margin: 0 0.75rem; }
.shop-steps li.is-done:not(:last-child)::after { background: var(--accent-ink); }
.shop-step-no { width: 2rem; height: 2rem; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--border-subtle); background: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 0.9rem; }
.shop-steps li.is-current { color: var(--text-main); font-weight: 600; }
.shop-steps li.is-current .shop-step-no { border-color: var(--accent-ink); background: var(--accent-ink); color: #fff; }
.shop-steps li.is-done { color: var(--text-muted); }
.shop-steps li.is-done .shop-step-no { border-color: var(--accent-ink); color: var(--accent-ink); }
@media (max-width: 560px) {
  .shop-steps li { flex-direction: column; font-size: 0.8rem; gap: 0.3rem; text-align: center; }
  .shop-steps li:not(:last-child)::after { position: absolute; top: 1rem; left: calc(50% + 1.25rem); right: calc(-50% + 1.25rem); margin: 0; }
}

/* ---------- หน้าสั่งซื้อ (2 คอลัมน์: ฟอร์ม + สรุปยอด) ---------- */
.shop-checkout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
@media (max-width: 900px) {
  .shop-checkout { grid-template-columns: 1fr; gap: 1.5rem; }
  .shop-checkout-side { order: -1; }                 /* ขั้นกรอกข้อมูล: เห็นของที่จะซื้อก่อน */
  .shop-checkout.is-main-first .shop-checkout-side { order: 0; }   /* ชำระเงิน / สำเร็จ: ยอดโอนและเลข order ก่อน */
}
.shop-checkout-side { position: sticky; top: 120px; }
@media (max-width: 900px) { .shop-checkout-side { position: static; } }
.shop-panel { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 1.4rem 1.5rem; background: #fff; }
.shop-panel + .shop-panel { margin-top: 1.25rem; }
.shop-panel h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 1rem; }
.shop-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.shop-panel-head a { font-size: 0.9rem; }
.shop-round-line { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.9rem; }

.shop-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1rem; }
.shop-fields .is-wide { grid-column: 1 / -1; }
@media (max-width: 560px) { .shop-fields { grid-template-columns: 1fr; } }
.shop-field label, .shop-field .shop-label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.35rem; }
.shop-field .shop-hint { display: block; color: var(--text-dim); font-size: 0.82rem; margin-top: 0.3rem; }
.shop-input {
  width: 100%; min-height: 48px; padding: 0.6rem 0.9rem; font-size: 1rem; line-height: 1.4;
  border: 1.5px solid #e4d4c8; border-radius: var(--radius-sm); background: #fff; color: var(--text-main);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.shop-input { min-height: 84px; resize: vertical; }
.shop-input:focus { outline: none; border-color: var(--accent-ink); box-shadow: 0 0 0 3px rgba(241, 90, 34, 0.15); }
.shop-input:disabled { background: #faf7f5; color: var(--text-dim); }
.shop-field.has-error .shop-input { border-color: #d9534f; }
.shop-field-error { display: none; color: #b3261e; font-size: 0.85rem; margin-top: 0.3rem; }
.shop-field.has-error .shop-field-error { display: block; }

/* วิธีรับสินค้า — การ์ดเลือก 2 ใบ */
.shop-pickup { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 420px) { .shop-pickup { grid-template-columns: 1fr; } }
.shop-pickup label { position: relative; margin: 0; cursor: pointer; }
.shop-pickup input { position: absolute; opacity: 0; }
.shop-pickup span { display: block; height: 100%; padding: 0.8rem 1rem; border: 1.5px solid #e4d4c8; border-radius: var(--radius-md); line-height: 1.4; font-weight: 400; }
.shop-pickup b { display: block; font-weight: 600; }
.shop-pickup small { color: var(--text-muted); }
.shop-pickup input:checked + span { border-color: var(--accent-ink); background: var(--accent-light); }
.shop-pickup input:focus-visible + span { outline: 3px solid var(--border-glow); outline-offset: 2px; }
.shop-field.has-error .shop-pickup span { border-color: #d9534f; }
.shop-address { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; padding: 1.1rem; border-radius: var(--radius-md); background: var(--bg-surface); }
.shop-address[hidden] { display: none; }
@media (max-width: 560px) { .shop-address { grid-template-columns: 1fr; } }
.shop-submit-row { margin-top: 1.5rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.shop-submit-row .s-btn { min-width: 14rem; }
.s-btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }

/* ใบสรุปยอด */
.shop-receipt-lines { list-style: none; padding: 0; margin: 0; }
.shop-receipt-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-subtle); }
.shop-receipt-lines b { display: block; font-weight: 600; line-height: 1.35; }
.shop-receipt-opt { display: block; color: var(--text-muted); font-size: 0.88rem; }
.shop-receipt-lines small { color: var(--text-dim); }
.shop-receipt-amt { font-family: var(--font-heading); font-weight: 600; white-space: nowrap; }
.shop-receipt-sum { margin: 0.75rem 0 0; }
.shop-receipt-sum > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.2rem 0; }
.shop-receipt-sum dt { font-weight: 400; color: var(--text-muted); }
.shop-receipt-sum dd { margin: 0; font-family: var(--font-heading); font-weight: 600; }
.shop-receipt-note dd { font-family: var(--font-body); font-weight: 400; color: var(--text-dim); font-size: 0.88rem; }
.shop-receipt-total { border-top: 2px solid var(--text-main); margin-top: 0.5rem; padding-top: 0.6rem !important; }
.shop-receipt-total dt { color: var(--text-main); font-weight: 600; }
.shop-receipt-total dd { font-size: 1.5rem; font-weight: 800; color: var(--accent-ink); line-height: 1.1; }
.shop-receipt-total dd small { font-size: 0.9rem; font-weight: 600; }

/* ---------- ชำระเงิน ---------- */
.shop-pay { text-align: center; }
.shop-pay-label { color: var(--text-muted); font-size: 0.95rem; }
.shop-pay-amount { font-family: var(--font-heading); font-size: clamp(2.4rem, 7vw, 3.2rem); font-weight: 800; color: var(--accent-ink); line-height: 1.1; margin: 0.15rem 0 1rem; }
.shop-pay-amount small { font-size: 1.1rem; font-weight: 600; color: var(--text-main); }
.shop-pay-qr { display: block; width: min(300px, 100%); margin: 0 auto 0.75rem; border-radius: var(--radius-md); border: 1px solid var(--border-subtle); }
.shop-pay-tip { font-size: 0.88rem; color: var(--text-muted); margin: 0.5rem 0 0; }
.shop-who { margin: 0; }
.shop-who > div { display: flex; gap: 1rem; padding: 0.3rem 0; }
.shop-who dt { flex: 0 0 7rem; font-weight: 400; color: var(--text-muted); }
.shop-who dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }

.shop-drop { position: relative; display: block; border: 2px dashed #e4d4c8; border-radius: var(--radius-md); padding: 1.25rem; text-align: center; cursor: pointer; background: var(--bg-surface); transition: border-color 0.15s; }
.shop-drop:hover, .shop-drop.is-over { border-color: var(--accent-ink); }
.shop-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.shop-drop i { font-size: 1.6rem; color: var(--accent-ink); }
.shop-drop b { display: block; margin-top: 0.35rem; }
.shop-drop small { color: var(--text-dim); }
.shop-drop img { display: none; max-width: 100%; max-height: 320px; margin: 0 auto 0.5rem; border-radius: var(--radius-sm); }
.shop-drop.has-file img { display: block; }
.shop-drop.has-file i { display: none; }
.shop-field.has-error .shop-drop { border-color: #d9534f; }

/* ---------- สำเร็จ ---------- */
.shop-done { text-align: center; padding: 1.75rem 1.5rem; }
.shop-done-icon { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 0.75rem; display: flex; align-items: center; justify-content: center; background: #e7f4ea; color: #2e7d45; font-size: 1.5rem; }
.shop-done h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 1rem; }
.shop-order-no { display: inline-block; font-family: var(--font-heading); font-size: clamp(2rem, 7vw, 2.8rem); font-weight: 800; letter-spacing: 0.02em; padding: 0.3rem 1.25rem; border: 2px dashed var(--accent-ink); border-radius: var(--radius-md); color: var(--accent-deep); margin: 0.25rem 0 0.75rem; }
.shop-done p { color: var(--text-muted); margin: 0 auto 0.35rem; max-width: 34rem; }
.shop-status-pill { display: inline-block; padding: 0.2rem 0.8rem; border-radius: 999px; background: #fff4d6; color: #7a5a00; font-size: 0.9rem; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .shop-cart, .shop-cart-backdrop, .shop-card-img img { transition: none; }
}

/* ---------- ยอดสั่งซื้อ (shop-stats.php) + "สั่งแล้ว n" ---------- */
.shop-card-meta { font-size: 0.82rem; color: var(--text-dim); }
.shop-round-tabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.shop-round-tabs a { padding: 0.4rem 1rem; border-radius: 999px; border: 1px solid var(--border-subtle); color: var(--text-muted); font-size: 0.92rem; }
.shop-round-tabs a:hover { text-decoration: none; border-color: var(--border-glow); color: var(--accent-ink); }
.shop-round-tabs a[aria-current] { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.shop-stats-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 0.5rem; }
.shop-stats-head h2 { font-size: 1.5rem; font-weight: 800; margin: 0; }
.shop-stats-num { display: flex; gap: 2rem; margin: 0; }
.shop-stats-num dt { font-weight: 400; color: var(--text-muted); font-size: 0.88rem; }
.shop-stats-num dd { margin: 0; font-family: var(--font-heading); font-size: 1.9rem; font-weight: 800; line-height: 1.1; color: var(--accent-ink); }
.shop-stats-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
@media (max-width: 560px) { .shop-stats-list { grid-template-columns: 1fr; } }
.shop-stats-list .shop-panel + .shop-panel { margin-top: 0; }
.shop-stat-head { display: grid; grid-template-columns: 56px 1fr auto; gap: 0.85rem; align-items: center; }
.shop-stat-head img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); background: var(--bg-surface); }
.shop-stat-head h3 { font-size: 1.02rem; font-weight: 700; margin: 0; line-height: 1.35; }
.shop-stat-head h3 a { color: var(--text-main); }
.shop-stat-total { text-align: right; }
.shop-stat-total b { display: block; font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; line-height: 1; }
.shop-stat-total small { color: var(--text-muted); }
.shop-stat-table { width: 100%; margin-top: 0.9rem; border-collapse: collapse; }
.shop-stat-table th, .shop-stat-table td { padding: 0.35rem 0; border-top: 1px solid var(--border-subtle); font-size: 0.93rem; }
.shop-stat-table th { font-weight: 500; width: 40%; padding-right: 0.75rem; }
.shop-stat-bar span { display: block; height: 8px; min-width: 2px; border-radius: 999px; background: var(--accent); }
.shop-stat-n { width: 3.5rem; text-align: right; font-family: var(--font-heading); font-weight: 700; font-variant-numeric: tabular-nums; }
.shop-stat-table tr.is-zero th, .shop-stat-table tr.is-zero td { color: var(--text-dim); }
.shop-stat-table tr.is-zero .shop-stat-bar span { background: var(--border-subtle); }

/* ---------- จำนวนก่อนใส่ตะกร้า + บอกว่าซื้อครบได้ราคาเซ็ต ---------- */
.shop-qty-row { display: flex; align-items: center; gap: 1rem; margin: 0.25rem 0 1rem; }
.shop-qty-row .shop-label { font-weight: 600; }
.shop-qty-lg button { width: 44px; height: 44px; font-size: 1.25rem; }
.shop-qty-lg input { width: 3rem; height: 44px; padding: 0; margin: 0; border: 0; color: var(--text-main); line-height: 44px; box-shadow: none; text-align: center; font-weight: 600; font-size: 1.05rem; background: none; -moz-appearance: textfield; }
.shop-qty-lg input::-webkit-outer-spin-button, .shop-qty-lg input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop-qty-lg input:focus { outline: 2px solid var(--border-glow); border-radius: 6px; }
.shop-bundle-hint { font-size: 0.93rem; }

/* ---------- ตารางไซส์ ---------- */
.shop-chart-btn { display: inline-flex; align-items: center; gap: 0.45rem; margin: 0 0.5rem 1rem 0; padding: 0.45rem 0.95rem; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: #fff; color: var(--accent-ink); font-weight: 600; font-size: 0.92rem; cursor: pointer; }
.shop-chart-btn:hover { border-color: var(--border-glow); background: var(--accent-light); }
/* หน้าต่างตารางไซส์: รูปแสดงในขนาดที่อ่านออก (ไม่ย่อจนตัวเล็ก) — กว้างเกินจอเลื่อนซ้าย-ขวา / ปุ่ม − + ซูม */
.shop-chart { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(1200px, calc(100vw - 32px)); max-width: none;
  max-height: calc(100dvh - 32px); box-shadow: var(--shadow-md); overflow: hidden; margin: auto; inset: 0; }
.shop-chart[open] { display: flex; flex-direction: column; }
.shop-chart::backdrop { background: rgba(43, 27, 21, 0.6); }
.shop-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem 0.6rem 1rem; border-bottom: 1px solid var(--border-subtle); background: #fff; flex: none; }
.shop-chart-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-chart-tools { display: flex; align-items: center; gap: 0.4rem; flex: none; }
.shop-chart-tools button[data-zoom] { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border-subtle); background: #fff; font-size: 1.1rem; font-weight: 700; color: var(--text-main); cursor: pointer; }
.shop-chart-tools button[data-zoom]:hover { background: var(--accent-light); color: var(--accent-ink); }
.shop-chart-body { flex: 1; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; background: #fff; overscroll-behavior: contain; }
.shop-chart-body img { display: block; flex: none; max-width: none; height: auto; margin: 0 auto; }
.shop-chart-hint { flex: none; margin: 0; padding: 0.45rem 1rem; font-size: 0.85rem; color: var(--text-muted); background: var(--bg-surface); border-top: 1px solid var(--border-subtle); text-align: center; }
.shop-chart-hint[hidden] { display: none; }
@media (max-width: 600px) {
  .shop-chart { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .shop-chart-body { display: flex; align-items: center; }
  .shop-chart-body img { margin: 0; }
}
