/* Cart Page CSS - Daeng Rubik */

.page-head {
    padding: 26px 0 10px;
    background: linear-gradient(180deg, #fff, var(--bg-soft));
}
.breadcrumb {
    color: rgba(17, 24, 39, 0.6);
    font-weight: 650;
    font-size: 13px;
}
.page-title {
    margin: 10px 0 0;
    font-size: 28px;
    letter-spacing: -0.02em;
}

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.2fr);
    gap: 24px;
    align-items: flex-start;
}

.cart-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    padding: 20px 22px;
}

.cart-card h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.cart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.link-clear,
.link-remove {
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: var(--red);
    font-weight: 650;
    cursor: pointer;
}

.link-clear:hover,
.link-remove:hover {
    text-decoration: underline;
}

.cart-empty {
    text-align: center;
    padding: 28px 12px 12px;
}

.cart-empty h3 {
    margin: 16px 0 6px;
    font-size: 18px;
}

.cart-empty p {
    margin: 0 0 18px;
    color: var(--muted);
    font-size: 14px;
}

.empty-illustration {
    display: flex;
    justify-content: center;
}

.empty-illustration {
    display: flex;
    justify-content: center;
}

.empty-illustration .cube {
    width: 90px;
    height: 90px;
    border-radius: 18px;
    border: 6px solid #fff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
    position: relative;
    box-sizing: border-box;
    background: #ffffff; /* garis antar kotak */
}

/* 1 kotak → digandakan jadi 3x3 */
.empty-illustration .cube::before {
    content: "";
    position: absolute;
    inset: 6px; /* jarak dari border putih */
    width: 22px;
    height: 22px;
    background: #1e88e5; /* Biru (kotak 1) */
    box-shadow:
        24px 0 #e53935,
        48px 0 #43a047,
        0 24px #fb8c00,
        24px 24px #fdd835,
        48px 24px #1e88e5,
        0 48px #1e88e5,
        24px 48px #43a047,
        48px 48px #e53935;

    border-radius: 6px;
}

.cart-table-wrapper {
    overflow-x: auto;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cart-table th,
.cart-table td {
    padding: 10px 8px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
    text-align: left;
}

.cart-table th {
    font-weight: 700;
    color: var(--muted);
    font-size: 13px;
}

.cart-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-item-info .thumb {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background:
        radial-gradient(
            40px 40px at 30% 30%,
            rgba(229, 57, 53, 0.22),
            transparent 60%
        ),
        radial-gradient(
            40px 40px at 70% 60%,
            rgba(25, 118, 210, 0.18),
            transparent 60%
        ),
        linear-gradient(180deg, #fff, #f3f6ff);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-info .thumb .cube {
    width: 70%;
    height: 70%;
    border-radius: 10px;
    border: 4px solid #fff;
    background: linear-gradient(
        90deg,
        #e53935 0 33%,
        #fdd835 33% 66%,
        #43a047 66% 100%
    );
}

.cart-item-info .name {
    font-weight: 600;
    margin-bottom: 2px;
}

.cart-item-info .meta {
    font-size: 12px;
    color: var(--muted);
}

.qty-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    padding: 4px 8px;
}

.qty-control button {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: none;
    background: rgba(17, 24, 39, 0.04);
    cursor: pointer;
    font-weight: 700;
}

.qty-control span {
    min-width: 20px;
    text-align: center;
    font-weight: 600;
}

.cart-summary {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 6px;
}

.summary-row span:first-child {
    color: var(--muted);
}

.summary-row span:last-child {
    font-weight: 800;
}

input[type="checkbox"] {
    accent-color: var(--red);
}


@media (max-width: 980px) {
    .cart-layout {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   MOBILE CART FIT ONE SCREEN
================================= */
@media (max-width: 720px) {

    .cart-table-wrapper {
        overflow-x: hidden;
    }

    .cart-table {
        width: 100%;
        table-layout: fixed;
        font-size: 11px;
    }

    .cart-table th,
    .cart-table td {
        padding: 6px 4px;
        white-space: nowrap;
        vertical-align: middle;
    }

    /* === 4 KOLOM === */

    .cart-table th:nth-child(1),
    .cart-table td:nth-child(1) {
        width: 8%;
        text-align: center;
    }

    .cart-table th:nth-child(2),
    .cart-table td:nth-child(2) {
        width: 55%;
    }

    .cart-table th:nth-child(3),
    .cart-table td:nth-child(3) {
        width: 22%;
        text-align: center;
    }

    .cart-table th:nth-child(4),
    .cart-table td:nth-child(4) {
        width: 15%;
        text-align: center;
    }

    /* =========================
       FIX GAMBAR PRODUK
    ========================== */

    .cart-item-info {
        display: flex;
        align-items: center;
        gap: 6px;
        min-width: 0; /* 🔥 penting supaya flex tidak overflow */
    }

    .cart-item-info .thumb {
        width: 38px;
        height: 38px;
        border-radius: 8px;
        flex-shrink: 0; /* 🔥 supaya tidak mengecil */
        background: #fff;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cart-item-info .thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain; /* 🔥 tampil full */
        display: block;
    }

    /* =========================
       TEXT HANDLING
    ========================== */

    .cart-item-info > div {
        min-width: 0; /* 🔥 WAJIB agar ellipsis jalan */
        overflow: hidden;
    }

    .cart-item-info .name {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cart-item-info .meta {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* =========================
       QTY CONTROL
    ========================== */

    .qty-control {
        gap: 2px;
        padding: 2px 4px;
    }

    .qty-control button {
        width: 16px;
        height: 16px;
        font-size: 10px;
    }

    .qty-control span {
        font-size: 11px;
        min-width: 14px;
    }

    .cart-table td:last-child i {
        font-size: 12px;
    }

    .summary-row {
        font-size: 12px;
    }
}



