/* 购物车页面样式 */

.cart-section {
    padding: 60px 0 100px;
    min-height: 60vh;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-top: 40px;
}

/* 购物车表格 */
.cart-table {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.cart-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr 0.8fr;
    gap: 20px;
    padding: 20px;
    background: var(--bg-light);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr 1fr 0.8fr;
    gap: 20px;
    padding: 25px 20px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
}

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

.cart-col-product {
    display: flex;
    gap: 15px;
    align-items: center;
}

.cart-col-product img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

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

.cart-col-product .product-name {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--text-dark);
}

.cart-col-product .product-name:hover {
    color: var(--gold-color);
}

.cart-col-product .product-sku {
    font-size: 12px;
    color: var(--text-light);
}

.cart-col-price {
    font-size: 18px;
    font-weight: 500;
}

.cart-col-quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: fit-content;
}

.qty-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-dark);
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--bg-light);
    color: var(--gold-color);
}

.qty-input {
    width: 50px;
    height: 35px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.qty-input::-webkit-inner-spin-button,
.qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.stock-warning {
    font-size: 12px;
    color: #f44336;
}

.cart-col-total {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

.btn-remove {
    background: transparent;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.btn-remove:hover {
    color: #f44336;
}

/* 购物车操作 */
.cart-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn-outline {
    background: transparent;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    padding: 12px 30px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    border-color: var(--text-dark);
    background: var(--bg-light);
}

/* 订单摘要 */
.cart-summary {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.cart-summary h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 25px;
    letter-spacing: 1px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 15px;
}

.summary-row span:last-child {
    font-weight: 500;
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
}

.summary-total {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.btn-block {
    width: 100%;
    margin-bottom: 20px;
}

.security-badges {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-light);
}

.badge-item svg {
    color: var(--gold-color);
}

/* 空购物车 */
.cart-empty {
    text-align: center;
    padding: 80px 20px;
}

.cart-empty svg {
    margin: 0 auto 30px;
}

.cart-empty h2 {
    font-size: 28px;
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.cart-empty p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 30px;
}

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

@media (max-width: 768px) {
    .cart-header {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .cart-col-product {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-col-product img {
        width: 100%;
        height: auto;
    }
    
    .cart-col-price,
    .cart-col-quantity,
    .cart-col-total {
        display: flex;
        justify-content: space-between;
    }
    
    .cart-col-price::before {
        content: '单价:';
        color: var(--text-light);
    }
    
    .cart-col-total::before {
        content: '小计:';
        color: var(--text-light);
    }
    
    .cart-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .cart-actions .btn {
        width: 100%;
    }
}

