/* Sidebar Giỏ Hàng */
.cart-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.cart-sidebar.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Lớp nền mờ bên trái */
.cart-sidebar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(11, 17, 30, 0.4); /* Sử dụng nền tối nhẹ ăn khớp với --bg-main của Dark Mode */
    backdrop-filter: blur(2px);
}

/* Khung Sidebar bên phải */
.cart-sidebar-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 440px;
    height: 100%;
    background-color: var(--bg-main); /* Chuyển sang màu nền chính */
    box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    border-left: 1px solid var(--border-subtle); /* Thêm viền nhẹ để phân tách rõ ở chế độ tối */
}

.cart-sidebar.active .cart-sidebar-container {
    transform: translateX(0);
}

/* Header */
.cart-sidebar-header {
    padding: 20px;
    background-color: var(--bg-card); /* Chuyển sang màu nền card */
    border-bottom: 2px dashed var(--border-subtle); /* Đồng bộ viền */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main); /* Đồng bộ màu chữ chính */
    font-size: 1.25rem;
    font-weight: 700;
}

.cart-sidebar-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-main);
    cursor: pointer;
    line-height: 0.8;
    transition: color 0.2s;
}

.cart-sidebar-close:hover {
    color: var(--accent-red); /* Đổi màu đỏ khi di chuột để tăng tính tương tác */
}

/* Body */
.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px;
    background-color: var(--bg-main);
}

/* Item trong giỏ hàng */
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 0;
    border-bottom: 1px dashed var(--border-subtle);
    gap: 12px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0 0 6px 0;
    text-transform: uppercase;
}

.cart-item-price {
    font-size: 0.8rem;
    color: var(--text-muted); /* Chữ màu phụ */
    font-weight: 500;
}

/* Nút xóa */
.btn-delete-cart-item {
    background: none;
    border: none;
    color: var(--accent-red); /* Đổi sang đỏ hệ thống */
    padding: 6px;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-cart-item:hover {
    background-color: rgba(239, 68, 68, 0.15); /* Sử dụng màu đỏ hệ thống với độ mờ, hoạt động tốt trên cả sáng/tối */
    color: var(--accent-red);
}

/* Trạng thái trống */
.cart-empty-message {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Footer */
.cart-sidebar-footer {
    padding: 20px;
    background-color: var(--bg-card);
    border-top: 2px dashed var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-total-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.total-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-orange); /* Màu cam hệ thống */
}

/* Các nút hành động */
.cart-footer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-cart-action {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #ffffff; /* Giữ chữ trắng để tương phản trên nền nút màu */
    transition: opacity 0.2s;
}

.btn-cart-action:hover {
    opacity: 0.9;
}

.btn-checkout {
    background-color: var(--primary); /* Màu chính hệ thống */
}

.btn-continue {
    background-color: var(--accent-green); /* Màu xanh lá hệ thống */
}