/* 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 .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;
}

/* 1 kotak → digandakan jadi 3x3 */
.empty-illustration .cube::before {
    content: "";
    position: absolute;
    inset: 6px;
    width: 22px;
    height: 22px;
    background: #1e88e5;
    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
================================= */

.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;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qty-control button:hover {
    background: rgba(17, 24, 39, 0.08);
}

.qty-control button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.qty-control button:disabled:hover {
    background: rgba(17, 24, 39, 0.04);
}

/* Qty sekarang input, bukan span */
.qty-input-form {
    display: inline-flex !important;
    align-items: center;
}

.qty-value,
.qty-input {
    width: 42px;
    min-width: 42px;
    height: 26px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--text);
    padding: 0;
}

.qty-input:focus {
    outline: none;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.qty-input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.cart-stock-text {
    font-size: 12px;
    color: var(--muted);
    margin-top: 6px;
}

.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;
    }

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

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

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

    .cart-item-info > div {
        min-width: 0;
        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 MOBILE
    ========================== */

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

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

    .qty-value,
    .qty-input {
        width: 28px;
        min-width: 28px;
        height: 18px;
        font-size: 11px;
        padding: 0;
    }

    .cart-stock-text {
        font-size: 10px;
        margin-top: 4px;
    }

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

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