/* POPUP BOX */
.modal_wrap {
    position: fixed;
    top: 0px;
    right: 0px;
    bottom: 0px;
    left: 0px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: 999999999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), backdrop-filter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal_wrap.show {
    pointer-events: auto;
    opacity: 1;
}

.modal_wrap .modal_box {
    position: relative;
    width: 90%;
    max-width: 500px;
    height: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal_wrap.show .modal_box {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1) translateY(0);
}

.modal_wrap .modal_data {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

.modal_wrap .modal_data img {
    width: 100%;
    display: block;
}

.modal_wrap .modal_close {
    width: 36px;
    height: 36px;
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

.modal_wrap .modal_close::before,
.modal_wrap .modal_close::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 2px;
    background-color: #334155;
    border-radius: 1px;
    transition: background-color 0.2s ease;
}

.modal_wrap .modal_close::before {
    transform: rotate(45deg);
}

.modal_wrap .modal_close::after {
    transform: rotate(-45deg);
}

.modal_wrap .modal_close:hover {
    transform: scale(1.1) rotate(90deg);
    background-color: #ef4444;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.modal_wrap .modal_close:hover::before,
.modal_wrap .modal_close:hover::after {
    background-color: #ffffff;
}

#mainpop .modal_box {
    width: auto;
    padding: 0;
    max-width: 800px;
}

#mainpop img {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 16px;
    display: block;
}

/* Responsividade para telas menores */
@media (max-width: 576px) {
    .modal_wrap .modal_box {
        width: 88%;
        border-radius: 12px;
    }
    #mainpop img {
        border-radius: 12px;
    }
    .modal_wrap .modal_close {
        top: 12px;
        right: 12px;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
    .modal_wrap .modal_close::before,
    .modal_wrap .modal_close::after {
        width: 12px;
    }
}
