/* =========================================================
   ເຍ່ຍ ກາເຟ — Stylesheet
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --brand: #8b5e3c;
  --brand-2: #c68b59;
  --brand-dark: #5d3a1a;
  --brand-soft: #f7ece1;
  --ink: #191c23;
  --ink-2: #39404e;
  --muted: #75808f;
  --line: #e9ebf1;
  --bg: #faf6f0;
  --card: #fff;
  --green: #0eab6a;
  --green-soft: #e5f8ef;
  --blue: #2f7cf6;
  --blue-soft: #e8f1ff;
  --amber: #b7791f;
  --amber-soft: #fdf3d9;
  --red: #e5484d;
  --red-soft: #fdeaea;
  --purple: #7c5cff;
  --purple-soft: #efebff;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(20, 25, 40, .06);
  --shadow: 0 10px 30px rgba(20, 25, 40, .10);
  --shadow-lg: 0 24px 60px rgba(20, 25, 40, .18);
  --header-h: 72px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans Lao", "Phetsarath OT", "Saysettha OT", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; letter-spacing: -0.2px; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
.hidden { display: none !important; }
.container { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.2;
  transition: transform .15s ease, background .18s ease, box-shadow .18s ease, color .18s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 8px 18px rgba(255, 107, 0, .28);
}
.btn-primary:hover { box-shadow: 0 10px 24px rgba(255, 107, 0, .36); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: #d6dae4; background: #fbfbfd; }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); }
.btn-soft:hover { background: #cfeaff; }
.btn-danger { background: var(--red-soft); color: #b32227; }
.btn-danger:hover { background: #fbd5d7; }
.btn-green { background: var(--green-soft); color: #067a4b; }
.btn-green:hover { background: #d3f3e4; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: 12px; }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--header-h);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  font-size: 24px;
  box-shadow: 0 8px 18px rgba(255, 107, 0, .3);
}
.brand strong { display: block; font-size: 17px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; color: var(--muted); font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

/* ---------- 5. Hero ---------- */
.hero { padding: 28px 0 8px; }
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 40px;
  color: #fff;
  background: linear-gradient(118deg, #c68b59, #8b5e3c 55%, #5d3a1a);
  box-shadow: 0 20px 44px rgba(255, 107, 0, .26);
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 28px;
  align-items: center;
}
.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  pointer-events: none;
}
.hero-card::before { width: 340px; height: 340px; right: -110px; top: -140px; }
.hero-card::after { width: 220px; height: 220px; right: 90px; bottom: -150px; background: rgba(255, 255, 255, .08); }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.hero h1 { font-size: clamp(24px, 3.4vw, 38px); margin-bottom: 10px; }
.hero p.lead { font-size: 15px; color: rgba(255, 255, 255, .9); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-actions .btn-ghost { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .35); color: #fff; }
.hero-actions .btn-ghost:hover { background: rgba(255, 255, 255, .26); }
.hero-actions .btn-light { background: #fff; color: var(--brand-dark); box-shadow: 0 10px 24px rgba(0, 0, 0, .12); }
.hero-facts { position: relative; display: grid; gap: 10px; }
.hero-fact {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: var(--r);
  padding: 12px 14px;
  backdrop-filter: blur(6px);
}
.hero-fact .ico { font-size: 20px; }
.hero-fact b { display: block; font-size: 13.5px; }
.hero-fact span { font-size: 12px; color: rgba(255, 255, 255, .85); }

/* ---------- 6. Section / toolbar ---------- */
.section { padding: 26px 0 40px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: 21px; }
.section-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-width: 220px;
}
.search-box input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 14px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13.5px;
  font-weight: 500;
  transition: .18s;
}
.chip:hover { border-color: #fdba74; color: var(--brand-dark); }
.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 107, 0, .28);
}

