/* =========================================
   CART / KERANJANG PADEPOKANFRESH
========================================= */

.cart-page {
    padding: 40px 0 70px;
}

.cart-page > .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* =========================================
   JUDUL
========================================= */

.cart-page .page-title {
    margin-bottom: 28px;
}

.cart-page .page-title .eyebrow {
    display: block;
    margin-bottom: 8px;
}

.cart-page .page-title h1 {
    margin: 0 0 8px;
    font-size: 38px;
    line-height: 1.2;
    color: #173d24;
}

.cart-page .page-title p {
    margin: 0;
    color: #777;
    font-size: 15px;
}

/* =========================================
   ALERT
========================================= */

.cart-page .alert {
    padding: 13px 16px;
    margin-bottom: 18px;
    border-radius: 10px;
}

.cart-page .alert-success {
    background: #eaf8ed;
    color: #16763a;
}

.cart-page .alert-error {
    background: #fff0f0;
    color: #c62828;
}

/* =========================================
   LAYOUT
========================================= */

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

/* =========================================
   DAFTAR PRODUK
========================================= */

.cart-items {
    width: 100%;
    min-width: 0;
}

/* =========================================
   ITEM PRODUK
========================================= */

.cart-item {
    display: grid;

    grid-template-columns: 90px minmax(0, 1fr) auto;

    grid-template-areas:
        "image info total"
        "image qty total";

    gap: 8px 15px;

    width: 100%;
    box-sizing: border-box;

    padding: 14px;

    margin-bottom: 12px;

    background: #fff;

    border: 1px solid #e5ebe6;

    border-radius: 14px;

    box-shadow: 0 3px 12px rgba(0, 0, 0, .04);
}

/* =========================================
   GAMBAR
========================================= */

.cart-item-image {
    grid-area: image;

    display: block;

    width: 90px;
    height: 90px;

    border-radius: 11px;

    overflow: hidden;

    background: #f6f8f6;
}

.cart-item-image img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;
}

/* =========================================
   INFORMASI PRODUK
========================================= */

.cart-item-info {
    grid-area: info;

    min-width: 0;

    padding-top: 2px;
}

.cart-item-name {
    display: block;

    color: #173d24;

    font-size: 16px;
    font-weight: 700;

    line-height: 1.35;

    text-decoration: none;

    margin-bottom: 4px;
}

.cart-item-name:hover {
    color: #16853b;
}

.cart-item-info small {
    display: block;

    color: #888;

    font-size: 12px;

    margin-bottom: 5px;
}

.cart-item-info strong {
    display: block;

    color: #16853b;

    font-size: 14px;
}

/* =========================================
   QUANTITY
========================================= */

.cart-qty {
    grid-area: qty;

    display: flex;

    align-items: center;

    width: fit-content;

    border: 1px solid #dfe6e0;

    border-radius: 7px;

    overflow: hidden;
}

