/* 热卖产品列表 / 详情（max-width: 1440px，自适应） */
.hp-page {
  background: #f5f7fb;
}

.hp-container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: clamp(1rem, 4vw, 2.5rem);
  padding-right: clamp(1rem, 4vw, 2.5rem);
}

/* ---------- 列表：右侧主区（搜索 + 产品网格） ---------- */
.hp-list-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  width: 100%;
}

.hp-search-form {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0;
  width: 100%;
  max-width: 100%;
  margin: 0 0 2rem;
  padding: 4px;
  box-sizing: border-box;
  border: 1px solid #c5cdd8;
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}

.hp-search-input-wrap {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  padding: 0 1rem;
  min-height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.hp-search-icon {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.hp-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.hp-search-input::placeholder {
  color: #9ca3af;
}

.hp-search-btn {
  flex: 0 0 auto;
  min-width: clamp(110px, 14vw, 140px);
  padding: 0 1.75rem;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  align-self: stretch;
}

.hp-search-btn:hover {
  opacity: 0.9;
}

/* ---------- 列表：侧栏 + 网格 ---------- */
.hp-list-section {
  padding: 4rem 0 4rem;
}

.hp-list-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}

.hp-sidebar {
  background: #fff;
  border-radius: var(--radius-card);
  border: 1px solid #e8ecf2;
  overflow: hidden;
}

.hp-sidebar-group + .hp-sidebar-group {
  border-top: 1px solid #e8ecf2;
}

.hp-sidebar-title {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--color-primary);
  background: #f0f3fa;
}

.hp-sidebar-nav {
  list-style: none;
  margin: 0;
  /*padding: 0.5rem 0;*/
}

.hp-sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  font-size: 0.875rem;
  color: var(--color-text);
  transition: background 0.15s, color 0.15s;
}

.hp-sidebar-link:hover {
  background: #f5f7fb;
  color: var(--color-accent);
}

.hp-sidebar-link.is-active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.hp-sidebar-link .hp-arrow {
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  opacity: 0.7;
}

.hp-sidebar-link.is-active .hp-arrow {
  opacity: 1;
}

.hp-list-main .hp-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.hp-pagination {
  margin-top: 2rem;
  padding-bottom: 0;
}

.hp-product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e8ecf2;
  border-radius: var(--radius-card);
  padding: 1.25rem 1rem 1rem;
  text-align: center;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.hp-product-card:hover {
  border-color: #c5d0e8;
  box-shadow: var(--shadow-card);
}

.hp-product-structure {
  display: flex;
  align-items: center;
  justify-content: center;
  /* min-height: 140px; */
  margin-bottom: 1rem;
  /* padding: 0.5rem; */
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hp-product-structure img {
  /* max-height: 130px; */
  /* width: 100%; */
  object-fit: contain;
  max-height: 100%;
}

.hp-product-name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.3;
}

.hp-product-cas {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

/* ---------- 详情 ---------- */
.hp-detail-section {
  padding: calc(4rem + var(--header-height)) 0 4rem;
  background: #fff;
}

.hp-detail-header {
  margin-bottom: 2rem;
}

.hp-detail-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.2;
}

.hp-detail-meta {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  color: var(--color-text-secondary);
}

.hp-detail-meta strong {
  color: var(--color-text);
  font-weight: 600;
}

.hp-detail-desc {
  margin: 0.75rem 0 0;
  font-size: 1rem;
  color: var(--color-text);
  line-height: 1.6;
}

.hp-detail-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.hp-detail-structure {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  padding: 1.5rem;
  background: #fafbfc;
  /* border: 1px solid #e8ecf2; */
  border-radius: var(--radius-card);
}

.hp-detail-structure img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.hp-specs-title {
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0d9488;
  border-bottom: 2px solid #0d9488;
  display: inline-block;
}

.hp-purity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.hp-purity-arrow {
  color: var(--color-accent);
  font-weight: 700;
}

