.w-100 {
    width: 100%;
}

.cart {
    --hit: 48px;
    font-family: var(--font);
    color: var(--ink);
    background-color: var(--bgc-app);
    max-width: 1400px;
    width: var(--full-width);
    margin: 0 auto;
    padding: 28px clamp(14px, 3vw, 36px);
    box-sizing: border-box;
}

.cart a {
    color: inherit;
    text-decoration: none;
}

.cart .link {
    color: var(--author-music);
}

.cart__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.cart__title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: var(--font-size-text);
}

.cart__title {
    font-size: var(--font-size-title);
    font-weight: var(--font-weight-bold);
    margin: 0;
    color: var(--text-white);
}

.cart__count-badge {
    font-size: var(--font-size-text);
    font-weight: var(--font-weight-bold);
    color: var(--text-grey);
    border: 1px solid var(--side-border);
    border-radius: var(--border-radius);
    padding: 3px 8px;
    line-height: 1;
}

.cart__header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cart__select-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-text);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    color: var(--text-grey);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 0;
    opacity: var(--opacity-btn-hover);
    transition:
        opacity 0.15s,
        color 0.15s;
    font-family: var(--font-family-app);
}

.cart__select-all:hover {
    opacity: var(--opacity-btn-hover);
    color: var(--text-white);
}

.cart__select-all[data-state="all"] {
    color: var(--text-white);
    opacity: var(--opacity-btn-hover);
}

.cart__grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
    align-items: start;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}

.cart__grid.fade-out {
    opacity: 0;
    transform: translateY(-6px);
}

.cart__grid.fade-in {
    opacity: 0;
    transform: translateY(6px);
}

.cart__empty-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 12px;
    text-align: center;
    gap: 18px;
    min-height: calc(100vh - 200px);
    box-sizing: border-box;
}

.cart-empty-lottie {
    width: min(60vw, 300px);
    height: min(60vw, 300px);
    display: block;
}

.cart__empty-text {
    margin: 0;
    color: var(--text-grey);
    font-size: clamp(14px, 3.6vw, 17px);
    line-height: 1.4;
}

.cart__list {
    display: flex;
    flex-direction: column;
}

.line {
    display: grid;
    grid-template-columns: 20px 100px 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--side-border);
    transition: opacity 0.2s ease;
}

.cart__list .line:first-child {
    border-top: 1px solid var(--side-border);
}

.cart__list.has-selection .line:not(.is-selected) {
    opacity: 0.4;
}

.cart__list.has-selection .line.is-selected {
    opacity: 1;
}

.line__check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.line__checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: var(--size-icons-xs);
    height: var(--size-icons-xs);
    border-radius: var(--middle-border);
    border: 2px solid var(--side-border);
    cursor: pointer;
    background: transparent;
    transition:
        border-color 0.15s,
        background 0.15s;
    position: relative;
    flex-shrink: 0;
}

.line__checkbox:checked {
    background: var(--text-white);
    border-color: var(--text-white);
}

.line__checkbox:checked::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3 3.5L11 1' stroke='%23111' stroke-width='2.2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
        center / 11px no-repeat;
}

.line__media {
    width: var(--full-width);
    height: var(--full-height);
    border-radius: var(--border-radius);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--side-border);
    display: block;
}

.line__media img {
    width: var(--full-width);
    height: var(--full-height);
    object-fit: cover;
    border-radius: var(--border-radius);
    display: block;
    transition: transform 0.3s ease;
}

.line__media:hover img {
    transform: scale(1.04);
}

.line__media dotlottie-player {
    display: block;
    width: var(--full-width);
    height: var(--full-height);
}

.line__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.line__chip {
    display: inline-block;
    font-size: var(--font-size-text);
    font-weight: var(--font-weight);
    text-transform: uppercase;
    color: var(--text-white);
    background: var(--bgc-input-div);
    border: 1px solid var(--side-border);
    padding: 3px 9px;
    border-radius: var(--border-radius);
    width: fit-content;
}

.line__title {
    font-size: var(--font-size-title);
    font-weight: var(--font-weight);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-white);
    display: block;
    transition: color 0.15s;
}

.line__meta {
    font-size: var(--font-size-text);
    color: var(--text-grey);
    line-height: 1.3;
}

.line__extra {
    font-size: var(--font-size-text);
    color: var(--text-grey);
    opacity: var(--opacity-btn-hover);
}

.line__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    min-width: 110px;
}

.line__price-total {
    font-size: var(--font-size-title);
    font-weight: var(--font-weight);
    color: var(--text-white);
}

.line__price-unit {
    font-size: var(--font-size-text);
    color: var(--text-grey);
    text-align: right;
}

.line__actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.line__btn,
.cart .icon {
    width: var(--size-icons-l);
    height: var(--size-icons-l);
    border-radius: var(--border-radius);
    border: 1px solid var(--side-border);
    background: var(--bgc-input-div);
    color: var(--text-grey);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition:
        border-color 0.15s,
        color 0.15s,
        background 0.15s;
    padding: 0;
    min-width: unset;
    flex-shrink: 0;
}

.line__btn:hover,
.cart .icon:hover {
    background: var(--bgc-input-div);
    color: var(--text-white);
}

