﻿/* =========================
   CART PAGE
========================= */

.cart-page {
    padding: 40px 20px 60px;
    background: #f8f9fa;
    min-height: 70vh;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
}


/* =========================
   HEADER
========================= */

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
}

    .cart-header h1 {
        margin: 0;
        font-size: 30px;
        font-weight: 700;
        color: #222;
    }

    .cart-header span {
        color: #777;
        font-size: 15px;
    }


/* =========================
   CART LAYOUT
========================= */

.cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 25px;
    align-items: start;
}


/* =========================
   CART ITEMS
========================= */

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cart-item {
    display: grid;
    grid-template-columns: 105px minmax(0, 1fr) auto 130px;
    gap: 18px;
    align-items: center;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}


/* =========================
   IMAGE
========================= */

.cart-item-image {
    width: 105px;
    height: 105px;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f1f1;
}

    .cart-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 35px;
}


/* =========================
   PRODUCT INFO
========================= */

.cart-item-info {
    min-width: 0;
}

.cart-product-name {
    display: block;
    color: #222;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

    .cart-product-name:hover {
        text-decoration: underline;
    }

.cart-variant {
    color: #777;
    font-size: 14px;
    margin-bottom: 4px;
}

    .cart-variant strong {
        color: #444;
    }

.cart-price {
    margin-top: 9px;
    font-size: 15px;
    font-weight: 600;
}


/* =========================
   QUANTITY
========================= */

.cart-quantity {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.qty-btn {
    width: 34px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    font-size: 20px;
    cursor: pointer;
}

    .qty-btn:hover {
        background: #e9e9e9;
    }

.qty-value {
    min-width: 38px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
}


/* =========================
   ITEM TOTAL
========================= */

.cart-item-total {
    text-align: right;
}

    .cart-item-total strong {
        display: block;
        font-size: 17px;
        margin-bottom: 8px;
    }

.remove-btn {
    border: none;
    background: transparent;
    color: #d33;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}

    .remove-btn:hover {
        text-decoration: underline;
    }


/* =========================
   SUMMARY
========================= */

.cart-summary {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 20px;
}

    .cart-summary h2 {
        margin: 0 0 20px;
        font-size: 21px;
        font-weight: 700;
    }

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 14px;
    color: #555;
    font-size: 14px;
}

    .summary-row strong {
        color: #222;
    }

    .summary-row span:last-child {
        text-align: right;
    }

.summary-divider {
    height: 1px;
    background: #eee;
    margin: 18px 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

    .summary-total strong {
        font-size: 21px;
    }


/* =========================
   CHECKOUT
========================= */

.checkout-btn {
    width: 100%;
    border: none;
    border-radius: 8px;
    padding: 13px 15px;
    background: #198754;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

    .checkout-btn:hover {
        background: #157347;
    }

.continue-shopping {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
}

    .continue-shopping:hover {
        text-decoration: underline;
    }


/* =========================
   EMPTY CART
========================= */

.empty-cart {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    text-align: center;
    padding: 70px 20px;
}

.empty-cart-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.empty-cart h2 {
    margin: 0 0 10px;
    font-size: 24px;
}

.empty-cart p {
    margin: 0 0 25px;
    color: #777;
}

.btn-shop {
    display: inline-block;
    padding: 12px 22px;
    background: #198754;
    color: #fff;
    border-radius: 7px;
    text-decoration: none;
    font-weight: 600;
}

    .btn-shop:hover {
        background: #157347;
    }


/* =========================
   TABLET
========================= */

@media (max-width: 900px) {

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .cart-item {
        grid-template-columns: 90px minmax(0, 1fr) auto;
    }

    .cart-item-total {
        grid-column: 2 / 4;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        border-top: 1px solid #eee;
        padding-top: 12px;
    }

        .cart-item-total strong {
            margin: 0;
        }
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    .cart-page {
        padding: 25px 12px 40px;
    }

    .cart-header {
        margin-bottom: 18px;
    }

        .cart-header h1 {
            font-size: 24px;
        }

    .cart-item {
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 12px;
        padding: 12px;
    }

    .cart-item-image {
        width: 80px;
        height: 80px;
    }

    .cart-product-name {
        font-size: 16px;
    }

    .cart-variant {
        font-size: 13px;
    }

    .cart-price {
        font-size: 14px;
    }

    .cart-quantity {
        grid-column: 1 / 2;
        justify-self: start;
    }

    .cart-item-total {
        grid-column: 2 / 3;
        border-top: none;
        padding-top: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 5px;
    }

        .cart-item-total strong {
            font-size: 15px;
        }

    .cart-summary {
        padding: 18px;
    }
}
