/* ── Cart page ────────────────────────────────────────────────────────────── */

/* mt-14 on page-header only for desktop (lg+) */
@media (max-width: 991px) {
    .page-header.mt-14 {
        margin-top: 0 !important;
    }
}


/* Empty state */
.cart-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.cart-empty-state .icon-shopping-cart {
    font-size: 4rem;
    color: #ddd;
    display: block;
    margin-bottom: 20px;
}

.cart-empty-state h3 {
    font-size: 1.6rem;
    color: #555;
    margin-bottom: 8px;
}

.cart-empty-state p {
    font-size: 1.4rem;
    margin-bottom: 0;
}

/* ── Desktop cart ─────────────────────────────────────────────────────────── */
.cart-product-quantity .form-control {
    width: 80px;
    height: 42px;
    text-align: center;
}

/* ── Spinner +/- buttons (desktop + mobile) ───────────────────────────────── */
/* Use 4-class specificity to beat Molla's .btn-spinner { background:none; border:none } */
.cart-product-quantity .input-group.input-spinner .btn-decrement,
.cart-product-quantity .input-group.input-spinner .btn-increment {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f0f0f0 !important;
    border: 1px solid #ddd !important;
    color: #444 !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.cart-product-quantity .input-group.input-spinner .btn-decrement {
    border-radius: 0 6px 6px 0 !important;
}

.cart-product-quantity .input-group.input-spinner .btn-increment {
    border-radius: 6px 0 0 6px !important;
}

.cart-product-quantity .input-group.input-spinner .btn-decrement:hover,
.cart-product-quantity .input-group.input-spinner .btn-increment:hover {
    background: #3399ff !important;
    border-color: #3399ff !important;
    color: #fff !important;
}

.cart-product-quantity .cart-qty-display[readonly] {
    background: #fafafa;
    cursor: default;
    pointer-events: none;
}

