/* 购物车页面样式 - 基于tcb-shop-demo设计规范 */

.cart-container {
  flex: 1;
  background-color: #f5f5f5;
}

/* 骨架屏样式 */
.cart-skeleton {
  padding: 20rpx;
}

.cart-skeleton .cart-group {
  margin-bottom: 20rpx;
}

.cart-skeleton .goods-item {
  background: white;
  border-radius: 16rpx;
  overflow: hidden;
}

.cart-skeleton .goods-item-info {
  padding: 30rpx;
  display: flex;
  align-items: flex-start;
}

.cart-skeleton .check-wrap {
  margin-right: 20rpx;
  margin-top: 40rpx;
}

.cart-skeleton .check-icon {
  width: 40rpx;
  height: 40rpx;
  border-radius: 50%;
  background-color: #f0f0f0;
}

.cart-skeleton .goods-card {
  flex: 1;
  display: flex;
}

.cart-skeleton .goods-thumb {
  width: 160rpx;
  height: 160rpx;
  border-radius: 8rpx;
  background-color: #f0f0f0;
  margin-right: 20rpx;
}

.cart-skeleton .goods-body {
  flex: 1;
}

.cart-skeleton .goods-title {
  height: 32rpx;
  background-color: #f0f0f0;
  border-radius: 4rpx;
  margin-bottom: 16rpx;
  width: 80%;
}

.cart-skeleton .goods-specs {
  height: 24rpx;
  background-color: #f0f0f0;
  border-radius: 4rpx;
  margin-bottom: 16rpx;
  width: 60%;
}

.cart-skeleton .goods-price {
  height: 28rpx;
  background-color: #f0f0f0;
  border-radius: 4rpx;
  margin-bottom: 20rpx;
  width: 40%;
}

.cart-skeleton .goods-stepper {
  height: 44rpx;
  background-color: #f0f0f0;
  border-radius: 8rpx;
  width: 120rpx;
}

/* 空态页面样式 */
.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120rpx 40rpx;
  text-align: center;
}

.cart-empty-image {
  width: 240rpx;
  height: 240rpx;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23cccccc"><path d="M7 18c-1.1 0-1.99.9-1.99 2S5.9 22 7 22s2-.9 2-2-.9-2-2-2zM1 2v2h2l3.6 7.59-1.35 2.45c-.16.28-.25.61-.25.96 0 1.1.9 2 2 2h12v-2H7.42c-.14 0-.25-.11-.25-.25l.03-.12.9-1.63h7.45c.75 0 1.41-.41 1.75-1.03l3.58-6.49c.08-.14.12-.31.12-.48 0-.55-.45-1-1-1H5.21l-.94-2H1zm16 16c-1.1 0-1.99.9-1.99 2s.89 2 1.99 2 2-.9 2-2-.9-2-2-2z"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin-bottom: 40rpx;
}

.cart-empty-tip {
  font-size: 32rpx;
  color: #999;
  margin-bottom: 20rpx;
}

