/* BidCity 市集網站 —— 主樣式。顏色／圓角全部用 css/tokens.css 嘅變數，改色只改嗰個檔。 */

/* ---------- 頁首 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: #fff; border-bottom: 1px solid var(--border);
}
.site-header .bar {
  max-width: var(--max); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: 0 0 auto; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand-text { display: flex; align-items: baseline; gap: 5px; }
.brand-text .name { font-size: 19px; font-weight: 800; color: var(--brand-blue); letter-spacing: .2px; }
.brand-text .cn { font-size: 13px; font-weight: 600; color: var(--brand-orange); }
.header-search {
  flex: 1 1 auto; display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 6px 4px 14px;
  background: var(--bg); max-width: 520px;
}
.header-search input {
  flex: 1; border: 0; background: transparent; font-size: 14px; outline: none; min-width: 0;
  font-family: var(--font);
}
.header-search button {
  border: 0; background: var(--brand-blue); color: #fff; border-radius: 999px;
  width: 34px; height: 34px; cursor: pointer; font-size: 15px;
}
.site-nav { display: flex; gap: 4px; margin-left: auto; }
.site-nav a {
  padding: 8px 10px; border-radius: 8px; text-decoration: none;
  color: var(--text-secondary); font-size: 14px; font-weight: 600;
}
.site-nav a.on, .site-nav a:hover { color: var(--brand-blue); background: #F0F6FF; }
.header-actions { display: flex; gap: 8px; }

/* ---------- 通用 ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-secondary); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px; padding: 9px 16px;
  font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none;
  font-family: var(--font); background: #fff; color: var(--text-primary);
}
.btn-primary { background: var(--brand-blue); color: #fff; }
.btn-orange { background: var(--brand-orange); color: #fff; }
.btn-ghost { border-color: var(--border); color: var(--text-primary); }
.btn-danger { background: #D93025; color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.badge {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px;
  border-radius: 999px; color: #fff; background: var(--brand-blue);
}
.badge-orange { background: var(--brand-orange); }
.badge-red { background: var(--badge-red); }
.badge-grey { background: #8A8A8A; }
.badge-blue { background: var(--brand-blue); }
.badge-purple { background: #7B3FF2; }
.chip {
  display: inline-block; border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; text-decoration: none; color: var(--text-primary); background: #fff;
}
.chip.on { border-color: var(--brand-blue); color: var(--brand-blue); background: #F0F6FF; font-weight: 700; }
.card-box {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
h1.page { font-size: 22px; margin: 18px 0 12px; }
h2.sec { font-size: 17px; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }
h2.sec .more { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--brand-blue); text-decoration: none; }

/* ---------- 貨品卡 ---------- */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; display: block;
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.card .thumb { position: relative; aspect-ratio: 1 / 1; background: #F1F1F1; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb-empty {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 13px;
}
.card .badges { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.card .body { padding: 10px; }
.card .price { font-size: 17px; font-weight: 800; color: var(--brand-orange); }
.card .title {
  font-size: 14px; margin: 2px 0 4px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta, .card .sub { font-size: 12px; color: var(--text-secondary); }

/* ---------- 分類格 ---------- */
.cat-strip {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px;
}
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 10px 4px; border-radius: var(--radius); text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--border);
}
.cat:hover { border-color: var(--brand-blue); }
.cat .ico { font-size: 24px; line-height: 1; }
.cat .nm { font-size: 12px; text-align: center; }

/* ---------- 英雄區／搜尋 ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand-blue), #0A7BD8);
  color: #fff; padding: 28px 0 34px;
}
.hero h1 { margin: 0 0 8px; font-size: 26px; }
.hero p { margin: 0 0 16px; opacity: .9; font-size: 14px; }
.hero .searchbox { display: flex; gap: 8px; max-width: 560px; }
.hero .searchbox input {
  flex: 1; border: 0; border-radius: 10px; padding: 13px 14px; font-size: 15px; font-family: var(--font);
}
.hero .hot { margin-top: 12px; font-size: 13px; opacity: .95; }
.hero .hot a { color: #fff; margin-right: 10px; }

/* ---------- 篩選列 ---------- */
.filters {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.filters select, .field input, .field select, .field textarea {
  font-family: var(--font); font-size: 14px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text-primary);
  width: 100%;
}
.filters select { width: auto; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* ---------- 詳情頁 ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } }
.gallery-main {
  width: 100%; aspect-ratio: 1 / 1; background: #F1F1F1; border-radius: var(--radius); object-fit: contain;
}
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.gallery-thumbs img {
  width: 62px; height: 62px; object-fit: cover; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent;
}
.gallery-thumbs img.on { border-color: var(--brand-blue); }
.price-lg { font-size: 28px; font-weight: 800; color: var(--brand-orange); }
.spec { display: grid; grid-template-columns: 78px 1fr; gap: 6px 10px; font-size: 14px; margin: 12px 0; }
.spec dt { color: var(--text-secondary); }
.spec dd { margin: 0; }
.seller-card { display: flex; align-items: center; gap: 10px; }

