/* ===========================
   SCHTAF 产品分类页面样式
   =========================== */

/* 页面整体布局 */
.category-page {
  min-height: calc(100vh - 60px);
  padding-top: 109px; /* 47px (nav-top-13px) + ~62px 分类栏高度(无padding) */
}

/* ===========================
   分类图标导航栏（分类页面专用）
   =========================== */
.category-page-nav {
  position: fixed;
  top: 47px; /* 顶部导航栏底部 - 13px（原 62px - 15px = 47px） */
  left: 0;
  right: 0;
  z-index: 99;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-page-nav .product-categories-nav {
  padding: 0;
}

.category-page-nav .category-icons-row {
  display: flex;
  justify-content: space-evenly;
  flex-wrap: wrap;
  width: 100%;
  box-sizing: border-box;
}

.category-page-nav .category-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  width: 90px;
  height: 66px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-secondary);
  border-radius: 8px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.category-page-nav .category-icon-item:hover {
  background: var(--bg-gray);
  color: var(--primary);
}

.category-page-nav .category-icon-item.active {
  background: var(--primary);
  color: #fff;
}

.category-page-nav .category-icon-item.active .category-icon svg {
  stroke: #fff;
}

.category-page-nav .category-icon {
  width: 45px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-page-nav .category-icon svg {
  width: 100%;
  height: 100%;
}

.category-page-nav .category-icon-text {
  font-size: 11px;
  text-align: center;
  line-height: 1.3;
  font-weight: 500;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ===========================
   主内容区
   =========================== */
.category-main {
  width: 100%;
  min-height: calc(100vh - 109px);
}

/* ===========================
   轮播图样式
   =========================== */
.category-carousel {
  position: relative;
  height: 500px;
  overflow: hidden;
  background: var(--primary);
  margin-top: -38px; /* 向上移动 40px（累计：原 2px - 40px = -38px） */
  z-index: 1; /* 确保轮播图在分类栏下方 */
}

.carousel-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.carousel-slide.active {
  opacity: 1;
  visibility: visible;
}

.carousel-slide.flip-image .carousel-image {
  transform: scaleX(-1);
}

.carousel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.carousel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent; /* 移除深色遮罩，让图片光鲜亮丽 */
}

.carousel-content {
  position: absolute;
  bottom: 80px;
  left: 60px;
  right: 60px;
  z-index: 10;
  color: #fff;
}

.carousel-title {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
  line-height: 1.2;
}

.carousel-desc {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  color: rgba(255,255,255,0.9);
  max-width: 600px;
  line-height: 1.6;
  margin: 0;
}

/* 轮播图指示器 */
.carousel-indicators {
  position: absolute;
  bottom: 30px;
  left: 60px;
  display: flex;
  gap: 10px;
  z-index: 20;
}

.indicator {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.indicator.active {
  background: var(--accent);
  width: 60px;
}

.indicator:hover {
  background: rgba(255,255,255,0.6);
}

/* 轮播图导航按钮 */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: all 0.3s ease;
  z-index: 20;
}

.carousel-nav:hover {
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.4);
}

.carousel-nav.prev {
  left: 30px;
}

.carousel-nav.next {
  right: 30px;
}

.carousel-nav svg {
  width: 24px;
  height: 24px;
}

/* ===========================
   产品列表区域
   =========================== */
.category-products {
  padding: 60px;
  background: var(--bg-white);
}

.category-products .section-header {
  text-align: center;
  margin-bottom: 50px;
}

.category-products .section-header h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  color: var(--primary);
  margin-bottom: 16px;
}

.category-title-en {
  display: block;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
  font-family: var(--font-en);
}

.category-products .section-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* 产品网格 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 16px;
  align-items: start;
}

/* 产品卡片 */
.product-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid var(--border-light);
  text-decoration: none;
  color: inherit;
  display: block;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}

.product-card-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--bg-gray);
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center top;
  padding: 8px;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
}

.product-card-info {
  padding: 12px;
}

.product-card-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-title strong {
  color: var(--text-dark);
  font-weight: 700;
  margin-right: 6px;
}

.product-card-title-sep {
  margin: 0 6px;
  opacity: 0.4;
}

.product-card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.product-card-spec {
  font-size: 12px;
  color: var(--text-light);
  background: var(--bg-gray);
  padding: 4px 10px;
  border-radius: 12px;
}

.product-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 产品标签 */
.product-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.product-card-tag {
  font-size: 11px;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 8px;
  border-radius: 10px;
  line-height: 1.4;
}

/* ===========================
   响应式设计
   =========================== */
@media (max-width: 1200px) {
  .category-products {
    padding: 40px;
  }
  
  .carousel-content {
    left: 40px;
    right: 40px;
  }
  
  .category-page-nav .category-icon-item {
    width: 80px;
    height: 60px;
  }
  
  .category-page-nav .category-icon {
    width: 40px;
    height: 30px;
  }
}

