/* ==========================================================================
   catalog.css — 分类页 / 详情页 / Lightbox / 分享条 / 静态页正文
   ========================================================================== */

/* ================= 分类横幅 .catalog-head ================= */
.catalog-head {
  position: relative;
  height: 40vh;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: linear-gradient(120deg, #23211d, #3a352c);
  color: #fff;
}
.catalog-head__img,
.catalog-head > img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.catalog-head::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, .28), rgba(0, 0, 0, .6));
}
.catalog-head__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 0 clamp(20px, 5vw, 64px) clamp(28px, 5vw, 52px);
}
.catalog-head__inner h1 { color: #fff; margin: 6px 0 8px; }
.catalog-head__inner p { color: rgba(255, 255, 255, .82); max-width: 60ch; font-size: .92rem; }
.catalog-head > .breadcrumb {
  position: absolute;
  z-index: 4;
  /* 避开 fixed 站点头（JS 同步真实高度到 --header-total） */
  top: calc(var(--header-total, 102px) + 12px);
  left: clamp(20px, 5vw, 64px);
  right: clamp(20px, 5vw, 64px);
}
.breadcrumb { font-size: .72rem; letter-spacing: .12em; color: rgba(255, 255, 255, .7); }
.breadcrumb a:hover { color: var(--c-accent); }
.breadcrumb span { margin: 0 8px; opacity: .5; }

/* 分类页横幅复用 .banner__* 结构（与首页同源），但本页只加载 catalog.css，
   故在此补齐必要样式，避免标题继承默认墨色贴在图上看不清。 */
.catalog-head .banner {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.catalog-head .banner__img,
.catalog-head .banner > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.catalog-head .banner__img--gradient { background: linear-gradient(135deg, var(--c-primary), var(--c-accent)); }
.catalog-head .banner__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, .52), rgba(0, 0, 0, .12) 70%);
}
.catalog-head .banner__content {
  position: absolute;
  z-index: 3;
  left: clamp(20px, 5vw, 64px);
  right: clamp(20px, 5vw, 64px);
  bottom: clamp(28px, 5vw, 52px);
  width: auto;
}
.catalog-head .banner__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 400;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35);
}
.catalog-head .banner__subtitle {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, .85);
  font-size: .9rem;
  letter-spacing: .14em;
  line-height: 1.7;
}

/* ================= 筛选条 .filter-bar / .filter-chip ================= */
.filter-bar {
  position: sticky;
  /* 站点头为 fixed：JS 同步 --header-total 为实际可见高度（含公告条是否被关闭） */
  top: var(--header-total, 102px);
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 16px clamp(20px, 5vw, 64px);
  background: rgba(248, 246, 241, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-line);
}
.filter-bar__label { font-size: .72rem; letter-spacing: .16em; color: var(--c-muted); margin-right: 4px; }
/* 维度/标签两组容器：允许内部换行且可收缩，避免手机端一整行标签溢出被裁 */
.filter-bar__dims,
.filter-bar__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  max-width: 100%;
}
.filter-bar__tags { flex: 1 1 100%; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: transparent;
  color: var(--c-ink);
  font-size: .78rem;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out);
  white-space: nowrap;
}
.filter-chip:hover { border-color: var(--c-accent); color: var(--c-accent); }
.filter-chip.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

/* ================= 产品网格 .catalog-grid ================= */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 34px);
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out);
}
.catalog-grid.is-switching { opacity: .35; transform: translateY(6px); pointer-events: none; }
.catalog-grid .product-card__media { aspect-ratio: 4 / 5; }
/* 追加的新卡片：入场微动效（JS 会立即加 is-visible） */
.catalog-card.is-visible { animation: jvCardIn .5s var(--ease-out) both; }
@keyframes jvCardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* 加载更多 / 空态 */
.load-more-wrap { display: flex; justify-content: center; margin-top: clamp(40px, 6vw, 72px); }
.load-more { min-width: 200px; }
.load-more[disabled] { opacity: .5; cursor: default; pointer-events: none; }
.load-more.is-done { opacity: 1; color: var(--c-muted); }
.empty-state {
  text-align: center;
  padding: clamp(64px, 10vw, 120px) 20px;
  color: var(--c-muted);
}
.empty-state h3 { color: var(--c-ink); margin-bottom: 10px; }
.empty-state p { font-size: .9rem; }