.cart-qty button {
    width: 30px;
    height: 30px;

    padding: 0;

    border: 0;

    background: #f4f7f4;

    cursor: pointer;

    font-size: 17px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-qty button:hover {
    background: #eaf7ef;
    color: #16853b;
}

.cart-qty input {
    width: 35px;
    height: 30px;

    padding: 0;

    border: 0;

    border-left: 1px solid #dfe6e0;
    border-right: 1px solid #dfe6e0;

    text-align: center;

    outline: none;

    font-size: 12px;
}

/* =========================================
   TOTAL ITEM
========================================= */

.cart-item-total {
    grid-area: total;

    min-width: 100px;

    display: flex;

    flex-direction: column;

    align-items: flex-end;

    justify-content: space-between;

    text-align: right;
}

.cart-item-total strong {
    color: #173d24;

    font-size: 14px;

    white-space: nowrap;
}

.remove-cart {
    color: #d93636;

    font-size: 11px;

    text-decoration: none;
}

.remove-cart:hover {
    text-decoration: underline;
}

/* =========================================
   AKSI KERANJANG
========================================= */

.cart-actions {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    margin-top: 15px;
}

.cart-actions .btn-outline {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 10px 16px;

    border: 1px solid #16853b;

    border-radius: 9px;

    color: #16853b;

    text-decoration: none;

    font-size: 13px;

    font-weight: 700;
}

.cart-actions .btn-outline:hover {
    background: #16853b;
    color: #fff;
}

.clear-cart {
    color: #d93636;

    font-size: 12px;

    text-decoration: none;
}

.clear-cart:hover {
    text-decoration: underline;
}

/* =========================================
   RINGKASAN
========================================= */

.cart-summary {
    width: 100%;

    box-sizing: border-box;

    padding: 20px;

    background: #f4faf2;

    border: 1px solid #dfe9df;

    border-radius: 15px;

    position: sticky;

    top: 20px;
}

.cart-summary h2 {
    margin: 0 0 15px;

    color: #173d24;

    font-size: 18px;
}

.summary-row {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

    padding: 8px 0;

    border-bottom: 1px solid #dfe9df;

    font-size: 13px;
}

.summary-row span {
    color: #666;
}

.summary-row strong {
    color: #333;

    text-align: right;
}

.summary-total {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-top: 12px;

    padding-top: 14px;

    border-top: 2px solid #cbdcc9;
}

.summary-total span {
    font-size: 15px;

    font-weight: 700;
}

.summary-total strong {
    color: #16853b;

    font-size: 19px;
}

.checkout-btn {
    display: flex;

    align-items: center;

    justify-content: center;

    width: 100%;

    min-height: 44px;

    margin-top: 16px;

    border-radius: 9px;

    text-align: center;

    text-decoration: none;

    font-size: 13px;

    font-weight: 700;
}

/* =========================================
   KERANJANG KOSONG
========================================= */

.cart-empty {
    max-width: 500px;

    margin: 40px auto;

    padding: 50px 20px;

    text-align: center;

    background: #fff;

    border: 1px solid #e5ebe6;

    border-radius: 16px;
}

.cart-empty-icon {
    margin-bottom: 12px;

    font-size: 50px;
}

.cart-empty h2 {
    margin: 0 0 8px;

    color: #173d24;
}

.cart-empty p {
    margin-bottom: 20px;

    color: #777;
}

/* =========================================================
   MOBILE RESPONSIVE - KERANJANG PADEPOKANFRESH
========================================================= */
@media screen and (max-width: 700px) {
    .cart-page,
    .cart-page * {
        box-sizing: border-box;
    }

    .cart-page {
        width: 100%;
        max-width: 100%;
        padding: 20px 0 40px;
        overflow-x: hidden;
    }

    .cart-page > .container {
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        padding: 0 12px;
    }

    .cart-page .page-title {
        margin-bottom: 18px;
    }

    .cart-page .page-title h1 {
        font-size: 26px;
        line-height: 1.2;
    }

    .cart-page .page-title p {
        font-size: 13px;
        line-height: 1.5;
    }

    .cart-page .cart-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        width: 100%;
        min-width: 0;
    }

    .cart-page .cart-items {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .cart-page .cart-item {
        display: grid;
        grid-template-columns: 60px minmax(0, 1fr) minmax(58px, auto);
        grid-template-areas:
            "image info total"
            "image qty total";
        align-items: center;
        gap: 6px 9px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 9px;
        margin: 0 0 10px;
        overflow: hidden;
    }

    .cart-page .cart-item-image {
        grid-area: image;
        display: block;
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        height: 60px;
        min-height: 60px;
        max-height: 60px;
        padding: 0;
        margin: 0;
        overflow: hidden;
        border-radius: 8px;
        flex: 0 0 60px;
    }

    .cart-page .cart-item-image img {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        object-fit: contain;
        margin: 0;
        padding: 0;
    }

    .cart-page .cart-item-info {
        grid-area: info;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .cart-page .cart-item-name {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        font-size: 12px;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .cart-page .cart-item-info small {
        font-size: 9px;
    }

    .cart-page .cart-item-info strong {
        font-size: 11px;
    }

    .cart-page .cart-qty {
        grid-area: qty;
        display: flex;
        width: fit-content;
        max-width: 100%;
        min-width: 0;
        margin: 0;
    }

    .cart-page .cart-qty button {
        width: 24px;
        min-width: 24px;
        height: 24px;
        font-size: 14px;
    }

    .cart-page .cart-qty input {
        width: 28px;
        min-width: 28px;
        height: 24px;
        font-size: 11px;
    }

    .cart-page .cart-item-total {
        grid-area: total;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: space-between;
        min-width: 0;
        max-width: 100%;
        text-align: right;
    }

    .cart-page .cart-item-total strong {
        font-size: 10px;
        line-height: 1.3;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .cart-page .remove-cart {
        font-size: 9px;
        white-space: nowrap;
    }

    .cart-page .cart-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 10px;
    }

    .cart-page .cart-actions .btn-outline {
        width: 100%;
        padding: 10px;
        box-sizing: border-box;
        text-align: center;
    }

    .cart-page .clear-cart {
        text-align: center;
        font-size: 11px;
    }

    .cart-page .cart-summary {
        position: static;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        padding: 15px;
    }

    .cart-page .summary-row {
        gap: 8px;
        font-size: 12px;
    }

    .cart-page .summary-row strong {
        overflow-wrap: anywhere;
    }

    .cart-page .summary-total strong {
        font-size: 17px;
        overflow-wrap: anywhere;
        text-align: right;
    }

    .cart-page .checkout-btn {
        width: 100%;
        min-height: 44px;
        font-size: 12px;
    }

    .cart-page .cart-empty {
        margin: 25px auto;
        padding: 40px 15px;
    }
}
