/* trava o fundo quando modal abre */
body.modal-open {
    overflow: hidden;
}

/* overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px; /* importante no mobile */
}

/* container do modal */
.modal-content {
    background: #0d1b2a;
    width: 100%;
    max-width: 600px;
    max-height: 90vh; /* ESSENCIAL */
    overflow-y: auto; /* ESSENCIAL */
    border-radius: 12px;
    padding: 20px;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #0f172a;
    color: #fff;
    width: 90%;
    max-width: 900px;
    border-radius: 16px;
    padding: 35px;
    animation: fadeUp 0.3s ease;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 30px;
    align-items: center;
}

.modal-imagem img {
    width: 100%;
    border-radius: 12px;
}

.fechar {
    float: right;
    font-size: 28px;
    cursor: pointer;
}

.modal-imagem img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    transform: translateY(-10px);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeUp {
    from {opacity: 0; transform: translateY(20px);}
    to {opacity: 1; transform: translateY(0);}
}

@media(max-width:768px){
    .modal-grid{
        grid-template-columns: 1fr;
    }
    .modal-content img {
        max-height: 200px; /* controla altura */
        object-fit: cover;
    }
    .tm-gallery-item {
        width: 100%;
        max-width: 350px;
        margin-bottom: 20px;
        padding-left: 60px;
        padding-right: 10px;
    }

}