/* 主要内容 */
.main {
    padding: 30px 0;
    min-height: calc(100vh - 80px - 60px);
    background: var(--bg-color);
}

/* 购物车标题 */
.cart-header {
    margin-bottom: 20px;
}

.cart-header h2 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 10px;
}

.cart-tips {
    color: #999;
    font-size: 14px;
}

/* 购物车主体 */
.cart-main {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 表头 */
.cart-table-header {
    display: grid;
    grid-template-columns: 80px 2fr 1fr 1fr 1fr 100px;
    align-items: center;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 8px 8px 0 0;
    color: #666;
}

/* 复选框样式 */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 商品列表 */
.cart-list {
    min-height: 200px;
}

.cart-item {
    display: grid;
    grid-template-columns: 80px 2fr 1fr 1fr 1fr 100px;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

/* 商品信息 */
.item-info {
    display: flex;
    gap: 15px;
}

.item-image {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-title {
    font-size: 14px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-sku {
    font-size: 12px;
    color: #999;
}

/* 价格 */
.item-price {
    color: var(--primary-color);
    font-weight: bold;
}

.item-price::before {
    content: '¥';
    font-size: 12px;
}

/* 数量选择 */
.quantity-wrapper {
    display: flex;
    align-items: center;
    width: 120px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.quantity-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s;
}

.quantity-btn:hover {
    color: var(--primary-color);
}

.quantity-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.quantity-input {
    width: 48px;
    height: 36px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
}

/* 小计 */
.item-total {
    color: var(--primary-color);
    font-weight: bold;
}

.item-total::before {
    content: '¥';
    font-size: 12px;
}

/* 操作按钮 */
.item-action {
    display: flex;
    gap: 10px;
}

.btn-delete {
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-delete:hover {
    color: var(--primary-color);
}

/* 空购物车 */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
    text-align: center;
}

.empty-cart img {
    width: 200px;
    margin-bottom: 20px;
}

.empty-cart p {
    color: #999;
    margin-bottom: 20px;
}

/* 结算栏 */
.cart-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 0 0 8px 8px;
}

.cart-footer-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-delete-selected,
.btn-clear-cart {
    color: #999;
    transition: color 0.3s;
}

.btn-delete-selected:hover,
.btn-clear-cart:hover {
    color: var(--primary-color);
}

.cart-footer-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.price-info {
    text-align: right;
}

.price-info span {
    display: block;
    line-height: 1.6;
}

.price-info em {
    font-style: normal;
    color: var(--primary-color);
    font-weight: bold;
}

.total-price {
    font-size: 20px;
}

.btn-checkout {
    width: 150px;
    height: 50px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-checkout:hover {
    background: #c13026;
}

.btn-checkout:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 猜你喜欢 */
.recommendations {
    margin-top: 30px;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.recommendations .product-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin-top: 20px;
}

/* 确认删除弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 400px;
    text-align: center;
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.modal-buttons button {
    padding: 10px 30px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: #fff;
    border: 1px solid var(--border-color);
    color: #666;
}

.btn-cancel:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-confirm {
    background: var(--primary-color);
    border: none;
    color: #fff;
}

.btn-confirm:hover {
    background: #c13026;
}

/* 响应式布局 */
@media screen and (max-width: 1024px) {
    .recommendations .product-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media screen and (max-width: 768px) {
    .cart-table-header,
    .cart-item {
        grid-template-columns: 60px 2fr 1fr 1fr 80px;
    }

    .col-total,
    .item-total {
        display: none;
    }

    .item-image {
        width: 60px;
        height: 60px;
    }

    .recommendations .product-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .cart-footer {
        flex-direction: column;
        gap: 20px;
    }

    .cart-footer-left,
    .cart-footer-right {
        width: 100%;
        justify-content: space-between;
    }
}

@media screen and (max-width: 480px) {
    .cart-table-header,
    .cart-item {
        grid-template-columns: 40px 2fr 80px;
        font-size: 14px;
    }

    .col-price,
    .item-price,
    .col-quantity,
    .quantity-wrapper {
        display: none;
    }

    .item-image {
        width: 50px;
        height: 50px;
    }

    .recommendations .product-list {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 90%;
        margin: 0 20px;
    }
} 