/* =========================
   CART
========================= */

.cart-page {
    padding: 50px 0 80px;
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 30px;
    align-items: start;
}


/* =========================
   CART PRODUCTS
========================= */

.cart-products {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cart-product {
    display: flex;
    align-items: center;
    gap: 24px;

    padding: 20px;

    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
}
/* IMAGE */

.cart-product > .cart-product__image {
    display: block;
    flex: 0 0 100px;
    width: 100px !important;
    height: 100px !important;
    min-width: 100px;
    min-height: 100px;
    padding: 0;
    border: 1px solid #e67e32;
    border-radius: 14px;
    object-fit: cover;
    object-position: center;
    box-sizing: border-box;
    overflow: hidden;
}

.cart-product__image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center;
}
/* INFO */

.cart-product__info {
    flex: 1;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
}
.cart-product__info h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
}
.cart-product__info p {
    margin: 0;
    color: #8994A5;
}
.cart-product__info strong {
    margin-top: 8px;
    font-size: 21px;
}


/* =========================
   QUANTITY
========================= */

.cart-product__quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}
.cart-product__quantity button {
    width: 34px;
    height: 34px;
    border: 1px solid #d9dee5;
    border-radius: 8px;
    background: #fff;
    font-size: 20px;
    cursor: pointer;
}
.cart-product__quantity span {
    min-width: 25px;
    text-align: center;
    font-weight: 600;
}
/* =========================
   REMOVE
========================= */

.cart-product__remove {
    border: none;
    background: transparent;

    color: #8994A5;

    cursor: pointer;

    margin-left: auto;
}

.cart-product__remove:hover {
    color: #e77b2c;
}


/* =========================
   CART SUMMARY
========================= */

.cart-summary {
    padding: 26px;

    background: #fff;

    border: 1px solid #e5e7eb;
    border-radius: 16px;

    position: sticky;
    top: 20px;
}

.cart-summary h2 {
    margin: 0 0 25px;

    font-size: 24px;
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;

    margin-bottom: 12px;

    color: #667085;
}

.cart-summary__total {
    display: flex;
    justify-content: space-between;
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid #e5e7eb;
    font-size: 22px;
    font-weight: 700;
}
.cart-summary__checkout {
    width: 100%;
    margin-top: 24px;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
}
.cart-summary__checkout:hover {
    background: var(--color-primary-hover);
}
/* =========================
   EMPTY CART
========================= */
.cart-empty {
    padding: 60px 20px;
    text-align: center;
    color: #8994A5;
}
/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

    .cart-layout {
        grid-template-columns: 1fr;
    }
    .cart-summary {
        position: static;
    }
}
@media (max-width: 600px) {
    .cart-product {
        display: flex;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
    }

    .cart-product img {
        width: 100px !important;
        height: 100px !important;
        min-width: 100px;
        min-height: 100px;
        flex: 0 0 100px;
        object-fit: cover;
        display: block;
        box-sizing: border-box;
    }

    .cart-product__info {
        flex: 1;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .cart-product__info h3 {
        font-size: 16px;
        line-height: 1.4;
        margin: 0;
    }
}
/* КАРТОЧКА КОРЗИНЫ — МОБИЛЬНАЯ ВЕРСИЯ */
@media (max-width: 767px) {
    .cart-products .cart-product {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 20px;
        border: 1px solid #e67e32;
        border-radius: 24px;
        box-sizing: border-box;
    }

    .cart-products .cart-product > .cart-product__image {
        width: 100% !important;
        height: 200px !important;
        min-width: 0 !important;
        min-height: 0 !important;
        flex: none !important;
        object-fit: cover;
        border-radius: 16px;
    }

    .cart-products .cart-product__info {
        width: 100%;
    }

    .cart-products .cart-product__remove {
        align-self: flex-end;
    }
    
    .cart-products .cart-product__info {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .cart-products .cart-product__quantity {
        grid-column: 1;
        grid-row: 4;
        margin-top: 12px;
    }

    .cart-products .cart-product__price {
        grid-column: 2;
        grid-row: 4;
        margin-top: 12px;
        white-space: nowrap;
        align-self: center;
    }
    .cart-products .cart-product__remove {
        align-self: flex-end;
        width: 28px;
        height: 28px;
        padding: 0;
        margin-top: 0;
        margin-bottom: -16px;
        margin-right: -14px;
        background: transparent;
        border: none;
        color: #8994A5;
        cursor: pointer;
        font-size: 0 !important;
    }

    .cart-products .cart-product__remove::after {
        content: "×";
        font-size: 20px;
        font-weight: 500;
    }
}