/* ---------- 7. Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(212px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #cfe4f7; }
.product-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  font-size: 54px;
  background: linear-gradient(135deg, #f0f9ff, #dff1ff);
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
}
.product-body { padding: 14px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-name { font-size: 15px; font-weight: 600; }
.product-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.price { color: var(--brand-dark); font-weight: 700; font-size: 15.5px; white-space: nowrap; }
.add-btn {
  width: 36px; height: 36px;
  border-radius: 11px;
  border: 0;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 20px;
  transition: .18s;
}
.add-btn:hover { background: var(--brand); color: #fff; transform: rotate(90deg); }
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
}
.empty-state .big { font-size: 42px; display: block; margin-bottom: 10px; }

/* ---------- 8. Features strip ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  padding: 6px 0 40px;
}
.feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
}
.feature .ico {
  width: 40px; height: 40px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  font-size: 19px;
}
.feature b { display: block; font-size: 13.5px; }
.feature span { font-size: 12px; color: var(--muted); }

/* ---------- 9. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 26px 0;
  color: var(--muted);
  font-size: 13px;
}
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.footer-inner a { color: var(--brand-dark); font-weight: 600; }

/* ---------- 10. Overlay / Drawer ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 30, .45);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s, visibility .25s;
  z-index: 60;
}
.overlay.open { opacity: 1; visibility: visible; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(400px, 100%);
  background: #fff;
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateX(102%);
  transition: transform .3s cubic-bezier(.22, .9, .3, 1);
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 17px; }
.drawer-body { flex: 1; overflow: auto; padding: 14px 18px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 18px 20px; background: #fff; }

.cart-item {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f2f6;
}
.cart-item:last-child { border-bottom: 0; }
.cart-thumb {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #f0f9ff, #dff1ff);
  font-size: 24px;
  overflow: hidden;
}
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-name { font-size: 14px; font-weight: 600; }
.cart-price { font-size: 12.5px; color: var(--muted); }
.qty {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f3f4f8;
  border-radius: 10px;
  padding: 2px;
}
.qty button {
  width: 26px; height: 26px;
  border: 0; border-radius: 8px;
  background: #fff;
  font-size: 15px;
  line-height: 1;
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.qty span { min-width: 24px; text-align: center; font-size: 13px; font-weight: 600; }

.sum-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; font-size: 13.5px; color: var(--ink-2); }
.sum-row.total { font-size: 17px; font-weight: 700; color: var(--ink); padding-top: 10px; }
.sum-row.total .price { font-size: 19px; }
.free-badge { color: var(--green); font-weight: 600; font-size: 12px; }

/* ---------- 11. Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(16, 20, 30, .5);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s, visibility .22s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  transform: translateY(14px) scale(.985);
  transition: transform .25s;
  overflow: hidden;
}
.modal.open .modal-dialog { transform: none; }
.modal-lg { max-width: 940px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 18px; }
.modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 18px 22px 22px; overflow: auto; }
.modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 22px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.close-btn {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border: 0; border-radius: 10px;
  background: #f3f4f8;
  display: grid; place-items: center;
  font-size: 17px;
  color: var(--ink-2);
}
.close-btn:hover { background: #e9ebf1; }

/* ---------- 12. Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.label .req { color: var(--red); }
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfbfd;
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: 0;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: #8fc9ff;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 107, 0, .12);
}
.textarea { resize: vertical; min-height: 76px; }
.hint { font-size: 11.5px; color: var(--muted); }
.form-error {
  display: none;
  align-items: center;
  gap: 8px;
  background: var(--red-soft);
  color: #b32227;
  border-radius: var(--r-sm);
  padding: 9px 12px;
  font-size: 13px;
  margin-top: 4px;
}
.form-error.show { display: flex; }

/* ---------- 13. Checkout ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.35fr .8fr; gap: 22px; align-items: start; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  background: #fff;
}
.panel + .panel { margin-top: 14px; }
.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
}
.panel-title .n {
  width: 24px; height: 24px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  display: grid; place-items: center;
}
.map-wrap {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eef1f6;
}
#mapPicker, .map-box { height: 230px; width: 100%; }
.map-loading {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.spinner {
  width: 16px; height: 16px;
  border: 2px solid #d9dee8;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.map-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.coords {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  background: #f3f4f8;
  border-radius: 8px;
  padding: 3px 9px;
}
.kd-pin { background: transparent; border: 0; }
.kd-pin-body { font-size: 28px; line-height: 1; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .3)); }
.map-manual { padding: 16px; }
.map-manual-note { font-size: 12.5px; color: var(--amber); background: var(--amber-soft); padding: 8px 10px; border-radius: 10px; margin-bottom: 10px; }
.map-manual-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* payment methods */
.pay-list { display: grid; gap: 10px; }
.pay-option {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  cursor: pointer;
  transition: .18s;
  background: #fff;
}
.pay-option:hover { border-color: #fdba74; }
.pay-option input { position: absolute; opacity: 0; pointer-events: none; }
.pay-option .radio {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid #cfd5e1;
  display: grid; place-items: center;
  transition: .18s;
}
.pay-option .radio::after {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
  transform: scale(0);
  transition: transform .18s;
}
.pay-option input:checked ~ .radio { border-color: var(--brand); }
.pay-option input:checked ~ .radio::after { transform: scale(1); }
.pay-option:has(input:checked) { border-color: var(--brand); background: #f5fbff; box-shadow: 0 0 0 3px rgba(10, 132, 255, .10); }
.pay-option b { display: block; font-size: 14px; }
.pay-option span.d { font-size: 12px; color: var(--muted); }
.pay-option .pay-ico { font-size: 20px; }

/* bank panel */
.bank-panel {
  margin-top: 12px;
  border: 1px dashed #fdba74;
  background: #f5fbff;
  border-radius: var(--r);
  padding: 14px;
}
.bank-top { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.bank-qr {
  width: 132px; height: 132px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  display: grid; place-items: center;
  overflow: hidden;
  text-align: center;
  padding: 6px;
  font-size: 11px;
  color: var(--muted);
}
.bank-qr img { width: 100%; height: 100%; object-fit: contain; }
.bank-info { flex: 1; min-width: 170px; }
.bank-info .row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 3px 0; }
.bank-info .row b { text-align: right; }

.drop {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px dashed #cfd5e1;
  border-radius: var(--r);
  padding: 12px;
  cursor: pointer;
  background: #fff;
  transition: .18s;
  margin-top: 12px;
}
.drop:hover, .drop.dragover { border-color: var(--brand); background: #f5fbff; }
.drop .drop-ico { font-size: 22px; }
.drop small { color: var(--muted); display: block; font-size: 11.5px; }
.slip-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.slip-preview img {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.slip-preview .ok { color: var(--green); font-size: 12.5px; font-weight: 600; }

/* checkout summary */
.summary-card {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  background: #fff;
}
.summary-items { max-height: 230px; overflow: auto; margin-bottom: 8px; }
.si-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #f0f1f5; }
.si-row:last-child { border-bottom: 0; }
.si-row .q { color: var(--muted); }

/* ---------- 14. Badges / status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.badge.purple { background: var(--purple-soft); color: var(--purple); }
.badge.green { background: var(--green-soft); color: #067a4b; }
.badge.red { background: var(--red-soft); color: #b32227; }
.badge.gray { background: #f0f1f5; color: var(--ink-2); }

/* ---------- 15. Tracking timeline ---------- */
.track-result { margin-top: 14px; }
.track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #fbfbfd;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.track-code { font-weight: 700; font-size: 14px; }
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: #eef0f5;
}
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .dot {
  position: absolute;
  left: -26px; top: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #d9dee8;
  display: grid; place-items: center;
  font-size: 9px;
}
.tl-item.done .dot { border-color: var(--green); background: var(--green-soft); }
.tl-item.current .dot { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 4px rgba(255, 107, 0, .14); }
.tl-item b { font-size: 13.5px; display: block; }
.tl-item span { font-size: 11.5px; color: var(--muted); }

/* ---------- 16. Success ---------- */
.success-wrap { text-align: center; padding: 8px 6px 4px; }
.success-ico {
  width: 76px; height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--green-soft);
  display: grid; place-items: center;
  font-size: 36px;
}
.success-wrap h3 { font-size: 21px; margin-bottom: 6px; }
.order-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 4px;
  background: #faf6f0;
  border: 1px dashed #cfd5e1;
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .5px;
}
.success-methods { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 4px; }

/* ---------- 17. Toast ---------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1f2430;
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: .22s;
  width: max-content;
  max-width: 100%;
}
.toast.show { opacity: 1; transform: none; }
.toast-dot { width: 8px; height: 8px; border-radius: 50%; background: #7ee2b8; flex: 0 0 auto; }
.toast.error .toast-dot { background: #ff8f8f; }
.toast.warn .toast-dot { background: #ffd166; }

/* =========================================================
   18. ADMIN
   ========================================================= */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 15% 10%, #d9efff, transparent 60%),
    radial-gradient(700px 500px at 90% 90%, #e4ecff, transparent 55%),
    var(--bg);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 30px 28px;
}
.login-card .brand { justify-content: center; margin-bottom: 18px; }
.login-card h1 { font-size: 20px; text-align: center; }
.login-card p.sub { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0 22px; }
.login-card .field { text-align: left; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; width: 100%; }
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 16px;
  line-height: 1;
  padding: 7px 8px;
  border-radius: 8px;
  cursor: pointer;
  opacity: .6;
  transition: opacity .16s, background .16s;
}
.pw-toggle:hover { opacity: 1; background: #eef3fa; }
.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.remember-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
}
.login-hint {
  margin-top: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  background: #faf6f0;
  border-radius: 10px;
  padding: 8px;
}
.login-hint code { color: var(--brand-dark); font-weight: 700; }
.auth-tabs {
  display: flex;
  gap: 6px;
  background: #eef2f8;
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.auth-tab {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: .16s;
}
.auth-tab.active {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 2px 8px rgba(16, 42, 80, .1);
}
.cust-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fdf5ef;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px 4px 10px;
}
.cust-avatar { font-size: 14px; }
.cust-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}
.share-row .btn { flex: 1 1 auto; }
.copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.copy-row .input { flex: 1; min-width: 0; }
.qr-box {
  margin: 16px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
  background: #fff;
  width: fit-content;
}
.qr-box img { border-radius: 8px; background: #fff; }
.share-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}

