/*
 * CSS của riêng trang giỏ hàng (resources/views/shop/cart.blade.php). Chỉnh lại
 * theo cỡ màn hình thì viết ở cart-responsive.css.
 *
 * File này nạp sau styles.css và shop.css: luật cùng độ ưu tiên ở đây đè luật ở
 * hai file đó.
 *
 * Ô số lượng, nút mua và khối "giỏ hàng trống" là thứ nhiều giao diện cùng dùng,
 * nên kiểu dáng của chúng nằm ở shop.css.
 */

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

.cart-table th {
    padding: 0 10px 12px;
    border-bottom: 3px solid var(--site-line);
    color: var(--site-ink);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
}

.cart-table td {
    padding: 16px 10px;
    border-bottom: 1px solid var(--site-line);
    vertical-align: middle;
}

.cart-table__total {
    text-align: right;
}

.cart-line__image {
    width: 92px;
}

.cart-line__image img {
    display: block;
    width: 72px;
    height: 72px;
    border: 1px solid var(--site-line);
    border-radius: 4px;
    object-fit: contain;
}

.cart-line__name a {
    font-weight: 600;
}

.cart-line__name a:hover {
    color: var(--site-primary);
}

.cart-line__name small {
    display: block;
    color: var(--site-muted);
}

.cart-line__price,
.cart-line__total {
    white-space: nowrap;
}

.cart-line__total {
    color: var(--site-ink);
    font-weight: 700;
}

.cart-line__quantity form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* cart.js tự gửi form khi khách đổi số lượng, nên nút "Cập nhật" chỉ còn cho trình đọc màn hình. */
.js-cart .cart-line__update {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.cart-line__remove button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--site-line);
    border-radius: 50%;
    background: #fff;
    color: var(--site-muted);
}

.cart-line__remove button:hover {
    border-color: var(--site-primary);
    color: var(--site-primary);
}

/* Sản phẩm không còn bán: dòng mờ đi, đứng ngoài mọi con số. */
.cart-line--unavailable .cart-line__image,
.cart-line--unavailable .cart-line__name a,
.cart-line--unavailable .cart-line__price {
    opacity: 0.55;
}

.cart-line__note {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 3px;
    background: var(--site-primary);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
}

.cart-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 20px;
}

.cart-actions .btn-outline-dark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cart-actions__clear {
    --bs-btn-color: var(--site-muted);
    --bs-btn-hover-color: var(--site-primary);
    text-decoration: underline;
}

/* Khối tổng tiền ở cột phải. */
.cart-totals {
    padding: 24px;
    border: 1px solid var(--site-line);
    border-radius: 4px;
    background: var(--site-soft);
}

.cart-totals__title {
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--site-line);
    font-size: 1rem;
    text-transform: uppercase;
}

.cart-totals__list {
    margin: 0 0 20px;
}

.cart-totals__list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid var(--site-line);
}

.cart-totals__list dt {
    font-weight: 500;
}

.cart-totals__list dd {
    margin: 0;
    color: var(--site-ink);
    font-weight: 700;
}

.cart-totals__total dd {
    color: var(--site-primary);
    font-size: 1.25rem;
}

.cart-totals__note {
    margin: 0;
}

/* Màn hình rộng: khối tổng tiền đứng yên trong lúc cuộn qua danh sách sản phẩm. */
@media (min-width: 992px) {
    .cart-totals {
        position: sticky;
        top: calc(var(--site-nav-height) + 24px);
    }
}
