.cart {
    padding-bottom: 2rem;
    background-color: var(--pageBg);
}
.cart__container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
@media (min-width: 1023.98px) {
    .cart__container {
        min-height: 100vh;
        justify-content: space-between;
        gap: 2rem;
    }
}

.cart__wrapper {
    width: calc(100% + 0.5rem);
    margin: 0 0 2rem;
}
@media (min-width:1023.98px) {
    .cart__wrapper {
        flex: 0 0 calc(100% - 22.5rem);
        width: calc(100% - 22.5rem);
    }
}

.cart__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: .9375rem .625rem .625rem;
    text-transform: uppercase;
    font-size: 1rem;
}
.all-delete {
    cursor: pointer;
}

.cart-list {
    background-color:white;
    border: 1px solid var(--borderColor);
    border-radius: 0.5rem;
    overflow: clip;
}

.cart-row {
    position: relative;
    padding: .5rem .5rem .5rem 2.1875rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    counter-increment: listItem;
    transition: .1s;
}
.cart-row:not(:last-child) {
    border-bottom: .0625rem dashed var(--colorTheme);
}
.cart-row::before {
    position: absolute;
    top: 0;
    left: 0;
    content: counter(listItem) "";
    min-width: 1.4375rem;
    height: 100%;
    border-right: .0625rem dashed var(--colorTheme);
    background: var(--bgLight);
    color: var(--colorTheme);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: .75rem;
    font-weight: 700;
}

.cart-row__media {
    position: relative;
    flex: 0 0 3.75rem;
    width: 3.75rem;
    height: 3.75rem;
    aspect-ratio: 1 / 1;
    border: .0625rem solid var(--borderColor);
    border-radius: .3125rem;
    overflow: hidden;
}
.cart-row__media img { width: 100%; height: 100%; object-fit: contain; }
.cart-row__noimg { color: var(--muted); font-size: 24px; }
.cart-row__info {
    display: flex;
    width: calc(100% - 16.875rem);
    white-space: nowrap;
    flex: 1 1 auto;
    margin: .25rem .625rem 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    height: 100%;
    row-gap: .3125rem;
}

.cart-row__name {
    max-width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    font-weight: 500;
}
.cart-row__name:hover { color: var(--primary); }
/* Откуда позиция взялась: «Подарок». Количество у такой позиции не меняется */
.cart-row__note {
    display: inline-block; margin-right: 6px; padding: 2px 8px;
    border-radius: 999px; background: var(--success-soft, #e8f5ec);
    font-size: 12px; font-weight: 600; color: var(--success, #2e7d4f);
}
/* Количество подарка не правится: показываем число, а не поле ввода */
.cart-qty.cart-qty--fixed {
    display: flex; align-items: center; justify-content: center;
    min-width: 52px; height: 38px; border: 0; color: var(--muted);
}
.cart-row__services { margin: 6px 0 0; padding-left: 16px; font-size: 12px; color: var(--muted); }
.cart-row__price { 
    margin-top: .3125rem;
    color: var(--bordo);
}
.cart-row__unit { color: var(--muted); font-size: 12px; }
/* Цена до скидки и за что она дана */
.cart-row__old { margin-right: 6px; color: var(--muted); font-size: 13px; text-decoration: line-through; }
.cart-row__now.is-sale { color: var(--danger); font-weight: 600; }
.cart-row__reasons { margin: 4px 0 0; padding: 0; list-style: none; white-space: normal; }
.cart-row__reasons li { color: var(--muted); font-size: 12px; line-height: 1.35; }
.cart-row__some {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    flex: 0 0 5rem;
    gap: .5625rem;
}
.cart-row__total {
    padding-top: .3125rem;
    display: flex;
    white-space: nowrap;
    color: var(--bordo);
}
.cart-row__remove {
    position: absolute;
    bottom: .5rem;
    right: .5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 1.25rem;
    height: 1.25rem;
}
.cart-row__remove:hover { color: var(--bordo); }

.cart-row__remove .icon-close {
    width: 0.75rem;
    height: 0.75rem;
    stroke: var(--bordo);
}

.cart-qty {
    display: flex;
    align-items: center;
    border: 1px solid var(--colorTheme);
    border-radius: 0.3125rem;
    overflow: hidden;
}
.cart-qty__btn {
    width: 1.875rem;
    height: 2rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.125rem;
    font-weight: 800;
}
.cart-qty__btn:hover { background: var(--surface, #f1f5f9); color: var(--primary); }
.cart-qty__input {
    width: 2.5rem;
    height: 2rem;
    padding: 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
}
.cart-qty__input:focus { box-shadow: none; }
.cart-row__addition {
    display: flex;
    align-items: center;
    flex: 0 0 13.75rem;
    column-gap: .625rem;
    margin: .875rem 0 .3125rem .1875rem;
    color: var(--green);
    font-weight: 500;
    cursor: pointer;
}
.cart-row__addition-icon {
    width: .875rem;
    height: .875rem;
    background: url(/storage/files/icons/plus-green.svg) 50% / 100% no-repeat;
}

.cart-summary {
    position: static;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 0 0.5rem;
}
@media (min-width:1023.98px) {
    .cart-summary {
        position: sticky;
        top: 5.375rem;
        flex: unset;
        align-self: flex-start;
        padding: 1.375rem;
        border: 1px solid var(--borderColor);
        border-radius: 0.5rem;
        background-color: white;
    }
}
.cart-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.cart-summary__row--total {
    padding: 1rem 0;
    border-top: 1px solid var(--borderColor);
    border-bottom: 1px solid var(--borderColor);
    font-size: 1.125rem;
    font-weight: 500;
}
.cart-summary__row--discount span:last-child { color: var(--success, #10b981); font-weight: 600; }

/* За что дана скидка: список акций мельче суммы, со сдвигом — это пояснение
   к строке выше, а не отдельные суммы */
.cart-summary__rules { list-style: none; margin: 2px 0 0; padding: 0 0 0 10px; display: flex; flex-direction: column; gap: 4px; }
.cart-summary__rules li { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
/* Сколько осталось до бесплатной доставки */
.cart-summary__free { display: flex; gap: 8px; align-items: center; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #10b981 12%, transparent); color: #059669; font-size: 13px; }
/* Заказ меньше минимальной суммы — оформление недоступно */
.cart-summary__checkout.is-disabled {
    background-color: var(--borderColor);
    pointer-events: none;
}
.cart-summary__warn {
    height: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    gap: 8px;
    border-radius: 10px;
    background: var(--cream2);
    color: #b91c1c;
    font-size: 13px;
    overflow: hidden;
    transition: 0.2s;
}
.cart-summary__warn.active {
    display: flex;
    height: 2.875rem;
}
.cart-summary__checkout {
    align-self: center;
}
.cart-summary__continue {
    align-self: center;
    max-width: 272px;
    width: 100%;
    border-width: 1px;
    color: var(--font-color);
    background-color: white;
    font-size: 0.875rem;
    text-align: center;
}
.cart-summary__continue:hover {
    background-color: var(--green3);
}

.cart-empty { text-align: center; padding: 64px 20px; color: var(--muted); }
.cart-empty i { font-size: 52px; opacity: .35; }
.cart-empty p { margin: 18px 0; font-size: 16px; }

/* Кнопка «в корзину» — подтверждение при добавлении */
.pcard__buy.is-added, .product-buy.is-added { background: #10b981 !important; }
