/* ==========================================================================
   通用组件：商品卡 / 类目入口 / 区块标题 / 面板 / 表格 / 筛选 / 分页 / 优惠券
   ========================================================================== */

/* --------------------------------------------------------------------------
   图片占位（商品图由后期接口提供，这里为统一风格的占位缩略图）
   -------------------------------------------------------------------------- */
.thumb {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #eef1f5;
  isolation: isolate;
}
.thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(72% 62% at 24% 16%, rgba(255, 255, 255, .82), rgba(255, 255, 255, 0) 62%),
    radial-gradient(64% 64% at 84% 96%, rgba(15, 23, 42, .14), transparent 62%);
}
.thumb::after {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 56%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 26%;
  border: 1px solid rgba(255, 255, 255, .42);
  background: linear-gradient(155deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .04));
  transform: rotate(-16deg);
  box-shadow: 0 26px 46px -20px rgba(15, 23, 42, .45);
}
.thumb__ico {
  position: relative;
  z-index: 3;
  width: 26%;
  max-width: 78px;
  color: rgba(255, 255, 255, .95);
  filter: drop-shadow(0 10px 20px rgba(15, 23, 42, .22));
}
.thumb__ico svg { width: 100%; height: auto; }

/* 占位色调 */
.t-1 { background: linear-gradient(150deg, #ffc0a6 0%, #ff8362 52%, #e4523c 100%); }
.t-2 { background: linear-gradient(150deg, #d3d9f7 0%, #8f9bf3 55%, #6370d8 100%); }
.t-3 { background: linear-gradient(150deg, #d7e6ff 0%, #7fa8ea 55%, #4f7bc4 100%); }
.t-4 { background: linear-gradient(150deg, #c6ece4 0%, #64c3b3 55%, #3a9d92 100%); }
.t-5 { background: linear-gradient(150deg, #ffe0b8 0%, #f0ae55 55%, #cf8a2f 100%); }
.t-6 { background: linear-gradient(150deg, #e0e4ea 0%, #a8b2c1 55%, #78838f 100%); }
.t-7 { background: linear-gradient(150deg, #cbd0da 0%, #6b7280 52%, #2f353d 100%); }
.t-8 { background: linear-gradient(150deg, #e6d8f7 0%, #ab84dd 55%, #7d55b4 100%); }
.t-9 { background: linear-gradient(150deg, #d7eccd 0%, #8fc47b 55%, #639a4f 100%); }
.t-10 { background: linear-gradient(150deg, #f9d2dd 0%, #e8879f 55%, #c7607a 100%); }

/* --------------------------------------------------------------------------
   区块标题
   -------------------------------------------------------------------------- */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.sec-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.2px;
}
.sec-title__ico { width: 21px; height: 21px; color: var(--brand); flex: none; }
.sec-title__ico svg { width: 100%; height: 100%; }
.sec-title__count {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0;
  padding-left: 2px;
}
.sec-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  transition: color .18s, gap .2s var(--ease);
}
.sec-more:hover { color: var(--brand); gap: 8px; }
.sec-more svg { width: 14px; height: 14px; }

.sec-sub {
  font-size: 13px;
  color: var(--ink-3);
  margin-top: 6px;
}
.sec-head--center { flex-direction: column; align-items: flex-start; }
.sec-head--center .sec-title { font-size: 26px; }

/* --------------------------------------------------------------------------
   商品卡
   -------------------------------------------------------------------------- */
.p-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 20px;
}
.p-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.p-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.p-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform .26s var(--ease), box-shadow .26s var(--ease), border-color .26s;
}
.p-card:hover {
  transform: translateY(-4px);
  border-color: #f0dcd8;
  box-shadow: var(--shadow-md);
}
.p-card__media { position: relative; }
.p-card__media .thumb { aspect-ratio: 4 / 3; }
.p-card:hover .thumb::after { transform: rotate(-16deg) scale(1.05); transition: transform .4s var(--ease); }
.p-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  height: 21px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .92);
  color: var(--brand-600);
  font-size: 11px;
  font-weight: 700;
  line-height: 21px;
  backdrop-filter: blur(4px);
}
.p-card__fav {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  color: var(--ink-2);
  opacity: 0;
  transform: translateY(-4px);
  transition: .22s var(--ease);
}
.p-card:hover .p-card__fav { opacity: 1; transform: none; }
.p-card__fav:hover { color: var(--brand); }
.p-card__fav svg { width: 16px; height: 16px; }
.p-card__fav.is-on { color: var(--brand); opacity: 1; transform: none; }
.p-card__fav.is-on svg { fill: currentColor; }

.p-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 15px;
  flex: 1;
}
.p-card__name {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}
.p-card__name:hover { color: var(--brand); }
.p-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-3);
}
.p-card__rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.p-card__rating svg { width: 12px; height: 12px; color: #ff9d1f; }
.p-card__price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: auto;
  padding-top: 2px;
}
.p-card__price .price { font-size: 17px; }
.p-card__price .price small { font-size: 12px; }

/* 横向商品行（购物车 / 订单等） */
.p-row { display: flex; align-items: center; gap: 14px; }
.p-row__thumb { width: 64px; flex: none; }
.p-row__thumb .thumb { width: 64px; height: 64px; border-radius: 10px; }
.p-row__thumb .thumb__ico { width: 34%; }

/* --------------------------------------------------------------------------
   类目入口卡
   -------------------------------------------------------------------------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}
.cat-card {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 74px;
  padding: 0 20px;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: .22s var(--ease);
}
.cat-card:hover {
  background: #fff;
  border-color: var(--line-2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.cat-card__ico { width: 22px; height: 22px; color: var(--brand); flex: none; transition: transform .25s var(--ease); }
.cat-card:hover .cat-card__ico { transform: scale(1.12); }
.cat-card__ico svg { width: 100%; height: 100%; }

/* --------------------------------------------------------------------------
   服务承诺条
   -------------------------------------------------------------------------- */
.promise {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.promise__item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 18px 22px;
}
.promise__item + .promise__item { border-left: 1px solid var(--line); }
.promise__ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-50);
  color: var(--brand);
  flex: none;
}
.promise__ico svg { width: 17px; height: 17px; }
.promise__title { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.promise__desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

/* --------------------------------------------------------------------------
   面板 / 卡片容器
   -------------------------------------------------------------------------- */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.panel__title { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel__title svg { width: 17px; height: 17px; color: var(--brand); }
.panel__body { padding: 22px; }
.panel__body--flush { padding: 0; }
.panel__foot { padding: 16px 22px; border-top: 1px solid var(--line); background: var(--bg-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* --------------------------------------------------------------------------
   筛选栏 / 工具条
   -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 20px;
}
.filter-bar__label { font-size: 12.5px; color: var(--ink-3); }
.sort-group { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 13px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--ink-2);
  transition: .18s;
}
.sort-btn:hover { background: var(--bg); color: var(--ink); }
.sort-btn.is-active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.sort-btn svg { width: 12px; height: 12px; }

.chip-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 30px;
  padding: 0 13px;
  border-radius: 15px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  transition: .18s;
}
.chip:hover { border-color: #cfd4db; color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 500; }

.search-box { position: relative; display: flex; align-items: center; min-width: 0; }
.search-box svg {
  position: absolute;
  left: 13px;
  width: 16px;
  height: 16px;
  color: var(--ink-3);
  pointer-events: none;
}
.search-box .input { height: 38px; min-height: 38px; padding-left: 38px; width: 240px; border-radius: 19px; font-size: 13px; }

/* --------------------------------------------------------------------------
   分页
   -------------------------------------------------------------------------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 0 4px;
}
.pager__btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  transition: .18s;
}
.pager__btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager__btn.is-active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager__btn:disabled { opacity: .4; cursor: not-allowed; }
.pager__btn svg { width: 14px; height: 14px; }
.pager__info { font-size: 12.5px; color: var(--ink-3); margin-left: 6px; }

/* --------------------------------------------------------------------------
   侧边筛选（商品中心）
   -------------------------------------------------------------------------- */
.side-group + .side-group { margin-top: 4px; padding-top: 18px; border-top: 1px solid var(--line); }
.side-group__title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.side-list { display: grid; gap: 2px; }
.side-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  transition: .16s;
}
.side-list a:hover { background: var(--bg); color: var(--ink); }
.side-list a.is-active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.side-list span { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }

/* --------------------------------------------------------------------------
   表格
   -------------------------------------------------------------------------- */
.tbl-wrap { overflow-x: auto; }
.tbl { font-size: 13px; min-width: 620px; }
.tbl th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-2);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.tbl td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #fcfcfd; }
.tbl .cell-strong { color: var(--ink); font-weight: 600; }
.tbl .cell-num { font-variant-numeric: tabular-nums; }

/* 状态徽标 */
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 11px;
  font-size: 11.5px;
  font-weight: 600;
}
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status--warn { background: #fff6e6; color: #b76a00; }
.status--ok { background: #e9f8ef; color: #17803d; }
.status--info { background: #eef3ff; color: #2b58c4; }
.status--muted { background: #f2f4f7; color: #6b7280; }

/* --------------------------------------------------------------------------
   标签页
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab {
  position: relative;
  height: 46px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  transition: color .18s;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); font-weight: 700; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2.5px;
  border-radius: 3px;
  background: var(--brand);
}

/* --------------------------------------------------------------------------
   优惠券
   -------------------------------------------------------------------------- */
.coupon {
  position: relative;
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #f6ded9;
  border-radius: var(--r-md);
  overflow: hidden;
  transition: .22s var(--ease);
}
.coupon:hover { box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.coupon__left {
  width: 116px;
  flex: none;
  display: grid;
  place-content: center;
  text-align: center;
  background: linear-gradient(160deg, #fff4f0, #ffe6df);
  color: var(--brand-600);
  padding: 16px 8px;
}
.coupon__amt { font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.coupon__amt small { font-size: 13px; font-weight: 700; margin-right: 1px; }
.coupon__cond { font-size: 11.5px; margin-top: 4px; color: #b4573f; }
.coupon__right { flex: 1; padding: 16px 18px; display: flex; flex-direction: column; justify-content: center; gap: 4px; border-left: 1px dashed #f0d3cc; }
.coupon__name { font-size: 14px; font-weight: 700; }
.coupon__desc { font-size: 11.5px; color: var(--ink-3); }
.coupon__btn { align-self: flex-start; margin-top: 4px; }
.coupon__state { font-size: 12px; color: var(--ink-3); }

/* --------------------------------------------------------------------------
   步骤条
   -------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step { position: relative; padding: 22px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); }
.step__no {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-50);
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
}
.step__title { font-size: 14.5px; font-weight: 700; }
.step__desc { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.7; }
.step::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 34px;
  width: 6px;
  height: 6px;
  border-top: 1.5px solid #d5dade;
  border-right: 1.5px solid #d5dade;
  transform: rotate(45deg);
}
.step:last-child::after { display: none; }

/* --------------------------------------------------------------------------
   FAQ 手风琴
   -------------------------------------------------------------------------- */
.faq { display: grid; gap: 10px; }
.faq__item { border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; overflow: hidden; }
.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
}
.faq__q svg { width: 16px; height: 16px; color: var(--ink-3); transition: transform .25s var(--ease); flex: none; }
.faq__item.is-open .faq__q svg { transform: rotate(180deg); color: var(--brand); }
.faq__a {
  display: none;
  padding: 0 20px 18px;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-2);
}
.faq__item.is-open .faq__a { display: block; animation: fadeUp .24s var(--ease) both; }

/* --------------------------------------------------------------------------
   表单栅格 / 表单卡片
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .span-2 { grid-column: span 2; }
.form-note { font-size: 12px; color: var(--ink-3); line-height: 1.8; }

/* --------------------------------------------------------------------------
   空状态 / 加载状态
   -------------------------------------------------------------------------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 70px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty__ico {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: #b9c0c9;
}
.empty__ico svg { width: 26px; height: 26px; }
.empty__title { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.empty__desc { font-size: 12.5px; }

.skeleton {
  background: linear-gradient(100deg, #f1f3f6 20%, #f8f9fb 40%, #f1f3f6 60%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--r-md);
}
@keyframes shimmer { to { background-position: -160% 0; } }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .p-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .promise { grid-template-columns: repeat(2, 1fr); }
  .promise__item:nth-child(3) { border-left: 0; }
  .promise__item:nth-child(n+3) { border-top: 1px solid var(--line); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step:nth-child(2)::after { display: none; }
}

@media (max-width: 820px) {
  .p-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .p-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat-card { height: 64px; padding: 0 16px; font-size: 13.5px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .sec-title { font-size: 18px; }
  .search-box .input { width: 100%; min-width: 0; }
  .search-box { flex: 1 1 100%; }
  .shop-main__head { align-items: stretch; }
  .sort-group { margin-left: 0; width: 100%; overflow-x: auto; }
}

@media (max-width: 560px) {
  .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .p-card__body { padding: 10px 11px 13px; }
  .p-card__price .price { font-size: 15px; }
  .promise { grid-template-columns: 1fr; }
  .promise__item + .promise__item { border-left: 0; border-top: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .step::after { display: none; }
  .coupon__left { width: 96px; }
  .coupon__amt { font-size: 22px; }
}
