/* 产品与解决方案列表页样式 */

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  background: #f8f9fb;
  color: #333;
  overflow-x: hidden;
}

/* 主体内容区域 */
.products-page {
  max-width: 1200px;
  margin: 20px auto 40px;
  padding: 0 16px 60px;
  width: 100%;
  min-width: 320px;
  box-sizing: border-box;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 0 20px;
  font-size: 14px;
  color: #999;
}

.breadcrumb a {
  color: #666;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: #1e76b9;
}

.breadcrumb svg {
  vertical-align: middle;
  margin-right: 4px;
  margin-bottom: 2px;
}

.breadcrumb .separator {
  margin: 0 8px;
}

.breadcrumb .current {
  color: #333;
  font-weight: 500;
}

.products-wrapper {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  width: 100%;
  max-width: 100%;
  min-height: 400px;
}

/* 左侧菜单 */
.products-sidebar {
  flex-shrink: 0;
  width: 220px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 90px;
}

.sidebar-title {
  padding: 20px 24px;
  background: #1e76b9;
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 1px;
}

.sidebar-menu {
  padding: 8px 0;
}

.menu-item {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  text-align: left;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.menu-item:hover {
  background: #f0f7ff;
  color: #1e76b9;
}

.menu-item.active {
  background: #f0f7ff;
  border-left-color: #1e76b9;
  color: #1e76b9;
  font-weight: 600;
}

/* 右侧产品列表 */
.products-content {
  flex: 1;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  min-height: 400px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
  /* 固定两行高度，避免切换产品时下方元素跳动 */
  min-height: 696px;
  align-content: start;
}

/* 加载状态 */
.products-grid.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  gap: 10px;
  background: #fafbfc;
  border-radius: 12px;
}

.products-grid .loading-text {
  color: #999;
  font-size: 14px;
}

.products-grid .loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #e0e0e0;
  border-top-color: #1e76b9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 产品卡片样式（与首页一致） */
.product-card {
  border: 1px solid #e7eef5;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  max-width: 100%;
  box-sizing: border-box;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}

.product-card .card-image {
  width: 100%;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #fafbfc;
}

.product-card .card-image::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  background: #1e76b9;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  opacity: 0.9;
}

.product-card:hover .card-image::after {
  transform: scaleX(1);
}

.product-card .card-image img {
  max-width: 90%;
  max-height: 240px;
  object-fit: contain;
}

.product-card .card-footer {
  padding: 18px;
  text-align: center;
  font-size: 18px;
  color: #333;
  font-weight: 500;
}

/* 分页样式 */
.pagination-container {
  margin-top: 32px;
}

.pagination {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 40px;
  height: 40px;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  color: #333;
  font-size: 15px;
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: #1e76b9;
  color: #1e76b9;
  background: #f0f7ff;
}

.page-btn.active {
  background: #1e76b9;
  color: #fff;
  border-color: #1e76b9;
}

.page-btn.active:hover {
  background: #1565a8;
  color: #fff;
  border-color: #1565a8;
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 无产品提示 */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 16px;
  background: #fff;
  border-radius: 12px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .products-page {
    margin-top: 16px;
    padding-bottom: 48px;
  }

  .products-wrapper {
    gap: 24px;
  }
  
  .products-sidebar {
    width: 200px;
  }

  .product-card .card-image {
    height: 248px;
  }

  .product-card .card-image img {
    max-height: 208px;
  }

  /* 1024px 下卡片高度：248px + 56px = 304px，两行 + gap(24px) = 632px */
  .products-grid {
    min-height: 632px;
    align-content: start;
  }
}

@media (max-width: 900px) {
  .products-page {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .products-wrapper {
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
  }

  .breadcrumb {
    padding-bottom: 12px;
    font-size: 13px;
  }
  
  .products-sidebar {
    width: 100%;
    max-width: 100%;
    position: static;
    border-radius: 16px;
    box-sizing: border-box;
  }

  .sidebar-title {
    padding: 14px 18px;
    font-size: 16px;
  }
  
  .sidebar-menu {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    gap: 8px;
    scrollbar-width: none;
  }

  .sidebar-menu::-webkit-scrollbar {
    display: none;
  }
  
  .menu-item {
    flex: 0 0 auto;
    min-width: auto;
    padding: 10px 16px;
    text-align: center;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 14px;
  }
  
  .menu-item.active {
    border-left-color: transparent;
    border-bottom-color: #1e76b9;
    background: #1e76b9;
    color: #fff;
  }
  
  .menu-item:hover {
    background: #f0f7ff;
    color: #1e76b9;
  }
  
  .menu-item.active:hover {
    background: #1e76b9;
    color: #fff;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 100%;
    /* 900px 下两列布局，卡片高度 248px + 56px = 304px，两行 + gap(20px) = 628px */
    min-height: 628px;
    align-content: start;
  }

  .pagination-container {
    margin-top: 28px;
  }
}

@media (max-width: 768px) {
  .products-page {
    margin-top: 12px;
    padding: 0 12px 36px;
  }

  .breadcrumb {
    padding: 0 0 16px;
  }

  .sidebar-title {
    padding: 16px 18px;
    font-size: 16px;
    letter-spacing: 0.5px;
  }

  .sidebar-menu {
    padding: 10px;
    gap: 10px;
  }

  .menu-item {
    min-width: auto;
    padding: 10px 14px;
    font-size: 14px;
  }
  
  .products-grid {
    gap: 16px;
    /* 768px 下卡片高度：220px + 46px = 266px，两行 + gap(16px) = 548px */
    min-height: 548px;
    align-content: start;
  }

  .product-card {
    border-radius: 10px;
  }

  .product-card .card-image {
    height: 220px;
  }

  .product-card .card-footer {
    padding: 14px 12px 16px;
    font-size: 16px;
  }

  .page-btn {
    min-width: 36px;
    height: 36px;
    padding: 6px 10px;
    font-size: 14px;
  }

  .no-products {
    padding: 40px 16px;
    font-size: 15px;
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    justify-items: center;
    /* 600px 下单列布局，卡片高度 220px + 46px = 266px，两行 + gap(16px) = 548px */
    min-height: 548px;
    align-content: start;
  }

  .product-card {
    width: 100%;
    max-width: 320px;
  }

  .product-card .card-image img {
    max-height: 188px;
  }
}

@media (max-width: 420px) {
  .products-page {
    padding: 0 10px 32px;
  }

  .products-wrapper {
    gap: 18px;
  }

  .products-sidebar {
    border-radius: 14px;
  }

  .sidebar-title {
    padding: 14px 16px;
    font-size: 15px;
  }

  .sidebar-menu {
    padding: 8px;
    gap: 8px;
  }

  .menu-item {
    min-width: auto;
    padding: 10px 14px;
    font-size: 13px;
  }

  .products-grid {
    gap: 14px;
    width: 100%;
    max-width: 100%;
    justify-items: center;
    /* 420px 下卡片高度：192px + 40px = 232px，两行 + gap(14px) = 478px */
    min-height: 478px;
    align-content: start;
  }

  .product-card {
    max-width: 280px;
  }

  .product-card .card-image {
    height: 192px;
  }

  .product-card .card-image img {
    max-height: 164px;
  }

  .product-card .card-footer {
    padding: 12px 10px 14px;
    font-size: 15px;
  }

  .pagination {
    gap: 6px;
    justify-content: flex-start;
  }

  .page-btn {
    min-width: 34px;
    height: 34px;
    padding: 6px 9px;
    border-radius: 7px;
    font-size: 13px;
  }
}
