/* 购物车页面样式 */



.breadcrumb {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: #777;
  margin-top: 1rem;
}

.breadcrumb a {
  color: #555;
  transition: color 0.3s;
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.breadcrumb .separator {
  margin: 0 8px;
  color: #999;
}

.breadcrumb .current {
  color: var(--primary-color);
  font-weight: 500;
}

/* 购物车步骤指示器 */
.cart-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3rem;
  position: relative;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f4f4f4;
  color: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-bottom: 10px;
  border: 2px solid #e0e0e0;
  transition: all 0.3s ease;
}

.step.active .step-number {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.step-label {
  font-size: 0.9rem;
  color: #777;
  font-weight: 500;
}

.step.active .step-label {
  color: var(--primary-color);
  font-weight: 600;
}

.step-connector {
  flex: 1;
  height: 2px;
  background: #e0e0e0;
  z-index: 1;
}

/* 购物车内容 */
.cart-content {
  margin-bottom: 3rem;
}

.cart-table {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.cart-header {
  display: flex;
  background: #f9f9f9;
  padding: 1rem;
  border-bottom: 1px solid #e0e0e0;
  font-weight: 600;
}

.cart-col {
  padding: 0 0.5rem;
}

.product-col {
  flex: 3;
}

.model-col {
  flex: 1;
}

.price-col, .quantity-col, .total-col {
  flex: 1;
  text-align: center;
}

.action-col {
  flex: 0.5;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 0.8rem;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 1.5rem 1rem;
  border-bottom: 1px solid #e0e0e0;
  transition: background 0.3s;
}

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

.cart-item:hover {
  background: #f9f9f9;
}

.cart-product {
  display: flex;
  align-items: center;
}

.cart-product-image {
  width: 100px;
  height: 100px;
  overflow: hidden;
  border-radius: 5px;
  margin-right: 1rem;
  border: 1px solid #e0e0e0;
}

.cart-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-product-info {
  flex: 1;
}

.cart-product-title {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.cart-product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: #777;
}

.meta-item i {
  margin-right: 5px;
  color: var(--primary-color);
}

/* 数量控制 */
.quantity-control {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  width: 120px;
  margin: 0 auto;
}

.quantity-btn {
  width: 34px;
  height: 34px;
  background: #f4f4f4;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.quantity-btn:hover {
  background: #e0e0e0;
}

.quantity-input {
  width: 50px;
  height: 34px;
  border: none;
  border-left: 1px solid #e0e0e0;
  border-right: 1px solid #e0e0e0;
  text-align: center;
  font-size: 0.9rem;
}

/* 更新与删除按钮 */
.update-item,
.remove-item {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e0e0e0;
  background: white;
  color: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
}

.update-item:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.remove-item:hover {
  background: #f44336;
  color: white;
  border-color: #f44336;
}

/* 操作按钮 */
.cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.cart-left-actions {
  display: flex;
  gap: 1rem;
}

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

/* 通用按钮样式 */
.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.btn-primary {
  background-color: var(--primary-color, #007bff);
  color: white;
  border-color: var(--primary-color, #007bff);
}

.btn-primary:hover {
  background-color: var(--primary-hover-color, #0069d9);
  border-color: var(--primary-hover-color, #0069d9);
}

.btn-outline {
  padding: 0.6rem 1.2rem;
  border: 1px solid #e0e0e0;
  background: white;
  color: #555;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-outline.danger:hover {
  border-color: #f44336;
  color: #f44336;
}

/* 购物车摘要区域 */
.cart-summary-container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
}

/* 小计表格容器 */
.cart-totals-container {
  width: 100%;
  margin-bottom: 2rem;
}

/* 小计表格样式 */
.cart-totals-table {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-top: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
}

.totals-row:last-child {
  border-bottom: none;
}

.totals-label {
  color: #555;
  font-weight: 500;
}

.totals-value {
  font-weight: 600;
  color: var(--dark-color);
  min-width: 120px;
  text-align: right;
}

.grand-total {
  background-color: #f9f9f9;
}

.grand-total .totals-label,
.grand-total .totals-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* 接下来想做什么区域 */
.what-next {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0 3rem;
  background-color: #f9f9f9;
}

.what-next-title {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
  font-weight: 600;
}

.what-next-desc {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1.5rem;
}

.coupon-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.coupon-buttons {
  display: flex;
  gap: 0.5rem;
}

.coupon-form input,
.gift-card-form input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  font-size: 0.9rem;
}

.btn-danger {
  color: #e74c3c;
  border-color: #e74c3c;
}

.btn-danger:hover {
  background: #e74c3c;
  color: white;
}

.gift-card-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 结账按钮 */
.checkout-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2rem;
}

.btn-checkout {
  padding: 0.8rem 2rem;
  font-size: 1rem;
  min-width: 150px;
  font-weight: 600;
}

.btn-continue {
  padding: 0.8rem 1.5rem;
}

/* 空购物车提示 */
.empty-cart {
  text-align: center;
  padding: 4rem 0;
}

.empty-cart-icon {
  font-size: 4rem;
  color: #ccc;
  margin-bottom: 1.5rem;
}

.empty-cart h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: #555;
}

.empty-cart p {
  color: #777;
  margin-bottom: 2rem;
}

.empty-cart .btn {
  padding: 0.8rem 2rem;
  font-size: 1rem;
}

/* 推荐产品 */
.recommendations {
  margin-top: 4rem;
}

.recommended-products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.product-item {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.3s;
}

.product-item:hover {
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transform: translateY(-5px);
}

.product-image {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.product-item:hover .product-image img {
  transform: scale(1.05);
}

.product-overlay {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0;
  background: rgba(255,255,255,0.9);
  transition: bottom 0.3s;
}

.product-item:hover .product-overlay {
  bottom: 0;
}

.action-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: white;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  transition: all 0.3s;
}

.action-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.product-text {
  padding: 1.5rem;
  text-align: center;
}

.product-text h3 {
  font-size: 1rem;
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.product-text h3 a {
  color: var(--dark-color);
  transition: color 0.3s;
}

.product-text h3 a:hover {
  color: var(--primary-color);
}

.product-text .price {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.product-text .btn {
  width: 100%;
  padding: 0.6rem 0;
  font-size: 0.9rem;
}

/* 添加购物车按钮样式 */
.product-text .btn-outline {
  background: transparent;
  color: #555;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 0.6rem 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-align: center;
}

.product-text .btn-outline:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 992px) {
  .cart-summary-container {
    grid-template-columns: 1fr;
  }

  .recommended-products {
    grid-template-columns: repeat(2, 1fr);
  }

  .cart-totals-table {
    max-width: 100%;
  }

  .checkout-buttons {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .cart-left-actions {
    flex-wrap: wrap;
  }

  .cart-right-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .btn-checkout {
    width: auto;
  }

  /* 推荐产品按钮响应式调整 */
  .product-text .btn {
    padding: 0.5rem 0;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  .cart-header {
    display: none;
  }

  .cart-item {
    flex-direction: column;
    padding: 1rem 1rem 1.2rem;
    gap: 0.6rem;
    position: relative;
  }

  .cart-col {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
  }

  .cart-product {
    margin-bottom: 0;
  }

  .quantity-col, .total-col {
    margin-top: 0.5rem;
  }

  .cart-product-info {
    width: 100%;
  }

  .cart-product-title {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cart-product-meta {
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .meta-item {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 合并型号、价格和数量到同一行 */
  .model-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .model-col {
    flex: 1;
    color: #777;
    font-size: 0.85rem;
    padding: 0;
  }

  .price-col {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0;
    margin-left: 10px;
  }

  /* 改变数量控制样式使其更紧凑 */
  .quantity-control {
    width: 90px;
    height: 28px;
    margin: 0;
  }

  .quantity-btn {
    width: 28px;
    height: 28px;
  }

  .quantity-input {
    width: 34px;
    height: 28px;
    font-size: 0.85rem;
  }

  .action-col {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    width: auto;
  }

  .total-col {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
  }

  .cart-left-actions {
    flex-wrap: wrap;
  }

  .cart-steps {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
  }

  .step-connector {
    display: none;
  }

  .what-next {
    padding: 1.5rem;
  }

  .totals-row {
    padding: 0.8rem 1rem;
  }

  .cart-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-left-actions,
  .cart-right-actions {
    width: 100%;
  }

  .cart-right-actions {
    margin-top: 1rem;
  }

  .btn-checkout {
    width: 100%;
  }

  /* 推荐产品按钮调整 */
  .product-text {
    padding: 1.2rem;
  }

  .product-text .btn {
    padding: 0.5rem 0;
  }
}

@media (max-width: 576px) {
  .recommended-products {
    grid-template-columns: 1fr;
  }

  .cart-product {
    gap: 0.6rem;
  }

  .cart-product-image {
    width: 60px;
    height: 60px;
    min-width: 60px;
  }

  .cart-product-meta {
    flex-direction: column;
    gap: 0.2rem;
  }

  .cart-coupon {
    padding: 1rem;
  }

  .coupon-form {
    flex-direction: column;
  }

  /* 小屏幕推荐产品按钮调整 */
  .product-text .btn {
    padding: 0.6rem 0;
    font-size: 0.9rem;
  }
}

/* 购物车页面顶部图标样式 */
.cart-icon {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--primary-color);
  color: white;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* 运费估算表单样式 */
.shipping-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.9rem;
  color: #555;
}

.required {
  color: #e74c3c;
}

.form-control {
  padding: 0.8rem 1rem;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  font-size: 0.9rem;
  background-color: #fff;
}

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23555' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 1rem) center;
}

.btn-shipping-quote {
  align-self: flex-end;
}