/* ================= 详情页 .product-layout ================= */
.product-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: start;
}
.product-gallery { position: relative; }
.product-main-img {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #e8e3da;
  cursor: zoom-in;
}
.product-main-img img { width: 100%; height: 100%; object-fit: cover; }
.product-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.product-thumbs img,
.product-thumbs .thumb {
  width: 76px; height: 92px;
  object-fit: cover;
  border: 1px solid transparent;
  cursor: pointer;
  opacity: .72;
  transition: opacity .3s, border-color .3s;
}
.product-thumbs img:hover,
.product-thumbs img.is-active,
.product-thumbs .thumb.is-active { opacity: 1; border-color: var(--c-accent); }

.product-info { position: relative; padding-top: 8px; }
.product-info h1 { margin-bottom: 12px; }
.product-info__lead { font-size: 1rem; color: var(--c-muted); line-height: 1.9; }
.product-meta {
  margin: 26px 0;
  padding: 20px 0;
  border-top: 1px solid var(--c-line);
  border-bottom: 1px solid var(--c-line);
}
.product-meta dl { display: grid; grid-template-columns: 88px 1fr; gap: 10px 18px; font-size: .88rem; }
.product-meta dt { color: var(--c-muted); }
.product-meta dd { margin: 0; color: var(--c-ink); }
.product-meta__row { display: flex; gap: 14px; padding: 5px 0; font-size: .88rem; }
.product-meta__k { flex: 0 0 72px; color: var(--c-muted); }
.product-meta__v { color: var(--c-ink); }
.product-price { font-family: var(--font-serif); font-size: 1.5rem; color: var(--c-accent); margin: 6px 0 14px; }
.product-sku { margin: 22px 0; }
.product-sku__label { font-size: .8rem; color: var(--c-muted); letter-spacing: .06em; margin-bottom: 12px; }
.product-sku__list { display: flex; flex-wrap: wrap; gap: 10px; }
.product-sku__item { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 5px; border: 1px solid var(--c-line); background: #fff; font-size: .8rem; }
.product-sku__item img { width: 34px; height: 34px; object-fit: cover; border: 1px solid var(--c-line); }
.product-sku__item em { font-style: normal; color: var(--c-ink); }
.product-video { margin: 22px 0; }
.product-video video { display: block; width: 100%; max-height: 560px; background: #000; object-fit: contain; }
.product-detail { margin-top: 26px; line-height: 1.95; }

/* 分享条 .share-bar */
.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}
.share-bar__label { font-size: .74rem; letter-spacing: .14em; color: var(--c-muted); margin-right: 4px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 14px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  font-size: .76rem;
  color: var(--c-ink);
  transition: background .3s, color .3s, border-color .3s;
}
.share-btn:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
/* 带真实品牌图标的分享按钮：图标固定尺寸，hover 保持浅底以确保彩色图标可见 */
.share-btn__ico { display: inline-flex; width: 18px; height: 18px; flex: 0 0 18px; margin-right: 7px; }
.share-btn__ico svg { display: block; width: 18px; height: 18px; }
.share-bar .share-btn:hover,
.share-bar .share-btn:focus-visible {
  background: rgba(198, 168, 124, .12);
  color: var(--c-ink);
  border-color: var(--c-accent);
}
.share-btn:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

/* ================= Lightbox ================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 5vw, 60px);
  background: rgba(12, 12, 12, .94);
}
.lightbox.is-open { display: flex; }
.lightbox__img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  user-select: none;
  touch-action: pan-y;
}
.lightbox__close,
.lightbox__nav {
  position: absolute;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 1.6rem;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  transition: background .3s;
}
.lightbox__close:hover,
.lightbox__nav:hover { background: rgba(255, 255, 255, .16); }
.lightbox__close { top: 20px; right: 24px; }
.lightbox__nav--prev { left: clamp(12px, 4vw, 40px); top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: clamp(12px, 4vw, 40px); top: 50%; transform: translateY(-50%); }
.lightbox__counter {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .7);
  font-size: .78rem;
  letter-spacing: .16em;
}

/* ================= 相关推荐 .related ================= */
.related { padding-top: clamp(48px, 7vw, 88px); }
.related .sec-head { margin-bottom: 32px; }

/* ================= 静态页正文 .prose ================= */
.prose { max-width: 760px; margin-inline: auto; }
.prose h2, .prose h3 { margin: 1.8em 0 .6em; }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.2rem; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.1em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose a { color: var(--c-accent); text-decoration: underline; }
.prose img { margin: 1.5em 0; }
/* 品牌故事 / 静态页：杂志感章节排版 */
.prose blockquote {
  margin: 0 0 2.2em;
  padding: 2px 0 2px 24px;
  border-left: 2px solid var(--c-accent);
  font-family: var(--font-serif);
  font-size: 1.45rem;
  line-height: 1.7;
  color: var(--c-primary);
}
.prose h3 {
  margin: 2.4em 0 .9em;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: .05em;
  color: var(--c-primary);
}
.prose h3::before {
  content: "";
  display: block;
  width: 28px; height: 1px;
  margin-bottom: .8em;
  background: var(--c-accent);
}
.prose li { margin-bottom: .6em; }
.prose li::marker { color: var(--c-accent); }
.prose strong { font-weight: 600; color: var(--c-primary); }
.prose em { font-style: normal; color: var(--c-muted); letter-spacing: .08em; font-size: .9rem; }

/* ================= 响应式 ================= */
@media (max-width: 1023px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-layout { grid-template-columns: 1fr; }
  .product-info { padding-top: 0; }
}
@media (max-width: 600px) {
  .catalog-head { height: 30vh; min-height: 220px; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  /* 手机端筛选条改为块级堆叠：维度组、标签组各自占满宽并内部换行，
     避免 flex:1 1 100% + 父级 gap 造成行末标签溢出被裁。 */
  .filter-bar { display: block; padding-block: 12px; }
  .filter-bar__dims,
  .filter-bar__tags { margin-bottom: 8px; }
  .filter-bar__tags { margin-bottom: 0; }
  .filter-chip { padding: 6px 13px; font-size: .72rem; }
  .share-bar { position: sticky; bottom: 0; background: var(--c-paper); padding: 10px 0; border-top: 1px solid var(--c-line); }
  .lightbox__nav { width: 40px; height: 40px; }
}

/* ==========================================================================
   相关推荐网格 .product-grid
   说明：详情页只加载 catalog.css，home.css 里的 .product-grid 不生效，
   此前相关推荐退化为 block 单列巨图，此处补齐网格与卡片基础样式。
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 34px);
}
.related .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.related .product-card {
  display: block;
  min-width: 0;
  color: var(--c-ink);
  text-decoration: none;
}
.related .product-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  background: #e8e3da;
}
.related .product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s var(--ease-lux, cubic-bezier(.22,1,.36,1));
}
.related .product-card:hover .product-card__media img { transform: scale(1.05); }
.related .product-card__body { padding-top: 14px; }
.related .product-card__name {
  margin: 0 0 5px;
  font-family: var(--font-serif);
  font-size: .88rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: .01em;
  color: var(--c-ink);
}
.related .product-card__material {
  margin: 0;
  font-size: .66rem;
  letter-spacing: .08em;
  color: var(--c-accent);
}

/* 相关推荐顶部标题：与全站区块标题统一（衬线 + 短金线） */
.related > .container > h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.3vw, 2.05rem);
  letter-spacing: .05em;
  margin-bottom: clamp(22px, 3vw, 34px);
}
.related > .container > h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin-bottom: 14px;
  background: var(--c-accent);
}

@media (max-width: 1023px) {
  .product-grid,
  .related .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 600px) {
  .product-grid,
  .related .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .related .product-card__name { font-size: .8rem; }
}

/* ==========================================================================
   详情页顶部避让
   头部为 fixed（公告条 34px + 导航 68px ≈ 102px），详情页无 hero，
   内容需自行下移，否则商品标题会被固定导航压住。
   ========================================================================== */
.product-layout { padding-top: clamp(128px, 12vw, 168px); }
@media (max-width: 900px) {
  .product-layout { padding-top: 116px; }
}

/* ==========================================================================
   404 / 空态精修：垂直居中构图，收紧大数字与标题之间的空隙
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.empty-state .notfound__code { margin: 0 0 10px; }
.empty-state h1 { margin: 0 0 14px; color: var(--c-ink); }
.empty-state p:not(.notfound__code) {
  margin: 0 0 28px;
  max-width: 46ch;
  line-height: 1.9;
}