/* ---------- 列表（訂單／通知／對話） ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; display: flex; gap: 12px; align-items: center; text-decoration: none; color: inherit;
}
.list-item img.li-thumb { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.list-item .li-sub { font-size: 12px; color: var(--text-secondary); }
.list-item.unread { border-left: 4px solid var(--brand-blue); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; border-bottom: 1px solid var(--border); }
.tabs a { white-space: nowrap; }

/* ---------- 對話氣泡 ---------- */
.chat-wrap { display: flex; flex-direction: column; height: min(70vh, 620px); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px; background: #F6F7F9; border-radius: var(--radius); }
.bubble { max-width: 74%; padding: 9px 12px; border-radius: 14px; margin-bottom: 8px; font-size: 14px; line-height: 1.5; }
.bubble.mine { background: var(--brand-blue); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.bubble.theirs { background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble .t { font-size: 11px; opacity: .75; margin-top: 4px; display: block; }
.offer-card {
  border: 1px solid var(--brand-orange); background: #FFF8F0; border-radius: 12px;
  padding: 10px; font-size: 13px; max-width: 74%;
}
.chat-input { display: flex; gap: 8px; margin-top: 10px; }
.chat-input input { flex: 1; }

/* ---------- 表單頁（登入／註冊） ---------- */
.auth-page { max-width: 420px; margin: 40px auto; }
.auth-page h1 { font-size: 22px; margin-bottom: 4px; }
.switch { text-align: center; font-size: 13px; margin-top: 12px; }
.switch a { color: var(--brand-blue); font-weight: 700; }

/* ---------- 其他 ---------- */
.empty {
  padding: 34px 16px; text-align: center; color: var(--text-secondary);
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); font-size: 14px;
}
.notice {
  background: #FFF8E6; border-bottom: 1px solid #F2E0B0; font-size: 13px;
  padding: 8px 16px; text-align: center; color: #7A5B00;
}
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: rgba(20, 20, 20, .92); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 99;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }
/* 統計格（賣家頁／會員中心／我的貨品等共用）：數字大字 + 中文標籤細字 */
.row3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .row3 { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: #F7F9FC; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 8px; text-align: center;
}
.stat b { display: block; font-size: 20px; font-weight: 800; color: var(--brand-blue); line-height: 1.2; }
.stat span { display: block; font-size: 12px; color: var(--text-secondary); margin-top: 3px; }

.stars { color: var(--brand-orange); letter-spacing: 1px; }
.doc { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.doc h2 { font-size: 18px; margin: 20px 0 8px; }
.doc h3 { font-size: 15px; margin: 16px 0 6px; }
.doc p, .doc li { font-size: 14px; line-height: 1.8; color: #2A2A2A; }

/* ---------- 頁尾 ---------- */
.site-footer { border-top: 1px solid var(--border); background: #fff; margin-top: 40px; padding: 26px 0 20px; }
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 18px; }
@media (max-width: 720px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { margin: 0 0 8px; font-size: 14px; }
.site-footer a { display: block; font-size: 13px; color: var(--text-secondary); text-decoration: none; margin-bottom: 5px; }
.site-footer a:hover { color: var(--brand-blue); }
.site-footer .fbrand { font-size: 18px; font-weight: 800; color: var(--brand-blue); margin-bottom: 6px; }
.site-footer .fbrand span { color: var(--brand-orange); font-size: 13px; margin-left: 4px; }
.site-footer .bottom { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; }

/* ---------- 相片全螢幕檢視（Carousell 式，2026-10-13） ---------- */
.gallery-main { cursor: zoom-in; }
.pv { position: fixed; inset: 0; z-index: 9999; background: rgba(0, 0, 0, .95); display: flex; flex-direction: column; }
.pv-stage {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  touch-action: none;      /* 手勢自己處理（pinch／滑動換相），唔准瀏覽器捲頁 */
}
.pv-img {
  max-width: 100%; max-height: 100%; display: block;
  transform-origin: center center; will-change: transform;
  user-select: none; -webkit-user-drag: none;
}
.pv-count {
  position: absolute; top: 14px; left: 14px; color: #fff; font-size: 13px;
  background: rgba(0, 0, 0, .55); padding: 5px 11px; border-radius: 999px;
}
.pv-close, .pv-nav, .pv-tools button {
  border: 0; color: #fff; background: rgba(0, 0, 0, .5); cursor: pointer; padding: 0;
  font-family: var(--font); line-height: 1;
}
.pv-close, .pv-nav { width: 42px; height: 42px; border-radius: 50%; font-size: 20px; }
.pv-close { position: absolute; top: 12px; right: 12px; }
.pv-close:hover, .pv-nav:hover, .pv-tools button:hover { background: rgba(255, 255, 255, .22); }
.pv-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; font-size: 26px;
}
.pv-nav.prev { left: 12px; }
.pv-nav.next { right: 12px; }
.pv-tools {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; background: rgba(0, 0, 0, .55); padding: 5px; border-radius: 999px;
}
.pv-tools button { width: 38px; height: 38px; border-radius: 50%; background: transparent; font-size: 17px; }
.pv-tools button:last-child { font-size: 13px; font-weight: 700; }
.pv-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; background: rgba(0, 0, 0, .6); justify-content: center; }
.pv-thumbs img {
  width: 46px; height: 46px; object-fit: cover; border-radius: 8px;
  border: 2px solid transparent; opacity: .55; cursor: pointer; flex: 0 0 auto;
}
.pv-thumbs img.on { opacity: 1; border-color: #fff; }
@media (max-width: 560px) {
  .pv-nav { display: none; }          /* 手機用滑動換相 */
  .pv-thumbs { justify-content: flex-start; }
}
