* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: #f4f4f4;
    color: #333;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

.page {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 0;
}

.page-header {
    margin-bottom: 16px;
}

.page-title {
    margin: 0;
     margin-left: 5px;
    font-size: 22px;
    font-weight: 600;
    color: #464646;
}

.cart {
    width: 100%;
}

.cart-empty {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    color: #777;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 120px;
    gap: 16px;
    align-items: center;

    min-height: 120px;
    background: #fff;
    border-radius: 10px;
    padding: 16px 22px 16px 14px;

    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.cart-item__image-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.cart-item__image {
    display: block;
    max-width: 86px;
    max-height: 72px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.cart-item__code {
    font-size: 12px;
    line-height: 1.2;
    color: #999;
    text-align: center;
    word-break: break-word;
}

.cart-item__info {
    min-width: 0;
    align-self: stretch;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cart-item__name {
    margin-bottom: 6px;

    color: #333;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 400;

    overflow-wrap: anywhere;
}

.cart-item__status {
    margin-bottom: 24px;

    color: #f28c00;
    font-size: 13px;
    line-height: 1.2;
}

.cart-item__qty {
    display: inline-flex;
    align-items: center;

    width: fit-content;
    height: 34px;

    border: 1px solid #e0e0e0;
    border-radius: 7px;
    background: #fff;

    overflow: hidden;
}

.cart-item__qty-btn {
    width: 36px;
    height: 34px;

    border: 0;
    background: #fff;
    color: #999;

    font-size: 18px;
    line-height: 1;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
}

.cart-item__qty-btn:hover {
    background: #f6f6f6;
    color: #333;
}

.cart-item__qty-btn:active {
    background: #eeeeee;
}

.cart-item__qty-input {
    width: 34px;
    height: 34px;

    border: 0;
    outline: none;
    background: #fff;

    color: #333;
    font-size: 15px;
    text-align: center;

    padding: 0;
}

.cart-item__side {
    align-self: stretch;

    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;

    min-width: 0;
}

/* Кнопка удаления: только Font Awesome значок, без рамки и фона */
.cart-remove {
    border: 0;
    background: transparent;
    box-shadow: none;
    outline: none;

    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding: 0;
    margin: 0;

    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;

    color: #C1C1C1;
    font-size: 16px;
    line-height: 1;

    cursor: pointer;
    transform: translateY(4px);
}

.cart-remove:hover {
    color: #A5A5A5;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.cart-remove:focus,
.cart-remove:active {
    border: 0;
    background: transparent;
    box-shadow: none;
    outline: none;
}

.cart-remove i {
    display: block;
    line-height: 1;
    pointer-events: none;
}

.cart-item__price {
    color: #464646;
    font-size: 16px;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
}

.cart-total {
    display: flex;
    justify-content: flex-end;
    align-items: baseline;
    gap: 12px;

    margin-top: 16px;
    padding: 18px 20px;

    background: #fff;
    border-radius: 10px;

    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.cart-total__label {
    color: #555;
    font-size: 16px;
}

.cart-total__price {
    color: #464646;
    font-size: 22px;
    font-weight: 700;
}

/* Планшеты */
@media (max-width: 768px) {
    .page {
        padding: 10px 0;
    }

    .cart-item {
        grid-template-columns: 86px minmax(0, 1fr) 90px;
        gap: 12px;
        padding: 14px;
        min-height: 112px;
    }

    .cart-item__image {
        max-width: 72px;
        max-height: 62px;
    }

    .cart-item__name {
        font-size: 14px;
    }

    .cart-item__price {
        font-size: 15px;
    }
}

/* Телефон */
@media (max-width: 520px) {
    .page {
        padding: 8px;
    }

    .page-title {
        font-size: 20px;
    }

    .cart-list {
        gap: 8px;
    }

    .cart-item {
        grid-template-columns: 64px minmax(0, 1fr) 64px;
        gap: 8px;

        min-height: 104px;
        padding: 10px;

        border-radius: 8px;
    }

    .cart-item__image {
        max-width: 58px;
        max-height: 52px;
    }

    .cart-item__code {
        font-size: 11px;
    }

    .cart-item__name {
        margin-bottom: 4px;
        font-size: 13px;
        line-height: 1.25;
    }

    .cart-item__status {
        margin-bottom: 12px;
        font-size: 12px;
    }

    .cart-item__qty {
        height: 30px;
        border-radius: 6px;
    }

    .cart-item__qty-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .cart-item__qty-input {
        width: 28px;
        height: 30px;
        font-size: 14px;
    }

    .cart-remove {
        font-size: 15px;
    }

    .cart-item__price {
        font-size: 14px;
    }

    .cart-total {
        padding: 14px;
        border-radius: 8px;
    }

    .cart-total__label {
        font-size: 15px;
    }

    .cart-total__price {
        font-size: 20px;
    }
}


 .cart-checkout-button {
    margin-top: 16px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: #29AD5E;
    color: #ffffff;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
         display: block;       /* превращаем в блочный элемент */
        margin-left: auto;    /* сдвигаем вправо */
}

.cart-checkout-button:hover {
    background: #31B764;
}

.cart-checkout-button:disabled {
    opacity: 1;
    cursor: default;
}

.cart-remains-modal {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100vh;
    z-index: 10000;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(0, 0, 0, 0.35);
}

.cart-remains-modal-box {
    position: relative;
    width: calc(100% - 32px);
    max-width: 560px;
    max-height: calc(100vh - 40px);
    overflow: auto;

    background: #ffffff;
    border-radius: 12px;
    padding: 20px 18px 18px 18px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
}

.cart-remains-modal-close {
    position: absolute;
    right: 10px;
    top: 8px;

    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: #555555;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.cart-remains-modal-title {
    padding-right: 34px;
    margin-bottom: 14px;
    font-size: 18px;
    font-weight: 700;
    color: #333333;
}

.cart-remains-modal-content {
    font-size: 15px;
    color: #333333;
}

.cart-remains-item {
    padding: 10px 0;
    border-top: 1px solid #eeeeee;
}

.cart-remains-item:first-child {
    border-top: none;
}

.cart-remains-item-title {
    font-weight: 700;
    margin-bottom: 4px;
}

.cart-remains-item-info {
    color: #666666;
    font-size: 14px;
}

.cart-remains-success {
    color: #1CA252;
}

.cart-remains-error {
    color: #DC3545;
}

.cart-remains-next-button {
    margin-top: 16px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: #1CA252;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.cart-remains-next-button:hover {
    background: #168743;
}

@media (max-width: 800px) {
    .cart-remains-modal-box {
        width: calc(100% - 24px);
        padding: 18px 14px 16px 14px;
    }
}






/* Совсем узкие экраны, чтобы не разорвало в труху */
@media (max-width: 380px) {
    .cart-item {
        grid-template-columns: 58px minmax(0, 1fr) 58px;
        gap: 6px;
        padding: 8px;
    }

    .cart-item__image {
        max-width: 52px;
        max-height: 48px;
    }

    .cart-item__name {
        font-size: 12px;
    }

    .cart-item__status {
        font-size: 11px;
    }

    .cart-item__price {
        font-size: 13px;
    }
}