/* ========================================
   产品展示目录页面 CSS (index-cp.html)
   ======================================== */

/* 分类标签按钮样式 */
.cp-tab-btn {
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4b5563;
  background-color: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 9999px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.cp-tab-btn:hover {
  background-color: #e5e7eb;
  color: #2563eb;
}

.cp-tab-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

/* 产品卡片样式 */
.cp-product-card {
  transition: all 0.3s ease;
}

.cp-product-card:hover {
  transform: translateY(-4px);
}

/* 产品网格容器 */
.cp-products-grid {
  transition: all 0.3s ease;
}

/* 隐藏产品卡片 - 用于切换分类时 */
.cp-product-card.hidden {
  display: none;
}

/* ========================================
   二维码弹窗样式 - PC端和移动端自适应
   ======================================== */
.cp-qrcode-modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  justify-content: center;
  align-items: center;
}

.cp-qrcode-modal-overlay.active {
  display: flex;
}

.cp-qrcode-modal {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: cpModalFadeIn 0.3s ease;
}

@keyframes cpModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.cp-qrcode-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: none;
  background: #f3f4f6;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.cp-qrcode-modal-close:hover {
  background: #e5e7eb;
}

.cp-qrcode-modal-close svg {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.cp-qrcode-modal-title {
  font-size: 20px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}

.cp-qrcode-modal-subtitle {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}

.cp-qrcode-modal-image {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.cp-qrcode-modal-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cp-qrcode-modal-tip {
  font-size: 13px;
  color: #9ca3af;
}

/* 移动端二维码弹窗样式 */
@media (max-width: 768px) {
  .cp-qrcode-modal {
    padding: 24px;
    max-width: 300px;
    border-radius: 12px;
  }

  .cp-qrcode-modal-title {
    font-size: 18px;
  }

  .cp-qrcode-modal-image {
    width: 160px;
    height: 160px;
  }

  .cp-qrcode-modal-subtitle {
    margin-bottom: 16px;
  }
}

/* ========================================
   悬浮客服样式
   ======================================== */
.cp-float-service {
  position: fixed;
  right: 20px;
  bottom: 100px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (max-width: 768px) {
  .cp-float-service {
    right: 12px;
    bottom: 80px;
  }
}

.cp-float-service-item {
  position: relative;
  width: 56px;
  height: 56px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cp-float-service-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.cp-float-service-icon {
  width: 24px;
  height: 24px;
  color: #3b82f6;
}

.cp-float-service-icon svg {
  width: 100%;
  height: 100%;
}

.cp-float-service-text {
  font-size: 10px;
  color: #6b7280;
  line-height: 1.2;
  text-align: center;
  margin-top: 2px;
}

.cp-float-service-contact {
  height: auto;
  padding: 10px 8px;
}

/* 悬浮客服弹出二维码 */
.cp-float-service-popup {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.cp-float-service-contact:hover .cp-float-service-popup {
  opacity: 1;
  visibility: visible;
}

.cp-float-service-popup::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: #fff;
}

.cp-float-service-qrcode {
  width: 120px;
  height: 120px;
  margin-bottom: 8px;
}

.cp-float-service-qrcode img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.cp-float-service-tip {
  font-size: 12px;
  color: #6b7280;
  text-align: center;
}

/* 返回顶部按钮 */
.cp-float-service-top {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.cp-float-service-top.visible {
  opacity: 1;
  visibility: visible;
}

.cp-float-service-top svg {
  width: 24px;
  height: 24px;
  color: #3b82f6;
}