.admin-shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; background: var(--bg); }
.sidebar {
  background: #171a21;
  color: #c9cfdb;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { padding: 4px 8px 16px; }
.sidebar .brand strong { color: #fff; font-size: 15px; }
.sidebar .brand small { color: #8b93a3; }
.sidebar .brand-logo { width: 40px; height: 40px; font-size: 20px; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: #6c7484; padding: 12px 10px 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 0;
  background: transparent;
  color: #c9cfdb;
  font-size: 14px;
  text-align: left;
  width: 100%;
  transition: .16s;
}
.nav-item .ico { font-size: 16px; width: 20px; text-align: center; }
.nav-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; font-weight: 600; box-shadow: 0 8px 18px rgba(10, 132, 255, .28); }
.nav-item .count {
  margin-left: auto;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
}
.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .08); }

.admin-main { min-width: 0; padding: 22px 26px 50px; }
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.admin-topbar h1 { font-size: 22px; }
.admin-topbar p { color: var(--muted); font-size: 13px; }
.admin-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid; place-items: center;
  font-weight: 700;
}
.admin-user b { display: block; font-size: 13px; }
.admin-user span { font-size: 11.5px; color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  gap: 13px;
  align-items: flex-start;
}
.stat-ico {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 19px;
  background: var(--brand-soft);
}
.stat-ico.blue { background: var(--blue-soft); }
.stat-ico.green { background: var(--green-soft); }
.stat-ico.purple { background: var(--purple-soft); }
.stat-card .lbl { font-size: 12px; color: var(--muted); }
.stat-card .val { font-size: 21px; font-weight: 700; line-height: 1.3; }
.stat-card .sub { font-size: 11.5px; color: var(--muted); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.card-head h3 { font-size: 15.5px; }
.card-body { padding: 0; }
.card-body.pad { padding: 18px; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 680px; }
.table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 600;
  padding: 11px 16px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid #f2f3f7; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfcfd; }
.table .code { font-weight: 700; font-size: 13px; }
.table .cust b { display: block; font-weight: 600; }
.table .cust span { font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.table .empty-row td { text-align: center; color: var(--muted); padding: 34px 16px; }

.select-mini {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  padding: 5px 8px;
}
.thumb-sm {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0f9ff, #dff1ff);
  display: grid; place-items: center;
  font-size: 19px;
  overflow: hidden;
  flex: 0 0 auto;
}
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.prod-cell { display: flex; align-items: center; gap: 10px; }
.prod-cell b { display: block; font-size: 13.5px; }
.prod-cell span { font-size: 11.5px; color: var(--muted); }

.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed #f0f1f5; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }
.detail-box {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px;
}
.detail-box h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.items-mini { display: grid; gap: 6px; }
.items-mini .it { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.items-mini .it .q { color: var(--muted); }
.slip-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fafbfd;
}
.status-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* admin responsive */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 10px;
    gap: 4px;
  }
  .sidebar .brand { display: none; }
  .nav-label { display: none; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .admin-main { padding: 16px; }
}

/* =========================================================
   19. Responsive
   ========================================================= */
@media (max-width: 900px) {
  .hero-card { grid-template-columns: 1fr; padding: 30px 24px; }
  .hero-facts { grid-template-columns: 1fr 1fr; }
  .checkout-grid { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .order-detail-grid { grid-template-columns: 1fr; }
  .modal-lg { max-width: 640px; }
}
@media (max-width: 620px) {
  .container { width: min(100% - 24px, 1180px); }
  .header-inner { height: 64px; }
  .brand small { display: none; }
  .header-actions .btn-ghost { display: none; }
  .cust-chip { padding: 3px 4px 3px 8px; gap: 5px; }
  .cust-name { max-width: 64px; font-size: 12px; }
  .cust-chip .btn { padding: 6px 8px; font-size: 12px; }
  .hero { padding-top: 18px; }
  .hero-card { padding: 24px 20px; border-radius: 22px; }
  .hero-facts { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-thumb { font-size: 42px; }
  .product-body { padding: 11px 12px 12px; }
  .product-name { font-size: 13.5px; }
  .product-desc { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog { max-width: 100%; max-height: 94vh; border-radius: 22px 22px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .drawer { width: 100%; }
  .section-head h2 { font-size: 18px; }
  .bank-top { flex-direction: column; }
  .bank-qr { width: 100%; height: 180px; }
}

@media print {
  .site-header, .site-footer, .no-print, .drawer, .overlay { display: none !important; }
}