/* ── Cart bottom actions ──────────────────────────────────────────────────── */
.cart-actions-group {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.cart-actions-group .cart-action-btn {
    min-width: 140px;
    justify-content: center;
}

@media (max-width: 767px) {
    .cart-actions-group {
        width: 100%;
    }

    .cart-actions-group .cart-action-btn {
        flex: 1;
        min-width: 0;
        justify-content: center;
    }
}

/* ── Desktop spinner: vertical alignment fix ──────────────────────────────── */
.cart-product-quantity .input-group.input-spinner {
    align-items: center;
}

.cart-product-quantity .input-group.input-spinner .input-group-prepend,
.cart-product-quantity .input-group.input-spinner .input-group-append {
    display: flex;
    align-items: center;
}

/* ── Point column ─────────────────────────────────────────────────────────── */
.table-cart .point-col {
    color: #c96;
    white-space: nowrap;
    font-size: 13px;
    width: 110px;
}

/* Per-unit point badge inside price-col (mobile only — hidden on desktop) */
.cart-unit-point {
    display: none;
}

/* Total points under row total */
.table-cart .total-col .total-points {
    display: block;
    color: #c96;
    font-size: 12px;
    white-space: nowrap;
    line-height: 1.4;
}

/* ── Total column: never wrap ─────────────────────────────────────────────── */
.table-cart .total-col {
    white-space: nowrap;
}

/* ── Sidebar subtotal / total: keep amount on one line ────────────────────── */
.summary-subtotal td:last-child,
.summary-total td:last-child {
    white-space: nowrap;
    text-align: right;
}

.table-cart .product-media img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

/* ── Mobile cart card layout ─────────────────────────────────────────────── */
@media (max-width: 767px) {

    /* Table becomes a list of cards */
    .table-cart.table-mobile {
        border: none !important;
        background: transparent;
    }

    .table-cart.table-mobile tr {
        background: #fff;
        border: 1px solid #e8e8e8 !important;
        border-radius: 12px !important;
        margin-bottom: 12px;
        padding: 14px 14px 10px !important;
        position: relative;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    .table-cart.table-mobile tr:not(:last-child) {
        border-bottom: 1px solid #e8e8e8 !important;
    }

    /* ── Remove button: circle icon top-right ── */
    .table-cart.table-mobile .remove-col {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        padding: 0 !important;
        width: auto !important;
    }

    .table-cart.table-mobile .remove-col .btn-remove {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #f5f5f5;
        border: none;
        display: flex !important;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        color: #bbb;
        cursor: pointer;
        padding: 0;
        line-height: 1;
    }

    .table-cart.table-mobile .remove-col .btn-remove:hover {
        background: #ffe0e0;
        color: #dc3545;
    }

    /* ── Product row: image left + name right ── */
    .table-cart.table-mobile .product-col {
        display: block !important;
        width: 100% !important;
        padding: 0 32px 10px 0 !important;  /* right gap for the × button */
        text-align: left !important;
    }

    .table-cart.table-mobile .product-col .product {
        display: flex !important;
        justify-content: flex-start !important;
        align-items: center;
        gap: 12px;
    }

    .table-cart.table-mobile .product-col .product-media {
        flex-shrink: 0;
        margin-right: 0 !important;
    }

    .table-cart.table-mobile .product-col .product-media img {
        width: 72px;
        height: 72px;
        object-fit: cover;
        border-radius: 8px;
        border: 1px solid #f0f0f0;
    }

    .table-cart.table-mobile .product-col .product-title {
        font-size: 1.4rem;
        font-weight: 500;
        color: #333;
        margin: 0;
        text-align: left !important;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .table-cart.table-mobile .product-col .product-title a { color: #333; }

    /* ── Bottom meta row: flex row — price | qty | total ── */
    /* Make the tr a flex-wrap container so the bottom tds align properly */
    .table-cart.table-mobile tr {
        display: flex !important;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .table-cart.table-mobile .product-col {
        flex: 0 0 100% !important;
    }

    /* ── Price col ── */
    .table-cart.table-mobile .price-col {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        width: 110px !important;
        flex: 0 0 110px !important;
        padding: 0 10px 0 0 !important;
        font-size: 1.3rem;
        color: #999;
        border: none;
        text-align: left;
    }

    /* ── Quantity col ── */
    .table-cart.table-mobile .quantity-col {
        display: flex !important;
        align-items: center;
        width: auto !important;
        padding: 0 !important;
        border: none;
    }

    .table-cart.table-mobile .quantity-col .cart-product-quantity {
        margin: 0 !important;
    }

    .table-cart.table-mobile .quantity-col .cart-qty-display {
        width: 44px !important;
        height: 34px;
        font-size: 1.35rem;
        text-align: center;
        padding: 0 4px;
        display: inline-block !important;
    }

    .table-cart.table-mobile .input-group.input-spinner {
        display: inline-flex !important;
        align-items: center !important;
        flex-wrap: nowrap;
    }

    .table-cart.table-mobile .input-group.input-spinner .btn-spinner {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 34px;
        padding: 0;
        line-height: 1;
    }

    .table-cart.table-mobile .input-group.input-spinner .input-group-prepend,
    .table-cart.table-mobile .input-group.input-spinner .input-group-append {
        display: flex !important;
        align-items: center !important;
    }

    /* ── Total col — takes remaining space, right-aligned ── */
    .table-cart.table-mobile .total-col {
        display: flex !important;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        flex: 1 !important;
        width: auto !important;
        padding: 0 !important;
        font-size: 1.5rem;
        font-weight: 600;
        color: #39f;
        border: none;
        white-space: nowrap;
        line-height: 1.4;
    }

    /* Hide point column on mobile — shown via cart-unit-point inside price-col */
    .table-cart.table-mobile .point-col {
        display: none !important;
    }

    /* Show per-unit point below price on mobile */
    .cart-unit-point {
        display: block;
        font-size: 11px;
        color: #c96;
        margin-top: 2px;
        line-height: 1.3;
    }
}
