/**
 * 首页拼团模块样式
 * 参考腾讯云风格，适配Hezi模板
 * @author Custom Development
 */

/* ========== 拼团模块容器 ========== */
.Heziyun-groupBuy {
  background: #f8f9fa;
  position: relative;
  overflow: hidden;
}

.Heziyun-groupBuy .Heziyun-commodity-title {
  margin-bottom: 40px;
}

/* ========== 拼团列表容器 ========== */
.Heziyun-groupBuy-list {
  min-height: 300px;
}

/* 加载状态 */
.groupbuy-loading {
  text-align: center;
  padding: 80px 20px;
  background: transparent;
}

.groupbuy-loading .loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0052d9;
  border-radius: 50%;
  animation: groupbuy-spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes groupbuy-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.groupbuy-loading p {
  font-size: 14px;
  color: #8c8c8c;
  margin: 0;
}

/* 空状态 */
.groupbuy-empty {
  text-align: center;
  padding: 80px 20px;
  background: #fff;
  border-radius: 8px;
  margin: 20px 0;
}

.groupbuy-empty p {
  font-size: 16px;
  color: #909399;
  margin: 0;
}

/* ========== 网格布局 - 3列 ========== */
.groupbuy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

/* ========== 拼团卡片 ========== */
.groupbuy-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e1e6ef;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
}

.groupbuy-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-4px);
  border-color: #d0d5de;
}

/* 卡片内容区 */
.groupbuy-card-content {
  padding: 24px;
  background: linear-gradient(135deg, #fff 0%, #f8faff 100%);
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 装饰性圆形背景 */
.groupbuy-card-content::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, rgba(0, 82, 217, 0.08) 0%, rgba(0, 82, 217, 0.02) 100%);
  border-radius: 50%;
  pointer-events: none;
}

/* 产品头部 */
.groupbuy-header {
  margin-bottom: 16px;
}

.groupbuy-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 6px 0;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.groupbuy-title-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.groupbuy-subtitle {
  font-size: 12px;
  color: #97a3b7;
  margin: 0;
  line-height: 20px;
}

/* 配置描述 - 蓝色高亮 */
.groupbuy-config {
  font-size: 16px;
  font-weight: 600;
  color: #0052d9;
  line-height: 1.5;
  margin-bottom: 16px;
  /* 限制最多2行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 48px;
  word-break: break-all;
  cursor: help;
}

/* 时间信息区 */
.groupbuy-time-info {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: auto;
  padding-top: 12px;
}

.groupbuy-time-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  line-height: 20px;
}

.groupbuy-time-label {
  color: #97a3b7;
  background: #f5f7fa;
  padding: 2px 8px;
  border-radius: 2px;
  margin-right: 8px;
  white-space: nowrap;
}

.groupbuy-time-value {
  color: #181818;
  font-weight: 500;
}

.groupbuy-time-value.danger {
  color: #f64041;
}

/* ========== 卡片底部 ========== */
.groupbuy-card-footer {
  padding: 0;
  background: linear-gradient(86deg, #f7faff 5%, #f5f9ff 71%);
  border-top: 1px solid rgba(0, 82, 217, 0.1);
}

.groupbuy-footer-inner {
  padding: 16px 20px;
}

/* 标签和价格行 */
.groupbuy-tag-price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

/* 标签组 */
.groupbuy-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-height: 22px;
}

.groupbuy-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  line-height: 18px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}

