/* ========== 购物车布局 ========== */
.cart-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 45px 5%;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 35px;
}

.cart-items {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}

.cart-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray);
    color: var(--text-light);
    font-size: 0.9rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 50px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--gray-light);
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 16px;
}

.cart-product img {
    width: 75px;
    height: 75px;
    object-fit: cover;
    border-radius: 10px;
}

.cart-product-name {
    font-size: 0.95rem;
    color: var(--text-dark);
}

.cart-price,
.cart-subtotal {
    color: var(--text-dark);
    font-weight: 500;
}

.cart-subtotal {
    color: var(--primary);
}

/* ========== 数量控制 ========== */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--gray);
    background: var(--white);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-gray);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.quantity-num {
    font-size: 0.95rem;
    min-width: 28px;
    text-align: center;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.3s ease;
    padding: 5px;
}

.delete-btn:hover {
    color: #D9534F;
}

/* ========== 订单摘要 ========== */
.cart-summary {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 95px;
}

.summary-title {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray);
    font-weight: 500;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    color: var(--text-gray);
    font-size: 0.92rem;
}

.summary-row.total {
    font-size: 1.15rem;
    color: var(--text-dark);
    font-weight: 500;
    padding-top: 14px;
    border-top: 1px solid var(--gray);
    margin-top: 18px;
}

.summary-row.total span:last-child {
    color: var(--primary);
}

.checkout-btn {
    width: 100%;
    padding: 14px;
    margin-top: 22px;
    font-size: 1rem;
}

/* ========== 空购物车 ========== */
.empty-cart {
    text-align: center;
    padding: 55px 20px;
}

.empty-cart-icon {
    width: 85px;
    height: 85px;
    background: var(--gray-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 22px;
}

.empty-cart-icon svg {
    width: 38px;
    height: 38px;
    stroke: var(--text-light);
}

.empty-cart p {
    color: var(--text-gray);
    margin-bottom: 22px;
}

/* ========== 模态框 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(61, 50, 41, 0.45);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow-hover);
}

.modal-icon {
    width: 65px;
    height: 65px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.modal-icon svg {
    width: 30px;
    height: 30px;
    stroke: var(--primary);
}

.modal h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 12px;
    font-weight: 500;
}

.modal p {
    color: var(--text-gray);
    margin-bottom: 22px;
    font-size: 0.92rem;
    line-height: 1.6;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .cart-container {
        grid-template-columns: 1fr;
    }
    
    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-header {
        display: none;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 14px;
        text-align: center;
    }
    
    .cart-product {
        flex-direction: column;
    }
    
    .quantity-control {
        justify-content: center;
    }
}