.line__btn--trash:hover,
.cart .icon--trash:hover {
    border-color: var(--danger-error);
    color: var(--bgc-app);
    background: var(--danger-error);
}

.cart__pagination {
    margin: 24px 0 4px;
}

.cart__pagination ul {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.cart__pagination a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--side-border);
    font-size: var(--font-size-text);
    color: var(--text-grey);
    transition:
        background 0.15s,
        color 0.15s;
}

.cart__pagination a:hover {
    background: var(--bgc-input-div);
    color: var(--text-white);
}

.cart__pagination .is-active a {
    background: var(--side-border);
    color: var(--text-white);
    font-weight: var(--font-weight);
    border-color: var(--side-border);
}

.summary,
.summary--below {
    position: sticky;
    top: 24px;
    background: var(--bgc-input-div);
    border: 1px solid var(--side-border);
    border-radius: var(--border-radius);
    padding: 24px;
    box-sizing: border-box;
}

.summary__title {
    margin: 0 0 20px;
    font-size: var(--font-size-title);
    font-weight: var(--font-weight);
    text-transform: uppercase;
    color: var(--text-white);
}

.summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    font-size: var(--font-size-text);
    border-bottom: 1px dashed var(--side-border);
}

.summary__row:last-of-type {
    border-bottom: none;
}

.summary__row span {
    color: var(--text-grey);
}

.summary__row strong {
    color: var(--text-white);
    font-weight: var(--font-weight);
}

.summary__row--taxes strong {
    color: var(--warning);
}

.summary__row--selected span {
    color: var(--text-tunedr);
    opacity: var(--opacity-btn-hover);
}

.summary__row--selected strong {
    color: var(--text-tunedr);
}

.summary__row--discount strong {
    color: var(--success);
}

.summary__sep {
    border: 0;
    border-top: 1px solid var(--side-border);
    margin: 14px 0;
}

.summary__row--total {
    border-bottom: none;
    padding: 10px 0 6px;
}

.summary__row--total span {
    font-size: var(--font-size-text);
    font-weight: var(--font-weight);
    color: var(--text-white);
}

.summary__row--total strong {
    font-size: var(--font-size-title);
    font-weight: var(--font-weight);
    color: var(--text-white);
}

.summary__promo {
    margin: 16px 0 6px;
}

.promo__label {
    font-size: var(--font-size-text);
    color: var(--text-grey);
    display: block;
    margin-bottom: 8px;
}

.promo__row {
    display: flex;
    gap: 0;
    align-items: stretch;
    border: 1px solid var(--side-border);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--side-border);
}

.promo__input {
    flex: 1;
    height: 44px;
    padding: 0 14px;
    border: none;
    background: transparent;
    color: var(--text-white);
    font-size: var(--font-size-text);
    font-family: var(--font-family-app);
    box-sizing: border-box;
    outline: none;
}

.promo__input::placeholder {
    color: var(--text-grey);
}

.promo__error {
    color: var(--danger-error);
    background: none;
    font-size: var(--font-size-text);
    font-family: var(--font-family-errors);
    margin: 7px 0 0 0;
    padding: 0 2px;
    min-height: 18px;
    line-height: 1.3;
    font-weight: var(--font-weight);
    border: none;
    display: block;
}

.promo__input.is-invalid {
    outline: none;
}

.promo__row.promo__row--error {
    border: 1.5px solid var(--danger-error) !important;
}

.btn--apply {
    height: 44px;
    padding: 0 16px;
    background: var(--side-border);
    color: var(--ink-soft);
    border: none;
    border-left: 1px solid var(--side-border);
    font-size: var(--font-size-text);
    font-weight: var(--font-weight);
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--font-family-app);
    transition:
        background 0.15s,
        color 0.15s;
}

.btn--apply:hover {
    opacity: var(--opacity-btn-hover);
}

.btn-buy {
    border-radius: var(--border-radius);
    background: var(--bgc-white);
    color: var(--text-black);
    width: var(--full-width);
    border: none;
    height: 45px;
    font-weight: var(--font-weight);
}

.btn-buy:hover {
    opacity: var(--opacity-btn-hover);
}

@media (max-width: 960px) {
    .cart__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .summary,
    .summary--below {
        position: static;
    }
}

@media (max-width: 640px) {
    .cart {
        padding: 20px clamp(12px, 4vw, 20px);
    }

    .cart__header {
        margin-bottom: 24px;
    }

    .cart__header-actions {
        gap: 14px;
    }

    .cart__select-all {
        font-size: var(--font-size-text);
    }

    .line {
        grid-template-columns: 20px 80px 1fr;
        gap: 12px;
    }

    .line__right {
        grid-column: 2 / -1;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-width: 0;
    }

    .line__price-unit {
        text-align: left;
    }

    .line__media {
        width: 80px;
        height: 80px;
    }

    .summary,
    .summary--below {
        padding: 18px;
    }

    .cart .btn {
        width: var(--full-width);
    }
}

@media (max-width: 420px) {
    .cart__empty-wrapper {
        padding: 40px 10px;
        min-height: 60vh;
    }

    .cart-empty-lottie {
        width: min(72vw, 260px);
        height: min(72vw, 260px);
    }

    .cart__empty-text {
        font-size: var(--font-size-text);
    }
}
