:root {
  --bg: #f7f5f0;
  --panel: #ffffff;
  --ink: #1b2230;
  --muted: #6d7280;
  --gold: #b08d3f;
  --gold-soft: #f3ead7;
  --line: #e6e1d7;
  --ok: #2f8f5b;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(27, 34, 48, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Public catalog ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(247, 245, 240, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand-block .brand-name {
  font-size: 20px; font-weight: 700; letter-spacing: 0.5px;
}
.brand-block .brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.brand-block .wa-line { color: var(--gold); font-weight: 600; }
.header-actions { display: flex; gap: 10px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; padding: 9px 16px; font-size: 14px; font-weight: 600;
  background: var(--ink); color: #fff; transition: transform 0.06s ease, opacity 0.15s ease;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.985); }
.btn.gold { background: var(--gold); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.wa { background: #25d366; color: #06341a; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.danger { background: var(--danger); }

.hero {
  max-width: 1180px; margin: 0 auto; padding: 34px 20px 10px;
}
.hero h1 { font-size: clamp(24px, 4vw, 34px); margin: 0 0 8px; letter-spacing: 0.4px; }
.hero p { color: var(--muted); margin: 0; max-width: 760px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--panel);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--ink);
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid {
  max-width: 1180px; margin: 0 auto; padding: 18px 20px 60px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); gap: 18px;
}
.card {
  background: var(--panel); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.card .thumb {
  aspect-ratio: 3 / 4; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef1f6 0%, #e3e7ef 100%);
  color: var(--muted); position: relative; overflow: hidden;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb .ph { text-align: center; padding: 12px; }
.card .thumb .ph .ph-brand { font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--ink); opacity: 0.75; }
.card .thumb .ph .ph-model { font-size: 12px; margin-top: 4px; opacity: 0.6; }
.card .badge-pin { position: absolute; top: 10px; left: 10px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.card .badge-cond { position: absolute; top: 10px; right: 10px; background: rgba(27,34,48,0.72); color: #fff; font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.card .body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .brand { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--gold); text-transform: uppercase; }
.card .model { font-size: 15px; font-weight: 600; line-height: 1.35; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--gold-soft); color: #7a5c1c; }
.tag.dark { background: #eef0f4; color: #4a5160; }
.card .price-row { margin-top: auto; padding-top: 10px; display: flex; align-items: baseline; gap: 8px; }
.card .price { font-size: 19px; font-weight: 700; }
.card .price-sub { font-size: 12px; color: var(--muted); }
.card .card-actions { display: flex; gap: 8px; margin-top: 10px; }
.card .card-actions .btn { flex: 1; }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; grid-column: 1 / -1; }

.site-footer { border-top: 1px solid var(--line); background: #fbfaf6; }
.site-footer-inner { max-width: 1180px; margin: 0 auto; padding: 34px 20px 46px; }
.site-footer h3 { margin: 0 0 8px; font-size: 16px; }
.site-footer p { color: var(--muted); font-size: 13px; max-width: 820px; margin: 0 0 14px; }
.footer-meta { font-size: 12px; color: var(--muted); display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Admin ---------- */
.admin-wrap { min-height: 100vh; }
.login-box {
  max-width: 380px; margin: 12vh auto 0; background: var(--panel);
  border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
  padding: 28px 26px;
}
.login-box h2 { margin: 0 0 4px; font-size: 20px; }
.login-box .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field input[type="text"], .field input[type="number"], .field input[type="password"],
.field input[type="url"], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--ink);
}
.field textarea { min-height: 80px; resize: vertical; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.check input { width: 16px; height: 16px; }

.admin-header {
  background: var(--ink); color: #fff; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.admin-header .title { font-weight: 700; letter-spacing: 0.5px; }
.admin-header .title span { color: var(--gold); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  background: rgba(255,255,255,0.1); color: #fff; border: none; border-radius: 999px;
  padding: 7px 14px; font-size: 13px;
}
.tab.active { background: var(--gold); color: #1b2230; font-weight: 700; }

.admin-main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 70px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title h2 { margin: 0; font-size: 20px; }
.panel-title .actions { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-list { display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.row .rthumb { width: 64px; height: 52px; border-radius: 8px; background: #eef1f6; overflow: hidden; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.row .rthumb img { width: 100%; height: 100%; object-fit: cover; }
.row .rinfo { flex: 1; min-width: 180px; }
.row .rname { font-weight: 700; font-size: 14px; }
.row .rmeta { font-size: 12px; color: var(--muted); }
.row .rprice { font-weight: 700; font-size: 14px; white-space: nowrap; }
.row .ractions { display: flex; gap: 6px; flex-wrap: wrap; }
.row.off .rname { color: var(--muted); text-decoration: line-through; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--ok); }
.status-dot.off { background: #bbb; }
.st-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.st-badge.sold { background: #fdecec; color: #b3261e; }
.st-badge.reserved { background: #fff4e5; color: #a05a00; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20, 24, 34, 0.5);
  display: none; align-items: flex-start; justify-content: center; padding: 30px 16px; z-index: 50; overflow-y: auto;
}
.modal-backdrop.show { display: flex; }
.modal {
  position: relative;
  background: var(--panel); border-radius: 16px; width: 100%; max-width: 640px;
  padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-close {
  position: absolute; top: 10px; right: 12px;
  width: 32px; height: 32px; border: none; border-radius: 50%;
  background: transparent; color: #999; font-size: 22px; line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: #f2f2f2; color: #111; }
.modal h3 { margin: 0 0 16px; font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

.thumb-edit { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb-edit .te { position: relative; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; background: #eef1f6; }
.thumb-edit .te img { width: 100%; height: 100%; object-fit: cover; }
.thumb-edit .te button {
  position: absolute; top: 2px; right: 2px; background: rgba(0,0,0,0.6); color: #fff; border: none;
  width: 20px; height: 20px; border-radius: 50%; font-size: 12px; line-height: 1;
}
.upload-box { position: relative; border: 1.5px dashed var(--line); border-radius: 10px; padding: 14px; text-align: center; color: var(--muted); font-size: 13px; cursor: pointer; }
.upload-box input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; font-size: 100px;
}
.pick-btn { display: flex; align-items: center; justify-content: center; margin-top: 8px; width: 100%; cursor: pointer; }
.staff-notice {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #e6d9bd;
  background: #fdf8ec;
  border-radius: 10px;
  font-size: 13px;
  color: #7a5a1e;
}
.user-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.user-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff;
}
.user-row .uname { font-weight: 700; font-size: 14px; }
.user-row .umeta { font-size: 12px; color: var(--muted); }
.user-row .uoff { font-size: 11px; color: #b3261e; }
.user-row .spacer { flex: 1; }
.rev-badge { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; margin-left: 6px; }
.rev-badge.pending { background: #fff4e5; color: #a05a00; }
.rev-badge.rejected { background: #fdecec; color: #b3261e; }
.rev-badge.owner { background: #eef3fb; color: #3b5b8c; }
.an-help { font-size: 12px; color: var(--muted); margin: -4px 0 12px; }
.an-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.an-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px 12px; overflow: hidden; }
.an-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--gold); opacity: .85; }
.an-card.t2::before { background: #7a9e7e; }
.an-card.t3::before { background: #8a8fb0; }
.an-card.t4::before { background: #b08d57; }
.an-card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.an-ico { font-size: 14px; }
.an-lbl { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.an-card b { display: block; font-family: var(--serif); font-size: 30px; line-height: 1.1; }
.an-card em { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.an-block { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 14px; margin-bottom: 12px; }
.an-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.an-block h3 { margin: 0 0 12px; font-size: 14px; }
.an-block-head h3 { margin: 0; }
.an-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.an-legend span { display: inline-flex; align-items: center; gap: 5px; }
.an-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.an-legend .lg-v { background: #e3d7bd; }
.an-legend .lg-u { background: #14161b; }

.an-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.an-trend { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: 6px; }
.an-trend .an-tbar { flex: 1; display: flex; align-items: flex-end; gap: 1px; height: 100%; min-width: 0; }
.an-trend .an-tbar span { flex: 1; min-width: 2px; border-radius: 2px 2px 0 0; display: block; transition: opacity .15s; }
.an-trend .an-tbar:hover span { opacity: .75; }
.an-trend .v { background: #e3d7bd; }
.an-trend .u { background: #14161b; }
.an-trend-axis { display: flex; gap: 4px; margin-top: 8px; }
.an-trend-axis span { flex: 1; font-size: 9.5px; color: var(--muted); text-align: center; min-width: 0; }

.an-hours { display: flex; align-items: flex-end; gap: 4px; height: 150px; }
.an-hour { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.an-hour .an-bar { width: 100%; min-height: 2px; background: linear-gradient(180deg, #c9ab7c, #e8dcc4); border-radius: 3px 3px 0 0; transition: height .3s ease; }
.an-hour:hover .an-bar { background: #b08d57; }
.an-hour span { font-size: 9.5px; color: var(--muted); }

.an-countries { display: flex; flex-direction: column; gap: 9px; }
.an-country { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.an-rank { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: #f4efe3; color: #8a7a55; font-size: 10.5px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 18px; }
.an-country span:not(.an-rank) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-country b { font-weight: 700; font-size: 12.5px; }
.an-country em { font-style: normal; color: var(--muted); width: 40px; text-align: right; font-size: 11.5px; }
.an-cbar { height: 6px; border-radius: 3px; background: #f0ebe0; flex: 0 0 70px; overflow: hidden; }
.an-cbar i { display: block; height: 100%; background: linear-gradient(90deg, #c9ab7c, #b08d57); border-radius: 3px; }
.an-empty { color: var(--muted); font-size: 12.5px; padding: 8px 0; }
.an-dayview-head { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; }
.an-dayview-head h2 { margin: 0; font-size: 20px; }
.an-daynav { margin-left: auto; display: flex; gap: 6px; }

.an-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.an-tbl th, .an-tbl td { text-align: left; padding: 8px; border-bottom: 1px solid #f3eee4; }
.an-tbl th { color: var(--muted); font-weight: 600; font-size: 11.5px; }
.an-tbl tbody tr:hover { background: #fbf8f1; }
.an-day-row { cursor: pointer; }
.an-day-row.open { background: #fbf8f1; }
.an-caret { color: var(--muted); font-size: 11px; width: 20px; }
.an-day-detail td { background: #fbf8f1; padding: 0 !important; border-bottom: 1px solid #f3eee4; }
.an-rate { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; }
.an-rate.good { background: #eaf4ec; color: #2f6b3a; }
.an-rate.mid { background: #fdf4e3; color: #a05a00; }
.an-rate.low { background: #f5f0ea; color: #8a7a64; }

.an-detail { padding: 14px 16px 16px; }
.an-dstats { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.an-dstats div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; min-width: 86px; }
.an-dstats b { display: block; font-family: var(--serif); font-size: 20px; }
.an-dstats span { font-size: 11px; color: var(--muted); }
.an-dcols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.an-dcol h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.an-chiprow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.an-chiplabel { font-size: 11.5px; color: var(--muted); }
.an-chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; }
.an-chip b { margin-left: 4px; }
@media (max-width: 900px) {
  .an-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-grid { grid-template-columns: 1fr; }
  .an-dcols { grid-template-columns: 1fr; }
}
.stats-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0 0 12px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.stat-card b { font-size: 20px; line-height: 1.2; font-family: var(--serif); }
.stat-card span { font-size: 11px; color: var(--muted); }
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-card { padding: 8px 10px; }
  .stat-card b { font-size: 17px; }
}
body.staff-mode #pinOrderBtn,
body.staff-mode #importBtn,
body.staff-mode #exportBtn { display: none !important; }
body.staff-mode #bulkDelete,
body.staff-mode .fab-menu button[data-bulk="delete"] { display: none !important; }
@media (max-width: 760px) {
  .modal { padding-bottom: 110px; }
}

.stocklist-output {
  width: 100%; min-height: 300px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.6; padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfaf6; color: var(--ink); resize: vertical;
}
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; z-index: 100;
}
.toast.show { opacity: 1; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; gap: 14px; padding: 14px 12px 50px; }
  .hero { padding: 22px 14px 6px; }
  .filter-bar { padding: 12px 12px 4px; }
  .card .body { padding: 11px 11px 13px; }
  .card .price { font-size: 16px; }
  .site-header-inner { padding: 12px 14px; }
  .field-row { flex-direction: column; gap: 0; }
}
@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
}

/* ---------- About section ---------- */
.about-section { background: #fbfaf6; border-top: 1px solid var(--line); }
.about-inner { max-width: 1180px; margin: 0 auto; padding: 36px 20px 38px; }
.about-inner h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: 0.3px; }
.about-body p { color: var(--muted); font-size: 14px; line-height: 1.7; max-width: 900px; margin: 0 0 10px; }
.about-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 6px; }
@media (max-width: 700px) { .about-gallery { grid-template-columns: repeat(2, 1fr); } }
.about-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.about-meta { font-size: 13px; color: var(--muted); margin-top: 12px; }
.muted { color: var(--muted); }

/* ---------- Trust bar ---------- */
.trust-bar { max-width: 1180px; margin: 0 auto; padding: 6px 20px 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.trust-bar span { font-size: 13px; color: var(--muted); }

/* ---------- Toolbar / search / download ---------- */
.toolbar { max-width: 1180px; margin: 0 auto; padding: 16px 20px 6px; }
.toolbar-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.search-input {
  flex: 1; min-width: 200px; max-width: 380px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; background: #fff; color: var(--ink); font-family: inherit;
}
.search-wrap { position: relative; display: flex; flex: 1 1 240px; max-width: 460px; }
.search-wrap .search-input { flex: 1; max-width: none; padding-right: 60px; }
.search-btn {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  box-shadow: 0 6px 16px rgba(20, 22, 27, 0.22);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}
.search-btn:hover { background: var(--gold); transform: translateY(-50%) scale(1.06); box-shadow: 0 8px 20px rgba(176, 141, 87, 0.35); }
.search-btn:active { transform: translateY(-50%) scale(0.92); }
.search-btn svg { transition: transform 0.25s ease; }
.search-btn:hover svg { transform: scale(1.1) rotate(-8deg); }
.search-btn.searching svg { animation: searchPulse 0.8s ease infinite; }
@keyframes searchPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18) rotate(8deg); }
}
.search-btn .ripple {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: scale(0); opacity: 1; pointer-events: none;
  animation: searchRipple 0.5s ease-out forwards;
}
@keyframes searchRipple {
  to { transform: scale(2.2); opacity: 0; }
}
@media (max-width: 560px) {
  .search-wrap .search-input { padding-left: 14px; padding-right: 56px; }
}
#grid.grid-anim .card { animation: cardIn 0.32s cubic-bezier(0.2, 0.8, 0.25, 1) both; }
#grid.grid-anim .card:nth-child(2) { animation-delay: 0.03s; }
#grid.grid-anim .card:nth-child(3) { animation-delay: 0.06s; }
#grid.grid-anim .card:nth-child(4) { animation-delay: 0.09s; }
#grid.grid-anim .card:nth-child(5) { animation-delay: 0.12s; }
#grid.grid-anim .card:nth-child(6) { animation-delay: 0.15s; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.btn.active { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ---------- Inquiry basket ---------- */
.basket-bar {
  position: fixed; left: 50%; bottom: 16px; z-index: 70;
  transform: translateX(-50%) translateY(160%);
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 9px 10px 9px 20px; display: flex; align-items: center; gap: 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28); transition: transform 0.22s ease;
  max-width: calc(100% - 24px);
}
.basket-bar.show { transform: translateX(-50%) translateY(0); }
.basket-text { font-size: 13px; font-weight: 600; white-space: nowrap; }
.basket-actions { display: flex; gap: 8px; }
.basket-actions .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, 0.4); background: transparent; }

/* ---------- How to Buy ---------- */
.howto { background: #fbfaf6; border-top: 1px solid var(--line); }
.howto-inner { max-width: 1180px; margin: 0 auto; padding: 34px 20px 38px; }
.howto-inner h2 { margin: 0; font-size: 19px; }
.howto-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.step .num { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.step h3 { margin: 0 0 4px; font-size: 15px; }
.step p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---------- Product detail modal ---------- */
.detail-modal { position: fixed; inset: 0; z-index: 90; background: rgba(20, 24, 34, 0.62); display: none; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.detail-modal.show { display: flex; }
.detail-panel { background: #fff; border-radius: 16px; width: 100%; max-width: 920px; max-height: 92vh; display: flex; flex-wrap: wrap; position: relative; overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3); }
.detail-close { position: absolute; top: 10px; right: 10px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 20px; line-height: 1; }
.detail-gallery { flex: 1 1 52%; min-width: 280px; background: #eef1f6; padding: 10px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; overflow-y: auto; max-height: 92vh; }
.detail-gallery img { width: calc(50% - 4px); aspect-ratio: 3 / 4; object-fit: contain; background: #f7f5f0; border-radius: 8px; }
.detail-gallery .ph { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 260px; color: var(--muted); }
.detail-gallery .ph .ph-brand { font-size: 18px; font-weight: 700; color: var(--ink); opacity: 0.7; letter-spacing: 1px; }
.detail-gallery .ph .ph-model { font-size: 13px; margin-top: 6px; opacity: 0.6; }
.detail-body { flex: 1 1 46%; min-width: 260px; padding: 24px; display: flex; flex-direction: column; gap: 8px; }
.detail-brand { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--gold); text-transform: uppercase; }
.detail-model { font-size: 22px; font-weight: 700; line-height: 1.3; }
.detail-meta { font-size: 13px; color: var(--muted); }
.detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-price { font-size: 26px; font-weight: 700; margin-top: 4px; }
.detail-desc { font-size: 13px; color: var(--muted); line-height: 1.7; }
.detail-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; flex-wrap: wrap; }
.detail-actions .btn { flex: 1; min-width: 140px; }

/* ---------- WhatsApp float ---------- */
.wa-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  width: 52px; height: 52px; border-radius: 50%;
  background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 24px; text-decoration: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(27, 34, 48, 0.14); }

@media (max-width: 760px) {
  .detail-panel { display: block; overflow-y: auto; }
  .detail-gallery { max-height: none; overflow: visible; padding: 8px; }
  .detail-gallery .gal-img { width: 100%; height: auto; max-height: 54vh; object-fit: contain; }
  .detail-body { padding: 16px; }
  .detail-model { font-size: 19px; }
  .detail-price { font-size: 22px; }
}
@media (max-width: 560px) {
  .toolbar { padding: 12px 12px 4px; }
  .search-input { max-width: none; }
  .wa-float { right: 14px; bottom: 16px; width: 50px; height: 50px; }
  body:has(.basket-bar.show) .wa-float { display: none; }
  .basket-bar { left: 12px; right: 12px; transform: translateY(160%); border-radius: 14px; padding: 10px 12px; justify-content: space-between; }
  .basket-bar.show { transform: translateY(0); }
  .trust-bar { padding: 6px 14px 0; gap: 6px 16px; }
}

/* ---------- Currency toggle ---------- */
.cur-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.cur-toggle .cur { border: none; background: transparent; padding: 8px 12px; font-size: 13px; color: var(--muted); font-family: inherit; }
.cur-toggle .cur.active { background: var(--ink); color: #fff; font-weight: 600; }

/* ---------- Mobile compact cards ---------- */
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .hero { padding: 16px 14px 4px; }
  .hero h1 { font-size: 21px; }
  .hero p { font-size: 13px; }
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .filter-bar .chip { flex: 0 0 auto; }
  .grid { gap: 10px; padding: 12px 10px 130px; }
  .card .thumb { aspect-ratio: 3 / 4; }
  .card .thumb .ph .ph-brand { font-size: 11px; }
  .card .thumb .ph .ph-model { font-size: 10px; }
  .card .body { padding: 10px; gap: 4px; }
  .card .brand { font-size: 10px; }
  .card .model { font-size: 13px; }
  .card .meta { font-size: 11px; }
  .card .tag { font-size: 10px; padding: 2px 6px; }
  .card .price { font-size: 15px; }
  .card .price-sub { display: none; }
  .card .card-actions { gap: 6px; }
  .card .card-actions .btn { padding: 6px 8px; font-size: 12px; border-radius: 10px; }
}

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; max-width: 1180px; margin: 0 auto; padding: 6px 20px 30px; }
.pager-info { font-size: 13px; color: var(--muted); }
.pager-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pager-dots { color: var(--muted); padding: 0 4px; }
.pager-current { font-size: 13px; color: var(--muted); padding: 0 6px; }
.btn[disabled] { opacity: 0.4; cursor: default; }
@media (max-width: 560px) {
  .pager { padding: 4px 12px 24px; }
  .pager-btns .btn.small { padding: 6px 9px; }
}

/* ---------- Condition / sort / share ---------- */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.seg-btn { border: none; background: transparent; padding: 8px 12px; font-size: 13px; color: var(--muted); font-family: inherit; }
.seg-btn.active { background: var(--ink); color: #fff; font-weight: 600; }
.sort-select { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; background: #fff; color: var(--ink); font-family: inherit; }

/* ---------- New badge ---------- */
.badge-new { display: none !important; }

/* ---------- Bulk bar ---------- */
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfaf6; }
.bulk-bar .check { margin-bottom: 0; }
.thumb-edit .te .te-cover { top: auto; bottom: 2px; left: 2px; right: auto; width: auto; height: 18px; padding: 0 5px; border-radius: 4px; font-size: 10px; background: rgba(0, 0, 0, 0.6); }
.thumb-edit .te .te-del { top: 2px; right: 2px; }
.thumb-edit .te .te-move { top: auto; bottom: 2px; width: 22px; height: 18px; padding: 0; border-radius: 4px; font-size: 12px; line-height: 1; background: rgba(0, 0, 0, 0.6); color: #fff; }
.thumb-edit .te .te-move[data-dir="-1"] { left: auto; right: 26px; }
.thumb-edit .te .te-move[data-dir="1"] { left: auto; right: 2px; }

/* PWA standalone tweaks */
@media (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
}

/* ================= Admin mobile: compact top ================= */
@media (max-width: 760px) {
  .admin-header { padding: 6px 8px; }
  .admin-header .title { display: none; }
  .tabs { gap: 4px; padding-bottom: 0; }
  .tab { padding: 5px 9px; font-size: 11.5px; }
  .admin-main { padding: 8px 8px 90px; }
  .panel-title { margin-bottom: 6px; }
  .panel-title h2 { display: none; }
  #productCount { display: none; }
  .panel-title .actions { gap: 6px; }
  #adminSearch { flex: 1 1 100% !important; padding: 8px 10px; font-size: 13px; }
  .panel-title .actions .btn,
  .panel-title .actions .sort-select { padding: 6px 8px; font-size: 11.5px; }

  .bulk-bar {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 6px 8px;
  }
  .bulk-bar::-webkit-scrollbar { display: none; }
  .bulk-bar > * { flex: 0 0 auto; }
  .bulk-bar .seg { flex-wrap: nowrap; }
  .bulk-bar .check { margin-bottom: 0; }

  /* mobile: 閸欘亞婀呴弮鐘辩幆閺?moved into sort; bulk actions in the sheet */
  #unpricedLabel, #bulkShelfOn, #bulkShelfOff, #bulkDelete { display: none !important; }

  .mobile-fab {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 60;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #14161b;
    color: #fff;
    border: none;
    font-size: 26px;
    line-height: 1;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  }
}

.mobile-fab { display: none; }

.bulk-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 22, 27, 0.5);
  display: none;
  align-items: flex-end;
}
.bulk-sheet.show { display: flex; }
.bulk-sheet-panel {
  width: 100%;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px 24px;
  max-height: 70vh;
  overflow-y: auto;
}
.bulk-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bulk-sheet-head button { border: none; background: transparent; font-size: 24px; color: #999; line-height: 1; }
.bulk-sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.bulk-sheet-actions .btn { padding: 12px; }
.bulk-sheet-actions .danger { grid-column: 1 / -1; }

/* compact popup above the FAB */
.fab-menu {
  position: fixed;
  right: 16px;
  bottom: 84px;
  z-index: 61;
  display: none;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(20, 22, 27, 0.18);
  overflow: hidden;
  min-width: 132px;
}
.fab-menu.show { display: flex; }
.fab-menu button {
  border: none;
  background: transparent;
  text-align: left;
  padding: 11px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.fab-menu button:hover { background: #f4f1ea; }
.fab-menu button.danger { color: #b3261e; }
.fab-menu button + button { border-top: 1px solid #f0ece3; }

html { color-scheme: light; }

/* Prevent mobile browsers from auto-zooming when focusing an input */
@media (max-width: 760px) {
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="url"],
  input[type="search"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

.warn-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: #fff4e5; border: 1px solid #f0d2a6; color: #8a5200;
  border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; font-size: 13px;
}
.warn-banner[hidden] { display: none; }
.warn-banner .btn { margin-left: auto; }
html, body, button, a, input, label, .row, .btn, .tab, .card {
  -webkit-tap-highlight-color: transparent;
}
.row, .btn, .tab {
  -webkit-user-select: none;
  user-select: none;
}
.btn { transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.08s ease, box-shadow 0.15s ease; }
.btn:active { transform: translateY(1px); }

.modal-backdrop {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-backdrop.show { opacity: 1; visibility: visible; pointer-events: auto; }
.modal { transform: translateY(12px) scale(0.985); opacity: 0; transition: transform 0.22s ease, opacity 0.22s ease; }
.modal-backdrop.show .modal { transform: none; opacity: 1; }

.toast { transform: translateX(-50%) translateY(10px); transition: opacity 0.2s ease, transform 0.2s ease; }
.toast.show { transform: translateX(-50%) translateY(0); }

.fab-menu {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
}
.fab-menu.show { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }

#tab-products:not([hidden]),
#tab-settings:not([hidden]),
#tab-stocklist:not([hidden]),
#tab-requests:not([hidden]) { animation: fadeUp 0.2s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.row { transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.row { cursor: pointer; }
.row.selected { border-color: #c9ab7c; background: #fdf9ef; box-shadow: inset 0 0 0 1px #c9ab7c; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================= Desktop motion ================= */
@media (min-width: 761px) {
  .row { transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease; }
  .row:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(20, 22, 27, 0.07); }
  .modal { transform: translateY(16px) scale(0.96); transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.22s ease; }
  .modal-backdrop { backdrop-filter: blur(2px); }
  .tab { transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
}

/* ================= Mobile motion (stronger) ================= */
@media (max-width: 760px) {
  .modal {
    transform: translateY(48px) scale(0.97);
    transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.26s ease;
  }
  .modal-backdrop.show .modal { transform: none; }

  #tab-products:not([hidden]),
  #tab-settings:not([hidden]),
  #tab-stocklist:not([hidden]),
  #tab-requests:not([hidden]) { animation: mFadeUp 0.3s cubic-bezier(0.2, 0.8, 0.25, 1); }
  @keyframes mFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }

  .rows-anim .row {
    animation: mRowIn 0.3s cubic-bezier(0.2, 0.8, 0.25, 1) both;
  }
  .rows-anim .row:nth-child(2) { animation-delay: 0.02s; }
  .rows-anim .row:nth-child(3) { animation-delay: 0.04s; }
  .rows-anim .row:nth-child(4) { animation-delay: 0.06s; }
  .rows-anim .row:nth-child(5) { animation-delay: 0.08s; }
  .rows-anim .row:nth-child(6) { animation-delay: 0.1s; }
  .rows-anim .row:nth-child(7) { animation-delay: 0.12s; }
  .rows-anim .row:nth-child(8) { animation-delay: 0.14s; }
  .rows-anim .row:nth-child(9) { animation-delay: 0.16s; }
  .rows-anim .row:nth-child(10) { animation-delay: 0.18s; }
  @keyframes mRowIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
  }

  .btn:active { transform: scale(0.95); }
  .mobile-fab:active { transform: scale(0.9); }
  .mobile-fab { transition: transform 0.12s ease; }

  .fab-menu {
    transform: translateY(16px) scale(0.88);
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.25, 1), visibility 0.22s ease;
  }

  .toast {
    transform: translateX(-50%) translateY(16px) scale(0.94);
    transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.2, 0.8, 0.25, 1);
  }
  .toast.show { transform: translateX(-50%) translateY(0) scale(1); }
}

/* ---------- Trust section ---------- */
.trust-section { background: #fff; border-top: 1px solid var(--line); }
.trust-inner { max-width: 1180px; margin: 0 auto; padding: 34px 20px 38px; }
.trust-inner h2 { margin: 0; font-size: 19px; }
.trust-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-top: 16px; }
.trust-item { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #fbfaf6; }
.trust-item .ti-icon { font-size: 20px; margin-bottom: 6px; }
.trust-item h3 { margin: 0 0 4px; font-size: 15px; }
.trust-item p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---------- Detail gallery carousel ---------- */
.detail-gallery .gal-img { cursor: zoom-in; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(8, 10, 14, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lightbox.show { opacity: 1; visibility: visible; pointer-events: auto; }
.lb-img {
  max-width: 94vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform-origin: center center;
  touch-action: none;
}
body.lb-open { overflow: hidden; }
.lightbox { touch-action: none; }
.lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}
.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-count {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.5px;
}
.detail-gallery .gal { position: relative; width: 100%; }
.detail-gallery .gal-img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #f7f5f0; border-radius: 8px; }
.detail-gallery .gal-prev, .detail-gallery .gal-next { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.5); color: #fff; font-size: 20px; line-height: 1; }
.detail-gallery .gal-prev { left: 8px; }
.detail-gallery .gal-next { right: 8px; }
.detail-gallery .gal-count { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 999px; }

/* ---------- Admin: watch requests ---------- */
.req-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: #fff; }
.req-head { font-size: 14px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.req-tag.buy { background: #eef4ff; color: #2456b8; }
.req-tag.sell { background: #fff4e5; color: #a05a00; }
.req-main { font-size: 14px; margin-bottom: 4px; }
.req-budget { font-size: 13px; color: #444; margin-bottom: 2px; }
.req-note { font-size: 13px; color: #666; margin-bottom: 2px; }
.req-meta { font-size: 12px; color: #999; }
.req-actions { margin-top: 6px; }

/* Admin product row: Chinese description */
.rdesc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Drag & drop: image thumbs + pin order */
.te { cursor: grab; }
.te.dragging { opacity: 0.4; }
.te.over { outline: 2px solid var(--gold); outline-offset: 1px; }
.pin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  background: #fff;
  cursor: grab;
}
.pin-row.dragging { opacity: 0.4; }
.pin-row.over { border-color: var(--gold); }
.pin-row img { width: 48px; height: 38px; object-fit: cover; border-radius: 6px; background: #eef1f6; }
.pin-grip { color: #aaa; font-size: 18px; }
.pin-name { flex: 1; font-size: 13px; }
.pin-order { font-weight: 700; color: #999; }

/* ---------- Admin mobile ---------- */
@media (max-width: 700px) {
  .admin-header { padding: 10px 12px; }
  .admin-header .title { font-size: 14px; }
  .tabs { gap: 4px; }
  .tab { padding: 6px 10px; font-size: 12px; }
  .admin-main { padding: 14px 12px 60px; }
  .panel-title { gap: 8px; }
  .panel-title .actions { width: 100%; }
  .panel-title .actions .search-input { width: 100% !important; }
  .row { align-items: flex-start; gap: 8px; padding: 10px; }
  .row .rthumb { width: 54px; height: 44px; }
  .row .rinfo { flex: 1 1 100%; min-width: 0; }
  .row .rprice { margin-left: 0; }
  .row .ractions { width: 100%; }
  .row .ractions .btn { flex: 1 1 0; font-size: 12px; padding: 7px 6px; }
  .modal-backdrop { padding: 12px 8px; }
  .modal { padding: 16px; border-radius: 12px; }
  .field-row { display: block; }
  .bulk-bar { flex-wrap: wrap; gap: 6px; }
}

/* ================= Admin UI refresh ================= */
.admin-wrap { background: #f6f3ec; }
.admin-header {
  background: #14161b;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: static;
}
.admin-header .title { font-size: 15px; letter-spacing: 0.3px; }
.admin-header .title span { color: #c9ab7c; }
.tabs { gap: 4px; }
.tab {
  background: transparent;
  color: #cfcabe;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}
.tab:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.tab.active { background: #f6f3ec; color: #14161b; border-color: #f6f3ec; font-weight: 700; }
.tabs .ver { align-self: center; margin-left: 6px; font-size: 10px; letter-spacing: 0.5px; color: rgba(255, 255, 255, 0.35); }

.admin-main { max-width: 1280px; padding: 18px 18px 90px; }

.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #f6f3ec;
  padding: 6px 0 10px;
  margin: -6px 0 8px;
  border-bottom: 1px solid var(--line);
}
.panel-title { margin-bottom: 10px; }
.panel-title h2 { font-size: 19px; }
.panel-title .actions { gap: 8px; }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
}

.admin-list { gap: 8px; }
.row {
  display: grid;
  grid-template-columns: 20px 72px minmax(0, 1fr) 110px auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.row:hover { border-color: #cfc6b5; box-shadow: 0 6px 18px rgba(20, 22, 27, 0.06); }
.row .rthumb { width: 72px; height: 72px; border-radius: 8px; }
.row .rinfo { min-width: 0; }
.row .rname { font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row .rmeta { font-size: 12px; color: #777; margin-top: 2px; }
.row .rdesc { margin-top: 3px; }
.row .rprice { text-align: right; font-size: 15px; white-space: nowrap; }
.row .ractions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row .ractions .btn { padding: 5px 9px; font-size: 12px; }

.modal { max-width: 780px; max-height: 88vh; overflow-y: auto; border-radius: 12px; }
.modal-actions {
  position: static;
  background: #fff;
  padding: 12px 0 4px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

#tab-settings .field input,
#tab-settings .field textarea { border-radius: 8px; }

@media (max-width: 760px) {
  .row { grid-template-columns: 20px 56px minmax(0, 1fr); }
  .row .rthumb { width: 56px; height: 56px; }
  .row .rprice { grid-column: 2 / 4; text-align: left; }
  .row .ractions { grid-column: 2 / 4; justify-content: flex-start; }
  .sticky-bar { padding-top: 8px; }
}

/* Row action "more" menu */
.more-wrap { position: relative; }
.more-menu {
  display: none;
  position: fixed;
  right: 0;
  top: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(20, 22, 27, 0.14);
  padding: 4px;
  z-index: 200;
  min-width: 128px;
}
.more-menu.open { display: block; }
.more-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
}
.more-menu button:hover { background: #f4f1ea; }
.more-menu button.danger { color: #b3261e; }

/* Settings sticky save */
.sticky-save {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 0 10px;
  margin-top: 16px;
  background: linear-gradient(to top, #f6f3ec 65%, rgba(246, 243, 236, 0));
}

/* ================= Admin mobile ================= */
@media (max-width: 760px) {
  .admin-header { padding: 8px 10px; }
  .admin-header .title { font-size: 13px; width: 100%; margin-bottom: 6px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 4px; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 6px 10px; font-size: 12px; }

  .admin-main { padding: 10px 10px 90px; }
  .sticky-bar { padding: 6px 0 8px; margin: 0 0 6px; }
  .panel-title h2 { font-size: 16px; }
  .panel-title .actions { gap: 6px; }
  .panel-title .actions .btn,
  .panel-title .actions .sort-select { font-size: 12px; padding: 7px 10px; }
  #adminSearch { width: 100% !important; flex: 1 1 100% !important; }

  .bulk-bar { gap: 6px; padding: 6px 8px; }
  .bulk-bar .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .bulk-bar .seg::-webkit-scrollbar { display: none; }
  .bulk-bar .check { margin-bottom: 0; font-size: 12px; }
  .bulk-bar .btn.small { padding: 5px 8px; font-size: 11px; }

  .row {
    grid-template-columns: 18px 52px minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
  }
  .row .rthumb { width: 52px; height: 52px; }
  .row .rname { font-size: 13px; }
  .row .rmeta { font-size: 11px; }
  .row .rdesc { display: none; }
  .row .rprice { grid-column: 2 / 4; text-align: left; font-size: 14px; }
  .row .ractions { grid-column: 2 / 4; justify-content: flex-start; gap: 4px; }
  .row .ractions .btn { padding: 5px 8px; font-size: 11px; }

  .modal { padding: 14px; max-height: 92vh; }
  .modal-actions { position: sticky; bottom: 0; background: #fff; padding: 10px 0 4px; }
  .modal-actions .btn { flex: 1; }

  .sticky-save { padding: 10px 0 8px; }
  .sticky-save .btn { flex: 1; }

  /* mobile toolbar: hide desktop-only import/export, share one row */
  #importBtn, #exportBtn { display: none !important; }
  .panel-title .actions .btn,
  .panel-title .actions .sort-select { flex: 1 1 0; min-width: 0; padding: 7px 6px; text-align: center; }
  #adminSearch { flex: 1 1 100% !important; }
  .thumb-edit .te { width: 100px; height: 76px; }
  .thumb-edit .te .te-move { width: 26px; height: 22px; font-size: 14px; }
  .thumb-edit .te .te-move[data-dir="-1"] { right: 30px; }
}

@media (max-width: 760px) { .modal { padding-bottom: 110px; } }
@media (max-width: 760px) {
  .modal { padding-bottom: 104px; }
  .modal-actions {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    margin: 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(20, 22, 27, 0.08);
  }
}
/* ---------- Product specs table ---------- */
.detail-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0 14px; }
.detail-specs:empty { display: none; }
.spec-row { background: #fff; padding: 9px 12px; display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.spec-k { color: var(--muted); }
.spec-v { font-weight: 600; text-align: right; }
@media (max-width: 560px) { .detail-specs { grid-template-columns: 1fr; } }

/* ---------- Featured brands ---------- */
.brands-section { padding: 34px 20px 12px; background: #fbf8f1; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brands-inner { max-width: 1180px; margin: 0 auto; text-align: center; }
.brands-title { font-family: var(--serif); font-size: 26px; margin: 6px 0 8px; font-weight: 600; }
.brands-sub { color: var(--muted); font-size: 13px; margin: 0 0 22px; }
.brand-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.brand-tile { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px 10px 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; font-family: inherit; }
.brand-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.07); border-color: #d9d2c3; }
.brand-tile img { width: 66px; height: 66px; object-fit: contain; }
.brand-tile span { font-size: 11px; letter-spacing: .6px; color: var(--ink); text-transform: uppercase; }
@media (max-width: 760px) {
  .brand-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .brand-tile img { width: 52px; height: 52px; }
  .brands-section { padding: 26px 14px 10px; }
  .brands-title { font-size: 20px; }
}

.about-gallery img.contain { object-fit: contain; background: #fff; padding: 4px; }


.rev-badge.warn { background: #fff4e5; color: #8a5200; }


/* ---------- Related products in detail modal ---------- */
.detail-related{margin:14px 0 4px}
.rel-title{font-size:12px;letter-spacing:.6px;color:var(--muted);margin-bottom:8px}
.rel-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.rel-card{background:#fff;border:1px solid var(--line);border-radius:8px;padding:0;overflow:hidden;cursor:pointer;text-align:left;font-family:inherit}
.rel-card img{width:100%;aspect-ratio:3/4;object-fit:cover;display:block;background:#f1ede4}
.rel-card span{display:block;padding:6px 8px 0;font-size:11px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rel-card b{display:block;padding:2px 8px 8px;font-size:12px}
.rel-card:hover{border-color:#d9d2c3}
@media(max-width:560px){.rel-row{grid-template-columns:repeat(2,minmax(0,1fr))}}


@media (max-width:560px){
  .filter-selects{flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;gap:8px;padding-bottom:6px}
  .filter-selects .sort-select{flex:0 0 auto;min-width:150px}
}


/* ---------- Card as real link (SEO) ---------- */
a.card-hit{display:block;color:inherit;text-decoration:none}
a.card-hit:focus-visible{outline:2px solid var(--gold);outline-offset:2px}


.req-tag.offer { background: #eaf4ec; color: #2f6b3a; }


.tab-badge{display:inline-block;min-width:16px;height:16px;line-height:16px;padding:0 4px;margin-left:6px;border-radius:999px;background:#d93025;color:#fff;font-size:10px;text-align:center;vertical-align:middle}
.tab-badge[hidden]{display:none}


.lead-banner { display:flex; align-items:center; gap:12px; flex-wrap:wrap; background:#eef4ff; border:1px solid #c9d9f5; color:#2456b8; border-radius:10px; padding:10px 14px; margin:0 0 12px; font-size:13px; }
.lead-banner[hidden] { display:none; }
.lead-banner .btn { margin-left:auto; }


/* offer modal must sit above the product detail modal */
#offerModal{z-index:130}

