/* ---------- 花色库 Products ---------- */

.page-body { padding-top: 56px; }   /* 避开固定导航，让内容从导航下方开始 */

.collection-header { text-align: center; padding: 60px 24px 8px; }
.collection-header h1 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 700; }
.collection-sub { margin-top: 12px; color: var(--muted); font-size: 16px; }

/* 动态画廊：瓷砖环绕轨道（移植 Orbit Images，js/gallery-orbit.js） */
.gallery-stage {
  width: 100vw; margin-left: calc(50% - 50vw);
  height: min(58vh, 560px);
  margin-top: 10px;
  position: relative; overflow: hidden;
  background: #ffffff;   /* 与页面同色，不出现灰底/遮罩感 */
  perspective: 1100px;
  perspective-origin: 50% 50%;
  cursor: grab;
  touch-action: pan-y;
  border-radius: 0;              /* 手机：横向拖交给轨道，纵向仍可滚页面 */
}
.gallery-stage.is-dragging { cursor: grabbing; }
.gf-world { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .35s ease-out; }
/* 聚焦时：画面四周覆一层白色柔光，让"飞过去看的那张"从背景里跳出来 */
.gf-focusimg {
  position: absolute; z-index: 1500; border-radius: 12px;
  background-size: cover; background-position: center;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .28), 0 4px 12px rgba(0, 0, 0, .10);
  opacity: 0; pointer-events: none;
}
.gf-focusimg.show { opacity: 1; }

.gf-haze {
  position: absolute; inset: 0; z-index: 500; pointer-events: none;
  background: radial-gradient(closest-side at 50% 50%,
    rgba(255,255,255,0) 0%, rgba(255,255,255,0) 42%,
    rgba(255,255,255,.5) 70%, rgba(255,255,255,.92) 94%);
  opacity: 0; transition: opacity .55s ease;
}
.gf-haze.show { opacity: 1; }

/* 画面内放大后，底部出现编号 + 跳转按钮（不是弹窗） */
.gf-focusbar {
  position: absolute; left: 50%; bottom: 16px; transform: translate(-50%, 10px);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 10px 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .12);
  opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease;
  z-index: 1000;
}
.gf-focusbar.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.gf-focusbar-code { font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.gf-focusbar-btn {
  border: 0; border-radius: 999px; padding: 8px 16px; cursor: pointer;
  background: var(--text); color: #fff; font: inherit; font-size: 12px; font-weight: 600;
  transition: background .2s;
}
.gf-focusbar-btn:hover { background: #333; }

.gf-tile {
  position: absolute; left: 50%; top: 50%;
  aspect-ratio: 110 / 155;
  border-radius: 10px;
  background-size: cover; background-position: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06);
  will-change: transform, opacity;
  backface-visibility: hidden;
  pointer-events: none;
}
.orbit-stage { position: absolute; inset: 0; }
.orbit-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.orbit-path { display: none; }
.orbit-item {
  position: absolute; left: 0; top: 0;
  padding: 0; border: 0; margin: 0;
  border-radius: 12px;
  background-color: #f2f2f4;
  background-size: cover; background-position: center;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06);
  cursor: pointer;
  will-change: transform, opacity;
  transition: box-shadow .25s ease;
}
.orbit-item:hover { box-shadow: 0 22px 46px rgba(0, 0, 0, .22), 0 2px 6px rgba(0, 0, 0, .08); }
.orbit-item:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

/* 筛选栏：规格 / 质感 两组翻牌，可同时筛选 */
.filter-bar {
  max-width: 1200px; margin: 26px auto 6px; padding: 0 24px;
  display: flex; flex-direction: column; gap: 14px;
}
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-group-label {
  font-size: 12px; color: var(--muted); letter-spacing: .05em;
  margin-right: 6px; text-transform: uppercase; font-weight: 600;
}
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s; user-select: none;
}
.chip:hover { border-color: var(--text); color: var(--text); }
.chip:focus { outline: none; }          /* 点后不留黑色描边（非选中卡不再误显高亮） */
.chip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.chip.active { background: var(--text); border-color: var(--text); color: #fff; }

/* 产品网格 */
.products-grid {
  max-width: 1200px; margin: 26px auto 80px; padding: 0 24px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  column-gap: 22px; row-gap: 38px;   /* 行间距加大（两排图像之间更透气） */
}
.p-card {
  background: #fff; border-radius: 16px; overflow: hidden; cursor: pointer;
  border: 1px solid rgba(17, 24, 39, .06);   /* 极细浅框，让四角圆角都有轮廓（底部白色区也能看出圆角） */
  transition: transform .3s ease, box-shadow .3s ease;
}
/* 悬停浮起更明显（用户要）：更大的上移 + 明显放大 + 深阴影 */
.p-card:hover { transform: translateY(-16px) scale(1.03); box-shadow: 0 32px 60px rgba(0, 0, 0, .20); }
.p-card { transition: transform .35s cubic-bezier(.2,.7,.3,1.2), box-shadow .35s ease; }
.p-img {
  aspect-ratio: 110 / 155; position: relative; overflow: hidden;
  background: #f5f5f7;   /* 未加载/加载中先垫一块浅灰底，图片就用懒加载逐张填充 */
}
.p-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.p-card:hover .p-img img { transform: scale(1.1); }   /* 悬停图片放大，浮起更明显 */

/* 悬停「光泽滑过」：一道柔光斜扫过卡片（react-bits GlareHover 的原生 CSS 复刻，零依赖）
   z-index 1 → 在图片之上、红心(2)之下；.p-img 已 overflow:hidden，光带不会溢出卡片
   ⚠ 带宽只占卡片 1/4（=25%）——窄而亮才像「一道高光」；带宽了会变成「一层白雾」把瓷砖纹理冲淡（看图代理实测反馈） */
.p-img::after {
  content: ''; position: absolute; top: -10%; left: 0;
  width: 25%; height: 120%; z-index: 1; pointer-events: none; opacity: 0;
  /* ⚠ 形状要「尖」不要「胖」：两侧各留一段纯 0 再急升到峰值 —— 长缓坡的平顶胖带子会读成「一层白雾」；
     0→峰值的爬升只用 ~19% 宽度（原 42%）。峰值 .62 是兼顾深/浅砖的甜点（低于 .55 在深砖上会发灰、那才是真的显脏）。 */
  background: linear-gradient(90deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0) 26%,
    rgba(255,255,255,.42) 45%,
    rgba(255,255,255,.62) 50%,
    rgba(255,255,255,.42) 55%,
    rgba(255,255,255,0) 74%,
    rgba(255,255,255,0) 100%);
  transform: translateX(-120%) skewX(-14deg);
}
.p-card:hover .p-img::after { animation: glareSweep .8s cubic-bezier(.3,.5,.3,1) .05s 1; }
/* ⚠ 位移百分比是「相对光带自身宽度」的 → 带宽 25%(≈卡片1/4) 时：-120% 起步(完全在卡左外)、430% 收尾(刚好滑出卡右)，
   行程刚好覆盖整张卡、没有「已出卡还在空转」的后半段。 */
