/* ============================================================
   Megatex Blanket — 产品详情页样式 (v20260831)
   结构：面包屑条 / 产品头区（左图集+右信息-含Description/Specifications）
        / Similar Items / 深色CTA带
   2026-08-31 调整：
     - 移除右侧滚动联动图集（原 show-body 双栏）；Description + Specifications
       上移到右栏 .show-info 内（紧跟按钮/信任条下方，首屏即达）
     - 缩略图区加左右箭头 + 主图箭头 + 页码，支持键盘/按钮/悬停切换
   设计依据：PDF 第4-5页（折叠面板：材质规格默认展开-减号）
   ============================================================ */

.show-container {
  max-width: 1158px; margin: 0 auto; padding: 0 24px;
}

/* ---------- 1. 面包屑条 ---------- */
.show-crumb { background: var(--surface); border-bottom: 1px solid var(--line); }
.show-crumb ol {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 12px;
  padding: 14px 0;
  font-size: 13px; color: #666;
  list-style: none;
}
.show-crumb li { display: flex; align-items: center; gap: 12px; }
.show-crumb li + li::before { content: "/"; color: #bbb; }
.show-crumb a { color: #666; }
.show-crumb a:hover { color: var(--ink); text-decoration: underline; }
.show-crumb .cur { color: var(--ink); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 2. 产品头区 ---------- */
.show-head { background: var(--surface); padding: 40px 0 72px; }
.show-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
/* 左侧组图固定跟随滚动（下拉时箭头随图集一起移动） */
.show-head-grid .gallery {
  position: sticky;
  top: 24px;
  align-self: start;
}

/* 主图区（含左右箭头 + 页码） */
.gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: #efedea;
}
.g-main-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .3s ease;
}
.g-main-img.g-active { opacity: 1; }
.g-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.88);
  color: var(--ink);
  font-size: 24px; line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  transition: background .2s, transform .2s, opacity .2s;
  z-index: 2;
  padding: 0 0 2px 0;
  font-family: inherit;
}
.g-arrow:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.g-arrow:disabled { opacity: .35; cursor: not-allowed; }
.g-prev { left: 12px; }
.g-next { right: 12px; }
.g-count {
  position: absolute;
  right: 12px; bottom: 12px;
  padding: 4px 12px;
  background: rgba(31,29,25,.72); color: #fff;
  border-radius: 999px; font-size: 12px;
  z-index: 2;
}
.gallery-main:hover .g-arrow { opacity: 1; }

/* 缩略图区（包裹左右箭头 + 横向滚动） */
.gallery-thumbs-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-top: 14px;
}
.g-thumb-arrow {
  flex: 0 0 32px;
  align-self: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  font-size: 20px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background .2s, border-color .2s, color .2s, opacity .2s;
  font-family: inherit;
}
.g-thumb-arrow:hover { background: var(--bg); border-color: var(--ink); }
.g-thumb-arrow:disabled { opacity: .3; cursor: not-allowed; background: transparent; }

