.magnet-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    height: -webkit-fill-available; /* Фикс для Safari */
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    -webkit-transition: opacity 0.5s ease;
    transition: opacity 0.5s ease;
    z-index: 20;
}

.magnet-bg.active {
    opacity: 1;
    pointer-events: all;
    -webkit-transition: 0.5s all;
    transition: 0.5s all;
}

.magnet {
    width: 96%;
    max-width: 998px;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    gap: 4%;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 54px 54px 54px 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%) scale(1);
    transform: translate(-50%, -50%) scale(1);
    -webkit-transition: transform 0.4s ease, opacity 0.4s ease;
    transition: transform 0.4s ease, opacity 0.4s ease;
    align-items: stretch;
    background-color: #FFFFFF;
    border-radius: 22px;

    /* Исправления для Safari 15 */
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000px;
}

/* Добавляем класс для старых версий Safari */
.old-safari .magnet {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Фикс для изображений в Safari */
.img-square,
.img-circle,
.img-rectangle {
    -webkit-transform-style: preserve-3d;
    transform-style: preserve-3d;
}

/* Особые стили для форм в старом Safari */
.old-safari .magnet__form {
    -webkit-overflow-scrolling: touch;
}

.magnet .img-cross {
    position: absolute;
    width: 18px;
    height: 18px;
    top: 16px;
    right: 16px;
}

.img-square {
    float: right;
    position: relative;
    max-width: 379px;
    height: auto;
    aspect-ratio: 1/1;
}

.img-circle {
    position: absolute;
    width: 54.6%;
    max-width: 260px;
    height: auto;
    max-height: 416px;
    aspect-ratio: 1/1;
    top: 50%;
    left: 50%;
    transform: translate(-100%, -50%);
}

.img-rectangle {
    position: absolute;
    width: 37.5%;
    height: auto;
    max-width: 286px;
    max-height: 111px;

    aspect-ratio: 1 / 1;
    top: 50%;
    left: 50%;
    transform: translate(16%, -50%);
    object-fit: contain;
}

.magnet__form {
    min-width: 40%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    gap: 24px;
}

.magnet__offer {
    min-width: 55%;
    overflow: hidden;
    position: relative;
    height: inherit;
    !*min-height: max-content;*!
    align-items: flex-end;
    min-height: 360px;
}

.magnet .inputs {
    flex-direction: column;
    margin: 0;
    gap: 6px;
}

.magnet .inputs__item {
    margin: 0;
}

.magnet .input {
    width: 100%;
}

.magnet__btn {
    width: 100%;
}

.magnet .auth-form__agree {
    margin: 0;
    position: absolute;
    bottom: -90px;
}

.magnet .auth-form__agree:only-child {
    margin: 0;
}

.magnet__content {
    position: absolute;
    color: white;
    display: flex;
    flex-direction: column;
    width: fit-content;
    right: 50px;
}

.magnet__content ._big {
    font-weight: 700;
    font-size: 50px;
    line-height: 61px;
}

.magnet .form-box__agree {
    margin: 0!important;
}

.magnet .auth-form__agree {
    position: relative;
    bottom: 0;
}

.magnet .callback__title {
    max-width: 100%;
    padding: 0;
    margin: 0;
    font-size: 55px;
    font-weight: 600;
    color: #705435;
    line-height: 100%;
}

.magnet .callback {
    margin: auto;
}

.magnet__img-wrap {
    max-width: 379px;
    float: right;
    width: 100%;
    position: relative;
    border-radius: 22px;
    background-color: #705435;
    flex-grow: 1;
    height: 100%;
}

.magnet .callback__text {
    font-size: 20px;
    font-weight: 600;
    color: #E25740;
    line-height: 100%;
}

.magnet__img-wrap {
    max-width: 379px;
    float: right;
    width: 100%;
    position: relative;
    height: 100%;
    border-radius: 22px;
    background-color: #705435;
    min-height: 290px;
}

.magnet__content {
    position: absolute;
    color: white;
    max-width: 379px;
    display: flex;
    flex-direction: column;
    width: fit-content;
    padding: 0 24px;
    justify-content: space-between;
    text-align: end;
    right: 0;
    height: 100%;
}

.magnet__percent {
    font-style: normal;
    font-weight: 700;
    font-size: 112px;
    line-height: 100%;
}

.magnet .percent {
    font-size: 50px;
}

.magnet__discount {
    display: flex;
    flex-direction: column;
    justify-content: end;
    align-items: end;
    margin-top: 20px;
}

.magnet__text {
    font-weight: 600;
    font-size: 13.4px;
    line-height: 21px;
    letter-spacing: 0;
    text-align: center;
   text-transform: uppercase;
    width: max-content;
    margin-top: -27px;
}

.magnet .highlight {
    background-color: #E25740;
    border-radius: 40px;
    padding: 5px;
}

.promo-card__gift {
    font-weight: 400;
    line-height: 21px;
    letter-spacing: 0;
    font-variant: small-caps;
    background-image: url(img/gift.svg);
    width: auto;
    background-size: contain;
    align-self: end;
    padding: 9px 8px 9px 47px;
    background-repeat: no-repeat;
    background-color: #e25740;
    border-radius: 18px;
    background-position: 6px 0;
}

.promo-card__text-wrap {
    font-size: 12px;
    
    :first-child {
            text-transform: uppercase;
            white-space: nowrap;
            font-weight: 700;
    }
    
}

.promo-card__note {
    font-weight: 400;
    font-size: 10px;
    text-align: left;
    margin-bottom: 20px;
}

.magnet .callback {
    width: fit-content;
    position: relative;
    padding: 0;
}

.magnet__btn {
    cursor: pointer;
}

/* Дополнительные исправления для текста */
.magnet__content,
.magnet__text,
.promo-card__gift {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
}

/* Фикс для backdrop-filter в старых Safari */
@supports not (backdrop-filter: blur(5px)) {
    .magnet-bg {
        background: rgba(0, 0, 0, 0.6);
    }
}

/* Фикс для aspect-ratio */
.img-square {
    aspect-ratio: 1/1;
    width: 100%;
    max-width: 379px;
    height: auto;
}

.old-safari .auth-form__agree {
    position: static !important;
    margin-top: 20px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
}

@media (max-width: 1040px) {
    .magnet {
        width: 75%;
        padding: 32px;
    }

    /* Фикс для transform в мобильном Safari */
    .old-safari .magnet {
        -webkit-transform: translate(-50%, -50%) scale(0.95);
        transform: translate(-50%, -50%) scale(0.95);
    }

    .magnet__offer {
        max-width: 300px;
        min-width: 240px;
        width: 100%;
        min-height: 290px;
    }
    
    .magnet__img-wrap {
        max-width: none;
        width: 100%;
    }

    .img-circle {
        display: none;
    }

    .magnet .img-cross {
        top: 12px;
        right: 12px;
        cursor: pointer;
    }

    .magnet .agree__text {
        font-size: 10px;
    }

    .magnet__discount {
        align-items: center;
    }

    .promo-card__gift {
        width: 100%;
        align-self: center;
        padding: 5px 16px 5px 25px;
        background-color: #e25740;
        border-radius: 18px;
    }
}

@media (max-width: 955px) {
    .magnet {
        
    }

    .magnet__content {
        padding: 0 20px;
    }

    .magnet__text {
        margin-top: -17px;
    }

    .magnet__form {
        gap: 18px;
    }

    .magnet .input__body {
        height: 52px;
    }

    .magnet .input__body::placeholder {
        margin: 5px;
    }

    .magnet .input__placeholder {
        top: 10px!important;
    }

    .magnet__percent {
        font-size: 99px;
    }
    
    .promo-card__note {
        text-align: left;
    }
}

@media (max-width: 768px) {
    .magnet {
        width: 95%;
        flex-direction: row;
        gap: 18px;
    }

    .magnet__percent {
        font-size: 80px;
    }
    
    .magnet .callback__text {
        font-size: 18px;
    }

    .magnet .callback__title {
        font-size: 50px;
    }
    
}

@media (max-width: 600px) {
    .magnet {
        width: 90%;
        gap: 14px;
        flex-direction: column;
        padding: 35px 12px 12px;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Плавный скролл */
        max-width: 380px;
    }

    /* Фикс для viewport units в iOS */
    @supports (-webkit-touch-callout: none) {
        .magnet-bg {
            height: -webkit-fill-available;
        }
    }
    
    .magnet__img-wrap {
        min-height: 227px;
    }

    .magnet__form {
        gap: 14px;
    }

    .img-square {
        max-width: fit-content;
    }

    .magnet__content {
        max-width: 100%;
        
    }

    .magnet__offer {
        width: 100%;
        max-width: none;
        min-height: 227px;
    }

    .old-safari .magnet__form {
        margin-top: 14px !important;
    }

    .old-safari .inputs__item {
        margin-bottom: 12px !important;
    }
    

    .magnet__text {
        text-align: left;
    }

    .magnet__discount {
        margin-top: 26px;
        flex-direction: row;
        gap: 9px;
        align-items: end;
        justify-content: center;
    }

    .magnet__percent {
        font-size: 48px;
    }

    .magnet .percent {
        font-size: 36px;
    }

    .magnet__text {
        margin-bottom: 5px;
        font-size: 12px;
        line-height: 19px;
    }

    .promo-card__gift {
        font-size: 12px;
        line-height: 16px;
        padding: 10px 10px 10px 12px;
        width: 100%;
        border-radius: 18px;
        background-color: #e25740;
        font-weight: 400;
        background-position: 97% 0;
        text-align: left;
    }

    .promo-card__note {
       margin-bottom: 14px;
    }
    
    
    .magnet .callback {
        padding: 60px 0;
    }
    
}

@media (max-width: 390px) {
    
    .promo-card__gift {
        margin-top: -4px;
        padding: 6px 6px 6px 12px;
    }
    
    .magnet__discount {
        margin-top: 7px;
        flex-direction: column;
        align-items: center;
    }
    
    .magnet__text {
        text-align: center;
        margin-top: -8px;
    }
}