﻿/* =========================================
   CSS RIÊNG CHO TRANG GIỎ HÀNG (CART)
   ========================================= */

/* 1. Layout Chung */
.cart-body {
    background-color: #0f1113;
    color: #e0e0e0;
    font-family: 'Rajdhani', sans-serif;
}

.cart-page-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: 60vh; /* Đảm bảo footer không bị đẩy lên khi giỏ hàng trống */
}

    .cart-page-container h1 {
        font-size: 2rem;
        margin-bottom: 30px;
        color: #fff;
        border-bottom: 2px solid #333;
        padding-bottom: 15px;
    }

/* 2. Bố cục Grid (Bảng bên trái - Tổng tiền bên phải) */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: flex-start;
}

/* 3. Bảng sản phẩm (Table) */
.cart-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
    margin-bottom: 18px;
}

    .cart-table thead th {
        text-align: left;
        padding: 15px 10px;
        color: #b3b3b3;
        font-weight: 600;
        border-bottom: 1px solid #333;
        font-size: 1rem;
        text-transform: uppercase;
    }

    .cart-table tbody td {
        padding: 20px 10px;
        vertical-align: middle;
        border-bottom: 1px solid #222;
        color: #fff;
    }

/* Cột thông tin sản phẩm (Ảnh + Tên) */
.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

    .product-info img {
        width: 80px;
        height: 60px;
        object-fit: cover;
        border-radius: 6px;
        border: 1px solid #333;
        background: #fff;
    }

.product-name {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
}

/* Cột Giá & Thành tiền */
.cart-price, .cart-sub {
    font-weight: 600;
}

.cart-sub {
    color: #00cec9; /* Màu xanh neon */
    font-size: 1.1rem;
}

/* 4. Nút tăng giảm số lượng */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1e1e1e;
    padding: 5px;
    border-radius: 6px;
    width: fit-content;
    border: 1px solid #333;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

    .qty-btn:hover {
        background: #6c5ce7; /* Màu tím */
    }

.qty-display {
    min-width: 30px;
    text-align: center;
    font-weight: bold;
}

/* Nút xóa (Thùng rác) */
.remove-btn {
    background: transparent;
    border: none;
    color: #ff4757;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    transition: 0.2s;
}

    .remove-btn:hover {
        color: #fff;
        transform: scale(1.1);
    }

/* 5. Khung Tổng Tiền (Summary Box) */
.cart-summary {
    background: #1e1e1e;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333;
    position: sticky;
    top: 20px; /* Dính khi cuộn */
}

    .cart-summary h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
        border-bottom: 1px solid #333;
        padding-bottom: 15px;
        color: #fff;
    }

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #ccc;
}

    .summary-row span:last-child {
        color: #00cec9;
        font-weight: bold;
        font-size: 1.5rem;
    }

/* Các nút hành động */
.cart-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, #6c5ce7, #a29bfe);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: 0.3s;
}

    .btn-checkout:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
    }

.btn-clear {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #ff4757;
    color: #ff4757;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

    .btn-clear:hover {
        background: #ff4757;
        color: white;
    }

/* Thông báo giỏ hàng trống */
.empty-cart-message {
    text-align: center;
    padding: 50px 0;
    color: #888;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 900px) {
    .cart-content {
        grid-template-columns: 1fr; /* Chuyển thành 1 cột */
    }

    .cart-summary {
        position: static; /* Hết dính */
    }
}