.gallery-thumbs {
  flex: 1 1 auto;
  /* min-width:0 —— 防止缩略图内容把 flex 容器撑破导致页面横向溢出 */
  min-width: 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 2px 0 6px;
  scrollbar-width: thin;
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: #cfc9c0; border-radius: 2px; }
.gallery-thumbs::-webkit-scrollbar-track { background: transparent; }
.g-thumb {
  flex: 0 0 88px;
  width: 88px; height: 88px;
  border-radius: 8px; overflow: hidden;
  border: 2px solid transparent;
  padding: 0; cursor: pointer;
  background: #efedea;
  transition: border-color .2s;
  scroll-snap-align: start;
}
.g-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-thumb:hover { border-color: var(--line); }
.g-thumb.g-on { border-color: var(--ink); }

/* 右侧信息 */
.show-title {
  font-size: clamp(17px, 2.4vw, 25px);
  line-height: 1.3;
}
.show-intro {
  margin-top: 16px;
  font-size: 15px; color: #555; line-height: 1.7;
}
.show-specs {
  margin-top: 26px;
  border-top: 1px solid var(--line);
}
.show-specs > div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.show-specs dt { color: #999; }
.show-specs dd { color: var(--ink); line-height: 1.6; }

.show-actions {
  margin-top: 30px;
  display: flex; flex-wrap: wrap; gap: 12px;
}
.show-btn-quote {
  background: var(--ink); color: #fff !important;
  padding: 14px 36px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: background .2s, transform .2s;
}
.show-btn-quote:hover { background: var(--ink-2); transform: translateY(-2px); }
.show-btn-wa, .show-btn-mail {
  padding: 13px 26px; border-radius: 999px;
  border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink) !important;
  transition: border-color .2s, background .2s;
}
.show-btn-wa:hover, .show-btn-mail:hover { border-color: var(--ink); background: var(--bg); }

.show-trust {
  margin-top: 28px;
  display: flex; flex-wrap: wrap; gap: 10px 22px;
  font-size: 13px; color: #666;
  list-style: none;
}
.show-trust li { display: flex; align-items: center; gap: 7px; }
.show-trust li::before {
  content: "✓"; color: var(--ink); font-weight: 700;
}

/* Description + Specifications：上移到右栏，紧接 trust 下方 */
.show-info-desc {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.show-info-desc .show-sec-title { font-size: 18px; margin-bottom: 18px; padding-left: 12px; }
.show-info-desc .show-rich {
  background: var(--bg);
  padding: 22px 26px;
}
.show-info-desc .show-rich:first-of-type { border-radius: var(--radius); }
.show-info-desc .accordion { margin-top: 0; }

/* ---------- 3. 区块通用（原 show-body 已移除双栏与右栏联动图集） ---------- */
.show-body { display: none; }  /* 空区，未来扩展时可启用 */
.show-sec-title {
  font-size: 18px; margin-bottom: 22px;
  padding-left: 14px;
  border-left: 2px solid var(--ink);
}
.show-content .show-sec-title + .show-sec-title,
.show-rich + .show-sec-title { margin-top: 48px; }
.show-rich {
  background: var(--surface); border-radius: var(--radius);
  padding: 28px 32px;
  font-size: 15px; line-height: 1.8; color: #444;
}
.show-rich img { max-width: 100%; height: auto; border-radius: 8px; }
.show-rich p { margin: 0 0 14px; }
.show-rich h2, .show-rich h3 { margin: 20px 0 12px; }
.show-rich table { width: 100%; border-collapse: collapse; }
.show-rich td, .show-rich th { border: 1px solid var(--line); padding: 8px 12px; }

/* 折叠面板（details/summary 原生无障碍） */
.accordion { display: flex; flex-direction: column; gap: 12px; }
.acc {
  background: var(--surface); border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
}
.acc summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  font-size: 16px; font-weight: 500; color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background .2s;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary:hover { background: var(--bg); }
/* 折叠图标：+ / -（open 时变 -，对应设计稿"材质规格默认展开为减号"） */
.acc-icon {
  position: relative; flex: none;
  width: 18px; height: 18px;
}
.acc-icon::before, .acc-icon::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  background: var(--ink);
  transition: transform .25s ease, opacity .25s ease;
}
.acc-icon::before { width: 16px; height: 2px; transform: translate(-50%, -50%); }
.acc-icon::after { width: 2px; height: 16px; transform: translate(-50%, -50%); }
.acc[open] .acc-icon::after { opacity: 0; transform: translate(-50%, -50%) rotate(90deg); }
.acc-body {
  padding: 0 24px 20px;
  font-size: 14px; line-height: 1.8; color: #555;
  border-top: 1px solid var(--line);
}
.acc-body p { margin: 16px 0 0; }

/* 折叠面板内图集网格：一行 3 个，平均平铺 */
.acc-body .size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 18px;
}
.acc-body .size-item { text-align: center; }
.acc-body .size-item .size-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #f5f0ec;
  border-radius: 6px;
  margin-bottom: 10px;
}
.acc-body .size-item .size-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.acc-body .size-item span {
  font-size: 13px; color: #555;
  line-height: 1.4;
}
@media (max-width: 640px) {
  .acc-body .size-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}

