/* =====================================================================
   Đấu Giá Nhật – giao diện theo bố cục chợ đấu giá (tham khảo Yahoo! Auctions)
   ===================================================================== */
:root {
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #f5f5f3;
  --text: #333333;
  --muted: #767676;
  --faint: #a0a0a0;
  --border: #dedede;
  --border-strong: #c8c8c8;
  --link: #0b57d0;
  --link-visited: #6b3fa0;
  --accent: #e5484d;          /* màu thương hiệu (logo, nút chính) */
  --accent-ink: #ffffff;
  --accent-soft: #fdeceb;
  --price: #d0021b;           /* giá */
  --bid: #f15a24;             /* nút đấu giá, thanh tìm kiếm */
  --bid-dark: #d9480f;
  --buy: #ffb000;             /* nút mua ngay */
  --buy-ink: #3d2b00;
  --ok: #1f7a4d;
  --ok-soft: #e4f4ea;
  --info: #0b57d0;
  --info-soft: #e8f0fe;
  --warn: #8a5a00;
  --warn-soft: #fff4d9;
  --header-bg: #ffffff;
  --catnav-bg: #f7f7f7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, .16);
  --radius: 8px;
  --header-h: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1c1c1c;
    --surface-2: #262626;
    --text: #e8e8e8;
    --muted: #a6a6a6;
    --faint: #7a7a7a;
    --border: #333333;
    --border-strong: #444444;
    --link: #8ab4f8;
    --link-visited: #c58af9;
    --accent: #f2555a;
    --accent-soft: #3a1f1f;
    --price: #ff6b6b;
    --bid: #ff7a45;
    --bid-dark: #ff5c1f;
    --buy: #ffbf33;
    --ok: #5fcf95;
    --ok-soft: #173126;
    --info: #8ab4f8;
    --info-soft: #1b2740;
    --warn: #f0c060;
    --warn-soft: #382c10;
    --header-bg: #1a1a1a;
    --catnav-bg: #202020;
    --shadow: none;
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--font);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -.005em;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.35; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Nút & nhãn
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: 6px; border: 1px solid var(--border-strong);
  background: var(--surface); cursor: pointer; color: var(--text); white-space: nowrap; font-weight: 500;
  text-decoration: none !important; transition: background .12s, border-color .12s, filter .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:focus-visible, .search-btn:focus-visible, a:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.07); }
