/* ==========================================================================
  产品中心区块 — 样式
  与“公司介绍”区块同一套设计语言：
   - 区块主色：亮绿 #2e9c27（Sodick 绿系一档）
   - 1px 细线框、克制的悬停交互
   - 卡片顶部展示产品图片（object-fit: cover），下方为图标与标题
   - 桌面 4 列 × 2 行，移动端 2 列
   ========================================================================== */

.products {
  /* 设计变量：作用域限定在本区块内 */
  --ci-primary: #2e9c27;              /* 主色（亮绿） */
  --ci-ink: #161a17;                  /* 标题 */
  --ci-mute: #8b908b;                 /* 辅助文字 */
  --ci-line: #e5e5df;                 /* 1px 分割线 */
  --ci-font: "Inter", "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC",
    "Source Han Sans SC", "Microsoft YaHei", sans-serif;

  box-sizing: border-box;
  font-family: var(--ci-font);
  line-height: 1.7;
  color: var(--ci-ink);
}

.products *,
.products *::before,
.products *::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   1. 区块标题（与公司介绍区块一致：英文眉标 + 主色短横线 + 中文标题）
   -------------------------------------------------------------------------- */
.products__inner {
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 64px);
}

.products__head {
  max-width: 600px;
  margin-inline: auto;
  text-align: center;
  border-top: 1px solid var(--ci-line);
  padding-top: clamp(28px, 3.4vw, 46px);
}

.products__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ci-primary);
}

.products__eyebrow-line {
  width: 60px;
  height: 1px;
  background: var(--ci-primary);
}

.products__title {
  margin-top: 0;
  font-size: clamp(30px, 3.4vw, 35px);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--ci-ink);
}

/* --------------------------------------------------------------------------
   2. 产品卡片网格（桌面 4 列，卡片为白色大卡 + 悬停交互）
   -------------------------------------------------------------------------- */
.products__grid {
  list-style: none;
  margin: clamp(48px, 6vw, 72px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.products__item {
  margin: 0;
  min-width: 0;
}

.products__card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--ci-line);
  border-radius: 0;
  background: #fff;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.products__card:hover,
.products__card:focus-visible {
  border-color: rgba(46, 156, 39, 0.4);
  transform: translateY(-8px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.16);
  outline: none;
}

/* 顶部图片：正方形展示 */
.products__media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}

.products__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease-out;
}

.products__card:hover .products__img,
.products__card:focus-visible .products__img {
  transform: scale(1.05);
}

/* 卡片信息区：底部居中标题 */
.products__body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
}

/* 标题文字 */
.products__text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.products__name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ci-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products__card:hover .products__name,
.products__card:focus-visible .products__name {
  color: var(--ci-primary);
}

/* --------------------------------------------------------------------------
   3. 滚动入场动画（复用公司介绍区块的 [data-reveal] 机制）
   卡片依次淡入 + 上移 20px，间隔 60ms
   -------------------------------------------------------------------------- */
html.js .products [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease-out, transform 0.9s ease-out;
  transition-delay: var(--ci-delay, 0ms);
}

html.js .products [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

.products__item:nth-child(2) { --ci-delay: 60ms; }
.products__item:nth-child(3) { --ci-delay: 120ms; }
.products__item:nth-child(4) { --ci-delay: 180ms; }
.products__item:nth-child(5) { --ci-delay: 240ms; }
.products__item:nth-child(6) { --ci-delay: 300ms; }
.products__item:nth-child(7) { --ci-delay: 360ms; }
.products__item:nth-child(8) { --ci-delay: 420ms; }

/* --------------------------------------------------------------------------
   4. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .products__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .products__body {
    padding: 12px 14px;
  }

  .products__name {
    font-size: 16px;
  }
}

@media (max-width: 575.98px) {
  .products__grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   5. 无障碍：尊重系统“减弱动态效果”设置
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html.js .products [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
