/* ============================================================
   默认模板（theme-default）专属样式覆盖
   ------------------------------------------------------------
   加载方式：front.js 按当前模板名注入 /public/themes/<模板>.css，
   排在 /public/front.css 之后，因此这里只写「默认模板」需要的差异，
   不会波及 80cn / bshop / foreverseal / forwa 等其它模板。

   v1.2.48：产品原图多为正方形（如 800×800），而 front.css 里
   .pcard .ph img 固定 height:200px + object-fit:cover，
   把正方形图上下裁掉 → 列表页显示不全。
   改为「正方形容器 + object-fit:contain」，正方形原图满幅显示，
   非正方形原图也完整呈现（留白不裁切）。
   ============================================================ */

/* --- 网格视图：产品卡片（/products、首页产品区、分类卡片） --- */
.pcard .ph { background: #fff; }
.pcard .ph img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  display: block;
}
.pcard .ph .noimg {
  height: auto;
  aspect-ratio: 1 / 1;
  background: #fafafa;
}

/* --- 列表视图：缩略图由 200×150 长方形改为 160×160 正方形 --- */
ul.list-view > li { grid-template-columns: 160px 1fr auto; }
.list-view .lv-thumb { width: 160px; height: 160px; }
.list-view .lv-thumb img { object-fit: contain; background: #fff; }

/* --- 产品详情页：相关产品 / 热门产品 的图片同样改为正方形完整显示 --- */
.rel-block .grid .card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  display: block;
}

/* --- 产品详情页右上角「编辑」入口（仅管理员可见，仅视觉点缀） --- */
.dp-btn.admin-edit {
  text-decoration: none;
  border-color: var(--fw-primary, #f56d33);
  color: var(--fw-primary, #f56d33);
  font-weight: 700;
}
.dp-btn.admin-edit:hover { background: #fff6f2; }

/* --- 旧版 home 的产品网格（.product-grid .card）同样不裁切 --- */
.product-grid .card img {
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

/* --- 窄屏兜底：列表视图退回纵向排列，缩略图仍是正方形 --- */
@media (max-width: 640px) {
  ul.list-view > li { grid-template-columns: 120px 1fr; }
  .list-view .lv-thumb { width: 120px; height: 120px; }
}
