/* ກະຕ່າ / ສັ່ງຊື້ / ລາຍລະອຽດບິນ — ໃຊ້ຮ່ວມກັນ (cart.html, checkout.html, checkout-detail.html) */
.sx { --g:#009043; --g-dark:#1c5f4e; --g-soft:#e8f5ee; --ink:#1c1c1c; --ink-2:#52514e; --muted:#7a7a74; --line:#ebebeb;
      --bg:#f5f7f6; --danger:#d03b3b; --warn:#a34a24; --warn-soft:#fdeee7; padding:20px 0 40px; color:var(--ink); display:block; }
.sx * { box-sizing:border-box; }
.sx-title { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-bottom:16px; }
.sx-title h1 { font-size:22px; margin:0; }
.sx-title .sx-count { color:var(--muted); font-size:14px; font-weight:normal; }
.sx-layout { display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:20px; align-items:start; }
.sx-card { background:#fff; border:1px solid var(--line); border-radius:14px; padding:18px; box-shadow:0 2px 10px rgba(16,24,40,.05); }
.sx-card + .sx-card { margin-top:16px; }
.sx-card h2 { font-size:16px; margin:0 0 14px; display:flex; align-items:center; gap:8px; }
.sx-step { display:inline-flex; width:24px; height:24px; border-radius:50%; background:var(--g); color:#fff; font-size:13px; align-items:center; justify-content:center; }
.sx-aside { position:sticky; top:16px; }
.sx-muted { color:var(--muted); font-size:13px; }

/* ປຸ່ມ */
.sx-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:48px; padding:0 18px; border-radius:10px; border:1px solid var(--line); background:#fff; color:var(--ink); font-size:15px; cursor:pointer; text-decoration:none; }
.sx-btn:hover { border-color:var(--g); color:var(--g); text-decoration:none; }
.sx-btn.primary { background:var(--g); border-color:var(--g); color:#fff; font-weight:600; }
.sx-btn.primary:hover { background:var(--g-dark); border-color:var(--g-dark); color:#fff; }
.sx-btn.block { width:100%; }
.sx-btn.sm { min-height:36px; padding:0 12px; font-size:13px; }
.sx-btn[disabled], .sx-btn.hide { opacity:.5; pointer-events:none; }
.sx-icon-btn { width:40px; height:40px; border-radius:10px; border:1px solid var(--line); background:#fff; color:var(--muted); display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
.sx-icon-btn:hover { color:var(--danger); border-color:var(--danger); }
.sx-seg { display:inline-flex; background:#ebedec; border-radius:10px; padding:3px; }
.sx-seg button { border:0; background:transparent; padding:8px 16px; border-radius:8px; color:var(--ink-2); font-size:15px; cursor:pointer; }
.sx-seg button.active { background:#fff; color:var(--g); box-shadow:0 1px 2px rgba(0,0,0,.12); font-weight:600; }

/* ລາຍການສິນຄ້າ (ກະຕ່າ) */
.sx-items { list-style:none; margin:0; padding:0; }
.sx-item { display:grid; grid-template-columns:72px minmax(0,1fr) auto; grid-template-areas:"img info total" "img ctrl ctrl"; gap:8px 14px; padding:14px 0; border-bottom:1px solid var(--line); }
.sx-item:last-child { border-bottom:0; }
.sx-item.is-bonus { background:linear-gradient(90deg, var(--g-soft), transparent 70%); border-radius:10px; padding-left:8px; }
.sx-item-img { grid-area:img; width:72px; height:72px; border-radius:10px; object-fit:cover; background:var(--bg); }
.sx-item-info { grid-area:info; min-width:0; }
.sx-item-name { display:block; font-size:15px; color:var(--ink); line-height:1.35; overflow-wrap:anywhere; }
.sx-item-name:hover { color:var(--g); }
.sx-item-sub { font-size:13px; color:var(--muted); margin-top:2px; }
.sx-item-total { grid-area:total; text-align:right; font-weight:700; white-space:nowrap; font-variant-numeric:tabular-nums; }
.sx-item-ctrl { grid-area:ctrl; display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.sx-item-ctrl select, .sx-item-ctrl .sx-price { height:40px; border:1px solid var(--line); border-radius:10px; padding:0 10px; font-size:15px; background:#fff; max-width:160px; }
.sx-item-ctrl .sx-price { width:120px; }
.sx-badge { display:inline-block; border-radius:999px; padding:2px 10px; font-size:12px; background:var(--g-soft); color:var(--g-dark); font-weight:600; }
.sx-qty { display:inline-flex; align-items:center; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.sx-qty button { width:40px; height:40px; border:0; background:var(--bg); font-size:20px; color:var(--ink); cursor:pointer; }
.sx-qty button:active { background:#dfe5e2; }
.sx-qty input { width:52px; height:40px; border:0; text-align:center; font-size:16px; -moz-appearance:textfield; }
.sx-qty input::-webkit-outer-spin-button, .sx-qty input::-webkit-inner-spin-button { -webkit-appearance:none; margin:0; }
.sx-push { margin-left:auto; display:flex; gap:8px; }

/* ສະຫຼຸບຍອດ */
.sx-sum { list-style:none; margin:0; padding:0; font-size:14px; }
.sx-sum li { display:flex; justify-content:space-between; gap:12px; padding:7px 0; color:var(--ink-2); }
.sx-sum li span:last-child { font-variant-numeric:tabular-nums; color:var(--ink); white-space:nowrap; }
.sx-sum li.neg span:last-child { color:var(--g-dark); }
.sx-total { display:flex; justify-content:space-between; align-items:baseline; border-top:1px dashed var(--line); margin-top:8px; padding-top:12px; }
.sx-total span:first-child { font-size:14px; color:var(--ink-2); }
.sx-total strong { font-size:24px; color:var(--g-dark); white-space:nowrap; }
.sx-due { display:flex; justify-content:space-between; background:var(--warn-soft); color:var(--warn); border-radius:10px; padding:10px 12px; margin-top:10px; font-weight:600; }
.sx-actions { display:flex; flex-direction:column; gap:10px; margin-top:16px; }

/* ລາຍການສັ້ນ (ໜ້າ checkout) */
.sx-lines { list-style:none; margin:0 0 10px; padding:0; max-height:340px; overflow:auto; }
.sx-lines li { display:flex; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); font-size:14px; }
.sx-lines img { width:44px; height:44px; border-radius:8px; object-fit:cover; background:var(--bg); flex:0 0 auto; }
.sx-lines .sx-l-info { flex:1 1 auto; min-width:0; }
.sx-lines .sx-l-name { display:block; overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.sx-lines .sx-l-amt { white-space:nowrap; font-weight:600; font-variant-numeric:tabular-nums; }
/* checkout-detail: ຖັນຈຳນວນ (ເລກ + ຫົວໜ່ວຍໂຕນ້ອຍຢູ່ລຸ່ມ) */
.sx-lines-head { display:flex; gap:10px; padding:0 0 6px; border-bottom:1px solid var(--line); font-size:12px; color:var(--muted); }
.sx-lines-head span:first-child { flex:1 1 auto; padding-left:54px; }
.sx-lines-head span:nth-child(2) { flex:0 0 64px; text-align:center; }
.sx-lines-head span:last-child { flex:0 0 96px; text-align:right; }
.sx-lines-qty li { align-items:center; }
.sx-lines-qty .sx-l-qty { flex:0 0 64px; display:flex; flex-direction:column; align-items:center; line-height:1.15; text-align:center; }
.sx-lines-qty .sx-l-qty b { font-size:16px; font-variant-numeric:tabular-nums; }
/* ຫົວໜ່ວຍຍາວ => ຕັດລົງແຖວໃໝ່ (ບໍ່ຕັດເປັນ …) */
.sx-lines-qty .sx-l-qty small { font-size:11px; line-height:1.25; color:var(--muted); max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.sx-lines-qty .sx-l-amt { flex:0 0 96px; text-align:right; }
@media (max-width: 575.98px) {
  .sx-lines-head span:nth-child(2), .sx-lines-qty .sx-l-qty { flex-basis:52px; }
  .sx-lines-head span:last-child, .sx-lines-qty .sx-l-amt { flex-basis:84px; }
  .sx-lines-qty .sx-l-amt { font-size:13px; }
}

/* ຟອມ */
.sx-grid2 { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:0 14px; }
.sx-field { margin-bottom:14px; }
.sx-field label { display:block; font-size:13px; color:var(--ink-2); margin:0 0 6px; }
.sx-field label .req { color:var(--danger); }
.sx-field input, .sx-field select, .sx-field textarea { width:100%; height:48px; border:1px solid #dcdcdc; border-radius:10px; padding:0 14px; font-size:16px; background:#fff; color:var(--ink); }
.sx-field textarea { height:auto; min-height:80px; padding:10px 14px; resize:vertical; }
.sx-field input:focus, .sx-field select:focus, .sx-field textarea:focus { outline:none; border-color:var(--g); box-shadow:0 0 0 3px rgba(0,144,67,.15); }
.sx-field input[readonly] { background:var(--bg); color:var(--ink-2); }
.sx-field .error, .sx-field label.error { color:var(--danger); font-size:12px; margin-top:4px; }
.sx-inline { display:flex; gap:8px; }
.sx-inline > :first-child { flex:1 1 auto; min-width:0; }
.sx-pick { display:flex; align-items:center; gap:12px; border:1px dashed #cfd8d3; border-radius:12px; padding:12px 14px; margin-bottom:14px; background:var(--bg); }
.sx-pick strong { display:block; }

/* ລູກຄ້າ (modal ຄົ້ນຫາ) */
.sx-cust-list { list-style:none; margin:12px 0 0; padding:0; max-height:55vh; overflow:auto; }
.sx-cust-list li button { width:100%; text-align:left; border:0; border-bottom:1px solid var(--line); background:#fff; padding:12px 6px; display:flex; justify-content:space-between; gap:10px; cursor:pointer; font-size:15px; }
.sx-cust-list li button:hover { background:var(--g-soft); }

/* ວ່າງ */
.sx-empty { text-align:center; padding:48px 16px; }
.sx-empty .sx-empty-icon { font-size:48px; color:#c8d3cd; }
.sx-empty p { color:var(--muted); margin:8px 0 18px; }

/* ໜ້າລາຍລະອຽດບິນ */
.sx-success { display:flex; gap:14px; align-items:center; background:var(--g-soft); border:1px solid #bfe3cf; border-radius:14px; padding:16px 18px; margin-bottom:16px; }
.sx-success .sx-success-icon { width:44px; height:44px; border-radius:50%; background:var(--g); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:22px; flex:0 0 auto; }
.sx-success strong { font-size:17px; display:block; }
.sx-meta { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px 16px; font-size:14px; }
.sx-meta dt { font-size:12px; color:var(--muted); font-weight:normal; margin:0; }
.sx-meta dd { margin:2px 0 0; overflow-wrap:anywhere; }
.sx-status { display:inline-block; border-radius:999px; padding:3px 12px; font-size:13px; font-weight:600; }
.sx-status.ok { background:#e3f4ea; color:#0a6b37; } .sx-status.wait { background:var(--warn-soft); color:var(--warn); }
.sx-note { background:#fffaf0; border:1px solid #f3e2b8; border-radius:10px; padding:10px 12px; font-size:14px; margin-top:12px; }
.sx-print-only { display:none; }

/* ແຖບລຸ່ມ (ມືຖື) */
.sx-bar { display:none; }

@media (max-width: 991.98px) {
  .sx-layout { grid-template-columns:minmax(0,1fr); }
  .sx-aside { position:static; }
}
@media (max-width: 767.98px) {
  .sx { padding:12px 0 110px; }
  .sx .container { padding-left:12px; padding-right:12px; }
  .sx-title h1 { font-size:19px; }
  .sx-card { padding:14px; border-radius:12px; }
  .sx-grid2 { grid-template-columns:minmax(0,1fr); }
  .sx-item { grid-template-columns:60px minmax(0,1fr) auto; }
  .sx-item-img { width:60px; height:60px; }
  .sx-meta { grid-template-columns:minmax(0,1fr); }
  .sx-hide-m { display:none !important; }
  .sx-bar { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:1040; background:#fff; border-top:1px solid var(--line);
            box-shadow:0 -4px 16px rgba(0,0,0,.08); padding:10px 12px calc(10px + env(safe-area-inset-bottom)); gap:12px; align-items:center; }
  .sx-bar .sx-bar-total { flex:1 1 auto; min-width:0; line-height:1.2; }
  .sx-bar .sx-bar-total > span { display:block; font-size:12px; color:var(--muted); }
  .sx-bar .sx-bar-total strong { font-size:19px; color:var(--g-dark); white-space:nowrap; display:block; }
  .sx-bar .sx-bar-total strong span { display:inline; font-size:inherit; color:inherit; }
  .sx-bar .sx-btn { flex:0 0 auto; min-width:150px; }
}
@media print {
  .sx-no-print, header, footer, .footer, .sx-bar { display:none !important; }
}