@media (max-width: 992px) {
  .category-page {
    padding-top: 93px; /* 47px top + ~44px 分类栏(小图标无padding) + 2px 间距 */
  }
  
  .category-page-nav .category-icons-row {
    gap: 0;
  }
  
  .category-page-nav .category-icon-item {
    width: 72px;
    height: 56px;
  }
  
  .category-page-nav .category-icon {
    width: 36px;
    height: 27px;
  }
  
  .category-page-nav .category-icon-text {
    font-size: 10px;
    height: 24px;
  }
  
  .category-carousel {
    height: 400px;
  }
  
  .carousel-content {
    left: 30px;
    right: 30px;
    bottom: 60px;
  }
  
  .carousel-indicators {
    left: 30px;
  }
  
  .carousel-nav {
    width: 40px;
    height: 40px;
  }
  
  .carousel-nav.prev {
    left: 15px;
  }
  
  .carousel-nav.next {
    right: 15px;
  }
  
  .category-products {
    padding: 30px;
  }
  
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
  
  .modal-content {
    grid-template-columns: 1fr;
  }
  
  .modal-gallery {
    padding: 30px;
    min-height: 300px;
  }
  
  .modal-info {
    padding: 30px;
  }
}

@media (max-width: 768px) {
  .category-page {
    padding-top: 0;
  }
  
  /* 移动端取消分类页面导航固定定位 */
  .category-page-nav {
    position: relative;
    top: auto;
  }
  
  .category-page-nav .category-icons-row {
    gap: 0;
    padding: 0 10px;
  }
  
  .category-page-nav .category-icon-item {
    width: 64px;
    height: 52px;
  }
  
  .category-page-nav .category-icon {
    width: 32px;
    height: 24px;
  }
  
  .category-page-nav .category-icon-text {
    font-size: 10px;
    height: 22px;
  }
  
  .category-carousel {
    height: 350px;
  }
  
  .carousel-content {
    left: 20px;
    right: 20px;
    bottom: 50px;
  }
  
  .carousel-indicators {
    left: 20px;
    bottom: 20px;
  }
  
  .carousel-nav {
    display: none;
  }
  
  .category-products {
    padding: 24px;
  }
  
  .category-products .section-header {
    margin-bottom: 30px;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  
  .product-card-info {
    padding: 10px;
  }
  
  .product-card-title {
    font-size: 11px;
  }
  
  .product-card-specs {
    display: none;
  }
}

@media (max-width: 480px) {
  .category-page {
    padding-top: 0;
  }
  
  .category-page-nav .category-icons-row {
    gap: 0;
  }
  
  .category-page-nav .category-icon-item {
    width: 56px;
    height: 48px;
  }
  
  .category-page-nav .category-icon {
    width: 29px;
    height: 22px;
  }
  
  .category-page-nav .category-icon-text {
    font-size: 9px;
    height: 22px;
  }
  
  .category-carousel {
    height: 300px;
  }
  
  .products-grid {
    grid-template-columns: 1fr;
  }
  
  .carousel-title {
    font-size: 1.2rem;
  }
  
  .carousel-desc {
    font-size: 0.85rem;
  }
}

/* ===========================
   功能分类筛选和悬浮按钮
   =========================== */

/* 功能分类筛选栏 */
.feature-filter-bar {
  position: sticky;
  top: 47px;
  z-index: 98;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  padding: 12px 0;
}

.feature-filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
  padding-bottom: 4px;
}

.feature-filter-scroll::-webkit-scrollbar {
  height: 4px;
}

.feature-filter-scroll::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 2px;
}

.feature-filter-item {
  flex-shrink: 0;
  padding: 6px 14px;
  background: var(--bg-gray);
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.feature-filter-item:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.feature-filter-item.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* All Products 按钮 - 胶囊形，保持与其他图标间距一致 */
.category-page-nav .all-products-btn {
  background: var(--primary);
  color: #fff;
  border-radius: 24px;
  box-shadow: 0 2px 12px rgba(185, 28, 28, 0.25);
  height: calc(66px * 0.5);
  width: calc(90px * 1.5);
  margin-top: 20px;
}

.category-page-nav .all-products-btn:hover {
  background: var(--primary-dark, #991b1b);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(185, 28, 28, 0.35);
}

.category-page-nav .all-products-btn .category-icon svg {
  stroke: #fff;
}

.category-page-nav .all-products-btn .category-icon-text {
  color: #fff;
}

/* 响应式 - 功能分类筛选 */
@media (max-width: 768px) {
  .feature-filter-bar {
    top: 47px;
    padding: 10px 0;
  }

  .feature-filter-item {
    padding: 5px 12px;
    font-size: 12px;
  }

  .floating-all-products-btn {
    top: auto;
    bottom: 20px;
    right: 20px;
    padding: 12px 14px;
    font-size: 12px;
  }

  .floating-all-products-btn span {
    display: none;
  }

  .floating-all-products-btn svg {
    width: 22px;
    height: 22px;
  }
}
