.overlay-background-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Полупрозрачный черный фон */
    z-index: 999; /* Достаточно высокий индекс, чтобы быть позади сцены */
    display: none; /* Скрыть по умолчанию */
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0,0,0);
    background-color: rgba(0,0,0,0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    width: 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.modal-content p,
.modal-content input {
    width: 80%;
    text-align: center;
    margin: 10px 0;
}

.modal-content button {
    width: 35%;
    text-align: center;
    margin: 10px 0;
}

.modal-content .close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    opacity: 0.5;
}

.fancybox-wrap-3d {
    z-index: 1000;
}

.modal-content .close:hover,
.modal-content .close:focus {
    opacity: 1;
}

#preview3d {
    width: 800px;
    height: 600px;
    overflow: hidden!important;
}

.fancybox-wrap, .fancybox-inner {
    overflow: hidden !important;
}

.fancybox-inner {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 1024px) {
    .fancybox-wrap-3d {
        width: 95vw !important;
        height: auto !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
    }

    #preview3d {
        width: 100% !important;
        height: auto !important;
    }

    #preview3d canvas {
        width: 100% !important;
        height: auto !important;
    }

    .modal-content {
        margin: 5% auto;
        width: 80%;
    }
    .modal-content button {
        width: auto;
    }
}