.cart-empty-btn {
  background: linear-gradient(135deg, #fa4126, #ff6b4a);
  color: white;
  border: none;
  border-radius: 50rpx;
  padding: 20rpx 60rpx;
  font-size: 28rpx;
  font-weight: 500;
}

/* 购物车内容样式 */
.cart-content {
  padding: 20rpx;
}

.cart-group {
  background: white;
  border-radius: 16rpx;
  overflow: hidden;
  margin-bottom: 20rpx;
}

.goods-item {
  position: relative;
  border-bottom: 1rpx solid #f0f0f0;
}

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

.goods-item-info {
  padding: 30rpx;
  display: flex;
  align-items: flex-start;
}

/* 选择框样式 */
.check-wrap {
  margin-right: 20rpx;
  margin-top: 40rpx;
  cursor: pointer;
}

.check-icon {
  width: 40rpx;
  height: 40rpx;
  border-radius: 50%;
  border: 2rpx solid #bbbbbb;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.check-icon.selected {
  background-color: #fa4126;
  border-color: #fa4126;
}

/* 商品卡片样式 */
.goods-sku-info {
  flex: 1;
}

.goods-card {
  display: flex;
}

.goods-card.horizontal-wrap {
  flex-direction: row;
}

/* 商品图片区域 */
.goods-thumb {
  position: relative;
  width: 160rpx;
  height: 160rpx;
  margin-right: 20rpx;
  flex-shrink: 0;
}

.thumb-image {
  width: 100%;
  height: 100%;
  border-radius: 8rpx;
}

.stock-mask {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 20rpx;
  text-align: center;
  padding: 8rpx;
  border-bottom-left-radius: 8rpx;
  border-bottom-right-radius: 8rpx;
}

/* 商品信息区域 */
.goods-body {
  flex: 1;
  min-width: 0;
}

.goods-title {
  font-size: 28rpx;
  color: #333;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 12rpx;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.goods-specs {
  display: flex;
  align-items: center;
  margin-bottom: 16rpx;
  cursor: pointer;
}

.specs-text {
  font-size: 24rpx;
  color: #999;
  margin-right: 8rpx;
}

/* 价格区域 */
.goods-price-section {
  display: flex;
  align-items: baseline;
  margin-bottom: 20rpx;
}

.goods-price {
  font-size: 32rpx;
  color: #fa4126;
  font-weight: bold;
}

.goods-original-price {
  font-size: 24rpx;
  color: #999;
  text-decoration: line-through;
  margin-left: 12rpx;
}

/* 购物车数量选择器样式 - 使用更具体的类名避免冲突 */
.cart-quantity-controls {
  display: flex;
  align-items: center;
  border: 1rpx solid #e5e7eb;
  border-radius: 8rpx;
  overflow: hidden;
  width: fit-content;
}

.cart-quantity-btn {
  width: 60rpx;
  height: 60rpx;
  min-width: 60rpx;
  padding: 0;
  background-color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28rpx;
  color: #374151;
  border: none;
  border-radius: 0;
}

.cart-quantity-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cart-quantity-input {
  width: 80rpx; /* 调整为80rpx */
  height: 60rpx;
  text-align: center;
  border: none;
  border-left: 1rpx solid #e5e7eb;
  border-right: 1rpx solid #e5e7eb;
  border-radius: 0;
  font-size: 28rpx;
  color: #374151;
  background-color: #ffffff;
  padding: 0;
}

.cart-quantity-input:disabled {
  background-color: #f9fafb;
  opacity: 0.5;
}


/* 删除按钮样式 */
.delete-btn {
  position: absolute;
  right: 30rpx;
  top: 50%;
  transform: translateY(-50%);
  background: #fa4126;
  color: white;
  padding: 16rpx 24rpx;
  border-radius: 8rpx;
  font-size: 24rpx;
  cursor: pointer;
  pointer-events: auto; /* 确保只有点击删除按钮本身才触发事件 */
  z-index: 1; /* 较低的z-index */
}


/* 底部留白 */
.cart-bottom-gap {
  height: 300rpx;
}

/* 底部结算栏样式 */
.cart-bar {
  position: fixed;
  bottom: 128rpx; /* TabBar高度为128rpx (64px) */
  left: 0;
  right: 0;
  background: white;
  border-top: 1rpx solid #f0f0f0;
  padding: 20rpx 30rpx;
  display: flex;
  align-items: center;
  z-index: 100;
  padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
}

.cart-bar-check {
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-right: 20rpx;
}

.cart-bar-text {
  font-size: 28rpx;
  color: #333;
  margin-left: 12rpx;
}

.cart-bar-total {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.total-label {
  font-size: 28rpx;
  color: #333;
  margin-right: 8rpx;
}

.total-amount {
  font-size: 32rpx;
  color: #fa4126;
  font-weight: bold;
}

.settle-btn {
  background: #ccc;
  color: white;
  border: none;
  border-radius: 50rpx;
  padding: 20rpx 40rpx;
  font-size: 28rpx;
  font-weight: 500;
  margin-left: 20rpx;
  min-width: 160rpx;
  text-align: center;
}

.settle-btn.active {
  background: linear-gradient(135deg, #fa4126, #ff6b4a);
}

.settle-btn.disabled {
  background: #ccc;
  color: #999;
}