.groupbuy-tag-discount {
  background: linear-gradient(90deg, #ff5800 0%, #ff7a00 100%);
  color: #fff;
  border: none;
}

.groupbuy-tag-normal {
  background: #fff;
  border: 1px solid #d6dbe3;
  color: #4b5b76;
}

/* 价格区域 */
.groupbuy-price-section {
  text-align: right;
  flex-shrink: 0;
}

.groupbuy-price {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  margin-bottom: 4px;
}

.groupbuy-price-label {
  font-size: 12px;
  color: #97a3b7;
  margin-right: 4px;
}

.groupbuy-price-integer {
  font-size: 28px;
  font-weight: 700;
  color: #f64041;
  line-height: 1;
}

.groupbuy-price-decimal {
  font-size: 16px;
  font-weight: 700;
  color: #f64041;
}

.groupbuy-price-unit {
  font-size: 12px;
  color: #f64041;
  margin-left: 2px;
}

.groupbuy-price-cycle {
  font-size: 11px;
  color: #97a3b7;
  margin-left: 4px;
}

.groupbuy-original-price {
  font-size: 12px;
  color: #97a3b7;
  text-align: right;
}

.groupbuy-original-price .value {
  text-decoration: line-through;
}

/* 进度信息 */
.groupbuy-progress-info {
  padding: 12px 20px;
  border-top: 1px solid rgba(0, 82, 217, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.groupbuy-progress-text {
  font-size: 12px;
  color: #97a3b7;
  flex: 1;
}

.groupbuy-progress-text.highlight {
  color: #0052d9;
  font-weight: 500;
}

/* 操作按钮 */
.groupbuy-btn {
  background: linear-gradient(90deg, #ff7e57 0%, #ff5825 100%);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 22px;
  flex-shrink: 0;
}

.groupbuy-btn:hover {
  background: linear-gradient(90deg, #ff6d40 0%, #f6501d 100%);
  box-shadow: 0 4px 12px rgba(255, 94, 37, 0.3);
}

.groupbuy-btn:active {
  transform: scale(0.98);
}

/* ========== 查看更多 ========== */
.groupbuy-more {
  text-align: center;
  margin-top: 50px;
  padding-bottom: 20px;
}

.groupbuy-more a {
  display: inline-flex;
  align-items: center;
  padding: 14px 40px;
  background: #fff;
  border: 2px solid #0052d9;
  color: #0052d9;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  gap: 8px;
}

.groupbuy-more a:hover {
  background: #0052d9;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 82, 217, 0.3);
}

.groupbuy-more a::after {
  content: "→";
  font-size: 18px;
  transition: transform 0.3s ease;
}

.groupbuy-more a:hover::after {
  transform: translateX(4px);
}

/* ========== 响应式适配 ========== */

/* 中等屏幕 - 2列 */
@media screen and (max-width: 1200px) {
  .groupbuy-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* 小屏幕/平板 - 2列紧凑 */
@media screen and (max-width: 960px) {
  .groupbuy-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .groupbuy-card-content {
    padding: 20px;
    background-size: auto 120px;
  }

  .groupbuy-title {
    font-size: 16px;
  }

  .groupbuy-config {
    font-size: 14px;
  }
}

/* 手机端 - 1列 */
@media screen and (max-width: 768px) {
  .Heziyun-groupBuy {
    padding-left: 15px;
    padding-right: 15px;
  }

  .groupbuy-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 30px;
  }

  .groupbuy-card-content {
    padding: 16px;
    background-size: auto 100px;
  }

  .groupbuy-title {
    font-size: 16px;
    line-height: 1.3;
  }

  .groupbuy-config {
    font-size: 14px;
    line-height: 1.4;
    max-height: 40px;
  }

  .groupbuy-time-info {
    gap: 8px 12px;
  }

  .groupbuy-footer-inner {
    padding: 12px 16px;
  }

  .groupbuy-tag-price-row {
    flex-direction: column;
    gap: 10px;
  }

  .groupbuy-price-section {
    text-align: left;
  }

  .groupbuy-price {
    justify-content: flex-start;
  }

  .groupbuy-original-price {
    text-align: left;
  }

  .groupbuy-progress-info {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .groupbuy-btn {
    width: 100%;
    padding: 10px 20px;
    justify-content: center;
  }

  .groupbuy-more {
    margin-top: 40px;
  }

  .groupbuy-more a {
    padding: 12px 30px;
    font-size: 14px;
  }
}

/* 超小屏幕优化 */
@media screen and (max-width: 480px) {
  .groupbuy-price-integer {
    font-size: 24px;
  }

  .groupbuy-price-decimal {
    font-size: 14px;
  }

  .groupbuy-tag {
    font-size: 11px;
    padding: 1px 6px;
  }
}
