/* 购物车页面样式 */

/* 购物车标题 */
.cart-header {
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fff;
}

.cart-header h1 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 10px;
}

.cart-tips {
    color: #999;
    font-size: 14px;
}

/* 购物车主体 */
.cart-main {
    margin-bottom: 40px;
}

/* 商品列表 */
.cart-list {
    background-color: #fff;
    margin-bottom: 20px;
}

/* 表头样式 */
.cart-table-header {
    display: grid;
    grid-template-columns: 80px 3fr 1fr 1fr 1fr 1fr;
    align-items: center;
    padding: 15px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #eee;
}

/* 商品项样式 */
.cart-item {
    display: grid;
    grid-template-columns: 80px 3fr 1fr 1fr 1fr 1fr;
    align-items: center;
    padding: 20px 15px;
    border-bottom: 1px solid #eee;
}

.cart-item:last-child {
    border-bottom: none;
}

/* 复选框样式 */
.col-check {
    text-align: center;
}

.col-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 商品信息样式 */
.col-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.col-info img {
    width: 100px;
    height: 140px;
    object-fit: cover;
}

.item-details h3 {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.item-details .author {
    color: #666;
    font-size: 14px;
}

/* 价格样式 */
.col-price,
.col-total {
    color: var(--primary-color);
    font-weight: bold;
}

/* 数量控制样式 */
.quantity-control {
    display: flex;
    align-items: center;
    width: 120px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.quantity-control button {
    width: 30px;
    height: 30px;
    border: none;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 16px;
}

.quantity-control button:hover {
    background: #eee;
}

.quantity-control input {
    width: 60px;
    height: 30px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

/* 操作按钮样式 */
.btn-delete {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-delete:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 结算栏样式 */
.cart-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 20px;
    background-color: #fff;
}

.cart-summary {
    margin-right: 30px;
}

.summary-item {
    display: inline-block;
    margin-right: 20px;
}

.summary-item .selected-count {
    color: var(--primary-color);
    font-weight: bold;
    margin: 0 5px;
}

.summary-item .total-price {
    color: var(--primary-color);
    font-size: 20px;
    font-weight: bold;
}

.btn-checkout {
    padding: 10px 30px;
    font-size: 16px;
}

/* 推荐商品样式 */
.recommendations {
    padding: 30px;
    background-color: #fff;
}

.recommendations .section-title {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.book-item {
    text-align: center;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 8px;
    transition: transform 0.3s;
}

.book-item:hover {
    transform: translateY(-5px);
}

.book-item img {
    width: 140px;
    height: 200px;
    object-fit: cover;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.book-item h3 {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.book-item .author {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.book-item .price {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .cart-table-header,
    .cart-item {
        grid-template-columns: 60px 2fr 1fr 1fr 1fr;
    }

    .col-action {
        display: none;
    }

    .col-info img {
        width: 80px;
        height: 120px;
    }

    .quantity-control {
        width: 100px;
    }

    .quantity-control input {
        width: 40px;
    }

    .cart-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .cart-summary {
        margin-right: 0;
        margin-bottom: 20px;
        text-align: center;
    }

    .btn-checkout {
        width: 100%;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 20px;
    }

    .book-item img {
        width: 120px;
        height: 170px;
    }
} 