/* ---------- 4. Similar Items ---------- */
.show-like { background: var(--surface); padding: 64px 0; }
.like-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 30px 28px;
}
.like-empty {
  grid-column: 1 / -1; text-align: center;
  color: #999; padding: 30px 0;
}
/* Similar Items 分页（对齐列表页 pagination 样式） */
.pagination {
  display: flex; justify-content: center;
  margin-top: 48px;
}
.pagination ul {
  display: flex; align-items: center; gap: 8px;
  list-style: none;
}
.pagination li { display: flex; }
.pagination a,
.pagination li > span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 10px;
  border-radius: 8px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 14px; color: var(--ink);
  transition: background .2s, color .2s, border-color .2s;
}
.pagination a:hover { border-color: var(--ink); }
.pagination li.current a,
.pagination li.active a,
.pagination li > span {
  background: var(--ink); color: #fff; border-color: var(--ink);
  font-weight: 600;
}
/* 复用列表页产品卡样式 */
.p-item .p-ph {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 1 / 1; background: #efedea;
}
.p-item .p-ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.p-item:hover .p-ph img { transform: scale(1.06); }
.p-nopic {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #999; font-size: 14px;
}
.p-item h3 { font-size: 15px; margin: 14px 0 0; text-align: center; }
.p-item a:hover h3 { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- 5. 深色 CTA 带（与列表页一致） ---------- */
.list-cta { background: var(--ink); }
.list-cta-inner { max-width: 1158px; margin: 0 auto; padding: 56px 24px; text-align: center; }
.list-cta h2 { color: #fff; font-size: clamp(22px, 2.4vw, 32px); letter-spacing: 1px; }
.list-cta p { color: rgba(255,255,255,.75); font-size: 15px; margin: 14px 0 28px; }
.btn-light {
  display: inline-block;
  background: #fff; color: var(--ink) !important;
  padding: 14px 40px; border-radius: 999px;
  font-weight: 600; font-size: 15px;
  transition: transform .2s, box-shadow .2s;
}
.btn-light:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }

/* ---------- 滚动入场 ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .show-head-grid { grid-template-columns: minmax(0, 480px) minmax(0, 1fr); gap: 36px; }
  .like-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .show-head-grid { grid-template-columns: 1fr; }
  .show-head { padding: 28px 0 48px; }
  /* 单列布局下取消左侧图集吸顶，避免滚动时遮挡内容 */
  .show-head-grid .gallery { position: static; }
  /* 窄屏主图区简化：隐藏箭头，缩略图改单行自动缩放（最多 9 张） */
  .g-arrow, .g-thumb-arrow { display: none; }
  .gallery-thumbs {
    flex-wrap: nowrap;
    overflow-x: hidden;
    gap: 8px;
    justify-content: flex-start;
    padding: 4px 0 0;
  }
  .g-thumb {
    flex: 1 1 0;
    min-width: 0;
    width: auto; height: auto;
    aspect-ratio: 1 / 1;
  }
  /* 超过 9 张时隐藏多余缩略图 */
  .g-thumb:nth-child(n+10) { display: none; }
  .g-count { display: none; }
  /* 底部推荐：平板 2 列 */
  .like-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
}
@media (max-width: 640px) {
  .show-head { padding: 24px 0 40px; }
  /* 缩略图单行自动缩放（同 900px 规则） */
  .gallery-thumbs { gap: 6px; }
  .g-thumb { flex: 1 1 0; }
  .show-specs > div { grid-template-columns: 96px 1fr; }
  .show-info-desc { margin-top: 28px; padding-top: 24px; }
  .show-info-desc .show-rich { padding: 18px 20px; }
  .show-crumb .cur { max-width: 180px; }
  .like-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
  .list-cta-inner { padding: 44px 18px; }

  /* 窄屏收紧：标题 / 按钮 / 折叠面板间距 */
  .show-title { font-size: 22px; }
  .show-info-desc .show-sec-title { font-size: 18px; padding-left: 10px; }
  .show-actions { gap: 10px; }
  .show-btn-quote, .show-btn-wa, .show-btn-mail { width: 100%; text-align: center; justify-content: center; }
  .acc summary { padding: 15px 18px; font-size: 15px; }
  .acc-body { padding: 0 18px 18px; }
  /* 窄屏容器留白 / 面包屑换行 */
  .show-container { padding: 0 16px; }
  .show-crumb ol { gap: 4px 8px; font-size: 12.5px; }
}
@media (max-width: 480px) {
  /* 小屏手机：底部推荐单列，图片完整展示 */
  .like-grid { grid-template-columns: 1fr; gap: 24px 0; max-width: 340px; margin: 0 auto; }
  .like-grid .p-item .p-ph { aspect-ratio: 4 / 3; }
  /* 缩略图保持单行自动缩放（900px 规则已生效） */
  .gallery-thumbs { gap: 5px; }
  .g-thumb { flex: 1 1 0; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .g-main-img, .reveal, .p-item .p-ph img { transition: none; }
  .gallery-thumbs { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}
