/* ============================================================
   Sunrise Violin — 商城页 / 商品卡 v2（第 3 步）
   依赖：vn-design.css（设计变量 + body.vn-ui 作用域）+ Astra 主题 DOM
   覆盖对象：商品归档页（/shop/、/zh/shangcheng/、商品分类页）
   ============================================================ */

/* ---------- 1. 商城页头：浅色卡片式横幅 ---------- */
body.vn-ui .woocommerce-products-header {
  position: relative;
  background: linear-gradient(160deg, var(--bg2) 0%, var(--paper) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  padding: clamp(38px, 4.6vw, 64px) clamp(24px, 4vw, 56px) clamp(34px, 4vw, 56px);
  text-align: center;
  margin-bottom: clamp(26px, 3vw, 42px);
}
body.vn-ui .woocommerce-products-header::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -1px;
  width: 72px;
  height: 3px;
  transform: translateX(-50%);
  background: var(--accent);
}
body.vn-ui .woocommerce-products-header h1,
body.vn-ui .woocommerce-products-header .page-title {
  font-size: clamp(30px, 4vw, 50px);
  letter-spacing: -.015em;
  margin: 0 0 18px;
}
body.vn-ui .woocommerce-products-header h1::after {
  content: "";
  display: block;
  width: 46px;
  height: 2px;
  background: var(--accent);
  margin: 20px auto 0;
}
body.vn-ui .woocommerce-products-header .term-description {
  max-width: 780px;
  margin: 22px auto 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--muted);
}
body.vn-ui .woocommerce-products-header .term-description p:last-child { margin-bottom: 0; }

/* 面包屑：小号大写字距 */
body.vn-ui .ast-breadcrumbs,
body.vn-ui .woocommerce-breadcrumb {
  font-size: 11.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted2);
  margin-bottom: 18px;
}
body.vn-ui .ast-breadcrumbs a,
body.vn-ui .woocommerce-breadcrumb a { color: var(--muted); }
body.vn-ui .ast-breadcrumbs a:hover,
body.vn-ui .woocommerce-breadcrumb a:hover { color: var(--accentd); }

/* ---------- 2. 工具条：结果数 + 排序 ---------- */
body.vn-ui .woocommerce .woocommerce-result-count,
body.vn-ui .woocommerce-result-count {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted2);
  margin: 0 0 26px;
}
body.vn-ui .woocommerce .woocommerce-ordering,
body.vn-ui .woocommerce-ordering { margin: 0 0 22px; }
body.vn-ui .woocommerce .woocommerce-ordering select {
  appearance: none;
  -webkit-appearance: none;
  min-width: 210px;
  font-size: 13px;
  letter-spacing: .06em;
  padding: 12px 40px 12px 16px;
  color: var(--ink2);
  background-color: var(--paper);
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  border-radius: var(--r);
}

/* ---------- 3. 商品卡 v2 ---------- */
body.vn-ui ul.products li.product {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r2);
}

/* 3.1 图片区：1:1 + 悬浮微放大 */
body.vn-ui ul.products li.product .astra-shop-thumbnail-wrap {
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  background: var(--bg2);
  line-height: 0;
}
body.vn-ui ul.products li.product .astra-shop-thumbnail-wrap img {
  width: 100%;
  height: auto;
  margin: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.22, .61, .36, 1);
}
body.vn-ui ul.products li.product:hover .astra-shop-thumbnail-wrap img { transform: scale(1.05); }

/* 悬浮“查看”胶囊 */
body.vn-ui ul.products li.product .astra-shop-thumbnail-wrap::after {
  content: "View";
  position: absolute;
  left: 14px;
  bottom: 14px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--ink);
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 15px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease;
  pointer-events: none;
}
body.vn-ui ul.products li.product:hover .astra-shop-thumbnail-wrap::after {
  opacity: 1;
  transform: translateY(0);
}
:lang(zh) body.vn-ui ul.products li.product .astra-shop-thumbnail-wrap::after { content: "查看"; }

/* 隐藏 Astra 图片角上的圆形加购按钮（下方 summary 内已有按钮） */
body.vn-ui ul.products li.product .ast-on-card-button { display: none !important; }

/* 3.2 摘要区：纵向排版，按钮沉底（卡片等高） */
body.vn-ui ul.products li.product .astra-shop-summary-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px 22px 24px !important;
  text-align: left !important;
}
body.vn-ui ul.products li.product .astra-shop-summary-wrap > * { order: 3; }

/* 分类胶囊 */
body.vn-ui ul.products li.product .ast-woo-product-category {
  order: 1;
  align-self: flex-start;
  font-family: var(--sans);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1;
  color: var(--accentd);
  background: rgba(200, 169, 106, .14);
  border: 1px solid var(--gold-line);
  border-radius: 999px;
  padding: 6px 12px;
  margin: 0 0 14px !important;
}

