:root {
    --overlay-bg: rgba(0, 0, 0, .6);
    --radius: 8px;
    --gap-xs: 8px;
    --gap-sm: 12px;
    --gap-md: 16px;
    --gap-lg: 24px;
    --color-light_grey: #e0e0e0;
    --brand: #0072ce;
}

.no-scroll {
    overflow: hidden;
    touch-action: none;
}

.pop-up__section {
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    background-color: var(--overlay-bg);
    z-index: 1000;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.pop-up__section.active {
    display: flex;
    justify-content: center;
    align-items: center; /* вместо flex-end */
    padding: 16px;
}

.pop-up {
    width: 100%;
    max-width: 680px; /* или подбери своё */
    background: #fff;
    border-radius: 8px;
    padding: 24px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.pop-up--lg {
    max-width: 680px;
}

.line--light-grey {
    width: 100%;
    height: 1px;
    background-color: var(--color-light_grey);
}

.container-product-credit {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
}

.item.cart__card {
    display: flex;
    align-items: flex-start;
    gap: var(--gap-md);
    padding: 10px 10px 10px 0;
}

.item__col,
.item__btn {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--gap-sm);
    height: 100%;
}

.item__col:first-of-type {
    margin-right: 0;
}

.item__img {
    width: clamp(64px, 22vw, 120px);
    max-width: 120px;
    height: auto;
    object-fit: contain;
    margin-right: 0;
    flex-shrink: 0;
}

.item__heading {
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.item__price,
.item__price .item__price {
    display: block;
    font-size: 30px;
    line-height: 1.2;
}

.applied_price {
    font-size: 18px;
}

.credit-choice__pop-up {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    z-index: 101;
    max-width: 680px;
    width: 100%;
    background: #fff;
    border-radius: 8px;
    padding: 24px 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

.credit-choice .line {
    margin: 14px 0;
}

.credit-choice__header {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
}

.credit-choice__img {
    width: 28px;
    height: 28px;
    margin-right: 0;
    flex-shrink: 0;
}

.credit-choice__item {
    margin-top: var(--gap-md);
    display: grid;
    grid-template-columns: 1fr 1fr .8fr;
    gap: var(--gap-xs);
    align-items: center;
    padding: 12px;
    transition: box-shadow .2s ease, border-color .2s ease;
    border-radius: 6px;
    border: 1px solid transparent;
}

.credit-choice__item--active {
    border-color: var(--brand);
    border-radius: 6px;
}

.credit-choice__item .delivery-item__time {
    margin: 0;
}

.credit-choice__item .dropdown {
    border: 1px solid var(--color-light_grey);
    border-radius: 6px;
}

.credit-choice__body,
.credit-choice__footer {
    justify-self: center;
}

.credit-choice__body.credit_item_wrapper {
    width: 100%;
    max-width: 220px;
}

.credit-choice__body.credit_item_wrapper .select2-container {
    width: 100% !important;
    text-align: center;
}

.credit-choice__heading {
    justify-self: center;
}

.credit-choice__heading:first-of-type {
    justify-self: start;
    margin-left: 0;
}

.credit-choice .heading--top {
    margin-top: 12px;
}

.credit-choice .checkout__total {
    margin-top: 16px;
}

.credit-choice .total__item {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-self: flex-end;
    gap: var(--gap-sm);
}

.credit-choice .btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 1.125rem;
    line-height: 1.1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 12px 0;
    height: auto;
    touch-action: manipulation;
}

.btn.btn--success {
    background-color: rgb(78, 198, 90);
    color: #fff;
}

.btn.btn--secondary {
    border: 1px solid #e24141;
    color: #e24141;
    background: transparent;
}

.credit-choice .cart__card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--gap-md);
    justify-content: flex-start;
}

.credit-choice__item label {
    margin-bottom: 0;
}

@supports (padding: max(0px)) {
    .pop-up__section.active {
        padding-bottom: max(var(--gap-lg), env(safe-area-inset-bottom));
        padding-left: max(var(--gap-md), env(safe-area-inset-left));
        padding-right: max(var(--gap-md), env(safe-area-inset-right));
    }

    .pop-up {
        border-radius: var(--radius) var(--radius) 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}

@media (min-width: 620px) {
    .pop-up {
        padding: 28px 20px;
        border-radius: var(--radius);
    }

    .credit-choice__img {
        width: 32px;
        height: 32px;
    }

    .credit-choice__item {
        grid-template-columns: 1fr 1fr .9fr;
        gap: var(--gap-sm);
        padding: 14px;
    }
}

@media (min-width: 768px) {
    .pop-up__section.active {
        align-items: center;
    }

    .pop-up {
        padding: 32px 24px;
        max-width: 760px;
    }

    .container-product-credit {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .item.cart__card {
        flex-direction: row;
    }

    .item__img {
        width: 96px;
    }
}

@media (min-width: 1024px) {
    .container-product-credit {
        grid-template-columns: 1.5fr 1fr;
        gap: 32px;
    }

    .credit-choice .cart__card {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .credit-choice__pop-up {
        position: relative;
    }
}

@media (min-width: 1200px) {
    .pop-up--lg {
        max-width: none;
    }

    .pop-up {
        padding: 36px 32px;
        max-width: 920px;
    }

    .container-product-credit {
        grid-template-columns: 2fr 1.25fr;
        gap: 40px;
    }

    .credit-choice__img {
        width: 40px;
        height: 40px;
    }

    .credit-choice__item {
        grid-template-columns: 1fr 2fr 1fr;
        gap: var(--gap-md);
        padding: 16px;
    }
}

.item__heading,
.credit-choice__header p,
.credit-choice__footer h4,
.credit-choice .dropdown__btn {
    overflow-wrap: anywhere;
}
