:root {
  --red: #c62424;
  --red-d: #a51d1d;
  --ink: #1c1f26;
  --muted: #7a808c;
  --line: #e7e8ec;
  --bg: #f4f5f7;
  --card: #fff;
  --new: #fff7d6;
  --new-line: #f2c94c;
  --navy: #1c4f9c;   /* (05/11/2026) cùng màu trang chủ thplog.com (cũ #00467f) */
  --navy-d: #143a74;
  --green: #22c55e;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--navy); font-weight: 700; white-space: nowrap; }
.brand b { font-weight: 800; color: var(--red); }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sep { width: 1px; height: 24px; background: var(--line); }
.auth-logo { display: block; width: 180px; max-width: 70%; margin: 0 auto 6px; }
.brand small { color: var(--muted); font-size: 12px; font-weight: 400; margin-left: 6px; }
.brand.big { font-size: 26px; justify-content: center; }
.logo { width: 26px; height: 26px; border-radius: 50%; background: var(--red); position: relative; flex: none; }
.logo::before { content: ""; position: absolute; inset: 6px; border: 2px solid #fff; border-radius: 50%; }
.logo::after { content: ""; position: absolute; left: 11px; top: 11px; width: 4px; height: 4px; border-radius: 50%; background: #fff; }

/* buttons */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 8px 14px; border-radius: 8px; font-weight: 600; white-space: nowrap;
}
.btn:hover { border-color: #cfd2d8; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-d); }
.btn.primary.off { background: #fff; color: var(--muted); border-color: var(--line); }
.btn.ghost { background: #e9f0f7; border-color: #e9f0f7; color: var(--navy); }
.btn.icon { padding: 8px 11px; }
.btn.block { width: 100%; padding: 12px; }
.btn.turbo { background: var(--navy); border-color: var(--navy); color: #fff; border-radius: 999px; padding: 8px 16px; }
.btn.turbo span { font-size: 10px; opacity: .7; margin-left: 4px; }
.btn.turbo.on { background: linear-gradient(90deg, var(--navy), var(--red)); border-color: var(--red); box-shadow: 0 0 0 3px #c6242430; }
.btn.turbo.on span { opacity: 1; }

/* topbar */
.topbar {
  position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 3px solid var(--navy);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
}
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.menu { position: fixed; right: 16px; top: 60px; z-index: 30; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px #0002; padding: 6px; min-width: 200px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px 12px; border-radius: 6px; }
.menu button:hover { background: var(--bg); }
.menu-phone { padding: 8px 12px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* add bar */
.addbar {
  display: grid; grid-template-columns: 1fr 110px 110px 150px auto; gap: 8px;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--line);
}
.addbar input, .auth input {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: #fff; min-width: 0; width: 100%;
}
.addbar input:focus, .auth input:focus { outline: 2px solid #c6242440; border-color: var(--red); }
.addbar .form-msg { grid-column: 1 / -1; }
.form-msg { font-size: 13px; color: var(--muted); min-height: 0; }
.form-msg.error { color: var(--red); }
.form-msg.ok { color: #15803d; }

.filterbar { display: flex; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* grid */
.grid {
  display: grid; gap: 12px; padding: 12px 16px 40px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.card {
  background: var(--card); border-radius: var(--radius); border: 1px solid var(--line);
  padding: 10px 10px 6px; display: flex; flex-direction: column; min-width: 0;
  transition: box-shadow .2s, opacity .2s;
}
.card.dragging { opacity: .4; border: 2px dashed var(--red); }
.card.drop-target { box-shadow: 0 0 0 2px var(--red); }
.card.paused { opacity: .6; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 2px 4px 4px; }
.card-title { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.kw { color: var(--navy); font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ago { color: var(--red); font-style: italic; font-size: 12px; white-space: nowrap; }
.ago.err { color: #b45309; }
.card-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.ic { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); display: grid; place-items: center; padding: 0; font-size: 14px; }
.ic:hover { color: var(--ink); border-color: #cfd2d8; }
.ic.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 0; padding: 0; margin-left: 4px; background: #c7cad1; }
.dot.on { background: var(--green); box-shadow: 0 0 0 3px #22c55e30; }
.dot.on.pulse { animation: pulse 1.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 #22c55e80; } 100% { box-shadow: 0 0 0 8px #22c55e00; } }
.card-sub { color: var(--muted); font-size: 12px; padding: 0 4px 6px; }
.card-sub .tag { background: var(--bg); border-radius: 4px; padding: 1px 6px; margin-right: 4px; }

.items { display: flex; flex-direction: column; gap: 6px; }
.item {
  display: grid; grid-template-columns: 56px 1fr; gap: 10px; align-items: start;
  padding: 7px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; position: relative;
}
.item:hover { background: #fafafb; border-color: var(--line); }
.item.new { background: var(--new); border-color: var(--new-line); }
.item.new::after { content: "MỚI"; position: absolute; left: 4px; top: 4px; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; padding: 1px 4px; border-radius: 3px; }
.item img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--bg); }
.item .row1 { display: flex; justify-content: space-between; gap: 6px; align-items: baseline; }
.price { color: var(--red); font-weight: 800; font-size: 15px; }
.vnd { color: var(--muted); font-size: 12px; margin-left: 6px; font-weight: 500; }
.time { color: var(--muted); font-size: 11px; font-style: italic; white-space: nowrap; }
.title { font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }
.item.sold { opacity: .5; }
.item.sold .soldtag { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #333d; color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 4px; font-size: 13px; letter-spacing: .5px; }
.items .placeholder { color: var(--muted); padding: 22px 8px; text-align: center; font-size: 13px; }
.more { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 8px; }
.more:hover { color: var(--red); }

.empty { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty h2 { color: var(--ink); margin: 18px 0 8px; }
.radar-anim { width: 90px; height: 90px; margin: auto; border-radius: 50%; border: 2px solid #c6242440; position: relative; overflow: hidden; }
.radar-anim::before { content: ""; position: absolute; inset: 0; background: conic-gradient(from 0deg, #c6242400 0 300deg, #c6242480 360deg); animation: spin 2.4s linear infinite; }

/* toasts */
.toasts { position: fixed; right: 16px; top: 70px; z-index: 40; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--red); color: #fff; padding: 10px 16px; border-radius: 8px; font-weight: 700; box-shadow: 0 8px 24px #c6242455; animation: slidein .25s ease-out; pointer-events: auto; cursor: pointer; max-width: 320px; }
.toast.info { background: var(--navy); box-shadow: 0 8px 24px #0003; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* modal */
.modal { position: fixed; inset: 0; background: #0008; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { background: #fff; border-radius: 14px; width: min(860px, 100%); max-height: calc(100vh - 32px); overflow: auto; position: relative; }
.modal-close { position: absolute; right: 10px; top: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: #fffc; font-size: 16px; }
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 20px; }
.gallery .main { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--bg); border-radius: 10px; }
.thumbs { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; }
.thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; flex: none; }
.thumbs img.active { border-color: var(--red); }
.detail h2 { font-size: 18px; margin: 0 0 4px; line-height: 1.35; }
.detail .ja { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.detail .bigprice { color: var(--red); font-size: 26px; font-weight: 800; }
.detail .bigprice small { color: var(--muted); font-size: 14px; font-weight: 500; margin-left: 8px; }
.specs { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.specs td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs td:first-child { color: var(--muted); width: 38%; }
.desc { white-space: pre-wrap; font-size: 13px; line-height: 1.5; background: var(--bg); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto; }
.detail .btns { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.btn.big { padding: 13px; font-size: 15px; text-align: center; text-decoration: none; }
.badge-sold { display: inline-block; background: #333; color: #fff; padding: 2px 10px; border-radius: 4px; font-weight: 700; font-size: 12px; margin-bottom: 8px; }
.linkbtn { border: 0; background: none; color: var(--red); padding: 4px 0; font-size: 13px; }
.order-form { display: grid; gap: 8px; margin-top: 10px; }
.order-form input, .order-form textarea { border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; width: 100%; }
.loading { padding: 60px; text-align: center; color: var(--muted); }

/* auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { background: #fff; border-radius: 16px; padding: 28px 24px; width: min(400px, 100%); box-shadow: 0 10px 40px #0001; }
.auth-card .muted { text-align: center; color: var(--muted); margin: 10px 0 18px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 8px; padding: 3px; margin-bottom: 14px; }
.tab { border: 0; background: none; padding: 8px; border-radius: 6px; font-weight: 600; color: var(--muted); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px #0001; }
.auth label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.auth label input { margin-top: 4px; padding: 11px 12px; }
.hint { font-size: 12px; color: var(--muted); text-align: center; }

/* mobile */
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 8px 12px; }
  .brand { font-size: 18px; }
  .brand small { display: none; }
  .actions { width: 100%; justify-content: space-between; gap: 6px; }
  .actions .btn { padding: 7px 10px; font-size: 13px; }
  .addbar { grid-template-columns: 1fr 1fr; }
  .addbar input[name=keyword], .addbar button { grid-column: 1 / -1; }
  .grid { grid-template-columns: 1fr; padding: 10px 12px 40px; }
  .detail { grid-template-columns: 1fr; padding: 14px; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card { border-radius: 14px 14px 0 0; max-height: 94vh; }
  .toasts { left: 12px; right: 12px; top: auto; bottom: 16px; }
}
.order-form .who { background: var(--bg); border-radius: 8px; padding: 10px; font-size: 13px; }
.order-form .qty { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.order-form .qty input { width: 90px; }
.hint a { color: var(--red); }

@media (max-width: 760px) { .brand-logo { height: 26px; } }
@media (max-width: 760px) {
  .actions .btn { flex: 1 1 auto; }
  .actions .btn.icon { flex: none; }
}

/* ---- điều hướng + khám phá ---- */
.nav { display: flex; gap: 4px; margin-right: auto; margin-left: 18px; }
.navtab { border: 0; background: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; color: var(--muted); }
.navtab:hover { background: var(--bg); }
.navtab.active { color: var(--navy); background: #e9f0f7; }
.navtab span { font-weight: 500; }

.searchbar { display: flex; gap: 8px; padding: 14px 16px 6px; max-width: 900px; }
.searchbar input { flex: 1; min-width: 0; border: 2px solid var(--navy); border-radius: 10px; padding: 11px 14px; font: inherit; font-size: 15px; background: #fff; }
.searchbar input:focus { outline: none; box-shadow: 0 0 0 3px #00467f22; }
.catbar { display: flex; gap: 6px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; }
.catbar::-webkit-scrollbar { display: none; }
.catbar .chip { white-space: nowrap; flex: none; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 16px 8px; }
.filters select, .filters input[inputmode] { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font: inherit; background: #fff; }
.filters input[inputmode] { width: 110px; }
.filters .check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.filters #watchThis { margin-left: auto; color: var(--navy); border-color: var(--navy); }
.explore-info { padding: 2px 16px 8px; color: var(--muted); font-size: 13px; }
.explore-info b { color: var(--ink); }

.pgrid { display: grid; gap: 12px; padding: 0 16px 20px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: 0 6px 20px #00467f1f; transform: translateY(-2px); }
.pimg { position: relative; aspect-ratio: 1; background: var(--bg); }
.pimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard.sold .pimg img { opacity: .45; }
.pcard .soldtag { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #333d; color: #fff; font-weight: 800; padding: 4px 12px; border-radius: 4px; font-size: 13px; }
.pbody { padding: 8px 10px 10px; }
.vnd2 { color: var(--muted); font-size: 12px; }
.pbody .title { margin-top: 4px; min-height: 2.7em; }
.pbody .time { margin-top: 4px; display: block; }
.pcard.skel { cursor: default; }
.pcard.skel .pimg, .pcard.skel .pbody div { background: linear-gradient(90deg, #eef0f3, #f7f8fa, #eef0f3); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.pcard.skel .pbody div { height: 12px; border-radius: 4px; margin: 6px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pgrid .placeholder { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px; }
.loadmore-wrap { text-align: center; padding: 0 16px 40px; }

/* đăng nhập dạng cửa sổ nổi */
.auth { position: fixed; inset: 0; z-index: 60; background: #0009; min-height: 0; }
.auth-card { position: relative; }

@media (max-width: 760px) {
  .nav { order: 3; width: 100%; margin: 4px 0 0; }
  .navtab { flex: 1; }
  .searchbar { padding: 10px 12px 4px; }
  .catbar, .filters, .explore-info { padding-left: 12px; padding-right: 12px; }
  .filters input[inputmode] { width: 90px; }
  .filters #watchThis { margin-left: 0; width: 100%; }
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0 12px 20px; }
}

/* sửa lỗi: món nhiều ảnh làm hàng ảnh nhỏ đẩy cột ảnh phình to, đè cột thông tin */
.detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.detail > * { min-width: 0; }
.gallery .main { max-height: 70vh; }
.thumbs { scrollbar-width: thin; padding-bottom: 4px; }
@media (max-width: 760px) { .detail { grid-template-columns: minmax(0, 1fr); } }

/* hàng đấu giá */
.auction { border: 2px solid var(--navy); border-radius: 10px; padding: 10px 12px; margin: 4px 0 12px; background: #f3f7fb; }
.auction.ended { border-color: #999; background: #f4f4f4; }
.auc-head { font-weight: 800; color: var(--navy); font-size: 13px; letter-spacing: .3px; margin-bottom: 6px; }
.auc-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 3px 0; }
.auc-row span { color: var(--muted); }
#aucLeft { color: var(--red); font-size: 15px; }

/* chế độ Tất cả / Đấu giá */
.modebar { display: flex; gap: 6px; padding: 8px 16px 0; }
.mode { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 7px 14px; font-weight: 700; color: var(--muted); }
.mode.active { border-color: var(--navy); color: var(--navy); background: #e9f0f7; }
.abadge { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; color: var(--navy); background: #e9f0f7; border-radius: 4px; padding: 2px 6px; }
@media (max-width: 760px) { .modebar { padding: 8px 12px 0; } .mode { flex: 1; } }

/* đấu giá của tôi */
.bids-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 16px 6px; }
.bids-head h2 { margin: 0; color: var(--navy); font-size: 20px; }
.bids-head .muted { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.bids-list { display: grid; gap: 10px; padding: 8px 16px 40px; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
.bid { display: grid; grid-template-columns: 96px 1fr; gap: 12px; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 10px; padding: 10px; }
.bid.st-ok { border-left-color: #16a34a; } .bid.st-bad { border-left-color: var(--red); } .bid.st-warn { border-left-color: #f59e0b; } .bid.st-wait { border-left-color: var(--navy); }
.bid-img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--bg); cursor: pointer; }
.bid-body { min-width: 0; }
.bid-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.src { font-size: 11px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: #fdecec; color: var(--red); }
.src.yahoo { background: #f1e9fb; color: #6d28d9; }
.st { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.st.st-ok { background: #dcfce7; color: #15803d; } .st.st-bad { background: #fee2e2; color: var(--red); } .st.st-warn { background: #fef3c7; color: #b45309; } .st.st-wait { background: #e9f0f7; color: var(--navy); }
.who2 { font-size: 12px; color: var(--muted); }
.bid-title { font-weight: 600; margin: 4px 0 6px; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bid-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bid-grid div { background: var(--bg); border-radius: 6px; padding: 5px 7px; display: flex; flex-direction: column; }
.bid-grid span { font-size: 11px; color: var(--muted); } .bid-grid b { font-size: 14px; } .bid-grid small { font-size: 11px; color: var(--muted); }
.bid-grid b.urgent { color: var(--red); }
.bid-need { font-size: 12px; color: var(--muted); margin-top: 6px; }
.bid-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.bid-actions input { width: 130px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; }
.bid-actions .btn { padding: 7px 11px; font-size: 13px; text-decoration: none; }
.bid-actions .won { border-color: #16a34a; color: #15803d; }
@media (max-width: 760px) {
  .bids-list { grid-template-columns: 1fr; padding: 8px 12px 40px; }
  .bid { grid-template-columns: 72px 1fr; } .bid-img { width: 72px; height: 72px; }
  .nav { overflow-x: auto; } .navtab { white-space: nowrap; font-size: 13px; padding: 8px; }
}

/* danh mục nhiều tầng */
.catbar { flex-direction: column; gap: 6px; }
.catbar .crumbs, .catbar .kids { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; }
.catbar .crumbs::-webkit-scrollbar, .catbar .kids::-webkit-scrollbar { display: none; }
.catbar .sep { color: var(--muted); flex: none; }
.chip.crumb { background: #e9f0f7; border-color: #e9f0f7; color: var(--navy); white-space: nowrap; flex: none; }
.chip.crumb.here { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 700; }
.src.rakuma { background: #fde7ef; color: #be123c; }
@media (max-width: 760px) { .modebar { flex-wrap: wrap; } .mode { flex: 1 1 45%; padding: 7px 8px; font-size: 13px; } }
.src.paypay { background: #fef3c7; color: #b45309; }
@media (min-width: 761px) { .modebar { flex-wrap: wrap; } }

/* khách tự đặt + quản trị */
.btn.walletbtn { background: linear-gradient(90deg, var(--navy), #0a5ea8); color: #fff; border-color: var(--navy); }
.grant-form { display: flex; gap: 8px; padding: 4px 16px 10px; max-width: 560px; }
.grant-form input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font: inherit; }
.grant-list { padding: 0 16px 40px; display: grid; gap: 6px; max-width: 760px; }
.grant { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.grant .muted { color: var(--muted); font-size: 12px; flex: 1; }
.navtab { white-space: nowrap; }
@media (min-width: 761px) and (max-width: 1100px) { .nav { margin-left: 8px; } .navtab { padding: 8px 8px; font-size: 13px; } }
.addbar { grid-template-columns: 110px 1fr 110px 110px 150px auto; }
.addbar .srcsel { border: 1px solid var(--line); border-radius: 8px; padding: 9px; background: #fff; font: inherit; }
.kw .src { font-size: 10px; vertical-align: middle; }
@media (max-width: 760px) { .addbar { grid-template-columns: 1fr 1fr; } .addbar .srcsel { grid-column: 1 / -1; } }

/* mặc cả */
.btn.offerbtn { border-color: var(--navy); color: var(--navy); }
.order-form .check2 { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.msgja { background: #f3f7fb; border-radius: 8px; padding: 8px; margin-top: 6px; font-size: 12px; }
.msgja code { display: block; white-space: pre-wrap; margin-bottom: 6px; font-family: inherit; }
.pbadge { position: absolute; left: 6px; top: 6px; box-shadow: 0 1px 4px #0002; }
.src.mercari { background: #fdecec; color: #c62424; }
.explore-info .src { font-size: 11px; }
.dot-m { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #ff333f; vertical-align: -1px; }
@media (min-width: 761px) { .modebar { flex-wrap: wrap; } }
@media (max-width: 760px) { .mode { flex: 1 1 30%; font-size: 12px; padding: 7px 6px; } }

/* bảng tạm tính phí */
.costbox { margin: 6px 0 4px; }
table.cost { width: 100%; border-collapse: collapse; font-size: 13px; background: #f3f7fb; border-radius: 8px; overflow: hidden; }
table.cost td { padding: 5px 8px; border-bottom: 1px solid #e3eaf2; }
table.cost td:last-child { text-align: right; white-space: nowrap; }
table.cost td:nth-child(2) { color: var(--muted); font-size: 12px; }
table.cost tr.sum td { background: #e9f0f7; color: var(--navy); font-size: 14px; }

/* ---------- đơn của tôi ---------- */
.ord-wrap { max-width: 900px; margin: 0 auto; padding: 0 16px 48px; }
.ord-wrap .bids-head { padding-left: 0; padding-right: 0; }
.ord-staff { display: flex; gap: 8px; margin-bottom: 10px; }
.ord-staff input, .ord-search { flex: 1; min-width: 0; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; width: 100%; }
.ord-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; }
.ord-chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 13px; color: var(--ink); }
.ord-chip span { background: #e9f0f7; color: var(--navy); border-radius: 999px; padding: 0 7px; margin-left: 4px; font-size: 12px; }
.ord-chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.ord-chip[aria-pressed="true"] span { background: #fff; }
.ord-search { margin-bottom: 12px; }
.ord-empty { padding: 40px 0; text-align: center; }
.ord-parcel { background: #e9f0f7; border-radius: 12px; padding: 10px 14px; margin: 16px 0 8px; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; color: var(--navy); }
.ord-parcel .muted { font-size: 13px; }
.ord-pstate { margin-left: auto; font-weight: 700; font-size: 13px; }
.ord-cards { display: grid; gap: 10px; margin-bottom: 10px; }
.ord-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ord-card.cancelled { opacity: .65; }
.ord-head { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; background: none; border: 0; text-align: left; color: inherit; }
.ord-head:focus-visible, .ord-chip:focus-visible, .ord-ph:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.ord-thumb { width: 60px; height: 60px; border-radius: 10px; background: var(--bg); overflow: hidden; display: block; }
.ord-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ord-info { display: grid; gap: 2px; min-width: 0; }
.ord-title { font-weight: 600; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.ord-ja { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ord-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 12.5px; color: var(--muted); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.ord-side { display: grid; gap: 4px; justify-items: end; text-align: right; font-variant-numeric: tabular-nums; }
.ord-pill { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.ord-pill.s-buy, .ord-pill.s-jp { background: #e9f0f7; color: var(--navy); }
.ord-pill.s-fly { background: #fff3dc; color: #b26a00; }
.ord-pill.s-vn { background: #fdecec; color: var(--red); }
.ord-pill.s-done { background: #e3f4ea; color: #18794e; }
.ord-pill.s-cancel { background: var(--bg); color: var(--muted); }
.ord-body { border-top: 1px solid var(--line); padding: 14px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; }
.ord-body h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ord-steps { list-style: none; margin: 0; padding: 0; }
.ost { display: grid; grid-template-columns: 20px 1fr; gap: 10px; position: relative; padding-bottom: 12px; }
.ost:last-child { padding-bottom: 0; }
.ost::before { content: ""; position: absolute; left: 9px; top: 18px; bottom: -2px; width: 2px; background: var(--line); }
.ost:last-child::before { display: none; }
.ost.done::before { background: var(--navy); }
.odot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: #fff; z-index: 1; display: grid; place-items: center; }
.ost.done .odot { background: var(--navy); border-color: var(--navy); }
.ost.done .odot::after { content: ""; width: 7px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.ost.now .odot { border-color: var(--red); box-shadow: 0 0 0 4px #fdecec; }
.ost.now .odot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.ost-t { font-weight: 600; }
.ost:not(.done):not(.now) .ost-t { color: var(--muted); font-weight: 500; }
.ost-s { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.ord-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.ord-ph { position: relative; padding: 0; border: 0; border-radius: 10px; overflow: hidden; aspect-ratio: 1; max-width: 100%; background: var(--bg); cursor: zoom-in; }
.ord-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ord-ph span { position: absolute; left: 4px; right: 4px; bottom: 4px; background: #0009; color: #fff; font-size: 10px; border-radius: 4px; padding: 1px 4px; }
.ord-nophoto { margin: 0 0 14px; font-size: 13px; }
.ord-money td:nth-child(2) { color: inherit; font-size: 13px; }
.ord-note { font-size: 11.5px; margin-top: 6px; }
.ord-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ord-more { text-align: center; margin-top: 16px; }
.ord-lb { padding: 16px; display: grid; gap: 8px; justify-items: center; }
.ord-lb img { max-width: 100%; max-height: 75vh; border-radius: 10px; }
@media (max-width: 640px) {
  .ord-body { grid-template-columns: 1fr; }
  .ord-head { grid-template-columns: 52px minmax(0, 1fr); }
  .ord-thumb { width: 52px; height: 52px; }
  .ord-side { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; justify-items: start; }
}

/* công nợ */
.bal-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; display: grid; gap: 10px; }
.bal-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 16px; }
.bal-lab { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--muted); }
.bal-num { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bal-head.owe .bal-num { color: var(--red); }
.bal-head.credit .bal-num { color: #18794e; }
.bal-when { font-size: 12px; }
.bal-table td:nth-child(2) { color: inherit; font-size: 13px; text-align: right; }
.bal-note { font-size: 11.5px; }
.bal-more summary { cursor: pointer; font-weight: 600; color: var(--navy); }
.bal-more h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bal-more ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 13px; }
.ord-tg { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; background: #e9f0f7; color: var(--navy); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-size: 13px; }

/* giỏ hàng */
.cart { padding: 20px; display: grid; gap: 12px; }
.cart h2 { margin: 0; }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cart-list li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.cart-list img, .cart-noimg { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--bg); display: block; }
.cart-title { font-weight: 600; overflow-wrap: anywhere; }
.cart-tip { background: #fff3dc; color: #8a5300; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.cart-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cart-progress { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.cart-progress .err { color: var(--red); }
#cartCount { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; margin-left: 2px; }
.src.yshop { background: #ffedd5; color: #c2410c; }
.src.rakuten { background: #fee2e2; color: #bf0000; }

/* ---- Trang chi tiết kiểu sàn TMĐT (20/10/2026) ---- */
.modal-card.wide { width: min(1120px, 100%); }
.detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "gal info" "more seller"; align-items: start; gap: 22px 26px; }
.detail .gallery { grid-area: gal; }
.detail .dinfo { grid-area: info; }
.detail .dmore { grid-area: more; }
.detail .seller { grid-area: seller; }
.gal-main { position: relative; }
.gal-main .main { display: block; border: 1px solid var(--line); }
.gal-main .noimg { width: 100%; aspect-ratio: 1; background: var(--bg); border-radius: 10px; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; background: #fffe; box-shadow: 0 2px 8px #0002; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink); }
.gal-nav.prev { left: 8px; } .gal-nav.next { right: 8px; }
.gal-count { position: absolute; right: 10px; bottom: 10px; background: #000a; color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.thumbs img { width: 64px; height: 64px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { font-size: 12px; padding: 3px 9px; border-radius: 20px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.chip.site { background: var(--navy); color: #fff; border-color: var(--navy); font-weight: 600; }
.chip.ok { background: #e8f8ee; border-color: #bfe8cd; color: #17803d; }
.detail h2 { font-size: 20px; }
.rating { font-size: 13px; margin: -4px 0 8px; }
.stars { color: #f5a623; letter-spacing: 1px; }
.pricebox { background: linear-gradient(90deg, #fff1f1, #fff); border-left: 4px solid var(--red); border-radius: 8px; padding: 10px 14px; margin: 8px 0 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pricebox .bigprice { font-size: 28px; font-weight: 800; color: var(--red); }
.pricebox .yen { color: var(--muted); font-size: 15px; }
.variants { margin: 6px 0 10px; border-radius: 10px; }
.variants.shake { animation: vshake .5s; box-shadow: 0 0 0 2px var(--red); }
@keyframes vshake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.vaxis { margin-bottom: 10px; }
.vname { font-size: 13px; margin-bottom: 6px; }
.vname::first-letter { text-transform: uppercase; }
.vchoices { display: flex; flex-wrap: wrap; gap: 6px; max-height: 210px; overflow: auto; }
.vchip { border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; text-align: left; line-height: 1.25; color: var(--ink); }
.vchip small { display: block; color: var(--muted); font-size: 10.5px; }
.vchip:hover { border-color: #f0a0a0; }
.vchip.on { border-color: var(--red); background: #fff3f3; color: var(--red); font-weight: 600; }
.vchip.off { opacity: .4; text-decoration: line-through; }
.vstock { font-size: 12.5px; min-height: 16px; }
.vstock.bad { color: var(--red); font-weight: 600; }
.qtyrow { display: flex; align-items: center; gap: 12px; margin: 8px 0 12px; font-size: 13px; }
.stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { width: 34px; border: 0; background: var(--bg); font-size: 18px; cursor: pointer; color: var(--ink); }
.stepper input { width: 52px; border: 0; text-align: center; font-size: 15px; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.est { display: inline-block; font-size: 10.5px; background: #fff4d6; color: #8a6100; border-radius: 4px; padding: 0 5px; margin-left: 3px; vertical-align: 1px; }
.trust { list-style: none; padding: 10px 12px; margin: 10px 0 0; background: #f3f7fb; border-radius: 8px; font-size: 12.5px; color: #33465a; display: grid; gap: 4px; }
.dmore section { margin-bottom: 18px; }
.dmore h3 { font-size: 16px; margin: 0 0 8px; padding-left: 8px; border-left: 3px solid var(--red); }
.sec-head { display: flex; justify-content: space-between; align-items: center; }
.desc.collapsed { max-height: 180px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.desc:not(.collapsed) { max-height: none; }
.reviews { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 10px; }
.reviews li { background: var(--bg); border-radius: 8px; padding: 10px; font-size: 13px; }
.rbody { white-space: pre-wrap; line-height: 1.5; max-height: 140px; overflow: auto; }
.rimgs { display: flex; gap: 6px; margin-top: 6px; }
.rimgs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.seller { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; }
.seller-name { font-weight: 700; font-size: 15px; }
.cart-var { font-size: 12px; color: var(--navy); margin: 2px 0; }
@media (max-width: 760px) {
  .detail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gal" "info" "seller" "more"; }
  .pricebox .bigprice { font-size: 24px; }
}
.itemnote { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; background: var(--bg); resize: vertical; margin: 0 0 10px; }

/* ---- Trang chi tiết toàn màn hình (20/10/2026, theo mẫu Ecoship) ---- */
.modal.full { padding: 0; align-items: stretch; background: #eef0f3; }
.modal.full .modal-card.wide { width: 100%; max-width: none; height: 100vh; max-height: 100vh; border-radius: 0; background: #eef0f3; }
.modal.full .modal-close { position: fixed; top: 8px; right: 14px; background: #fff; box-shadow: 0 1px 4px #0002; }
.dpage { min-height: 100%; }
.dbar { position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 60px 10px 16px; display: flex; align-items: center; gap: 14px; }
.dback { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 14px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.dcrumb { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dpage .detail { max-width: 1320px; margin: 16px auto; padding: 0 16px; gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) 300px; grid-template-areas: "gal info seller" "more more seller"; }
.dpage .detail > .gallery, .dpage .detail > .dinfo, .dpage .detail > .dmore, .dpage .detail > .seller { background: #fff; border-radius: 12px; padding: 18px; border: 0; }
.dpage .detail > .seller { position: sticky; top: 70px; }
.dpage .gallery .main { max-height: none; aspect-ratio: 1; }
.dpage .thumbs { flex-wrap: wrap; overflow: visible; }
.dpage .thumbs img { width: 72px; height: 72px; }
.dpage .desc.collapsed { max-height: 320px; }
.vchip.hasimg { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; }
.vchip.hasimg img { width: 34px; height: 34px; object-fit: cover; border-radius: 5px; flex: none; }
@media (max-width: 1150px) {
  .dpage .detail { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-areas: "gal info" "more seller"; }
  .dpage .detail > .seller { position: static; }
}
@media (max-width: 760px) {
  .dpage .detail { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gal" "info" "seller" "more"; margin: 8px auto; padding: 0 8px; gap: 8px; }
  .dpage .detail > * { padding: 12px; }
  .dpage .thumbs { flex-wrap: nowrap; overflow-x: auto; }
  .dpage .thumbs img { width: 56px; height: 56px; }
  .modal.full .modal-card.wide { max-height: 100vh; border-radius: 0; }
}

/* logo sàn trên các nút chọn nguồn (20/10/2026) */
.mode .mlogo { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; vertical-align: -4px; margin-right: 3px; }

/* ================= Giao diện mới (22/10/2026, theo bản mẫu demo-giao-dien.html) ================= */
body { font-family: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
.topbar { border-bottom: 1px solid var(--line); background: #fffffff2; backdrop-filter: blur(8px); }
.searchbar { max-width: 1280px; margin: 0 auto; padding: 14px 16px 10px; }
.searchbar input { border: 1.5px solid var(--line); border-radius: 999px; padding: 12px 20px; background: #fff; }
.searchbar input:focus { border-color: var(--navy); }
.searchbar .btn.primary { border-radius: 999px; padding: 0 26px; background: var(--red); border-color: var(--red); font-weight: 700; }

/* phần giới thiệu */
#heroBox[hidden] { display: none; }
.hero { position: relative; background: radial-gradient(1100px 380px at 85% -10%, #ffdede 0%, transparent 60%), linear-gradient(135deg, #0b3d6b 0%, #0f4f86 55%, #145e9c 100%); color: #fff; border-radius: 16px; margin: 4px 16px 0; overflow: hidden; }
.hero-x { position: absolute; top: 10px; right: 12px; border: 0; background: #ffffff1f; color: #dbe8f5; font-size: 12px; padding: 5px 10px; border-radius: 999px; }
.hero-x:hover { background: #ffffff33; color: #fff; }
.hero-in { padding: 30px 28px 22px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: center; }
.hero h1 { font-size: 34px; line-height: 1.18; margin: 0 0 10px; font-weight: 800; letter-spacing: -.5px; }
.hero h1 em { font-style: normal; color: #ffd166; }
.hero .lead { font-size: 15.5px; line-height: 1.6; color: #d7e6f5; margin: 0 0 20px; max-width: 560px; }
.cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hbtn { border: 0; border-radius: 12px; padding: 12px 20px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; cursor: pointer; }
.hbtn.red { background: var(--red); color: #fff; box-shadow: 0 6px 18px #c6242455; }
.hbtn.red:hover { background: var(--red-d); }
.hbtn.ghost { background: #ffffff1a; color: #fff; border: 1px solid #ffffff40; }
.hbtn.ghost:hover { background: #ffffff2b; }
.hero-side { display: grid; gap: 12px; }
.hrate { background: #fff; color: var(--ink); border-radius: 14px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; box-shadow: 0 10px 30px #00000026; }
.hrate .lbl { color: var(--muted); font-size: 12.5px; }
.hrate .val { font-size: 25px; font-weight: 800; color: var(--navy); }
.hrate .val small { font-size: 14px; font-weight: 600; color: var(--muted); }
.hrate .live { font-size: 12px; color: #17803d; background: #e8f8ee; padding: 4px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.step { background: #ffffff14; border: 1px solid #ffffff2e; border-radius: 12px; padding: 12px; }
.step b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #ffd166; color: var(--navy); font-size: 13px; margin-bottom: 8px; }
.step div { font-weight: 700; font-size: 13.5px; margin-bottom: 2px; }
.step span { font-size: 12px; color: #c9dcef; line-height: 1.45; display: block; }
.sites { padding: 0 28px 20px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sites .t { color: #c9dcef; font-size: 12.5px; margin-right: 2px; }
.sites span.s { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--ink); border-radius: 999px; padding: 4px 11px 4px 5px; font-size: 12.5px; font-weight: 600; }
.sites img { width: 20px; height: 20px; border-radius: 5px; }
.trustbar { padding: 12px 16px 2px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.trustbar div { background: #fff; border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; box-shadow: 0 1px 2px #0000000d, 0 4px 14px #0000000a; font-size: 12.5px; color: var(--muted); }
.trustbar i { font-style: normal; font-size: 22px; }
.trustbar b { display: block; color: var(--ink); font-size: 13.5px; }

/* nút chọn sàn */
.modebar { padding: 14px 16px 2px; gap: 8px; }
.mode { border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; padding: 7px 14px 7px 9px; }
.mode.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.mode .mlogo { width: 20px; height: 20px; border-radius: 5px; vertical-align: -5px; }

/* thẻ sản phẩm */
.pgrid { gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.pcard { border: 0; border-radius: 14px; box-shadow: 0 1px 2px #0000000d, 0 4px 14px #0000000a; display: flex; flex-direction: column; }
.pcard:hover { box-shadow: 0 2px 4px #0000000f, 0 12px 28px #00000017; transform: translateY(-3px); }
.pimg { overflow: hidden; }
.pimg > img { transition: transform .3s; }
.pcard:hover .pimg > img { transform: scale(1.04); }
.psrc { position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 5px; background: #fffffff0; border-radius: 999px; padding: 3px 9px 3px 4px; font-size: 11px; font-weight: 700; color: var(--ink); box-shadow: 0 1px 4px #00000022; }
.psrc img { width: 16px !important; height: 16px !important; border-radius: 4px; }
.pauc { position: absolute; bottom: 8px; left: 8px; background: #1d1d1fd9; color: #fff; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 3px 7px; }
.pbody { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.pvnd { color: var(--red); font-weight: 800; font-size: 18px; letter-spacing: -.3px; }
.pyen { color: var(--muted); font-size: 12px; }
.pfree { color: #17803d; font-weight: 600; }
.pbody .title { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; margin-top: 2px; white-space: normal; }
.pmeta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11.5px; padding-top: 4px; }
.pnew { color: #17803d; font-weight: 600; }
.pcard.skel .pbody div { height: 14px; }

/* menu dưới đáy - chỉ điện thoại */
.bnav, .m-only { display: none; }
@media (max-width: 1100px) {
  .hero-in { grid-template-columns: 1fr; gap: 16px; padding: 24px 20px 16px; }
  .sites { padding: 0 20px 18px; }
  .trustbar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .nav, #cartBtn, #menuBtn { display: none !important; }
  body:not(.tab-watch) #addBtn, body:not(.tab-watch) #runBtn, body:not(.tab-watch) #tgBtn, body:not(.tab-watch) #turboBtn { display: none !important; }
  .m-only:not([hidden]) { display: block; }
  .topbar { flex-wrap: nowrap; }
  .actions { width: auto; }
  .searchbar { padding: 10px 12px 8px; }
  .searchbar input { padding: 10px 16px; }
  .searchbar .btn.primary { padding: 0 16px; }
  .hero { margin: 2px 12px 0; border-radius: 14px; }
  .hero-in { padding: 20px 16px 12px; gap: 12px; }
  .hero h1 { font-size: 25px; padding-right: 60px; }
  .hero .lead { font-size: 13.5px; margin-bottom: 14px; }
  .cta .hbtn { flex: 1; justify-content: center; padding: 11px 12px; font-size: 14px; }
  .hrate { padding: 10px 14px; }
  .hrate .val { font-size: 21px; }
  .hrate .live { font-size: 10.5px; padding: 3px 8px; }
  .steps { gap: 6px; }
  .step { padding: 8px; text-align: center; }
  .step b { margin: 0 auto 4px; width: 22px; height: 22px; font-size: 12px; }
  .step div { font-size: 11.5px; line-height: 1.3; margin: 0; }
  .step span { display: none; }
  .sites { padding: 0 16px 14px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sites .t, .sites span.s { flex: none; }
  .trustbar { padding: 10px 12px 0; gap: 8px; }
  .trustbar div { padding: 10px; font-size: 11.5px; }
  .trustbar b { font-size: 12.5px; }
  .modebar { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding: 12px 12px 2px; }
  .modebar::-webkit-scrollbar { display: none; }
  .mode { flex: none !important; font-size: 13px; padding: 7px 12px 7px 8px; }
  .pgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 12px 20px; }
  .pvnd { font-size: 16px; }
  .pbody { padding: 8px 10px 10px; }
  .pmore { display: none; }
  #appView { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .bnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
    background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px #0000000f; }
  .bnav button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; color: var(--muted); padding: 4px 0; position: relative; font-weight: 500; }
  .bnav button i { font-style: normal; font-size: 21px; line-height: 1.1; }
  .bnav button.on { color: var(--red); font-weight: 700; }
  .bbadge { position: absolute; top: 0; left: 55%; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
  .bbadge[hidden] { display: none; }
  .menu { top: auto; bottom: calc(70px + env(safe-area-inset-bottom)); right: 12px; left: 12px; }
  .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* ---- Thanh đầu trang như bản mẫu (22/10/2026): logo + "Mua hộ hàng Nhật", ô tìm ở giữa, mục có biểu tượng ---- */
.topbar { padding: 10px 20px; gap: 18px; justify-content: flex-start; }
.brand { display: flex; align-items: center; gap: 10px; flex: none; font-size: 15px; }
.brand-txt { font-weight: 700; color: var(--navy); line-height: 1.15; }
.brand-txt small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; margin-left: 0; }
.topbar .searchbar { flex: 1; min-width: 260px; max-width: none; margin: 0; padding: 0; display: flex; gap: 0; background: var(--bg); border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.topbar .searchbar:focus-within { border-color: var(--navy); background: #fff; }
.topbar .searchbar input { border: 0; border-radius: 0; background: transparent; padding: 10px 18px; font-size: 14.5px; box-shadow: none; }
.topbar .searchbar input:focus { box-shadow: none; }
.topbar .searchbar .btn.primary { border-radius: 0; padding: 0 22px; }
.nav { margin: 0; gap: 2px; flex: none; }
.navtab, .navcart { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 500; color: var(--muted); cursor: pointer; }
.navtab i, .navcart i { font-style: normal; font-size: 19px; line-height: 1; }
.navtab:hover, .navcart:hover { background: var(--bg); color: var(--ink); }
.navtab.active { background: none; color: var(--navy); font-weight: 700; }
.nbadge { position: absolute; top: 1px; right: 4px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.nbadge:empty, .nbadge[hidden] { display: none; }
.actions { flex: none; flex-wrap: nowrap; }
#loginBtn { background: var(--navy); border-color: var(--navy); border-radius: 12px; padding: 10px 18px; font-weight: 700; }
body:not(.tab-watch) #addBtn, body:not(.tab-watch) #runBtn, body:not(.tab-watch) #tgBtn, body:not(.tab-watch) #turboBtn { display: none !important; }
@media (max-width: 1240px) { .brand-txt { display: none; } .navtab, .navcart { padding: 6px 7px; } }
@media (max-width: 760px) {
  .topbar { padding: 8px 12px; gap: 10px; }
  .topbar .searchbar { min-width: 0; }
  .topbar .searchbar input { padding: 9px 14px; font-size: 14px; }
  .topbar .searchbar .btn.primary { padding: 0 14px; }
  .brand-logo { height: 28px; }
  #loginBtn { display: none !important; }
}

/* ---- Nút chọn sàn nằm sau "Mua được từ" trong phần giới thiệu; đếm ngược đấu giá (22/10/2026) ---- */
.sites { align-items: center; flex-wrap: nowrap; }
.sites .t { flex: none; }
#heroModes { min-width: 0; flex: 1; }
.hero .modebar { padding: 0 !important; gap: 8px; flex-wrap: wrap; }
.hero .mode { background: #fff; border-color: #fff; color: var(--ink); }
.hero .mode:hover { background: #f2f6fb; }
.hero .mode.active { background: #ffd166; border-color: #ffd166; color: var(--navy); }
.pauc b { font-weight: 600; }
.pcard.ended .pimg > img { opacity: .45; }
.pcard.ended .pauc { background: #6b7482d9; }
@media (max-width: 760px) {
  .sites { flex-direction: column; align-items: stretch; gap: 6px; overflow: visible; }
  .hero .modebar { flex-wrap: nowrap !important; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px !important; }
}

/* logo là link về trang chủ mới */
a.brand { text-decoration: none; }

/* ---- (05/11/2026) Đầu trang giống trang chủ thplog.com: dải hotline/tỷ giá, logo đầy đủ, ô tìm viền xanh, menu xanh ---- */
.twrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.tstrip { background: var(--navy-d); color: #dfe8f7; font-size: 12.5px; }
.tstrip .twrap { display: flex; gap: 18px; align-items: center; height: 34px; overflow: hidden; white-space: nowrap; }
.tstrip a { color: inherit; text-decoration: none; }
.tstrip a:hover { color: #fff; }
.tstrip b { color: #fff; }
.tstrip .sp { flex: 1; }
.topbar { border-bottom: 1px solid var(--line); background: #fff; backdrop-filter: none; max-width: none; }
.topbar .brand-logo { height: 44px; }
.topbar .brand-txt { font-weight: 800; font-size: 15px; }
.topbar .brand-txt small { color: var(--red); font-weight: 600; font-size: 11.5px; letter-spacing: .3px; }
.topbar .searchbar { border: 2px solid var(--navy); border-radius: 10px; background: #fff; height: 44px; }
.topbar .searchbar .btn.primary { background: var(--red); border-color: var(--red); font-weight: 700; }
.tmnav { background: var(--navy); }
.tmnav .twrap { display: flex; gap: 2px; align-items: stretch; height: 42px; }
.tmnav a { color: #e6edf9; font-weight: 600; font-size: 13.5px; padding: 0 13px; display: flex; align-items: center; white-space: nowrap; text-decoration: none; }
.tmnav a:hover, .tmnav a.on { background: #ffffff1f; color: #fff; }
.tmnav a.on { box-shadow: inset 0 -3px 0 #ffd84d; }
.tmnav .has-sub { position: relative; display: flex; }
.tmnav .sub { display: none; position: absolute; top: 100%; left: 0; background: #fff; border-radius: 0 0 10px 10px; box-shadow: 0 10px 24px #0002; min-width: 250px; padding: 6px; z-index: 30; }
.tmnav .sub a { color: var(--ink); padding: 10px 12px; border-radius: 7px; }
.tmnav .sub a:hover { background: #eef3fb; color: var(--navy); }
.tmnav .has-sub:hover .sub { display: block; }
@media (max-width: 1100px) { .tmnav .twrap { overflow-x: auto; scrollbar-width: none; } .tmnav .has-sub .sub { display: none !important; } }
@media (max-width: 760px) {
  .tstrip .hide-m { display: none; }
  .tmnav { display: none; }   /* điện thoại: đã có thanh dưới + menu ☰ */
  .topbar .brand-logo { height: 32px; }
  .topbar .searchbar { height: 40px; }
}
