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

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    /* background-color: #555; */
}

.header-cart {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    width: 100%;
    z-index: 9999;
}

.header-cart-wrap {}

.header-card-title {}

.card-section {}

.container-card {
    /* background-color: aliceblue; */
    max-width: 1300px;
    margin: 20px auto;
    padding: 20px 20px;
    border-radius: 30px;
}

.cart-wrapper {
    margin: 10px auto;
    align-items: center;
    display: grid;
    grid-template-columns: 1fr 340px;
    /* width: 600px; */
    align-items: start;
    gap: 25px;
}

.carts-block-elem {
    background-color: #fff;
    padding: 40px;
    border-radius: 12px;
    /* border: 1px solid #111; */
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);

}

.cart-summary {
    position: sticky;
    /* чтобы правая колонка "липла" при скролле */
    top: 70px;
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    display: flex;
    flex-direction: column;
    gap: 16px;

}

#checkout-form .submit-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}


h1 {
    text-align: center;
    /* margin-bottom: 30px; */
}

form {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

input,
select {
    padding: 10px;
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
}


.total {
    font-size: 18px;
    margin-top: 20px;
    font-weight: bold;
}


.submit-btn {
    padding: 12px;
    background-color: #098507;
    color: #fff;
    font-size: 16px;
    border: none;
    cursor: pointer;
}



.cart-item {
    display: flex;
    /* align-items: center; */
    gap: 20px;
    border-bottom: 1px solid #ccc;
    padding: 15px 0;


}

.cart-item img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
}

.cart-details {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 8px;
}

.cart-details strong {
    font-size: 18px;
}

.cart-details .size {
    font-size: 14px;
    color: #555;
}

/* Контейнер для количества и цены */
.qty-price-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.card-block-size-price {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    width: 100%;
}

/* Кол-во */
.cart-controls {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 10px;
    border: 1px solid #d7d3d3;
    width: 120px;
    height: 40px;
    border-radius: 9999px;
}

.cart-size {
    display: flex;
}

.cart-price {
    /* align-items: flex-end;
    display: flex;
    justify-content: flex-end; */
    /* padding: 0 0 0 30px; */
}

.cart-size {
    color: #888;
}

.cart-desc {
    margin-top: 4px;
    font-size: 14px;
    opacity: .85;
    padding: 0 40px 0 0;


    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* ← Количество строк (можешь поставить 2) */
    -webkit-box-orient: vertical;
    overflow: hidden;
}


.qty-btn {

    color: #888;
    width: 40px;
    height: 40px;
    /* border-radius: 50%; */
    border-radius: 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 26px;
    line-height: 20px;
    padding: 0;
    display: flex;
    /* font-weight: 400; */
    align-items: center;
    justify-content: center;
}

.qty-btn.trash {
    background: url("../assets/icon-delete.png") center/18px 18px no-repeat;
    font-size: 0;
    /* скрываем текст, если вдруг будет */
}


.qty-btn:hover {
    background-color: #d4d3d3;
    color: #9a9999;
}

/* Цена */
.price {
    font-weight: bold;
    font-size: 16px;
}

/* Кнопка удалить */
.remove-btn {
    position: absolute;
    top: 0;
    right: 0;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: #888;
    border: 1px solid #888;
    border-radius: 50%;
    padding: 0 6px;
}

.remove-btn:hover {
    color: rgb(198, 85, 85);
}

.btn-back-to-catalog {
    align-items: center;
    display: block;

    width: 160px;
    margin: 0 auto;
    padding: 10px 20px;
    background: black;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.card-qty {
    text-align: center;
    width: 20px;
    /* border: 1px solid #555; */
}



/* === Адаптация для мобильных устройств === */

@media (max-width: 600px) {

    .qty-price-row {
        justify-content: space-between;
        width: 100%;
        gap: 0;
    }

    .cart-controls {}

    .price {
        font-size: 15px;
    }

    .remove-btn {
        right: 15px;

    }

    .cart-desc {
        padding: 0;
    }

    /* .submit-btn {
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 10000;
    } */
    .submit-btn {
        position: sticky;
        bottom: 0;
    }

}



/* Мобильный вид оставляем центрированным (как было) */
@media (max-width: 1024px) {
    #cart-modal {
        position: fixed;
        /* как у тебя сейчас */
        /* остальной текущий стиль модалки */
    }
}

/* Десктоп: ведём себя как выпадающее окошко */
@media (min-width: 1025px) {
    #cart-modal {
        display: none;
        /* показываем через JS */
        position: fixed;
        /* позиционируем в JS возле иконки */
        z-index: 9999;
        /* оформление, если нужно: */
        /* background: #fff; border: 1px solid #eee; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); */
    }
}




.btn {
    width: 28px;
    /* диаметр ховер-круга */
    height: 28px;
    margin: 0 3px;
    /* зазор до бордера */
    border: none;
    background: transparent;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s;
}

.btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.qty {
    padding: 0 8px;
    /* расстояние между кнопками и числом */
    user-select: none;
    min-width: 1.5ch;
    text-align: center;
}

@media(max-width:1024px) {
    .cart-wrapper {
        grid-template-columns: 1fr;
        /* в одну колонку */
        max-width: 600px;
        /* не больше 600px */
        width: 100%;
    }


}

@media(max-width:576px) {
    .card-block-size-price {

        flex-direction: column;
        align-items: start;
        justify-content: start;
        gap: 10px;
        padding-top: 0;
    }

    .cart-price {}

    .carts-block-elem {
        padding: 0;
    }

    .container-card {
        padding: 0;
    }
}

/* Плавающая копия кнопки “До сплати” */
.floating-submit {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 16px;
    z-index: 10000;
    display: none;
    /* по умолчанию скрыта */
    width: calc(100% - 32px);
    /* аккуратно по краям на мобильных */
    max-width: 570px;
    /* чтобы не была слишком широкой на планшетах */
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: #111;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

/* Показываем, когда нужна */
.floating-submit.show {
    display: block;
}

/* Только мобильные — если нужно ограничить */
@media (min-width: 1025px) {
    .floating-submit {
        display: none !important;
    }
}