/* 标题 */
body.vn-ui ul.products li.product .astra-shop-summary-wrap .ast-loop-product__link {
  order: 2;
  display: block;
  width: 100%;
}
body.vn-ui ul.products li.product .woocommerce-loop-product__title,
body.vn-ui ul.products li.product h2 {
  font-family: var(--serif);
  font-size: 18px !important;
  font-weight: 600;
  line-height: 1.42;
  letter-spacing: -.005em;
  color: var(--ink);
  padding: 0 !important;
  margin: 0 0 12px !important;
}
body.vn-ui ul.products li.product:hover .woocommerce-loop-product__title { color: var(--accentd); }

/* 价格 */
body.vn-ui ul.products li.product .price {
  order: 3;
  display: block;
  padding: 0 !important;
  margin: auto 0 14px !important;
  font-size: 19px;
  letter-spacing: -.01em;
}
body.vn-ui ul.products li.product .price del { color: var(--muted2); font-size: 15px; }
body.vn-ui ul.products li.product .price ins { text-decoration: none; }

/* 询价型商品（无价格）：显示“价格请咨询”分隔行 */
body.vn-ui ul.products li.product:not(:has(.price)) .astra-shop-summary-wrap::after {
  content: "Price on request";
  order: 4;
  align-self: stretch;
  margin: auto 0 14px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted2);
}
:lang(zh) body.vn-ui ul.products li.product:not(:has(.price)) .astra-shop-summary-wrap::after {
  content: "价格请咨询";
}

/* 3.3 按钮：可购商品实心按钮，询价商品文字链接 */
body.vn-ui ul.products li.product .button {
  order: 5;
  margin: 0 !important;
  align-self: flex-start;
}
body.vn-ui ul.products li.product .button::after {
  content: " →";
  letter-spacing: 0;
}
body.vn-ui ul.products li.product:not(:has(.price)) .button {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  padding: 0 0 3px !important;
  font-size: 11.5px;
  letter-spacing: .18em;
  color: var(--accentd) !important;
  border-bottom: 1px solid var(--gold-line) !important;
}
body.vn-ui ul.products li.product:not(:has(.price)) .button:hover {
  color: var(--ink) !important;
  border-bottom-color: var(--ink) !important;
}

/* ---------- 4. 分类卡片（商城页顶部三宫格） ---------- */
body.vn-ui ul.products li.product-category {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r2);
  overflow: hidden;
  padding: 0;
  transition: box-shadow .28s ease, transform .28s ease, border-color .28s ease;
}
body.vn-ui ul.products li.product-category:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--gold-line);
  transform: translateY(-4px);
}
body.vn-ui ul.products li.product-category img {
  margin: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  opacity: .9;
}
body.vn-ui ul.products li.product-category .woocommerce-loop-category__title {
  font-family: var(--serif);
  font-size: 15px !important;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 18px 20px 4px !important;
  margin: 0 !important;
}
body.vn-ui ul.products li.product-category .woocommerce-loop-category__title .count {
  display: block;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--muted2);
  margin-top: 8px;
  background: transparent;
  padding: 0;
}

/* ---------- 5. 分页 ---------- */
body.vn-ui .woocommerce nav.woocommerce-pagination { text-align: center; margin: clamp(36px, 4vw, 56px) 0 0; }
body.vn-ui .woocommerce nav.woocommerce-pagination ul {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border: 0;
  margin: 0;
}
body.vn-ui .woocommerce nav.woocommerce-pagination ul li {
  border: 0;
  margin: 0;
  overflow: visible;
}
body.vn-ui .woocommerce nav.woocommerce-pagination ul li a,
body.vn-ui .woocommerce nav.woocommerce-pagination ul li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1;
  color: var(--ink2) !important;
  background: var(--paper) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r) !important;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
body.vn-ui .woocommerce nav.woocommerce-pagination ul li a:hover {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: #fff !important;
}
body.vn-ui .woocommerce nav.woocommerce-pagination ul li span.current,
body.vn-ui .woocommerce nav.woocommerce-pagination ul li .current {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: #fff !important;
}

/* ---------- 6. 响应式 ---------- */
@media (max-width: 1024px) {
  body.vn-ui ul.products li.product .astra-shop-summary-wrap { padding: 18px 18px 22px !important; }
}
@media (max-width: 640px) {
  body.vn-ui ul.products li.product .astra-shop-summary-wrap { padding: 15px 15px 18px !important; }
  body.vn-ui ul.products li.product .woocommerce-loop-product__title,
  body.vn-ui ul.products li.product h2 { font-size: 15.5px !important; }
  body.vn-ui ul.products li.product .price { font-size: 17px; }
  body.vn-ui ul.products li.product .ast-woo-product-category { font-size: 9px; padding: 5px 10px; }
  body.vn-ui .woocommerce .woocommerce-ordering select { min-width: 0; width: 100%; }
  body.vn-ui .woocommerce nav.woocommerce-pagination ul li a,
  body.vn-ui .woocommerce nav.woocommerce-pagination ul li span { min-width: 40px; height: 40px; }
}
