/* Исправления для скролла попапов на мобильных устройствах */

/* Основные настройки для всех попапов */
.wd-popup {
    -webkit-overflow-scrolling: touch !important;
    overflow-y: auto !important;
    max-height: 90vh !important;
}

/* Специальные настройки для iOS */
@supports (-webkit-touch-callout: none) {
    .wd-popup {
        position: relative !important;
        height: auto !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .mfp-wrap .wd-popup {
        position: relative !important;
        transform: none !important;
    }
}

/* Настройки для Android */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    .wd-popup {
        -webkit-overflow-scrolling: touch !important;
        overflow-y: auto !important;
    }
}

/* Дополнительные настройки для мобильных устройств */
@media (max-width: 768px) {
    .wd-popup {
        max-height: 85vh !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .mfp-wrap {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .mfp-container {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Исправление для вложенных попапов */
.mfp-wrap .mfp-content .wd-popup {
    position: relative !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: 90vh !important;
}

/* Исправления для кнопки закрытия Magnific Popup */
.mfp-close {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    text-align: center !important;
    font-size: 0 !important;
    color: transparent !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    z-index: 9999 !important;
    cursor: pointer !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border: none !important;
}

/* .mfp-close::before {
    content: "×" !important;
    font-size: 20px !important;
    color: #333 !important;
    line-height: 30px !important;
    display: block !important;
} */

.mfp-close {
    background: rgba(255, 255, 255, 1) !important;
    color: #000 !important;
}

/* Дополнительные стили для кнопки закрытия на мобильных */
@media (max-width: 768px) {
    .mfp-close {
        top: 5px !important;
        right: 5px !important;
        width: 35px !important;
        height: 35px !important;
        line-height: 35px !important;
    }
    
    .mfp-close::before {
        font-size: 22px !important;
        line-height: 35px !important;
    }
}