/* ⚠ 亮度要在前段保持满值、最后再淡出 —— 否则「边走边线性变暗」会像「扫到一半就没劲了」。
   但也不能保持太久（曾设 85%）：满值期越长，「太抢眼」的感受越强（看图代理实测）。取 80%。 */
@keyframes glareSweep {
  0%   { transform: translateX(-120%) skewX(-14deg); opacity: 0; }
  12%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateX(430%) skewX(-14deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .p-card:hover .p-img::after { animation: none; } }

/* 有「上墙效果图」的花色：图左下角一个小标签，提示点开能看实景 */
.room-badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text); background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 4px 9px; border-radius: 999px; pointer-events: none;
}

/* 悬停浮现的红心收藏（滑走消失）—— 未点亮=灰、点亮=红，形态统一 */
.fav-heart {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  opacity: 0; transform: scale(.7); transition: opacity .2s, transform .2s;
}
.fav-heart svg { width: 18px; height: 18px; fill: #c7c7cd; transition: fill .2s; }   /* 默认灰心 */
.fav-heart.on svg { fill: #e0245e; }   /* 点亮红心 */
.p-card:hover .fav-heart { opacity: 1; transform: scale(1); }   /* 悬停浮现 */
.fav-heart:hover { transform: scale(1.1); }

.p-count {
  max-width: 1200px; margin: 16px auto 0; padding: 0 24px;
  font-size: 12px; color: var(--muted); letter-spacing: .02em;
}
.p-meta { padding: 14px 16px 18px; }
.p-name { font-size: 15px; font-weight: 700; }
.p-sub {
  margin-top: 6px; font-size: 12px; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center;
}
.p-tag {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: #f5f5f7; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em;
}

.p-empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 15px; }

/* 点击弹出的产品详情：上半「左花色 / 右上墙实景」左右对比，下半文字居中 */
.p-modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
}
.p-modal.open { display: flex; }
.p-modal-card {
  background: #fff; border-radius: 20px; width: min(1280px, 96vw);
  max-height: 92vh; overflow: auto; position: relative;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .18);
}
.p-modal-close {
  position: absolute; top: 14px; right: 18px; font-size: 26px;
  color: var(--muted); background: rgba(255,255,255,.9); border: none; cursor: pointer; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; line-height: 1;
}
.p-modal-close:hover { color: var(--text); }

/* 左右两张图：同一高度并排 */
.p-modal-body { display: block; }
.p-modal-imgs { display: grid; grid-template-columns: 1fr 3fr; gap: 4px; }   /* 左 1/4 花色、右 3/4 实景 */
.p-modal-img,
.p-modal-case {
  position: relative; overflow: hidden; background: #f5f5f7;
  height: min(64vh, 700px);
  display: flex; align-items: center; justify-content: center;
}
.p-modal-img img,
.p-modal-case img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-cap {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text); background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 4px 9px; border-radius: 999px; pointer-events: none;
}
.pm-case-text { padding: 0 30px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* 下方文字：整体居中 */
.p-modal-info { padding: 16px 30px 20px; text-align: center; border-top: 1px solid var(--line); }
.p-modal-info h2 { font-size: 20px; font-weight: 700; letter-spacing: .01em; line-height: 1.2; }
.pm-meta {
  margin-top: 8px; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 26px;
  font-size: 13px; color: var(--muted);
}
.pm-line b { color: var(--text); font-weight: 600; margin-left: 6px; }
.pm-desc { margin: 10px auto 0; max-width: 620px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  /* 手机上两张图改为上下叠，各占约 1/3 屏高 */
  .p-modal-imgs { grid-template-columns: 1fr; }
  .p-modal-img, .p-modal-case { height: 32vh; }
  .p-modal-info { padding: 20px 20px 26px; }
  .p-modal-info h2 { font-size: 20px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* Three.js 画布（3D 无限画廊） */
.g3d-canvas { display: block; width: 100%; height: 100%; }
.gallery-stage.is-dragging { cursor: grabbing; }
.gallery-stage.is-focused { cursor: zoom-in; }
