/* 现代化组件样式 */
/* 产品卡片组件 */
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  border-color: var(--primary-color);
}

.product-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
  transition: transform 0.3s ease;
  background-color: var(--bg-secondary-color); /* 为加载中的图片提供背景色 */
}

.product-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, var(--card-bg) 0%, var(--bg-secondary-color) 100%);
}

.product-name {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.product-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary-color), var(--primary-hover-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.product-description {
  color: var(--text-secondary-color);
  margin-bottom: 1.5rem;
  flex-grow: 1;
  font-size: var(--font-size-sm);
}

.btn-add-to-cart {
  width: 100%;
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: var(--btn-text);
  padding: 0.75rem;
  border-radius: var(--border-radius);
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-weight: 500;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

.btn-add-to-cart:hover {
  background-color: #218838;
  border-color: #1e7e34;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-add-to-cart::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-add-to-cart:hover::before {
  width: 300px;
  height: 300px;
}

.btn-add-to-cart:active {
  transform: scale(0.95);
}

/* 方案卡片组件 */
.solution-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}

.solution-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  border-color: var(--primary-color);
}

.solution-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
  transition: transform 0.3s ease;
  background-color: var(--bg-secondary-color); /* 为加载中的图片提供背景色 */
}

.solution-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, var(--card-bg) 0%, var(--bg-secondary-color) 100%);
}

.solution-title {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.solution-excerpt {
  color: var(--text-secondary-color);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  flex-grow: 1;
}

.solution-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: var(--font-size-sm);
  color: var(--text-secondary-color);
}

.btn-read-more {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: var(--btn-text);
  text-decoration: none;
  border-radius: var(--border-radius);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

.btn-read-more:hover {
  background-color: var(--primary-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.25);
}

.btn-read-more::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-read-more:hover::before {
  width: 300px;
  height: 300px;
}

.btn-read-more:active {
  transform: scale(0.95);
}

/* 购物车项目组件 */
.cart-item {
  display: flex;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.cart-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.item-image {
  flex: 0 0 120px;
  height: 120px;
  margin-right: 1.5rem;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius);
  transition: transform 0.3s ease;
}

.item-details {
  flex: 2;
}

.item-name {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-color);
  transition: color 0.3s ease;
}

.item-price {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary-color), var(--primary-hover-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.item-actions {
  display: flex;
  align-items: center;
}

.quantity-control {
  display: flex;
  align-items: center;
  margin-right: 1rem;
}

.quantity-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary-color);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
}

.quantity-btn:hover {
  background: var(--bg-tertiary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.quantity-btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(130, 138, 145, 0.25);
}

.quantity-input {
  width: 50px;
  height: 36px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-left: none;
  border-right: none;
  font-size: 1rem;
  background-color: var(--card-bg);
  color: var(--text-color);
}

.remove-btn {
  background: none;
  border: none;
  color: var(--danger-color);
  cursor: pointer;
  font-size: var(--font-size-sm);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

.remove-btn:hover {
  color: #bd2130;
  background-color: rgba(220, 53, 69, 0.1);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.remove-btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.remove-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.remove-btn:hover::before {
  width: 300px;
  height: 300px;
}

.remove-btn:active {
  transform: scale(0.95);
}

/* 结账表单组件 */
.checkout-form {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  border: 1px solid var(--border-color);
}

.form-section {
  margin-bottom: 2rem;
}

.form-section-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary-color);
  text-align: center;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

.form-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: all 0.3s ease;
  background-color: var(--card-bg);
  color: var(--text-color);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 确保表单控件在暗色主题下有足够的对比度 */
[data-theme="dark"] .form-input {
  color: #ffffff;
  background-color: var(--form-bg);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-col {
  flex: 1;
}

.form-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  background-color: var(--card-bg);
  color: var(--text-color);
  transition: all 0.3s ease;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
}

.form-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* 确保表单控件在暗色主题下有足够的对比度 */
[data-theme="dark"] .form-select {
  color: #ffffff;
  background-color: var(--form-bg);
}

.form-checkbox {
  margin-right: 0.5rem;
}

/* 订单摘要组件 */
.order-summary {
  background: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  height: fit-content;
  border: 1px solid var(--border-color);
}

.summary-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--text-color);
  text-align: center;
  background: linear-gradient(45deg, var(--primary-color), var(--primary-hover-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.summary-items {
  margin-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
  border-radius: var(--border-radius-sm);
  padding: 0.5rem;
}

.summary-item:hover {
  background-color: var(--bg-secondary-color);
  transform: translateX(5px);
}

.item-name {
  font-weight: 500;
}

.item-total {
  font-weight: 500;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.summary-row.total {
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: 3px solid var(--primary-color);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(45deg, var(--primary-color), var(--primary-hover-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.summary-label {
  color: var(--text-secondary-color);
}

.summary-value {
  font-weight: 500;
}

.place-order-btn {
  display: block;
  width: 100%;
  padding: 1rem;
  background-color: var(--success-color);
  color: var(--btn-text);
  text-align: center;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-size: 1.2rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: none;
  cursor: pointer;
  margin-bottom: 1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  will-change: transform, box-shadow;
}

.place-order-btn:hover {
  background-color: #218838;
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.place-order-btn:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.place-order-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.place-order-btn:hover::before {
  width: 300px;
  height: 300px;
}

.place-order-btn:active {
  transform: scale(0.95);
}

/* 响应式组件调整 */
@media (max-width: 768px) {
  .cart-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .item-image {
    margin-right: 0;
    margin-bottom: 1rem;
    width: 100%;
  }
  
  .item-actions {
    width: 100%;
    justify-content: space-between;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .product-card,
  .solution-card {
    margin-bottom: 1.5rem;
  }
  
  .product-card:hover,
  .solution-card:hover {
    transform: none;
  }
}

@media (max-width: 576px) {
  .product-info,
  .solution-content {
    padding: 1rem;
  }
  
  .item-image {
    height: auto;
  }
  
  .quantity-control {
    margin-right: 0.5rem;
  }
  
  .quantity-btn {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }
  
  .quantity-input {
    width: 40px;
    height: 30px;
  }
  
  .checkout-form,
  .order-summary {
    padding: 1rem;
  }
  
  .form-input,
  .form-select {
    padding: 0.5rem;
  }
  
  .btn {
    padding: 0.5rem 1rem;
    min-height: 40px;
  }
  
  .btn-add-to-cart,
  .btn-read-more,
  .place-order-btn {
    padding: 0.7rem;
    font-size: 0.95rem;
    min-height: 44px;
  }
  
  .remove-btn {
    padding: 0.5rem 0.7rem;
    font-size: 0.85rem;
    min-height: 36px;
  }
}

/* 确保在不同主题下按钮有足够的对比度 */
[data-theme="dark"] .btn-add-to-cart {
  color: #ffffff;
}

[data-theme="dark"] .btn-read-more {
  color: #ffffff;
}

[data-theme="dark"] .remove-btn {
  color: var(--danger-color);
}

[data-theme="dark"] .place-order-btn {
  color: #ffffff;
}

/* 确保数量控制按钮在所有主题下都有足够的对比度 */
[data-theme="dark"] .quantity-btn {
  color: var(--text-color);
  background: var(--bg-tertiary-color);
}

/* 确保表单元素在暗色主题下有足够的对比度 */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select {
  color: #ffffff;
  background-color: var(--card-bg);
}