/* ============================================================
   shop.css —— 前台（PC 为主 + 移动端自适应）
   与后台共用 tokens.css / ui.css，只在这里写商城独有的版式。
   ============================================================ */

.s-wrap { width: min(var(--wrap), calc(100% - 32px)); margin: 0 auto; }

/* ================= 顶部细条 ================= */
.s-topline { background: var(--brand-ink-2); color: #a9b3cb; font-size: 12.5px; }
.s-topline__in {
  height: 36px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.s-topline a { color: #a9b3cb; }
.s-topline a:hover { color: #fff; }
.s-topline__l { display: flex; align-items: center; gap: 9px; min-width: 0; }
.s-topline__l b { color: #fff; font-weight: 600; }
.s-topline__r { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.s-topline__sep { color: #4d5878; }

/* ================= 头部：logo + 搜索 ================= */
.s-hd { background: #fff; border-bottom: 1px solid var(--line); }
.s-hd__in { display: flex; align-items: center; gap: 26px; padding: 16px 0; }
.s-brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.s-brand__mark {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  background: linear-gradient(135deg, #5c78ff, #2b45d8);
  color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700;
}
.s-brand h1 { font-size: 19px; font-weight: 700; letter-spacing: .01em; }
.s-brand p { font-size: 12px; color: var(--text-3); }
.s-hd__search { flex: 1 1 auto; max-width: 620px; }
.s-hd__search .search { height: 46px; }
.s-hd__search .btn { height: 36px; }
.s-hd__acts { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.s-hd__link {
  display: flex; align-items: center; gap: 6px; color: var(--text-2);
  font-size: 13px; padding: 6px 8px; border-radius: var(--radius-sm);
}
.s-hd__link:hover { background: var(--brand-tint); color: var(--brand); }

/* ================= 主导航 ================= */
.s-nav { background: var(--brand-ink); color: #fff; }
.s-nav__in { display: flex; align-items: center; height: 44px; gap: 8px; }
.s-nav__cat {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  background: var(--brand); color: #fff; font-weight: 600; font-size: 14px;
  border: 0; cursor: pointer;
}
.s-nav__cat:hover { background: var(--brand-hover); }
.s-nav__links { display: flex; align-items: center; }
.s-nav__links a {
  display: flex; align-items: center; height: 44px; padding: 0 14px;
  color: #c7cfeb; font-weight: 500; font-size: 14px;
}
.s-nav__links a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.s-nav__links a.is-active { color: #fff; background: rgba(255, 255, 255, .12); }
.s-nav__right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.s-nav__right a { color: #c7cfeb; padding: 0 10px; height: 44px; display: flex; align-items: center; font-size: 13px; }
.s-nav__right a:hover { color: #fff; }

/* ================= 主体两栏 ================= */
.s-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 18px 0 8px; }
.s-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ================= 轮播 ================= */
.banner {
  position: relative; height: 296px; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--brand-ink-2); box-shadow: var(--shadow-sm);
}
.banner__slide {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  gap: 13px; padding: 0 84px 0 78px; color: #fff; opacity: 0; pointer-events: none;
  transition: opacity .45s var(--ease);
}
.banner__slide.is-active { opacity: 1; pointer-events: auto; }
.banner__slide::after {
  content: ""; position: absolute; right: -60px; top: -80px; width: 380px; height: 380px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 62%);
  pointer-events: none;
}
.banner__slide--1 { background: linear-gradient(118deg, #2239c4, #3d5af1 52%, #6b86fb); }
.banner__slide--2 { background: linear-gradient(118deg, #16204a, #1f2a5a 45%, #2f4292); }
.banner__slide--3 { background: linear-gradient(118deg, #c4291d, #e5342b 52%, #f9705f); }
.banner__eyebrow {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
  padding: 5px 12px; border-radius: var(--radius-pill); font-size: 12.5px;
  background: rgba(255, 255, 255, .18); backdrop-filter: blur(4px);
}
.banner__t { font-size: 33px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
/* 有轮播图数据时这一屏换成图片轮播（同位置二选一）；没有数据才用上面的图文 hero 兜底 */
.banner__slide--img { padding: 0; display: block; }
.banner__slide--img::after { display: none; }
.banner__slide--img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.banner__d { max-width: 46ch; color: rgba(255, 255, 255, .82); font-size: 14px; }
.banner__acts { display: flex; gap: 10px; margin-top: 6px; }
.banner__dots { position: absolute; left: 78px; bottom: 20px; display: flex; gap: 8px; z-index: 3; }
.banner__dot {
  width: 22px; height: 4px; padding: 0; border: 0; border-radius: 2px;
  background: rgba(255, 255, 255, .38); cursor: pointer; transition: width var(--dur) var(--ease);
}
.banner__dot.is-active { width: 34px; background: #fff; }
.banner__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .18); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.banner__arrow:hover { background: rgba(255, 255, 255, .3); }
.banner__arrow--l { left: 14px; }
.banner__arrow--r { right: 14px; }

/* ================= 分类入口 ================= */
.cats__hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; }
.cats__hd h2 { font-size: 15px; font-weight: 600; }
.cats__grid {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 4px; padding: 10px 10px 14px;
}
.cat {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 11px 4px; border-radius: var(--radius); color: var(--text-2); font-size: 12.5px;
  cursor: pointer; text-align: center;
}
.cat:hover { background: var(--brand-tint); color: var(--brand); }
.cat__i {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand);
}
.cat:hover .cat__i { background: var(--brand); color: #fff; }

/* ================= 商品区 ================= */
.goods__hd { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.goods__grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; padding: 16px; }
.gcard {
  display: flex; flex-direction: column; overflow: hidden; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.gcard:hover { box-shadow: var(--shadow-sm); border-color: #ccd4ec; transform: translateY(-2px); }
.gcard__thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(150deg, #eef1fe, #f7f8fc); }
.gcard__thumb img { width: 100%; height: 100%; object-fit: cover; }
/* 商品没有图片时的底版：分类图标 + 浅色渐变，比一屏“暂无图片”更接近真实商城 */
.gcard__ph { position: absolute; inset: 0; display: grid; place-items: center; color: #b8c3ef; }
.gcard__ph .ic { width: 46px; height: 46px; }
.gcard__badge {
  position: absolute; left: 8px; top: 8px; padding: 2px 7px; border-radius: var(--radius-xs);
  background: rgba(18, 183, 106, .94); color: #fff; font-size: 11.5px; font-weight: 500;
}
.gcard__badge--hot { background: rgba(229, 52, 43, .94); }
.gcard__bd { display: flex; flex-direction: column; gap: 8px; padding: 11px 12px 13px; flex: 1; }
.gcard__name {
  font-size: 13.5px; font-weight: 500; line-height: 1.5; min-height: 2.9em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gcard__meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; }
.gcard__price { color: var(--danger); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.gcard__price small { font-size: 12px; font-weight: 600; }
.gcard__sold { color: var(--text-3); font-size: 12px; }

/* ================= 侧栏：会员卡板 ================= */
.mcard {
  border-radius: var(--radius-lg); padding: 16px; color: #fff;
  background: linear-gradient(155deg, #2b3d92, #1b2440 78%);
  box-shadow: var(--shadow-sm);
}
.mcard__top { display: flex; align-items: center; gap: 11px; }
.mcard__avatar {
  width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .24);
  display: grid; place-items: center; font-size: 18px; font-weight: 600;
}
.mcard__who { min-width: 0; }
.mcard__who b { display: block; font-size: 15px; }
.mcard__money { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0 13px; }
.mcard__money span { display: block; font-size: 11.5px; color: #a9b7e2; }
.mcard__money b { font-size: 19px; font-variant-numeric: tabular-nums; }
.mcard__stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); text-align: center; gap: 2px;
  padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .12);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.mcard__stat b { display: block; font-size: 14px; font-variant-numeric: tabular-nums; }
.mcard__stat span { font-size: 11px; color: #a9b7e2; }
.mcard__stat:hover b, .mcard__stat:hover span { color: #fff; }
.mcard__btns { display: flex; gap: 8px; margin-top: 13px; }
.mcard__btns .btn { flex: 1; background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.mcard__btns .btn:hover { background: rgba(255, 255, 255, .22); border-color: rgba(255, 255, 255, .3); color: #fff; }
.mcard__btns .btn--gold { background: var(--gold); border-color: var(--gold); color: #463000; }
.mcard__btns .btn--gold:hover { background: #e5a716; border-color: #e5a716; color: #463000; }
.mcard__quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 12px; }
.mcard__q {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 9px 2px;
  border-radius: 9px; background: rgba(255, 255, 255, .08); color: #c9d2ee;
  font-size: 11.5px; cursor: pointer;
}
.mcard__q:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* ================= 侧栏：公告 / 客服 ================= */
.slist { display: flex; flex-direction: column; }
.slist a {
  display: flex; align-items: center; gap: 8px; padding: 9px 16px;
  color: var(--text-2); font-size: 13px; border-bottom: 1px solid var(--line);
}
.slist a:last-child { border-bottom: 0; }
.slist a:hover { background: var(--surface-2); color: var(--brand); }
.slist a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slist a time { color: var(--text-4); font-size: 12px; flex: 0 0 auto; }

/* ================= 信任栏 / 跑马灯 / 页脚 ================= */
.trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 6px 0 18px; }
.trust__i {
  display: flex; align-items: center; gap: 11px; padding: 14px 16px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.trust__i .ic { width: 24px; height: 24px; color: var(--brand); }
.trust__i b { display: block; font-size: 13.5px; }
.trust__i span { font-size: 12px; color: var(--text-3); }

.marquee {
  overflow: hidden; background: #fff; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); color: var(--text-3); font-size: 12.5px;
}
.marquee__in { display: flex; gap: 40px; padding: 9px 0; white-space: nowrap; animation: marquee 34s linear infinite; }
.marquee:hover .marquee__in { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.s-foot { padding: 22px 0 84px; color: var(--text-3); font-size: 12.5px; }
.s-foot__links { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.s-foot__links a { color: var(--text-2); }

/* ================= 右下浮标 ================= */
.fab { position: fixed; right: 22px; bottom: 26px; z-index: 55; display: flex; flex-direction: column; gap: 10px; }
.fab__btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); cursor: pointer;
  display: grid; place-items: center; box-shadow: var(--shadow-sm);
}
.fab__btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.fab__btn--chat { background: var(--brand); border-color: var(--brand); color: #fff; }
.fab__btn--chat:hover { background: var(--brand-hover); }

/* ================= 移动端底部 Tab ================= */
.tabbar { display: none; }

/* ================= 强制登录守卫占位 =================
   会话确认前整页隐藏（只看得到占位文字），通过后由 shop-shell.js 摘掉 class */
html.shop-auth-pending body { visibility: hidden; }
html.shop-auth-pending body::before {
  content: attr(data-boot);
  position: fixed; inset: 0; display: grid; place-items: center;
  visibility: visible; color: var(--text-3); font-size: 14px;
}

/* ================= 响应式 ================= */
@media (max-width: 1180px) {
  .s-layout { grid-template-columns: minmax(0, 1fr) 268px; }
  .cats__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .goods__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  body { padding-bottom: 60px; }
  .s-wrap { width: calc(100% - 24px); }
  .s-topline__r, .s-nav, .s-hd__acts, .trust, .marquee { display: none; }
  .s-hd__in { flex-wrap: wrap; gap: 12px; padding: 12px 0; }
  .s-brand__mark { width: 36px; height: 36px; font-size: 17px; }
  .s-brand h1 { font-size: 16px; }
  .s-hd__search { flex: 1 1 100%; max-width: none; order: 3; }
  .s-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 0 6px; }
  .banner { height: 210px; }
  .banner__slide { padding: 0 20px; gap: 9px; }
  .banner__t { font-size: 22px; }
  .banner__d { font-size: 13px; }
  .banner__dots { left: 20px; bottom: 14px; }
  .cats__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .goods__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
  .gcard__badge { left: 6px; top: 6px; }
  .gcard__price { font-size: 15px; }
  .fab { display: none; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; height: 56px; color: var(--text-3); font-size: 11px;
  }
  .tabbar a.is-active { color: var(--brand); }
  .tabbar a .ic { width: 20px; height: 20px; }
  .s-foot { padding-bottom: 24px; }
}
