
/* ===== МОДАЛЬНОЕ ОКНО ===== */
.modal-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-sizing: border-box;
}

.modal-wrap._active {
    opacity: 1;
    visibility: visible;
}

/* Контент модала */
.x-modal,
.modal-content,
.modal-child {
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    margin: auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    padding: 30px;
    box-sizing: border-box;
}

.modal-wrap._active .x-modal,
.modal-wrap._active .modal-content,
.modal-wrap._active .modal-child {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Скрываем скролл при открытом модале */
body.scroll-lock {
    overflow: hidden;
    overscroll-behavior: none;
}

/* ===== ПРЕЛОАДЕР ===== */
.modal-preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-preloader._active {
    opacity: 1;
    visibility: visible;
}

/* Spinner с кольцами */
.modal-preloader-spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 4px solid transparent;
    animation: spinner-ring-rotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(1) {
    border-top-color: #4F7177;
    animation-delay: -0.45s;
}

.spinner-ring:nth-child(2) {
    border-top-color: #4F7177;
    animation-delay: -0.3s;
}

.spinner-ring:nth-child(3) {
    border-top-color:#4F7177;
    animation-delay: -0.15s;
}

.spinner-ring:nth-child(4) {
    border-top-color: #4F7177;
    animation-delay: 0s;
}

@keyframes spinner-ring-rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .x-modal,
    .modal-content,
    .modal-child {
        max-width: 100%;
        max-height: 95vh;
        padding: 20px;
        border-radius: 8px;
    }

    .modal-wrap {
        padding: 10px;
    }

    .modal-preloader-spinner {
        width: 50px;
        height: 50px;
    }

    .spinner-ring {
        border-width: 3px;
    }
}