/* ==========================================================================
   产品中心 products.css
   ========================================================================== */

/* Banner */
.products-banner {
  position: relative;
  width: 100%;
  height: 280px;
  overflow: hidden;
}

.products-banner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.products-banner__mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.7),
    rgba(255, 255, 255, 0.4),
    transparent
  );
}

.products-banner__inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 80px;
}

.products-banner__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 16px;
}

.products-banner__title {
  font-size: 64px;
  font-weight: 300;
  color: var(--foreground);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.products-banner__desc {
  font-size: 18px;
  color: var(--muted-foreground);
  max-width: 36rem;
  font-weight: 300;
  line-height: 1.7;
}

/* 轮播 */
.product-carousel {
  position: relative;
  width: 100%;
  padding: 10px 80px;
}

.carousel-frame {
  position: relative;
  overflow: hidden;
  background-color: hsl(30 20% 97%);
  border: 1px solid var(--border);
  cursor: pointer;
}

.carousel-stage {
  position: relative;
  aspect-ratio: 16 / 9;
}

.carousel-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 0;
  transition: opacity 0.7s ease-in-out;
}

.carousel-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 信息层 */
.carousel-info {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  pointer-events: none;
}

.carousel-info__text {
  max-width: 28rem;
  pointer-events: auto;
}

.carousel-info__title {
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.carousel-info__sub {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.carousel-explore {
  pointer-events: auto;
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: 0;
  padding: 12px 32px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: opacity 0.2s ease;
}

.carousel-explore:hover {
  opacity: 0.9;
}

/* 底部渐变 */
.carousel-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.6),
    rgba(0, 0, 0, 0.3),
    transparent
  );
  pointer-events: none;
}

/* 切换按钮（CSS 箭头） */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 48px;
  height: 48px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s ease;
}

.carousel-arrow:hover {
  background-color: #fff;
}

.carousel-arrow.prev {
  left: 16px;
}

.carousel-arrow.next {
  right: 16px;
}

.carousel-arrow::before {
  content: '';
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--foreground);
  border-right: 2px solid var(--foreground);
}

.carousel-arrow.prev::before {
  transform: rotate(-135deg);
  margin-left: 4px;
}

.carousel-arrow.next::before {
  transform: rotate(45deg);
  margin-right: 4px;
}

/* 指示器 */
.carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  gap: 8px;
  align-items: center;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.6);
  border: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot:hover {
  background-color: rgba(255, 255, 255, 0.85);
}

.carousel-dot.is-active {
  background-color: var(--primary);
  width: 32px;
}

/* 响应式 */
@media (max-width: 768px) {
  .products-banner {
    height: 220px;
  }

  .products-banner__inner {
    padding: 0 32px;
  }

  .products-banner__title {
    font-size: 40px;
  }

  .products-banner__desc {
    font-size: 15px;
  }

  .product-carousel {
    padding: 10px 24px;
  }

  .carousel-stage {
    aspect-ratio: 4 / 3;
  }

  .carousel-info {
    padding: 0 24px;
  }

  .carousel-info__title {
    font-size: 20px;
  }

  .carousel-info__sub {
    font-size: 14px;
  }

  .carousel-explore {
    padding: 10px 20px;
    font-size: 14px;
  }

  .carousel-arrow {
    width: 40px;
    height: 40px;
  }

  .carousel-dot {
    width: 8px;
    height: 8px;
  }

  .carousel-dot.is-active {
    width: 24px;
  }
}
