/* cart.css - Kiểu dáng cho trang giỏ hàng (dùng chung token với modern.css) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent-color: var(--tsa-brand, #b8862f);
    --accent-color-dark: var(--tsa-brand-dark, #6f4f17);
    --danger-color: var(--tsa-price, #b42318);
}

.cart-page-title {
    margin: 18px 0 20px;
    color: var(--tsa-ink);
}

/* ===========================
    Bố cục Giỏ Hàng (Mục + Tóm tắt)
    =========================== */
.cart-layout {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.cart-items { flex: 2; min-width: 60%; }
.cart-summary {
    flex: 1;
    padding: 24px;
    min-width: 280px;
}

.cart-summary h4 {
    margin-bottom: 18px;
    color: var(--tsa-ink);
}

@media (max-width: 992px) {
    .cart-items { min-width: 100%; }
}
@media (max-width: 768px) {
    .cart-layout { flex-direction: column; }
    .cart-summary { margin-top: 1rem !important; }
}

/* ===========================
    Kiểu dáng Bảng Giỏ Hàng
    =========================== */
.cart-table-custom {
    width: 100%;
    border-collapse: collapse;
}

.cart-table-custom th,
.cart-table-custom td {
    padding: 12px;
    text-align: center;
    vertical-align: middle;
}

.cart-table-custom tbody tr {
    border-bottom: 1px solid var(--tsa-line);
    transition: background-color 0.15s;
}

.cart-table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Kiểu dáng các mục giỏ hàng (hình ảnh, tên, số lượng, giá, nút xóa)*/
.cart-item-image {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--tsa-line);
}

.cart-item-title {
    font-weight: 600;
}

.cart-empty {
    padding: 3rem 1.5rem !important;
    color: var(--tsa-muted) !important;
    text-align: center;
}

/* Kiểu điều khiển số lượng */
.quantity-controls {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--tsa-line);
    border-radius: 6px;
    background: #fff;
    color: var(--tsa-text);
    cursor: pointer;
    font-weight: 700;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.quantity-btn:hover {
    background: var(--tsa-ink);
    border-color: var(--tsa-ink);
    color: #fff;
}

.quantity {
    display: inline-block;
    width: 26px;
    font-weight: 700;
}

/* Nút hành động (Xóa) */
.remove-btn-custom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: var(--danger-color) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.remove-btn-custom:hover {
    background-color: #8f1c14 !important;
}

/* ===========================
    Phần Tổng Cộng
    =========================== */
.cart-totals-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: var(--tsa-muted);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--tsa-line);
}

.cart-totals-discount span {
    color: var(--danger-color);
}

.cart-total {
    font-weight: 700;
    font-size: 1.4rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid var(--accent-color);
}

/* Kiểu dáng các nút "Tiến hành thanh toán" và "Tiếp tục mua sắm"*/
.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.cart-button {
    flex: 1;
    padding: 0.85rem;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    text-align: center;
    text-decoration: none;
}

.cart-button--checkout:hover,
.cart-button--continue:hover {
    transform: translateY(-2px);
}

@media (max-width: 620px) {
    .cart-table-custom {
        font-size: 13px;
    }

    .cart-item-image {
        width: 56px;
        height: 40px;
    }
}