.hp-spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid #e8ecf2;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.hp-spec-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e8ecf2;
  border-right: 1px solid #e8ecf2;
}

.hp-spec-item:nth-child(2n) {
  border-right: 0;
}

.hp-spec-item:nth-last-child(-n+2) {
  border-bottom: 0;
}

.hp-spec-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.hp-spec-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  word-break: break-word;
}

.hp-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.75rem;
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  border: none;
}

.hp-btn--primary {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: #fff;
}

.hp-btn--outline {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.hp-btn:hover {
  opacity: 0.9;
}

.hp-btn-icon {
  font-size: 1.125rem;
  line-height: 1;
}

/* ---------- 详情：相关产品推荐 ---------- */
.hp-related-section {
  padding: 2.5rem 0 4rem;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f9 100%);
  border-top: 1px solid #e8ecf2;
}

.hp-related-title {
  margin: 0 0 1.75rem;
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.3;
}

.hp-related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  width: 100%;
}

.hp-related-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 1.25rem 1rem 1rem;
  background: #fff;
  border: 1px solid #e3eaf5;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(45, 66, 153, 0.08);
  text-align: center;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}

.hp-related-card:hover {
  border-color: #b8c8e8;
  box-shadow: 0 8px 28px rgba(45, 66, 153, 0.14);
  transform: translateY(-2px);
}

.hp-related-structure {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 0.5rem 0.25rem 1rem;
}

.hp-related-structure img {
  max-width: 100%;
  max-height: 110px;
  object-fit: contain;
}

.hp-related-divider {
  height: 1px;
  margin: 0 0 1rem;
  background: #e5e9f0;
}

.hp-related-name {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.3;
}

.hp-related-cas {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .hp-list-layout {
    grid-template-columns: 220px 1fr;
    gap: 1.25rem;
  }

  .hp-list-main .hp-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hp-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .hp-list-section {
    padding: 1.25rem 0 3rem;
  }

  .hp-list-layout {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  /* 手机端：分类在上，搜索+产品在下 */
  .hp-sidebar {
    order: 1;
    width: 100%;
  }

  .hp-list-main {
    order: 2;
    width: 100%;
  }

  .hp-search-form {
    flex-direction: column;
    max-width: none;
    margin-bottom: 1.25rem;
    padding: 0.5rem;
    border-radius: var(--radius-card);
  }

  .hp-search-input-wrap {
    min-height: 44px;
  }

  .hp-search-btn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
  }

  .hp-list-main .hp-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
  }

  .hp-product-card {
    padding: 1rem 0.75rem 0.875rem;
  }

  .hp-product-structure {
    margin-bottom: 0.75rem;
  }

  .hp-product-structure img {
    /* max-height: 100px; */
    /* width: auto; */
    max-width: 100%;
    margin: 0 auto;
  }

  .hp-product-name {
    font-size: 0.9375rem;
    word-break: break-word;
  }

  .hp-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
  }

  .hp-related-card {
    padding: 1rem 0.75rem 0.875rem;
  }

  .hp-related-name {
    font-size: 0.9375rem;
    word-break: break-word;
  }

  .hp-detail-body {
    grid-template-columns: 1fr;
  }

  .hp-spec-grid {
    grid-template-columns: 1fr;
  }

  .hp-spec-item {
    border-right: 0;
  }

  .hp-spec-item:nth-last-child(-n+2) {
    border-bottom: 1px solid #e8ecf2;
  }

  .hp-spec-item:last-child {
    border-bottom: 0;
  }

  .hp-detail-actions {
    flex-direction: column;
  }

  .hp-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hp-list-main .hp-product-grid {
    grid-template-columns: 1fr;
  }

  .hp-related-grid {
    grid-template-columns: 1fr;
  }
}

.hp-empty-tip {
  grid-column: 1 / -1;
  padding: 48px 16px;
  text-align: center;
  color: #64748b;
  font-size: 16px;
}