.btn-bid { background: var(--bid); border-color: var(--bid); color: #fff; font-weight: 700; }
.btn-bid:hover { background: var(--bid-dark); border-color: var(--bid-dark); }
.btn-buy { background: var(--buy); border-color: var(--buy); color: var(--buy-ink); font-weight: 700; }
.btn-buy:hover { background: var(--buy); filter: brightness(1.05); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { min-height: 46px; font-size: 16px; padding: 0 20px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link-btn { border: none; background: none; padding: 0; color: var(--link); cursor: pointer; font-size: inherit; }
.link-btn:hover { text-decoration: underline; }

.badge {
  display: inline-block; padding: 0 6px; border-radius: 3px; font-size: 11px; line-height: 18px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.badge-buy { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-ship { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-store { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-new { background: var(--accent); color: #fff; border-color: transparent; }
.badge-closed { background: var(--surface-2); color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 4px; }

.price { color: var(--price); font-weight: 700; font-variant-numeric: tabular-nums; }
.vnd { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   Header trang người dùng
   --------------------------------------------------------------------- */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); position: relative; z-index: 10; }

/* Nút trên header: biểu tượng + nhãn */
.hdr-actions { display: flex; align-items: stretch; gap: 6px; margin-left: auto; flex-shrink: 0; }
.hbtn {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 66px; height: 52px; padding: 4px 2px; border-radius: 10px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 11px; font-weight: 600; line-height: 1.1; cursor: pointer; text-decoration: none !important;
  transition: background .12s, border-color .12s, transform .08s;
}
.hbtn:hover { border-color: var(--bid); color: var(--bid); background: var(--surface); }
.hbtn:active { transform: scale(.97); }
.hbtn[aria-current=page] { border-color: var(--bid); color: var(--bid); background: var(--surface); }
.hb-icon { font-size: 18px; line-height: 1; }
.hb-label { white-space: nowrap; max-width: 62px; overflow: hidden; text-overflow: ellipsis; }
.hb-badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--price); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--header-bg);
}
.notice-dialog { text-align: center; width: min(400px, calc(100vw - 32px)); }
.notice-dialog .notice-icon { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.notice-dialog h2 { margin: 0 0 8px; }
.notice-dialog p { margin: 0 0 8px; line-height: 1.6; }
.notice-dialog .dialog-actions { justify-content: center; }
.notice-dialog .dialog-actions .btn { min-width: 120px; }
.hbtn.hb-primary { background: var(--bid); border-color: var(--bid); color: #fff; }
.hbtn.hb-primary:hover { background: var(--bid-dark); color: #fff; }
.hbtn.hb-wallet { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.hbtn.hb-wallet:hover { color: var(--ok); }
.hbtn.hb-wallet .hb-label { font-variant-numeric: tabular-nums; }
.utility { border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.utility-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 30px; }
.utility-right { display: flex; align-items: center; gap: 14px; }
.rate-badge { color: var(--muted); white-space: nowrap; }
.rate-badge b { color: var(--text); }
.user-menu { display: flex; align-items: center; gap: 12px; }
.user-menu a, .user-menu .link-btn { font-size: 12px; white-space: nowrap; }
.user-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

.header-main { display: flex; align-items: center; gap: 24px; padding-top: 12px; padding-bottom: 12px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); flex-shrink: 0; text-decoration: none !important; }
.logo-mark {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px;
  background: var(--accent); color: #fff; font-weight: 800; letter-spacing: -.5px; font-size: 16px;
}
.logo-text { display: flex; flex-direction: column; font-weight: 800; font-size: 17px; line-height: 1.15; }
.logo-text small { font-weight: 400; color: var(--muted); font-size: 11px; }

.searchbox { flex: 1; min-width: 0; max-width: 820px; }
.searchbox-row {
  display: flex; height: 42px; border: 2px solid var(--bid); border-radius: 6px; overflow: hidden; background: var(--surface);
}
.search-cat {
  border: none; border-right: 1px solid var(--border); background: var(--surface-2); padding: 0 8px; max-width: 170px;
  font-size: 13px; cursor: pointer;
}
.searchbox-row input {
  flex: 1; min-width: 0; border: none; padding: 0 12px; background: transparent; font-size: 15px;
}
.searchbox-row input:focus, .search-cat:focus { outline: none; }
.search-btn {
  display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--bid); color: #fff;
  padding: 0 20px; font-weight: 700; cursor: pointer;
}
.search-btn:hover { background: var(--bid-dark); }
.search-icon {
  width: 15px; height: 15px; border: 2.5px solid currentColor; border-radius: 50%; position: relative; display: inline-block;
}
.search-icon::after {
  content: ""; position: absolute; width: 2.5px; height: 7px; background: currentColor; right: -4px; bottom: -6px;
  transform: rotate(-45deg); border-radius: 2px;
}
.qvi { display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--muted); cursor: pointer; }

.catnav { background: var(--catnav-bg); border-top: 1px solid var(--border); }
.catnav-inner { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.catnav-inner::-webkit-scrollbar { display: none; }
.catnav a {
  flex-shrink: 0; padding: 8px 12px; font-size: 13px; color: var(--text); white-space: nowrap; border-bottom: 2px solid transparent;
}
.catnav a:hover { text-decoration: none; color: var(--bid); }
.catnav a.active { border-bottom-color: var(--bid); color: var(--bid); font-weight: 600; }

main.wrap { padding-top: 16px; padding-bottom: 40px; min-height: 60vh; outline: none; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.footer-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 20px; padding-bottom: 28px; }
.footer-inner strong { color: var(--text); font-size: 13px; }
.footer-inner p { margin: 6px 0 0; }

/* ---------------------------------------------------------------------
   Khối dùng chung
   --------------------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.panel + .panel { margin-top: 12px; }
.section { margin-top: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { font-size: 17px; margin: 0; }
.notice { padding: 10px 14px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); font-size: 13px; margin-bottom: 12px; }
.notice a { color: inherit; font-weight: 600; text-decoration: underline; }
.error-box { text-align: center; padding: 48px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.error-box h2 { margin: 0 0 8px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--link); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 13px;
}
.chip:hover { border-color: var(--bid); color: var(--bid); text-decoration: none; }
.chip small { color: var(--muted); }

/* ---------------------------------------------------------------------
   Trang chủ
   --------------------------------------------------------------------- */
.home { display: block; }
.side-cats { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.side-cats h2 { font-size: 13px; margin: 0; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.side-cats a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--text); font-size: 13px; border-bottom: 1px solid var(--border); }
.side-cats a:last-child { border-bottom: none; }
.side-cats a:hover { background: var(--surface-2); text-decoration: none; color: var(--bid); }
.cat-icon { width: 22px; text-align: center; font-size: 16px; }
.welcome {
  background: linear-gradient(120deg, #fff4ec, #ffe9e1); border: 1px solid #ffd8c7; border-radius: var(--radius); padding: 20px 22px;
}
@media (prefers-color-scheme: dark) { .welcome { background: linear-gradient(120deg, #2a1d15, #2a1818); border-color: #4a2c20; } }
.welcome h1 { margin: 0 0 6px; font-size: 22px; }
.welcome p { margin: 0; color: var(--muted); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.step { background: var(--surface); border-radius: 6px; padding: 10px 12px; font-size: 13px; border: 1px solid var(--border); }
.step b { display: block; color: var(--bid); font-size: 12px; }
/* Lưới danh mục dạng ô (PC 6 cột, điện thoại 4 cột) */
.cat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.cat-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 13px; text-align: center; line-height: 1.3;
}
.cat-grid a:hover { border-color: var(--bid); color: var(--bid); text-decoration: none; }
.cat-grid .cat-icon { font-size: 28px; width: auto; }
.hscroll { display: grid; grid-auto-flow: column; grid-auto-columns: 168px; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
.hscroll > * { scroll-snap-align: start; }

/* ---------------------------------------------------------------------
   Trang kết quả tìm kiếm
   --------------------------------------------------------------------- */
.results { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.sidebar { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sidebar-head { display: none; }
.filter { padding: 12px; border-bottom: 1px solid var(--border); }
.filter:last-child { border-bottom: none; }
.filter h3 { font-size: 13px; margin: 0 0 8px; }
.filter-list { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.filter-list li { margin: 2px 0; }
.filter-list a { display: flex; align-items: baseline; gap: 6px; color: var(--text); padding: 3px 0; }
.filter-list a .count { margin-left: auto; }
.filter-list a:hover { color: var(--bid); text-decoration: none; }
.filter-list a.active { color: var(--bid); font-weight: 700; }
.filter-list a.active::before { content: "✓"; }
.filter-list .count { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.filter-list .back { color: var(--link); }
.price-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.price-filter input {
  width: 0; flex: 1; min-width: 70px; height: 32px; border: 1px solid var(--border-strong); border-radius: 4px; padding: 0 8px; background: var(--surface);
}

.results-head h1 { font-size: 18px; margin: 0; }
.results-head .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 6px 10px; margin: 10px 0;
}
.sort-tabs { display: flex; flex-wrap: wrap; gap: 2px; font-size: 13px; }
.sort-tabs a { padding: 4px 8px; border-radius: 4px; color: var(--text); }
.sort-tabs a:hover { background: var(--surface-2); text-decoration: none; }
.sort-tabs a.active { background: var(--text); color: var(--surface); font-weight: 600; }
.sort-select { display: none; height: 34px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 8px; background: var(--surface); }
.view-toggle { display: flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; }
.view-toggle button { border: none; background: var(--surface); padding: 4px 10px; cursor: pointer; font-size: 13px; }
.view-toggle button[aria-pressed=true] { background: var(--text); color: var(--surface); }
.filter-btn { display: none; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.active-filters a { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--info-soft); color: var(--info); }
.active-filters a::after { content: " ✕"; }

/* Dạng lưới */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; color: var(--text); text-decoration: none !important;
  transition: box-shadow .12s, border-color .12s;
}
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.card-img { position: relative; aspect-ratio: 1; background: var(--surface-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img .badges { position: absolute; left: 6px; top: 6px; }
.card-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.card-title {
  color: var(--link); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em;
}
.card:visited .card-title { color: var(--link-visited); }
.card:hover .card-title { text-decoration: underline; }
.card-orig { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-price { margin-top: 4px; }
.card-price .lbl { font-size: 11px; color: var(--muted); margin-right: 4px; }
.card-price .price { font-size: 16px; }
.card-sub { font-size: 12px; color: var(--muted); }
.card-sub b { color: var(--text); font-weight: 600; }
.card-meta > span { white-space: nowrap; }
.card-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 6px; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 6px; border-top: 1px dashed var(--border); }
.card-meta .soon { color: var(--price); font-weight: 600; }

/* Dạng danh sách */
.grid.list { grid-template-columns: 1fr; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.grid.list .card { flex-direction: row; border: none; border-bottom: 1px solid var(--border); border-radius: 0; }
.grid.list .card:last-child { border-bottom: none; }
.grid.list .card:hover { box-shadow: none; background: var(--surface-2); }
.grid.list .card-img { width: 140px; flex-shrink: 0; margin: 10px; border-radius: 4px; overflow: hidden; }
.grid.list .card-body { padding: 10px 12px 10px 0; display: grid; grid-template-columns: minmax(0, 1fr) 150px 120px; grid-template-rows: auto auto 1fr; column-gap: 16px; }
.grid.list .card-title { grid-column: 1; font-size: 14px; min-height: 0; }
.grid.list .card-orig { grid-column: 1; }
.grid.list .card-price { grid-column: 2; grid-row: 1 / span 3; margin: 0; text-align: right; }
.grid.list .card-price .lbl { display: block; margin: 0; }
.grid.list .card-meta { grid-column: 3; grid-row: 1 / span 3; flex-direction: column; justify-content: flex-start; border: none; padding: 0; margin: 0; text-align: right; }
.card-badges-inline { display: none; }
.grid.list .card-badges-inline { display: flex; grid-column: 1; margin-top: 6px; }
.grid.list .card-img .badges { display: none; }

/* Phân trang */
.pager { display: flex; justify-content: center; align-items: center; gap: 4px; margin-top: 20px; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0 10px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums;
}
.pager a:hover { border-color: var(--bid); color: var(--bid); text-decoration: none; }
.pager .current { background: var(--bid); border-color: var(--bid); color: #fff; font-weight: 700; }
.pager .gap { border: none; background: none; min-width: 16px; padding: 0; }

/* Lớp phủ khi mở bộ lọc trên điện thoại */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; }
.drawer-backdrop[hidden] { display: none; }

/* ---------------------------------------------------------------------
   Trang sản phẩm
   --------------------------------------------------------------------- */
.item-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 20px; align-items: start; }
.item-title { font-size: 20px; line-height: 1.45; margin: 0 0 4px; font-weight: 700; }
.item-orig { color: var(--muted); font-size: 13px; margin: 0 0 8px; }
.item-head { margin-bottom: 12px; }

.gallery-main {
  position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; cursor: zoom-in;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-main .nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .45); color: #fff; font-size: 22px; cursor: pointer;
}
.gallery-main .nav.prev { left: 10px; }
.gallery-main .nav.next { right: 10px; }
.gallery-count { position: absolute; right: 10px; bottom: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; padding: 1px 8px; border-radius: 999px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; margin-top: 8px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; aspect-ratio: 1; background: var(--surface-2); cursor: pointer; }
.thumbs button.active { border-color: var(--bid); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.swipe { display: none; }

.buybox { position: sticky; top: 12px; }
.buybox > .panel:not(.seller-card) { padding: 0; overflow: hidden; }
.bb-price { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.bb-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bb-row + .bb-row { margin-top: 8px; }
.bb-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.bb-value { text-align: right; }
.bb-value .price { font-size: 26px; line-height: 1.2; }
.bb-value .price.sm { font-size: 19px; }
.bb-value .tax { font-size: 11px; color: var(--muted); }
.bb-stats { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
.bb-stats > div { padding: 10px 16px; }
.bb-stats > div + div { border-left: 1px solid var(--border); }
.bb-stats .k { font-size: 12px; color: var(--muted); }
.bb-stats .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bb-stats .v small { font-size: 12px; font-weight: 400; color: var(--muted); }
.countdown.soon { color: var(--price); }
.bb-actions { padding: 14px 16px; display: grid; gap: 8px; }
.bb-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bb-note { font-size: 11px; color: var(--muted); margin: 0; }
.bb-badges { padding: 10px 16px 0; }
.seller-card { margin-top: 12px; }
.seller-card h3 { font-size: 13px; margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.seller-name { font-weight: 700; font-size: 15px; }
.seller-meta { font-size: 12px; color: var(--muted); }

.item-sections { margin-top: 20px; }
.sec-tabs { display: flex; border-bottom: 2px solid var(--text); overflow-x: auto; scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tabs button {
  border: none; background: var(--surface-2); padding: 9px 18px; cursor: pointer; font-weight: 600; color: var(--muted);
  border-radius: 6px 6px 0 0; margin-right: 4px; white-space: nowrap;
}
.sec-tabs button[aria-selected=true] { background: var(--text); color: var(--surface); }
.sec-body { background: var(--surface); border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: 16px; }
.lang-switch { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 6px; overflow: hidden; margin-bottom: 12px; }
.lang-switch button { border: none; background: var(--surface); padding: 5px 12px; cursor: pointer; font-size: 13px; }
.lang-switch button + button { border-left: 1px solid var(--border-strong); }
.lang-switch button[aria-pressed=true] { background: var(--info-soft); color: var(--info); font-weight: 600; }
.desc-text { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.8; }
.desc-html { overflow-x: auto; word-break: break-word; font-size: 14px; }
.desc-html img { height: auto; }
.desc-html table { max-width: 100%; }
.bilingual { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bilingual .col { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.8; }
.bilingual .col:last-child { color: var(--muted); border-left: 1px solid var(--border); padding-left: 16px; }
.desc-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 16px; }
.desc-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; cursor: zoom-in; background: var(--surface-2); }

.facts { width: 100%; border-collapse: collapse; font-size: 13px; }
.facts th, .facts td { text-align: left; padding: 9px 12px; border: 1px solid var(--border); vertical-align: top; }
.facts th { width: 30%; background: var(--surface-2); color: var(--text); font-weight: 600; }
.facts .orig { display: block; color: var(--faint); font-size: 12px; }

.mobile-bar { display: none; }
.ship-row .ship-fee { font-weight: 700; font-size: 15px; }
.ship-row .ship-fee.muted { font-weight: 400; font-size: 13px; }
.total-row { border-top: 1px dashed var(--border-strong); padding-top: 8px; }
.card-ship { font-size: 11px; color: var(--muted); }

/* ---------------------------------------------------------------------
   Tài khoản / đăng nhập
   --------------------------------------------------------------------- */
.auth { display: grid; place-items: center; padding: 24px 0 40px; }
.auth-card { width: min(420px, 100%); padding: 24px; }
.auth-card h1 { margin: 0 0 6px; font-size: 20px; }
.auth-card form { margin-top: 16px; }
.auth-footer { text-align: center; margin: 16px 0 0; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; }
.field input, .field select {
  height: 40px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 10px; background: var(--surface);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--link); box-shadow: 0 0 0 3px var(--info-soft); }
.field input:disabled { opacity: .7; background: var(--surface-2); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 10px; }
.form-error { background: var(--accent-soft); color: var(--price); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.form-ok { background: var(--ok-soft); color: var(--ok); border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.form-error[hidden], .form-ok[hidden] { display: none; }
.account { max-width: 560px; margin: 0 auto; }
.account h1 { font-size: 20px; margin: 0 0 4px; }
.account h2 { font-size: 16px; margin: 0 0 12px; }
.account .panel { margin-top: 12px; }

/* ---------------------------------------------------------------------
   Header kiểu đơn giản (trang quản trị dùng)
   --------------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--header-bg); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.top-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

/* ---------------------------------------------------------------------
   Trạng thái tải, hộp thoại, xem ảnh lớn
   --------------------------------------------------------------------- */
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { height: 300px; }
.loading-line { height: 14px; margin: 8px 0; }

.dialog { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); padding: 20px; width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dialog h2 { margin: 0 0 14px; font-size: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .94); display: grid; place-items: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 96vw; max-height: 88vh; object-fit: contain; }
.lightbox button { position: absolute; border: none; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; border-radius: 50%; width: 48px; height: 48px; font-size: 26px; }
.lb-close { top: 14px; right: 14px; font-size: 20px !important; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #ddd; font-size: 13px; }


/* ---------------------------------------------------------------------
   Đặt giá hộ, đơn, ví
   --------------------------------------------------------------------- */
.badge-lost { background: var(--accent-soft); color: var(--price); border-color: transparent; }
.warn-text { color: var(--price); font-size: 13px; font-weight: 600; }
.bid-box { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); min-width: 0; }
.bid-box > *, .bid-box form, .bid-box .field, .bid-stepper, .bid-est { min-width: 0; }
.buybox { min-width: 0; }
.bid-head { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.bid-head strong { color: var(--bid); }
.bid-hint { margin: 0; font-size: 12px; color: var(--muted); }
.bid-box .field { margin-bottom: 8px; }
.bid-box .field input { height: 42px; font-size: 16px; }
.bid-box .field input[type=number] { font-weight: 700; }
.bid-est { background: var(--surface-2); border-radius: 6px; padding: 8px 10px; font-size: 12px; margin-bottom: 8px; }
.est-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; font-variant-numeric: tabular-nums; }
.est-row.strong { font-weight: 700; font-size: 13px; border-top: 1px dashed var(--border-strong); margin-top: 2px; padding-top: 4px; }
.bid-balance { font-size: 13px; margin-bottom: 8px; }
.bid-current { display: grid; gap: 4px; font-size: 13px; background: var(--info-soft); border-radius: 6px; padding: 10px; }
.bid-raise { display: grid; gap: 8px; }
.bid-raise input { flex: 1; min-width: 0; height: 38px; border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 10px; background: var(--surface); font-weight: 700; }
.bid-links { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }

.site-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); z-index: 70; opacity: 0; pointer-events: none;
  background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg);
  transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px);
}
.site-toast.show { opacity: 1; transform: translate(-50%, 0); }
.site-toast.error { background: var(--price); color: #fff; }
body.has-mobile-bar .site-toast { bottom: 88px; }

.orders { max-width: 960px; margin: 0 auto; }
.orders-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.orders-head h1 { font-size: 20px; margin: 0; }
.balance-chip { font-size: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.seg button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.seg button[aria-pressed=true] { background: var(--text); color: var(--surface); border-color: var(--text); }
.order-list { display: grid; gap: 10px; }
.order-card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.order-img { width: 110px; height: 110px; flex-shrink: 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.order-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.order-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.order-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.order-title { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Lưới thông tin đơn: số cột cố định để các ô thẳng hàng (PC 4, tablet 3, điện thoại 2). */
.order-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; font-size: 13px; }
.order-facts > div { min-width: 0; overflow-wrap: anywhere; }
.order-facts span { display: block; color: var(--muted); font-size: 11px; }
.order-facts small { color: var(--muted); }
.order-note { font-size: 13px; background: var(--surface-2); border-radius: 6px; padding: 6px 10px; }
.order-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.order-card .notice { margin: 0; }

.account { max-width: 760px; }
.wallet-balance { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; background: var(--surface-2); border-radius: 8px; padding: 12px 14px; }
.wallet-balance strong { font-size: 24px; color: var(--ok); font-variant-numeric: tabular-nums; }
.wallet-h3 { font-size: 14px; margin: 16px 0 6px; }
.topup { white-space: pre-wrap; background: var(--warn-soft); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.tx-wrap { overflow-x: auto; }
.tx-table th { width: auto; }
.tx-table .pos { color: var(--ok); font-weight: 600; }
.tx-table .neg { color: var(--price); font-weight: 600; }
.nowrap { white-space: nowrap; }

@media (max-width: 760px) {
  .order-card { padding: 10px; gap: 10px; }
  .order-img { width: 72px; height: 72px; }
  .order-facts { grid-template-columns: 1fr 1fr; }
  .orders-head h1 { font-size: 18px; }
}


/* ---------------------------------------------------------------------
   Nạp tiền VietQR, hóa đơn
   --------------------------------------------------------------------- */
.topup-dialog { width: min(440px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow-y: auto; }
.qr-box { width: min(260px, 70vw); margin: 4px auto 12px; background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--border); }
.qr-box svg, .qr-box img { display: block; width: 100%; height: auto; }
.qr-box.vietqr { width: min(300px, 78vw); padding: 4px; }
.bank-info { display: grid; gap: 6px; margin-bottom: 10px; }
.bank-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 14px; }
.bank-row b { word-break: break-all; font-variant-numeric: tabular-nums; }
.bank-row b.hl { color: var(--price); font-size: 18px; }
.copy-btn { min-height: 26px; padding: 0 8px; font-size: 12px; }
.wallet-balance .btn-lg { min-height: 42px; }
.wallet-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; font-size: 14px; }
.wallet-sub > div { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; }
.wallet-sub b { font-size: 16px; font-variant-numeric: tabular-nums; }
.check-email { text-align: center; }
.check-email .notice-icon { font-size: 44px; }
@media (max-width: 760px) { .wallet-sub { grid-template-columns: 1fr; } }
.invoice { border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 12px; font-size: 13px; background: var(--warn-soft); }
.invoice.paid { background: var(--ok-soft); }
.invoice-title { font-weight: 700; margin-bottom: 4px; }
.invoice .est-row.due span:last-child { color: var(--price); font-size: 16px; }
.invoice.paid .est-row.due span:last-child { color: var(--ok); }

/* =====================================================================
   Máy tính bảng
   ===================================================================== */
@media (max-width: 1024px) {
  .order-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .grid.list .card-body { grid-template-columns: minmax(0, 1fr) 130px; }
  .grid.list .card-meta { grid-column: 2; grid-row: auto; flex-direction: row; justify-content: flex-end; gap: 10px; }
  .grid.list .card-price { grid-row: 1 / span 2; }
}

/* =====================================================================
   Điện thoại
   ===================================================================== */
@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .wrap { padding: 0 10px; }

  /* Header gọn (không cố định, để dành chỗ cho nội dung) */
  .utility { display: none; }
  .header-main { flex-wrap: wrap; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
  .logo-mark { width: 30px; height: 30px; font-size: 12px; border-radius: 7px; }
  .logo-text { font-size: 14px; }
  .logo-text small { display: none; }
  .searchbox { flex-basis: 100%; max-width: none; order: 3; }
  .hdr-actions { gap: 3px; order: 2; }
  .order-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; }
  .hbtn { min-width: 0; width: 50px; height: 46px; padding: 3px 1px; border-radius: 9px; font-size: 9.5px; letter-spacing: -.2px; }
  .hb-icon { font-size: 16px; }
  .hb-label { max-width: 49px; }
  .header-main .logo { gap: 6px; }
  .hbtn.hb-logout, .hdr-actions.logged .hb-settings { display: none; }
  .searchbox-row { height: 40px; }
  .search-cat { display: none; }
  .search-btn { padding: 0 14px; }
  .qvi { margin-top: 6px; }
  .catnav a { padding: 7px 10px; font-size: 12px; }

  main.wrap { padding-top: 10px; }
  .footer-inner { grid-template-columns: 1fr; gap: 12px; }

  /* Trang chủ */
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .cat-grid a {
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 11px; text-align: center; line-height: 1.3;
  }
  .cat-grid .cat-icon { font-size: 22px; width: auto; }
  .welcome { padding: 14px; }
  .welcome h1 { font-size: 17px; }
  .steps { display: none; }
  .hscroll { grid-auto-columns: 140px; }

  /* Kết quả: bộ lọc là ngăn kéo trượt từ dưới lên */
  .results { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-height: 82vh; overflow-y: auto;
    border-radius: 14px 14px 0 0; transform: translateY(105%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
    padding-bottom: env(safe-area-inset-bottom); visibility: hidden;
  }
  .sidebar.open { transform: none; visibility: visible; }
  .sidebar-head {
    display: flex; align-items: center; justify-content: space-between; padding: 12px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--surface); z-index: 1;
  }
  .sidebar-head strong { font-size: 15px; }
  .filter-list a { padding: 8px 0; }
  .toolbar { border-radius: 0; margin: 8px -10px; border-left: none; border-right: none; flex-wrap: nowrap; }
  .sort-tabs { display: none; }
  .sort-select { display: block; flex: 1; min-width: 0; }
  .filter-btn { display: inline-flex; flex-shrink: 0; }
  .view-toggle { flex-shrink: 0; }

  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .grid.list { margin: 0 -10px; border-radius: 0; border-left: none; border-right: none; }
  .grid.list .card-img { width: 104px; margin: 8px; }
  .grid.list .card-body { display: flex; flex-direction: column; padding: 8px 10px 8px 0; }
  .grid.list .card-title { font-size: 13px; }
  .grid.list .card-price { text-align: left; margin-top: 4px; }
  .grid.list .card-price .lbl { display: inline; margin-right: 4px; }
  .grid.list .card-meta { flex-direction: row; justify-content: space-between; text-align: left; margin-top: auto; padding-top: 4px; }
  .grid.list .card-badges-inline { margin-top: 4px; }
  .card-body { padding: 6px 8px 8px; }
  .card-price .price { font-size: 15px; }

  /* Sản phẩm */
  .item-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .item-title { font-size: 16px; }
  .gallery { margin: 0 -10px; }
  .gallery-desktop { display: none; }
  .swipe { display: block; position: relative; background: var(--surface); }
  .swipe-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1; }
  .swipe-track::-webkit-scrollbar { display: none; }
  .swipe-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
  .swipe-dots { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; scrollbar-width: none; background: var(--surface); }
  .swipe-dots::-webkit-scrollbar { display: none; }
  .swipe-dots button { flex: 0 0 52px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; background: var(--surface-2); }
  .swipe-dots button.active { border-color: var(--bid); }
  .swipe-dots img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .buybox { position: static; }
  .bb-value .price { font-size: 22px; }
  .bb-actions .row { grid-template-columns: 1fr; }
  .sec-body { padding: 12px; }
  .sec-tabs button { padding: 8px 12px; font-size: 13px; }
  .bilingual { grid-template-columns: 1fr; }
  .bilingual .col:last-child { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
  .facts th { width: 36%; padding: 8px; }
  .facts td { padding: 8px; }

  .mobile-bar {
    display: flex; align-items: center; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0, 0, 0, .08);
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-bar .mb-price { flex: 1; min-width: 0; line-height: 1.25; }
  .mobile-bar .price { font-size: 18px; }
  .mobile-bar .btn { min-height: 44px; }
  body.has-mobile-bar { padding-bottom: 72px; }
}

/* Màn hình rất hẹp: chỉ giữ biểu tượng logo để các nút header nằm cùng một hàng. */
@media (max-width: 380px) {
  .header-main .logo-text { display: none; }
}

/* ---- Hạng thành viên ---- */
.tier-bronze   { --t1: #e8a96a; --t2: #a0612b; --tbg: linear-gradient(135deg, #f6d3b0, #d99a5e); --tfg: #5c3311; }
.tier-silver   { --t1: #e9edf2; --t2: #8a95a3; --tbg: linear-gradient(135deg, #f4f6f9, #c3cad3); --tfg: #3b4450; }
.tier-gold     { --t1: #ffe27a; --t2: #c8930e; --tbg: linear-gradient(135deg, #fff1b8, #f2c335); --tfg: #6b4a00; }
.tier-platinum { --t1: #d4f3f7; --t2: #4fa3b5; --tbg: linear-gradient(135deg, #e6fbfd, #9fd8e3); --tfg: #1d5662; }
.tier-titanium { --t1: #a7b3c4; --t2: #2e3747; --tbg: linear-gradient(135deg, #5d6878, #232a36); --tfg: #f1f4f8; }
.tier-ico { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; }
.tier-ico svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.18)); }
.tier-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 4px; border-radius: 999px;
  background: var(--tbg); color: var(--tfg); font-size: 11px; font-weight: 800; letter-spacing: .4px;
  line-height: 18px; vertical-align: middle; white-space: nowrap; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.tier-badge .tier-ico { width: 16px; height: 16px; }
.tier-badge.big { font-size: 15px; padding: 5px 14px 5px 8px; gap: 6px; line-height: 24px; }
.tier-badge.big .tier-ico { width: 24px; height: 24px; }
.hbtn.hb-tier { background: var(--tbg); color: var(--tfg); border-color: transparent; font-weight: 800; letter-spacing: .3px; }
.hbtn.hb-tier:hover, .hbtn.hb-tier[aria-current=page] { background: var(--tbg); color: var(--tfg); border-color: var(--t2); }
.hbtn.hb-tier .tier-ico { width: 20px; height: 20px; }
.hbtn.hb-tier .tier-ico svg { filter: drop-shadow(0 1px 1px rgba(0,0,0,.3)); }
.account-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tier-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.tier-head-info { display: grid; gap: 3px; }
.tier-progress { display: grid; gap: 6px; margin-bottom: 12px; }
.tier-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.tier-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--bid), #f5a623); border-radius: 4px; }
.tier-table { display: grid; gap: 4px; }
.tier-row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px; border: 1px solid transparent;
}
.tier-row.current { border-color: var(--bid); background: var(--surface-2); }
@media (max-width: 640px) {
  .hbtn.hb-tier .tier-ico { width: 18px; height: 18px; }
  .tier-row { grid-template-columns: 104px minmax(0, 1fr); }
  .tier-row > :last-child { grid-column: 2; }
}

/* Từ khóa tiếng Nhật đã dịch (sửa được) */
.qja-box {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
}
.qja-box .input { flex: 1 1 200px; min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font: inherit; background: var(--surface); color: var(--text); }
.searchbox.translating .search-btn { opacity: .7; cursor: progress; }
.searchbox.translating .search-btn .hide-sm::after { content: '…'; }

/* ---- Nút nổi dịch trang (Google Dịch trên trình duyệt) ---- */
.fab-tr {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 38;
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px 0 6px; border-radius: 23px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); transition: transform .1s, background .15s;
}
.fab-tr:hover { transform: translateY(-1px); }
.fab-tr:active { transform: scale(.97); }
.fab-tr .fab-ico {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%;
  background: #4285f4; color: #fff; font-size: 13px; font-weight: 800; letter-spacing: -.5px;
}
.fab-tr.on { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.fab-tr.on .fab-ico { background: #fff; color: #1a73e8; font-size: 16px; }
.fab-tr.busy .fab-ico { animation: fab-spin 1s linear infinite; }
.fab-tr.err { background: #fff4e5; border-color: #f0a020; color: #8a4b00; }
.fab-tr.err .fab-ico { background: #f0a020; color: #fff; }
@keyframes fab-spin { to { transform: rotate(360deg); } }
body.has-mobile-bar .fab-tr { bottom: calc(84px + env(safe-area-inset-bottom)); }
@media (max-width: 640px) {
  .fab-tr { right: 12px; height: 42px; font-size: 13px; padding-right: 12px; }
  .fab-tr .fab-ico { width: 30px; height: 30px; }
}
@media print { .fab-tr { display: none; } }

/* ---- Khung thời gian + đồng hồ đếm ngược ---- */
.time-box {
  margin: 12px 16px; padding: 12px; border: 1.5px solid var(--border-strong, #d0d4da); border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); text-align: center;
}
.tb-head { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px; }
.tb-clock { display: flex; justify-content: center; gap: 6px; }
.tb-seg {
  flex: 1 1 0; max-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 6px; border-radius: 9px; background: #1f2937; color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 2px 6px rgba(0, 0, 0, .12);
}
.tb-seg[hidden] { display: none; }
.tb-num { font-size: 24px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.tb-unit { font-size: 10px; opacity: .75; text-transform: uppercase; letter-spacing: .4px; }
.tb-over { font-size: 18px; font-weight: 800; color: var(--muted); padding: 8px 0; }
.tb-end { display: grid; gap: 4px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 12px; }
.tb-end > div { display: flex; justify-content: space-between; gap: 8px; }
.tb-end span { color: var(--muted); }
.tb-end b { font-variant-numeric: tabular-nums; }
.time-box.soon { border-color: var(--price); background: linear-gradient(180deg, #fff1f1, var(--surface)); }
.time-box.soon .tb-seg { background: var(--price); }
.time-box.soon .tb-head { color: var(--price); }
.time-box.urgent .tb-seg:last-child { animation: tb-pulse 1s ease-in-out infinite; }
.time-box.ended { opacity: .85; }
@keyframes tb-pulse { 50% { transform: scale(1.06); } }
@media (prefers-color-scheme: dark) {
  .time-box.soon { background: var(--surface-2); }
}
@media (max-width: 640px) {
  .tb-num { font-size: 22px; }
}
.bid-hint.center { text-align: center; }

/* Logo ảnh */
.logo-img { display: block; height: 52px; width: auto; }
@media (max-width: 760px) { .logo-img { height: 38px; } }
@media (max-width: 380px) { .logo-img { height: 32px; } }

/* ---- Ô nhập giá theo bước giá Yahoo ---- */
.bid-stepper { display: grid; gap: 6px; }
.bs-row { display: flex; align-items: stretch; height: 44px; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.bs-row:focus-within { border-color: var(--bid); box-shadow: 0 0 0 3px rgba(241, 90, 36, .15); }
.bs-btn {
  width: 46px; flex-shrink: 0; border: 0; background: var(--surface-2); color: var(--text);
  font-size: 22px; font-weight: 700; cursor: pointer; line-height: 1;
}
.bs-btn:hover { background: var(--bid); color: #fff; }
.bs-row .bs-input, .bid-raise .bs-row .bs-input {
  flex: 1; min-width: 0; height: auto; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  border-radius: 0; padding: 0 10px; text-align: center; font-size: 18px; font-weight: 800; background: var(--surface); color: var(--text);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; outline: none;
}
.bs-input::-webkit-outer-spin-button, .bs-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.bs-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-quick button {
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 12px; cursor: pointer;
}
.bs-quick button:hover { border-color: var(--bid); color: var(--bid); }
.bs-hint { font-size: 12px; color: var(--muted); }
.est-row > span:last-child { white-space: nowrap; }
@media (max-width: 640px) {
  .bs-quick { gap: 4px; flex-wrap: nowrap; }
  .bs-quick button { flex: 1 1 0; padding: 4px 2px; font-size: 11px; white-space: nowrap; }
}

/* Khung ước tính trong ô đặt giá: nền tối, nổi khối */
.bid-box .bid-est {
  background: linear-gradient(160deg, #1b2436, #0f1522); color: #e8ecf3; border-radius: 12px;
  padding: 12px 14px; font-size: 13px; box-shadow: 0 8px 22px rgba(15, 21, 34, .28), inset 0 1px 0 rgba(255, 255, 255, .06);
}
.bid-box .bid-est .est-row { padding: 4px 0; }
.bid-box .bid-est .est-row > span:first-child { color: #aab4c5; }
.bid-box .bid-est .est-row > span:last-child { color: #fff; font-weight: 600; }
.bid-box .bid-est .est-row.strong { border-top: 1px dashed rgba(255, 255, 255, .22); margin-top: 6px; padding-top: 8px; font-size: 15px; }
.bid-box .bid-est .est-row.strong > span:first-child { color: #fff; }
.bid-box .bid-est .est-row.strong > span:last-child { color: #ff8a3d; font-size: 18px; font-weight: 800; }

/* Chữ: tiêu đề đậm, số dạng bảng cho giá */
h1, h2, h3, .item-title { letter-spacing: -.015em; }
.price, .bb-value, .tb-num, .bs-input, .est-row, .vnd { font-variant-numeric: tabular-nums; }

/* ---- Điều khoản ---- */
.terms-page { max-width: 860px; margin: 0 auto; padding: 20px 24px; }
.terms-page h1 { font-size: 22px; margin: 0 0 4px; }
.terms-body { line-height: 1.7; font-size: 14px; }
.terms-body h2 { font-size: 16px; margin: 18px 0 6px; }
.terms-body ul { padding-left: 20px; margin: 6px 0; }
.terms-body li { margin: 4px 0; }
.terms-dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 32px); display: none; flex-direction: column; }
.terms-dialog[open] { display: flex; }
.terms-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.terms-scroll { overflow-y: auto; max-height: 60vh; padding: 4px 12px 4px 2px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.terms-dialog .dialog-actions { align-items: center; flex-wrap: wrap; }
.terms-dialog .dialog-actions .muted { margin-right: auto; }
.terms-check { align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.5; margin: 4px 0 12px; }
.terms-check input { margin-top: 3px; flex-shrink: 0; }
.small.center, p.center { text-align: center; }

/* ---- Điện thoại: các nút tài khoản thành thanh nổi dưới cùng ---- */
@media (max-width: 760px) {
  .hdr-actions {
    position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 45;
    order: 0; margin: 0; gap: 4px; justify-content: space-around; padding: 5px 6px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
    border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  }
  .hdr-actions:empty { display: none; }
  .hdr-actions .hbtn { flex: 1 1 0; width: auto; max-width: 76px; height: 42px; padding: 2px 1px; gap: 1px; border-radius: 10px; font-size: 9.5px; }
  .hdr-actions .hbtn:not(.hb-wallet):not(.hb-tier):not(.hb-primary) { background: transparent; border-color: transparent; }
  .hdr-actions .hbtn[aria-current=page]:not(.hb-wallet):not(.hb-tier) { background: var(--surface-2); color: var(--bid); }
  .hdr-actions .hb-icon, .hdr-actions .hbtn .tier-ico { font-size: 16px; width: 17px; height: 17px; }
  .hdr-actions .hb-label { max-width: 70px; }
  .hdr-actions .hb-badge { top: -3px; right: 4px; }
  .header-main .logo { margin-right: auto; }
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  /* Trang sản phẩm: thanh giá + "Đặt giá" nằm ngay trên thanh nút */
  body.has-mobile-bar { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }
  body.has-mobile-bar .mobile-bar {
    left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom)); border: 1px solid var(--border);
    border-radius: 14px; padding: 6px 10px; box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
  }
  .fab-tr { bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.has-mobile-bar .fab-tr { bottom: calc(136px + env(safe-area-inset-bottom)); }
  .site-toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  body.has-mobile-bar .site-toast { bottom: calc(140px + env(safe-area-inset-bottom)); }
}

/* ---- Giao hàng ---- */
.delivery-box { margin-top: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); display: grid; gap: 2px; font-size: 13px; }
.delivery-box .db-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.delivery-box .db-locked { color: var(--warn, #b26a00); font-weight: 600; }
.delivery-box.st-shipped, .delivery-box.st-ready { border-color: var(--ok); }
.delivery-box.st-delivered { opacity: .85; }
.delivery-todo { border-left: 3px solid var(--bid); }
.delivery-dialog { width: min(560px, calc(100vw - 24px)); }
.delivery-dialog h2 { margin: 0 0 4px; font-size: 18px; }
.dl-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 12px; }
.dl-tab { padding: 10px; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; color: var(--text); }
.dl-tab[aria-pressed=true] { border-color: var(--bid); background: color-mix(in srgb, var(--bid) 10%, var(--surface)); color: var(--bid); }
.dl-pane[hidden] { display: none; }
.dl-input { width: 100%; box-sizing: border-box; padding: 9px 10px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
textarea.dl-input { resize: vertical; }
.wh-list { display: grid; gap: 8px; max-height: 46vh; overflow: auto; }
.wh-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; }
.wh-item:has(input:checked) { border-color: var(--bid); background: color-mix(in srgb, var(--bid) 6%, var(--surface)); }
.wh-item input { margin-top: 4px; }

/* ---- Hành trình đơn hàng ---- */
.jn-steps { list-style: none; margin: 10px 0 4px; padding: 0; position: relative; }
.jn-step { position: relative; display: flex; gap: 10px; padding: 0 0 12px; }
.jn-step::before { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: var(--border); }
.jn-step:last-child::before { display: none; }
.jn-step.done::before { background: var(--ok); }
.jn-dot {
  position: relative; z-index: 1; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.jn-step.done .jn-dot { background: var(--ok); border-color: var(--ok); }
.jn-step.current .jn-dot { background: var(--bid); border-color: var(--bid); box-shadow: 0 0 0 4px color-mix(in srgb, var(--bid) 22%, transparent); animation: jn-pulse 1.6s ease-in-out infinite; }
@keyframes jn-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--bid) 8%, transparent); } }
.jn-body { min-width: 0; flex: 1; display: grid; gap: 3px; padding-top: 1px; }
.jn-title { font-weight: 600; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.jn-step.todo .jn-title { color: var(--faint); font-weight: 500; }
.jn-step.current .jn-title { color: var(--bid); font-weight: 800; }
.jn-when { font-size: 11px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.jn-track { display: grid; gap: 2px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.jn-log { font-size: 12px; margin-top: 2px; }
.jn-log summary { cursor: pointer; color: var(--link); }
.jn-log ul { margin: 6px 0 0; padding-left: 16px; display: grid; gap: 3px; }
.jn-badge.st-to_jp, .jn-badge.st-to_vn, .jn-badge.st-shipping_vn { background: #e8f1ff; color: #1a5fd0; border-color: transparent; }
.jn-badge.st-at_vn, .jn-badge.st-ready, .jn-badge.st-done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.jn-badge.st-won { background: #fff3e0; color: #b45f00; border-color: transparent; }

/* ---- Bộ lọc dạng nút (chip) nổi bật ---- */
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.seg button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 8px 6px 14px;
  border: 1.5px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .06); transition: transform .08s, border-color .12s, background .12s, box-shadow .12s;
}
.seg button:not(:has(.seg-n)) { padding-right: 14px; }
.seg button:hover { border-color: var(--bid); color: var(--bid); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0, 0, 0, .1); }
.seg button:active { transform: translateY(0); }
.seg .seg-n {
  min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.seg button.zero { opacity: .62; }
.seg button.urgent .seg-n { background: var(--price); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--price) 22%, transparent); }
.seg button[aria-pressed=true] {
  background: linear-gradient(135deg, #ff7a2f, var(--bid)); border-color: transparent; color: #fff; opacity: 1;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--bid) 40%, transparent);
}
.seg button[aria-pressed=true] .seg-n { background: rgba(255, 255, 255, .25); color: #fff; box-shadow: none; }
@media (max-width: 640px) {
  .seg { gap: 6px; flex-wrap: wrap; max-width: 100%; }
  .seg button { min-height: 34px; font-size: 13px; padding-left: 11px; padding-right: 11px; }
}

/* ---- Thẻ nhắc bật thông báo ---- */
.push-prompt {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 60; width: min(460px, calc(100vw - 16px));
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: 0 14px 40px rgba(0, 0, 0, .25);
  animation: pp-in .25s ease-out;
}
@keyframes pp-in { from { opacity: 0; transform: translate(-50%, 12px); } }
.pp-icon { font-size: 26px; flex-shrink: 0; }
.pp-text { display: grid; gap: 2px; font-size: 13px; min-width: 0; flex: 1; }
.pp-text span { color: var(--muted); }
.pp-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
@media (max-width: 760px) {
  .push-prompt { bottom: calc(70px + env(safe-area-inset-bottom)); }
  body.has-mobile-bar .push-prompt { bottom: calc(144px + env(safe-area-inset-bottom)); }
}

/* Giá vừa được đồng bộ */
.live-flash { animation: live-flash 1.6s ease-out; border-radius: 4px; }
@keyframes live-flash { 0% { background: color-mix(in srgb, var(--bid) 35%, transparent); } 100% { background: transparent; } }

/* ---- Mã đơn hàng / mã vận đơn ---- */
.order-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .5px; color: var(--text); }
.code-strip {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px dashed var(--border-strong); background: var(--surface-2);
}
.code-item { display: grid; gap: 1px; min-width: 0; flex: 1 1 150px; }
.ci-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.ci-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ci-value { font-size: 16px; overflow-wrap: anywhere; }
.ci-value.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .5px; }
.ci-value.muted { font-size: 13px; font-weight: 500; color: var(--muted); }
.ci-copy { border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: 6px; padding: 1px 6px; cursor: pointer; font-size: 13px; }
.ci-copy:hover { color: var(--bid); border-color: var(--bid); }

/* ---- Phiếu nhận hàng ---- */
.slip-dialog { width: min(520px, calc(100vw - 16px)); }
.slip { display: grid; gap: 12px; color: var(--text); }
.slip-head { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--text); }
.slip-head b { font-size: 18px; letter-spacing: .5px; }
.slip-logo { height: 42px; width: auto; }
.slip-main { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; }
.slip-qr { background: #fff; padding: 6px; border-radius: 8px; border: 1px solid var(--border); }
.slip-qr svg { display: block; width: 100%; height: auto; }
.slip-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 30px; font-weight: 800; letter-spacing: 1px; line-height: 1.1; }
.slip-track { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.slip-info { display: grid; gap: 4px; padding-top: 10px; border-top: 1px dashed var(--border-strong); font-size: 13px; }
.slip-row { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }
.slip-row span { color: var(--muted); }
@media (max-width: 480px) {
  .slip-main { grid-template-columns: 120px 1fr; }
  .slip-code { font-size: 24px; }
}
@media print {
  body.printing-slip > *:not(.slip-dialog) { display: none !important; }
  body.printing-slip { background: #fff !important; padding: 0 !important; }
  .slip-dialog { position: static !important; width: 100% !important; max-width: 640px; border: 0 !important; box-shadow: none !important; margin: 0 auto !important; color: #000 !important; background: #fff !important; }
  .slip-dialog::backdrop { display: none; }
  .no-print { display: none !important; }
  .slip, .slip * { color: #000 !important; }
}

/* ---- Căn chỉnh giao diện điện thoại ---- */
.qvi input { margin: 0; }
.wallet-balance, .wallet-sub > div { padding: 12px 14px; }
@media (max-width: 760px) {
  /* Thanh danh mục: chữ thẳng hàng với lề nội dung */
  .catnav-inner { padding: 0; }
  /* Ảnh sản phẩm: khung 4:3 vừa với ảnh Yahoo, không để trống phía trên/dưới */
  .swipe-track { aspect-ratio: 4 / 3; background: var(--surface-2); }
  /* Nút dịch nổi: thu gọn thành nút tròn để không che nội dung */
  .fab-tr { width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 50%; gap: 0; }
  .fab-tr > span:not(.fab-ico) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .fab-tr .fab-ico { width: 36px; height: 36px; }
}

/* ---- Nút liên hệ Zalo (nổi phía trên nút dịch) ---- */
.fab-zalo {
  position: fixed; right: 16px; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 38;
  display: inline-flex; align-items: center; gap: 6px; height: 46px; padding: 0 16px 0 6px; border-radius: 23px;
  background: #0068ff; color: #fff !important; font-weight: 800; font-size: 14px; text-decoration: none !important;
  box-shadow: 0 6px 20px rgba(0, 104, 255, .35); transition: transform .1s;
}
.fab-zalo:hover { transform: translateY(-1px); }
.fz-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; color: #0068ff; }
.fz-ico svg { width: 22px; height: 22px; }
.btn-zalo { background: #0068ff; border-color: #0068ff; color: #fff !important; font-weight: 700; }
.btn-zalo:hover { background: #0057d6; }
@media (max-width: 760px) {
  .fab-zalo { right: 10px; width: 50px; height: 50px; padding: 0; flex-direction: column; justify-content: center; gap: 0; border-radius: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); }
  .fab-zalo .fz-label { font-size: 10px; line-height: 1; letter-spacing: .2px; }
  .fab-zalo .fz-ico { width: 24px; height: 22px; background: transparent; color: #fff; }
  .fab-zalo .fz-ico svg { width: 20px; height: 20px; }
  body.has-mobile-bar .fab-zalo { bottom: calc(190px + env(safe-area-inset-bottom)); }
}
@media print { .fab-zalo { display: none; } }
@media (min-width: 761px) {
  /* PC không có thanh giá dưới cùng: giữ nút dịch và nút Zalo ở vị trí chuẩn */
  body.has-mobile-bar .fab-tr { bottom: calc(16px + env(safe-area-inset-bottom)); }
}

/* ---- Giỏ hàng ---- */
.cart-btn { width: 100%; justify-content: center; gap: 8px; min-height: 42px; font-weight: 700; border: 1.5px solid var(--bid); color: var(--bid); background: var(--surface); }
.cart-btn:hover { background: color-mix(in srgb, var(--bid) 8%, var(--surface)); }
.cart-btn.in-cart { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border-color: var(--ok); color: var(--ok); }
.cart-btn .cart-ico { font-size: 17px; }
.cart-btn.compact { width: 44px; min-height: 44px; padding: 0; flex-shrink: 0; }
.mobile-bar .cart-btn.compact { margin-left: auto; }
.cart-pin {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; border: 0; cursor: pointer; font-size: 16px;
  background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); transition: transform .1s;
}
.cart-pin:hover { transform: scale(1.08); }
.cart-pin.in-cart { background: var(--ok); box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(0, 0, 0, .2); }
.card-img { position: relative; }
.cart-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.cart-price .price { font-size: 18px; }
.cart-item.ended { opacity: .7; }
.hbtn.hb-cart .hb-icon { font-size: 18px; }

/* ---- Popup đặt giá nhanh (giỏ hàng) ---- */
.quickbid-dialog { width: min(480px, calc(100vw - 16px)); max-height: calc(100vh - 24px); overflow-y: auto; padding: 16px; position: relative; }
.qb-close { position: absolute; top: 6px; right: 10px; border: 0; background: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; z-index: 1; }
.qb-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 22px; margin-bottom: 12px; }
.qb-img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--surface-2); }
.qb-info { display: grid; gap: 3px; min-width: 0; }
.qb-title { font-weight: 700; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qb-info .price { font-size: 18px; }
.qb-more { display: inline-block; margin-top: 8px; }
.quickbid-dialog .bid-box { padding: 0; border: 0; }
.cart-order { margin: 4px 0; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.cart-order.outbid { background: color-mix(in srgb, var(--price) 10%, var(--surface)); }
.cart-order.cart-won { background: color-mix(in srgb, var(--ok, #16a34a) 12%, var(--surface)); border-left: 3px solid var(--ok, #16a34a); }
.badge.badge-won { background: color-mix(in srgb, var(--ok, #16a34a) 18%, transparent); color: var(--ok, #16a34a); font-weight: 700; }
@media (max-width: 640px) {
  .quickbid-dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); }
}

/* ---- Phí vận chuyển Nhật–Việt ---- */
.est-foot { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.bid-box .bid-est .est-foot { color: #aab4c5; }
.bid-box .bid-est .est-foot a { color: #ffb37a; }
.intl-box { margin-top: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); display: grid; gap: 4px; font-size: 13px; }
.intl-box.due { border-color: var(--bid); background: color-mix(in srgb, var(--bid) 8%, var(--surface)); }
.intl-box.due .btn { justify-self: start; margin-top: 4px; }
.intl-box.paid { border-color: var(--ok); background: var(--ok-soft); }
.catnav a.catnav-ship { font-weight: 700; color: var(--bid); }
.ship-explain { margin-bottom: 12px; }
.rates-body table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 14px; }
.rates-body th, .rates-body td { border: 1px solid var(--border-strong); padding: 8px 10px; text-align: left; vertical-align: top; }
.rates-body th { background: color-mix(in srgb, #ffd400 35%, var(--surface)); }
.rates-body td:nth-child(2) { font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) { .rates-body table { font-size: 12.5px; } .rates-body th, .rates-body td { padding: 6px; } }

/* Ship Nhật–Việt ước tính trong khung giá dự kiến */
.est-intl-row small { color: inherit; opacity: .75; font-size: 11px; }
.est-intl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 2px 0 4px; font-size: 12px; }
.est-select, .est-kg { font: inherit; font-size: 12px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 4px 6px; }
.est-select { flex: 1 1 140px; min-width: 0; max-width: 100%; width: 0; text-overflow: ellipsis; }
.est-kg { width: 64px; text-align: right; }
.bid-box .bid-est .est-select, .bid-box .bid-est .est-kg { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .25); color: #fff; }
.bid-box .bid-est .est-select option { color: #111; }
.bid-box .bid-est .est-intl { color: #aab4c5; }

/* Phiếu nhận hàng: chỉ hiện khi đơn sẵn sàng lấy tại kho, làm nổi bật */
.slip-cta {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 8px; padding: 12px 16px;
  border: 0; border-radius: 12px; cursor: pointer; text-align: left; font: inherit; color: #fff;
  background: linear-gradient(135deg, #16a34a, #0d9488); box-shadow: 0 6px 18px rgba(22, 163, 74, .35);
  animation: slip-pulse 2.2s ease-in-out infinite;
}
.slip-cta:hover { filter: brightness(1.08); }
.slip-cta:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.slip-cta-icon { font-size: 26px; line-height: 1; }
.slip-cta b { display: block; font-size: 16px; }
.slip-cta small { display: block; opacity: .9; font-size: 12px; }
@keyframes slip-pulse { 0%, 100% { box-shadow: 0 6px 18px rgba(22, 163, 74, .35); } 50% { box-shadow: 0 6px 26px rgba(22, 163, 74, .7); } }
@media (prefers-reduced-motion: reduce) { .slip-cta { animation: none; } }
.won-box { display: grid; gap: 8px; padding: 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.won-title { font-weight: 800; color: var(--ok); }
.order-note.finished-note { border-left: 3px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); font-weight: 600; }

/* Thanh danh mục: máy tính xuống dòng để thấy hết mục (không bị cắt chữ);
   điện thoại cuộn ngang, có lớp mờ ở mép phải báo còn mục phía sau. */
@media (min-width: 761px) {
  .catnav-inner { flex-wrap: wrap; overflow: visible; row-gap: 0; }
  .catnav a { padding: 8px 10px; }
}
@media (max-width: 760px) {
  .catnav { position: relative; }
  .catnav::after {
    content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 28px; pointer-events: none;
    background: linear-gradient(to right, transparent, var(--catnav-bg));
  }
}
.forgot-link { text-align: right; margin: -4px 0 8px; font-size: 13px; }
.money-input { font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.btn.btn-cancel { color: var(--price); border-color: color-mix(in srgb, var(--price) 45%, transparent); background: transparent; }
.btn.btn-cancel:hover { background: color-mix(in srgb, var(--price) 10%, transparent); }

/* Quy trình đấu giá */
.process-body h2 { margin-top: 0; }
.process-body h3 { margin: 18px 0 6px; color: var(--bid); }
.process-body ul { padding-left: 20px; margin: 4px 0; }
.process-body li { margin: 3px 0; }
.process-cta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.dialog.process-dialog { width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 40px); overflow: auto; position: relative; }
.dialog.process-dialog .process-body { font-size: 14px; line-height: 1.6; }
.dialog.process-dialog .process-body h2 { padding-right: 34px; }
.dialog.process-dialog .dialog-actions { position: sticky; bottom: -1px; background: var(--surface); padding: 10px 0 2px; margin-top: 10px; border-top: 1px solid var(--border); }

/* ---- Gợi ý khi gõ tìm kiếm ---- */
.searchbox { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; z-index: 60; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 0 0 10px 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .14); padding: 4px 0; max-height: 380px; overflow: auto;
}
.suggest-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; font-size: 14px; }
.suggest-item:hover, .suggest-item.on { background: var(--surface-2); }
.sg-ico { width: 20px; text-align: center; opacity: .8; }
.sg-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-ja { color: var(--muted); font-size: 13px; white-space: nowrap; }
.sg-del { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.sg-del:hover { color: var(--price); }
.sg-clear { display: block; width: 100%; border: 0; border-top: 1px solid var(--border); background: none; color: var(--muted); font: inherit; font-size: 12px; padding: 8px 14px; text-align: left; cursor: pointer; }
@media (max-width: 760px) { .suggest-item { padding: 11px 12px; } }

/* ---- Lọc nhanh, đơn vị giá, không có kết quả ---- */
.quick-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 10px; }
.qchip { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 13px; color: var(--text); background: var(--surface); text-decoration: none !important; white-space: nowrap; }
.qchip:hover { border-color: var(--bid); color: var(--bid); }
.qchip.on { background: var(--bid); border-color: var(--bid); color: #fff; font-weight: 600; }
@media (max-width: 760px) { .quick-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .quick-chips::-webkit-scrollbar { display: none; } }
.unit-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.unit-toggle button { border: 0; background: var(--surface); color: var(--muted); font: inherit; font-size: 12px; padding: 4px 10px; cursor: pointer; }
.unit-toggle button[aria-pressed="true"] { background: var(--bid); color: #fff; font-weight: 600; }
.price-presets { margin-bottom: 6px; }
.price-filter input { font-variant-numeric: tabular-nums; }
.empty-help ul { text-align: left; max-width: 560px; margin: 10px auto 0; padding-left: 20px; line-height: 1.9; }
/* Hai ô giá xếp dọc, rộng hết cột để số tiền VND (1.000.000) hiện đủ. */
.price-filter { display: grid; grid-template-columns: 1fr; gap: 6px; }
.price-filter > span { display: none; }
.price-filter input { width: 100%; min-width: 0; }

/* ---- Trang chủ: tiêu đề & dịch vụ ---- */
.home-hero { padding: 6px 0 2px; }
.home-hero h1 { font-size: 22px; margin: 0 0 4px; line-height: 1.3; }
.home-hero p { margin: 0 0 12px; color: var(--muted); }
@media (max-width: 760px) { .home-hero h1 { font-size: 18px; } .home-hero p { font-size: 13px; } }
.svc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .svc-grid { grid-template-columns: 1fr 1fr; } }
.svc-card { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); text-decoration: none !important; }
.svc-card:hover { border-color: var(--bid); }
.svc-card b { font-size: 15px; }
.svc-card span:last-child { color: var(--muted); font-size: 13px; }
.svc-ico { font-size: 22px; }

/* ---- Trang giới thiệu dịch vụ ---- */
.landing { max-width: 860px; margin: 0 auto; line-height: 1.7; }
.landing h1 { font-size: 26px; margin: 6px 0 10px; line-height: 1.3; }
.landing h2 { font-size: 19px; margin: 22px 0 6px; }
.landing .lp-lead { font-size: 16px; }
.landing .crumbs { font-size: 13px; color: var(--muted); }
.lp-cta { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.lp-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; }
.lp-cats a { display: inline-block; padding: 4px 10px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; }
.lp-faq details { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 6px 0; }
.lp-faq summary { cursor: pointer; font-weight: 600; }
@media (max-width: 760px) { .landing h1 { font-size: 21px; } }

/* ---- Chân trang ---- */
.site-footer { margin-top: 28px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; padding-top: 22px; padding-bottom: 10px; font-size: 13px; }
.footer-grid ul { list-style: none; padding: 0; margin: 6px 0 0; line-height: 1.9; }
.footer-grid p { margin: 6px 0 0; line-height: 1.6; }
.footer-copy { padding-bottom: 22px; font-size: 12px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > div:first-child { grid-column: 1 / -1; } .site-footer { padding-bottom: 76px; } }

/* ---- Vừa khít màn hình điện thoại (freesize) ---- */
html, body { max-width: 100%; overflow-x: clip; }
img, video, svg, canvas { max-width: 100%; }
main, .wrap, .card, .order, .orders, .panel { min-width: 0; }
@media (max-width: 760px) {
  /* iOS tự phóng to khi chạm vào ô nhập chữ < 16px và không thu lại -> trang bị lệch sau khi đăng nhập */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
  pre, code { white-space: pre-wrap; word-break: break-word; }
  table { max-width: 100%; }
}

/* ---- Thanh tiến trình khi đang tải trang ---- */
.top-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 9999; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, var(--bid, #f05a28), var(--price, #d0021b)); box-shadow: 0 0 8px color-mix(in srgb, var(--bid, #f05a28) 60%, transparent); }
.top-progress.on { opacity: 1; width: 85%; transition: width 8s cubic-bezier(.1, .7, .2, 1), opacity .2s; }
.top-progress.on.done { width: 100%; opacity: 0; transition: width .2s ease-out, opacity .3s .1s; }
@media (prefers-reduced-motion: reduce) { .top-progress.on { transition: none; width: 100%; } }

/* ---- Khung "Bạn đã đặt giá" trên trang sản phẩm ---- */
.bid-current.placed { gap: 8px; font-size: 13.5px; padding: 14px; border-radius: 12px;
  border: 2px solid var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--surface));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ok) 18%, transparent); animation: placed-in .45s ease-out; }
.bid-current.placed.is-pending { border-color: var(--bid); background: color-mix(in srgb, var(--bid) 9%, var(--surface));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--bid) 20%, transparent); }
.placed-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; color: var(--ok); }
.is-pending .placed-title { color: var(--bid); }
.placed-ico { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--ok); color: #fff; font-size: 14px; font-weight: 900; }
.is-pending .placed-ico { background: var(--bid); }
.placed-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.placed-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; font-size: 15px; letter-spacing: .3px;
  padding: 3px 10px; border-radius: 6px; background: var(--surface); border: 1px dashed var(--border-strong); }
.placed-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 13px;
  background: var(--ok); color: #fff; }
.is-pending .placed-status { background: var(--bid); }
.placed-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: placed-pulse 1.4s ease-in-out infinite; }
.placed-note { font-size: 12.5px; color: var(--text); opacity: .85; }
.placed-max b { font-size: 15px; }
.raise-label { margin-top: 12px; font-weight: 700; font-size: 13px; }
@keyframes placed-pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes placed-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bid-current.placed, .placed-dot { animation: none; } }
.mobile-bar .btn-bid.mb-placed { background: var(--ok); border-color: var(--ok); color: #fff; }

/* ---- Số dư dạng VND ~ JPY ---- */
.hbtn.hb-wallet .hb-label { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.05; max-width: none; text-align: center; }
.hbtn.hb-wallet .hb-sub { font-size: 10px; font-weight: 700; opacity: .8; }
.wallet-jpy { font-size: 15px; font-weight: 700; color: var(--price, #d0021b); margin-top: 2px; font-variant-numeric: tabular-nums; }
.retention-note { margin-top: 16px; text-align: center; }

/* ---- Nút "Đơn": số đơn đang xử lý + chấm thông báo chưa đọc ---- */
.hb-badge.hb-badge-open { background: var(--bid, #f05a28); }
.hb-dot { position: absolute; top: -3px; left: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--price, #d0021b); box-shadow: 0 0 0 2px var(--header-bg); }
@media (max-width: 760px) { .hdr-actions .hb-dot { top: 0; left: 8px; } }
