.cart-page{padding:26px 0 70px}
.cart-head{align-items:flex-end}

.cart-layout{
    display:grid;
    grid-template-columns:1fr 360px;
    gap:16px;
    align-items:start;
}

.cart-list{
    display:grid;
    gap:12px;
}

.cart-item{
    border-radius:18px;
    border:1px solid rgba(19,34,80,.08);
    background:rgba(255,255,255,.92);
    overflow:hidden;
    display:grid;
    grid-template-columns:120px 1fr;
    gap:12px;
    padding:12px;
}

.cart-item-media{display:flex}
.cart-item-img{
    width:120px;
    height:92px;
    border-radius:16px;
    background-size:cover;
    background-position:center;
    background-repeat:no-repeat;
    border:1px solid rgba(19,34,80,.08);
    background-color:rgba(245,248,255,.9);
}
.cart-item-img-empty{
    display:flex;
    align-items:center;
    justify-content:center;
    color:rgba(129,140,175,.9);
    font-size:22px;
}

.cart-item-body{display:grid;gap:10px;min-width:0}

.cart-item-title{
    font-weight:900;
    color:var(--ns-text-main);
    line-height:1.25;
    display:inline-block;
    max-width:100%;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}
.cart-item-sub{
    margin-top:4px;
    font-size:12px;
    font-weight:800;
    color:var(--ns-text-muted);
}

/* верхняя строка: название + qty + итого + удалить */
.cart-item-top{
    display:grid;
    grid-template-columns:1fr auto auto auto;
    gap:10px;
    align-items:center;
}

.cart-qty{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:6px 8px;
    border-radius:999px;
    border:1px solid rgba(19,34,80,.08);
    background:rgba(245,248,255,.95);
}
.cart-qty-btn{
    width:28px;height:28px;
    border:none;
    border-radius:999px;
    background:rgba(0,82,255,.08);
    color:var(--ns-blue);
    font-weight:900;
}
.cart-qty-input{
    width:46px;
    text-align:center;
    border:none;
    background:transparent;
    font-weight:900;
    color:var(--ns-text-main);
}

.cart-row-total{
    font-weight:900;
    color:var(--ns-blue);
    white-space:nowrap;
}

.cart-item-bottom{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    flex-wrap:wrap;
}
.cart-item-price{
    font-size:13px;
    font-weight:900;
    color:var(--ns-text-muted);
}
.cart-item-line{
    display:none; /* на десктопе итого сверху, на мобилке покажем */
    font-weight:900;
    color:var(--ns-blue);
}

/* Summary */
.cart-summary{
    position:sticky;
    top:calc(var(--site-header-h, 0px) + 12px);
}
.cart-summary-glass{
    border-radius:18px;
    border:1px solid rgba(19,34,80,.08);
    background:rgba(255,255,255,.92);
    padding:14px;
}
.cart-summary-title{
    font-weight:900;
    margin-bottom:10px;
}
.cart-summary-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:10px 12px;
    border-radius:16px;
    border:1px solid rgba(19,34,80,.08);
    background:rgba(245,248,255,.95);
    font-weight:900;
}
.cart-checkout-btn{
    border-radius:999px;
    font-weight:900;
    display:inline-flex;
    align-items:center;
    gap:8px;
}

/* =======================
   Mobile
======================= */
@media (max-width: 991.98px){
    .cart-layout{
        grid-template-columns:1fr;
    }
    .cart-summary{
        position:static;
    }
}

@media (max-width: 575.98px){
    .cart-item{
        grid-template-columns:92px 1fr;
        padding:10px;
        gap:10px;
    }
    .cart-item-img{
        width:92px;height:78px;border-radius:14px;
    }

    .cart-item-top{
        grid-template-columns:1fr 1fr;
        grid-template-areas:
            "title title"
            "qty total"
            "remove remove";
        align-items:start;
    }

    .cart-item-top > div:first-child{grid-area:title}
    .cart-qty-form{grid-area:qty}
    .cart-row-total{grid-area:total;text-align:right}
    .cart-item-top form:last-child{grid-area:remove}

    .cart-item-top form:last-child button{
        width:100%;
        border-radius:14px;
    }

    .cart-item-line{
        display:block;
    }
}
