/* ===================== ร้านค้า + ยืนยันตัวตน + เครดิตร้าน (8 พ.ย. 2569) =====================
   โหลดต่อจาก space.css ใน partials/top.ejs — ใช้สีชุดเดียวกับธีมอวกาศ (--glass, --glass-border)
   เครื่องหมายยืนยันตัวตนใช้สีฟ้า (#38bdf8) ให้เด่นจากสีม่วงของธีม */
.vtick { display: inline-flex; vertical-align: -3px; margin-left: 4px; flex: none; }
.vtick svg { width: 16px; height: 16px; filter: drop-shadow(0 0 6px rgba(56, 189, 248, .45)); }
.vtick-lg svg { width: 24px; height: 24px; }
.vt-seal { fill: #38bdf8; }
.vt-check { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.savatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; border: 1px solid var(--glass-border, var(--border)); background: var(--surface-2); }
.savatar-letter { display: inline-grid; place-items: center; font-family: var(--display); font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #7c5cff, #a855f7 55%, #db2777); }
.savatar-md { width: 48px; height: 48px; border-radius: 14px; font-size: 1.2rem; }
.savatar-xl { width: 96px; height: 96px; border-radius: 24px; font-size: 2.4rem; }

.lcard-shop { display: inline-flex; align-items: center; min-width: 0; max-width: 55%; font-size: .78rem; color: var(--muted); }
.lcard-shop-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* โลโก้ร้านเล็กหน้าชื่อร้านบนการ์ดสินค้า */
.savatar-xs { width: 20px; height: 20px; border-radius: 6px; font-size: .62rem; margin-right: 5px; border-width: 1px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.shopcard { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); color: var(--text);
  background: var(--glass, var(--surface)); border: 1px solid var(--glass-border, var(--border)); text-decoration: none; transition: transform .15s, border-color .15s; }
.shopcard:hover { transform: translateY(-2px); border-color: rgba(167, 139, 250, .55); text-decoration: none; }
.shopcard.is-verified { border-color: rgba(56, 189, 248, .35); }
.shopcard-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.shopcard-name { display: inline-flex; align-items: center; min-width: 0; }
.shopcard-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shopcard-user { font-size: .75rem; color: var(--muted); }
.shopcard-meta { font-size: .78rem; color: var(--muted); }
.shopcard-meta small { color: var(--muted); }

.shop-hits { margin: 4px 0 22px; }
.shop-hits-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.shop-hits-head h3 { margin: 0; font-size: 1rem; }
.shop-search { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.shop-search input { flex: 1 1 220px; }

.shop-hero { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 16px; }
.shop-hero-main { min-width: 0; flex: 1; }
.shop-hero-name { display: flex; align-items: center; gap: 4px; margin: 0 0 2px; font-size: clamp(1.4rem, 4vw, 2rem); word-break: break-word; }
.shop-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.shop-bio { margin: 12px 0 0; color: var(--text); opacity: .9; }
.vchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  color: #7dd3fc; background: rgba(56, 189, 248, .12); border: 1px solid rgba(56, 189, 248, .4); }
.vchip-off { color: var(--muted); background: transparent; border-color: var(--border); font-weight: 500; }
.verified-note { color: #7dd3fc; font-weight: 600; margin: 6px 0; }

.credit { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; gap: 22px; align-items: center; margin-bottom: 22px; }
.credit-score { text-align: center; min-width: 120px; }
.credit-big { font-family: var(--display); font-size: 3rem; font-weight: 700; line-height: 1; }
.credit-stars { font-size: 1.1rem; letter-spacing: 2px; margin: 4px 0; }
.credit-bars { display: flex; flex-direction: column; gap: 5px; }
.cbar { display: grid; grid-template-columns: 34px 1fr 28px; gap: 8px; align-items: center; font-size: .8rem; color: var(--muted); }
.cbar-track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.cbar-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #facc15, #f59e0b); width: 0; }
.cbar-n { text-align: right; }
.cbar-fill.w5 { width: 5%; } .cbar-fill.w10 { width: 10%; } .cbar-fill.w15 { width: 15%; } .cbar-fill.w20 { width: 20%; } .cbar-fill.w25 { width: 25%; }
.cbar-fill.w30 { width: 30%; } .cbar-fill.w35 { width: 35%; } .cbar-fill.w40 { width: 40%; } .cbar-fill.w45 { width: 45%; } .cbar-fill.w50 { width: 50%; }
.cbar-fill.w55 { width: 55%; } .cbar-fill.w60 { width: 60%; } .cbar-fill.w65 { width: 65%; } .cbar-fill.w70 { width: 70%; } .cbar-fill.w75 { width: 75%; }
.cbar-fill.w80 { width: 80%; } .cbar-fill.w85 { width: 85%; } .cbar-fill.w90 { width: 90%; } .cbar-fill.w95 { width: 95%; } .cbar-fill.w100 { width: 100%; }
.credit-facts { display: grid; grid-template-columns: repeat(2, minmax(90px, auto)); gap: 10px 18px; margin: 0; }
.credit-facts dt { font-size: .75rem; color: var(--muted); }
.credit-facts dd { margin: 0; font-weight: 700; font-family: var(--display); }
.credit-note { grid-column: 1 / -1; margin: 0; }

.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.review-card p { margin: 6px 0; }
.review-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.shop-box-head { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; margin-bottom: 4px; }
.shop-box-head:hover { text-decoration: none; }
.shop-box-head > span { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.mini-reviews { border-top: 1px dashed var(--border); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.mini-review .tag { margin-left: 4px; }

.myshop { display: flex; gap: 14px; align-items: center; color: var(--text); text-decoration: none; margin-bottom: 16px; }
.myshop:hover { text-decoration: none; border-color: rgba(167, 139, 250, .55); }
.myshop.is-verified { border-color: rgba(56, 189, 248, .35); }
.myshop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.shop-avatar-edit { display: flex; gap: 16px; align-items: flex-start; margin: 8px 0 18px; }
.verify-card.is-verified { border-color: rgba(56, 189, 248, .35); }
.verify-card h2 { display: flex; align-items: center; gap: 4px; }

.kyc-slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 14px; }
.kyc-slot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 12px; cursor: pointer;
  border: 2px dashed rgba(167, 139, 250, .4); border-radius: var(--radius); background: rgba(124, 92, 255, .06); transition: border-color .15s, background .15s; }
.kyc-slot:hover { border-color: rgba(167, 139, 250, .8); background: rgba(124, 92, 255, .12); }
.kyc-slot.has-file { border-style: solid; border-color: rgba(34, 197, 94, .6); }
.kyc-slot small { color: var(--muted); font-size: .76rem; }
.kyc-art svg { fill: none; stroke: #a78bfa; stroke-width: 2; stroke-linecap: round; }
.kyc-slot.has-file .kyc-art { display: none; }
.kyc-preview { width: 100%; max-height: 160px; object-fit: contain; border-radius: 10px; background: #000; }

/* ร้านทางการ (เจ้าของเว็บ) + ปุ่มเปลี่ยนรูปบนหน้าร้าน + ตัวอย่างรีวิว */
.shop-hero-av { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.shop-av-btn { white-space: nowrap; }
.vchip-official { color: #e9d5ff; background: rgba(168, 85, 247, .18); border-color: rgba(192, 132, 252, .55); }
.official-tag { color: #d8b4fe; font-weight: 600; }
.example-reviews { margin-top: 22px; padding: 16px; border: 1px dashed rgba(167, 139, 250, .35); border-radius: var(--radius); }
.example-reviews h3 { display: flex; align-items: center; gap: 8px; }
.review-card.is-example { opacity: .78; border-style: dashed; }

/* แถบร้านแนะนำในตลาด (ทุกหน้า): การ์ดแบบการ์ดลอยหน้าแรก ปัด/เลื่อนแนวนอน (CSS ล้วน) */
.promo-shops { margin: 4px 0 20px; }
.promo-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 12px; overflow-x: auto;
  scroll-snap-type: x mandatory; padding: 4px 2px 12px; scrollbar-width: thin; }
.pcard { scroll-snap-align: start; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; color: var(--text); text-decoration: none;
  background: rgba(19, 14, 46, .92); border: 1px solid rgba(250, 204, 21, .45); box-shadow: 0 0 0 1px rgba(250, 204, 21, .12) inset, 0 12px 28px rgba(5, 2, 20, .45);
  transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-3px); text-decoration: none; box-shadow: 0 0 0 1px #facc15 inset, 0 18px 36px rgba(250, 204, 21, .18); }
.pcard-img { position: relative; display: block; }
.pcard-img > img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pcard-img .fc-shield { top: 8px; right: 8px; font-size: .66rem; padding: 2px 8px; }
.pcard-img .fc-game { top: auto; bottom: 8px; left: 8px; max-width: 80%; }
.pcard-body { display: flex; gap: 9px; align-items: center; padding: 10px 12px; min-width: 0; }
.pcard-text { display: flex; flex-direction: column; min-width: 0; }
.pcard-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-text small { color: var(--muted); font-size: .74rem; }
.savatar-sm { width: 34px; height: 34px; border-radius: 10px; font-size: .9rem; }

/* ปุ่มเลขหน้า 1 2 3 … */
.pager-num { gap: 6px; align-items: center; }
.pg { min-width: 40px; height: 40px; padding: 0 12px; display: inline-grid; place-items: center; border-radius: 12px; font-weight: 700; color: var(--text);
  background: var(--glass, var(--surface)); border: 1px solid var(--glass-border, var(--border)); text-decoration: none; }
.pg:hover { border-color: rgba(196, 181, 253, .7); text-decoration: none; }
.pg.on { color: #fff; border-color: transparent; background: linear-gradient(135deg, #7c5cff, #a855f7 55%, #db2777); box-shadow: 0 6px 18px rgba(124, 58, 237, .45); }
.pg-arrow { font-size: 1.3rem; }
.pg-gap { background: none; border: 0; min-width: 20px; padding: 0; color: var(--muted); }
.pager-note { text-align: center; margin: 8px 0 0; }

/* มือถือ: การ์ดไอดีแถวละ 2 ใบ — ย่อตัวอักษร/ป้ายให้พอดี */
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .lcard { border-radius: 14px; }
  .lcard-body { padding: 9px 10px 10px; gap: 4px; }
  .lcard-title { font-size: .82rem; line-height: 1.35; }
  .lcard-hl { display: none; }
  .lcard-meta { gap: 4px; }
  .lcard-meta .chip-safe, .lcard-meta .seller-badge { display: none; }
  .lcard-meta .stars { font-size: .7rem; }
  .lcard-foot { padding-top: 6px; gap: 4px; flex-wrap: wrap; }
  .lcard-foot .price { font-size: .98rem; }
  .lcard-shop { max-width: 100%; font-size: .68rem; flex-basis: 100%; }
  .savatar-xs { width: 16px; height: 16px; border-radius: 5px; font-size: .55rem; margin-right: 4px; }
  .thumb2-game { top: 6px; left: 6px; font-size: .64rem; padding: 2px 7px 2px 2px; gap: 4px; max-width: 52%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .thumb2-game img { width: 16px; height: 16px; }
  .thumb2 .rank { left: 6px; bottom: 6px; font-size: .64rem; padding: 2px 8px; }
  .thumb2 .lv { right: 6px; top: 6px; font-size: .62rem; padding: 2px 7px; }
  .feat-badge { right: 6px; top: 6px; font-size: .62rem; padding: 2px 7px; }
  .photo-badge { right: 6px; bottom: 6px; font-size: .6rem; padding: 2px 6px; }
  .promo-track { grid-auto-columns: calc(50% - 6px); gap: 10px; }
  .pcard-body { padding: 8px 9px; gap: 7px; }
  .pcard-text b { font-size: .8rem; }
  .pcard-text small { font-size: .66rem; }
  .savatar-sm { width: 28px; height: 28px; font-size: .78rem; }
  .pcard-img .fc-shield { font-size: .56rem; padding: 2px 6px; top: 6px; right: 6px; }
  .pg { min-width: 36px; height: 36px; padding: 0 10px; }
}
.boost-shop-preview { display: flex; gap: 12px; align-items: center; }

/* การ์ดลอยหน้าแรก: ร้านที่โปรโมท (แสดงชื่อร้าน) */
a.float-card { color: inherit; text-decoration: none; }
a.float-card:hover { text-decoration: none; border-color: rgba(250, 204, 21, .6); }
.fc-promo { box-shadow: 0 0 0 1px rgba(250, 204, 21, .35), 0 18px 40px rgba(0, 0, 0, .45); }
.fc-av { width: 28px; height: 28px; border-radius: 8px; font-size: .8rem; }
.fc-body b.fc-shop { display: flex; align-items: center; min-width: 0; }
.fc-shop > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-shop .vtick { margin-left: 3px; }
.fc-shop .vtick svg { width: 14px; height: 14px; }
/* การ์ดลอยที่สลับหน้าได้: แต่ละช่องมีหลายหน้า (.fc-face) แสดงทีละหน้า */
.fc-face { display: none; color: inherit; text-decoration: none; }
.fc-face.on { display: block; animation: fcFade .7s ease; }
.fc-face:hover { text-decoration: none; color: inherit; }
.fc-img { position: relative; display: block; }
.fc-img > img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.fc-img .fc-game { top: auto; bottom: 8px; left: 8px; max-width: 80%; }
.fc-text { display: flex; flex-direction: column; min-width: 0; }
.fc-body .savatar-letter { display: inline-grid; color: #fff; font-size: .8rem; }
@keyframes fcFade { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) { .fc-img > img { aspect-ratio: 16 / 10; } .fc-game, .fc-img .fc-game { bottom: 5px; left: 5px; font-size: .6rem; padding: 2px 6px 2px 3px; } .fc-game img { width: 12px; height: 12px; } }
@media (prefers-reduced-motion: reduce) { .fc-face.on { animation: none; } }

.fc-game { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 4px; border-radius: 999px;
  background: rgba(10, 7, 32, .78); border: 1px solid rgba(167, 139, 250, .35); color: #fff; font-size: .72rem; font-weight: 600; line-height: 1.2;
  backdrop-filter: blur(4px); max-width: 55%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-game img { width: 16px; height: 16px; border-radius: 5px; flex: none; }
.fc-body b span, .fc-body .fc-by { color: inherit; font-size: inherit; font-weight: inherit; }
.fc-body .fc-sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-body .fc-by { display: inline; color: #e9e5ff; font-weight: 500; }
.fc-body .vtick { display: inline-flex; }
.fc-by .vtick svg { width: 13px; height: 13px; }
.fc-feat { color: #1a1300; background: linear-gradient(90deg, #fde68a, #facc15); border-color: transparent; font-weight: 700; }

@media (max-width: 720px) {
  .shop-hero { flex-direction: column; align-items: center; text-align: center; }
  .shop-hero-name, .shop-hero-tags { justify-content: center; }
  .credit { grid-template-columns: 1fr; gap: 16px; }
  .credit-facts { grid-template-columns: repeat(2, 1fr); }
  .kyc-slots { grid-template-columns: 1fr; }
  .shop-avatar-edit { flex-direction: column; align-items: center; text-align: center; }
}
