/* --- Layout --- */
.cart-detail-page {
    background-color: #f9f9f9; /* Nền xám rất nhạt để làm nổi bật khối trắng */
    min-height: 80vh;
}

.cart-breadcrumb {
    font-size: 14px;
    color: #999;
}

.cart-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.cart-breadcrumb .current {
    color: #000;
    font-weight: 500;
}

.cart-page-title {
    font-family: roboto;
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 30px;
    letter-spacing: 1px;
    color: #000;
}

/* --- Bảng Sản Phẩm --- */
.cart-table-wrapper {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    padding: 20px;
    overflow-x: auto; /* Scroll ngang trên mobile nếu cần */
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    text-align: left;
    padding: 15px 0;
    border-bottom: 2px solid #eee;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
}

.cart-table td {
    font-family: roboto;
    padding: 25px 0;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.cart-table tr:last-child td {
    border-bottom: none;
}

/* Product Column */
.product-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart-detail-page .img-box {
    width: 90px;
    height: 90px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.cart-detail-page .img-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.info-box .name a {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: color 0.3s;
}

.info-box .name a:hover {
    color: #d4af37;
}

.info-box .variant, .info-box .sku {
    font-size: 13px;
    color: #888;
    margin: 3px 0 0 0;
}

/* Other Columns */
.price-col, .total-col {
    font-size: 16px;
    color: #000;
    font-weight: 500;
}

.total-col strong {
    font-family: Roboto;
    color: #3e1515; /* Màu đỏ rượu */
    font-size: 17px;
}

/* Quantity */
.cart-detail-page .qty-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.cart-detail-page .qty-btn {
    background: #fff;
    border: none;
    width: 30px;
    height: 32px;
    font-size: 16px;
    cursor: pointer;
    color: #555;
    transition: background 0.2s;
}

.cart-detail-page .qty-btn:hover {
    background: #f5f5f5;
}

.cart-detail-page .qty-input {
    width: 40px;
    height: 32px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-weight: 600;
    outline: none;
    color: #333;
}

/* Remove Button */
.btn-remove-item {
    background: none;
    border: none;
    color: #ccc;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.3s;
}

.btn-remove-item:hover {
    color: #ff4d4d;
}

/* --- Cart Actions Bottom --- */
.cart-actions-row {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.btn-continue {
    text-decoration: none;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
}

.btn-continue:hover {
    color: #d4af37;
}

.btn-update-cart {
    background: #eee;
    color: #999;
    border: none;
    padding: 10px 25px;
    border-radius: 4px;
    font-weight: 600;
    cursor: not-allowed; /* Mặc định disable cho đến khi có thay đổi */
    transition: all 0.3s;
}

.btn-update-cart.active {
    background: #000;
    color: #fff;
    cursor: pointer;
}

/* --- Order Summary (Right Col) --- */
.order-summary-box {
    background: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #eee;
}

.summary-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 25px;
    text-transform: uppercase;
    padding-bottom: 15px;
    border-bottom: 2px solid #000;
}

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

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    font-size: 18px;
    font-weight: 800;
    color: #000;
}

.total-value {
    font-family: Roboto;
    color: #d4af37; /* Vàng kim */
    font-size: 22px;
}

.cart-detail-page .tax-note {
    font-size: 12px;
    color: #999;
    text-align: right;
    margin-top: 5px;
}

.btn-checkout-large {
    width: 100%;
    background: linear-gradient(to right, #3e1515, #000000);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 12px; /* Bo tròn */
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 25px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 10px 20px rgba(62, 21, 21, 0.2);
}

.btn-checkout-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(62, 21, 21, 0.3);
}

/* Coupon */
.coupon-input-group {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
}

.coupon-input-group input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    outline: none;
}

.coupon-input-group button {
    background: #000;
    color: #fff;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

.security-note {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

/* --- Responsive Mobile --- */
@media (max-width: 768px) {
    .cart-table thead {
        display: none; /* Ẩn header bảng trên mobile */
    }

    .cart-table tbody tr {
        display: block;
        border-bottom: 10px solid #f9f9f9; /* Tạo khoảng cách giữa các item */
        padding: 20px 0;
        
        /* QUAN TRỌNG: Để làm mốc toạ độ cho nút xóa tuyệt đối */
        position: relative; 
    }

    .cart-table td {
        font-family: Roboto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
        border: none;
    }

    /* Sắp xếp lại các thành phần trong thẻ sản phẩm */
    .product-col {
        margin-bottom: 15px;
        padding-right: 30px; /* Chừa chỗ bên phải để nút xóa không đè lên tên sản phẩm nếu tên dài */
    }
    
    /* Hiển thị Label trên mobile */
    .cart-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 13px;
        color: #555;
    }
    
    .product-col::before, .remove-col::before {
        display: none; /* Không hiện label cho ảnh và nút xóa */
    }

    /* --- SỬA LỖI NÚT XÓA --- */
    .remove-col {
        /* Đưa về vị trí tuyệt đối góc trên phải */
        position: absolute;
        top: 10px;
        right: 0;
        
        /* Reset các thuộc tính flex của td */
        width: auto !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        justify-content: flex-end !important;
    }
    
    .btn-remove-item {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #f00;
        font-size: 14px;
        transition: all 0.3s;
    }
    
    .btn-remove-item:hover {
        background: #f00;
        color: #fff;
    }
}
