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

.modal-content {
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 800px;
    max-height: 80%;
    position: relative;
    box-sizing: border-box;
}

.close {
    color: var(--red);
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.carousel-container {
    display: flex;
    overflow: hidden;
    width: 100%;
    max-height: 80vh; /* 80% del viewport height */
    border-radius: 30px;
    position: relative;
    box-sizing: border-box;
}

.carousel-container img {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain; /* Mantiene la proporcionalidad */
    border-radius: 30px;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 16px;
    color: var(--red);
    font-weight: bold;
    font-size: 45px;
    transition: 0.6s ease;
    user-select: none;
    border: none;
    background: none;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 10px;
    }

    .close {
        font-size: 24px;
    }

    .prev, .next {
        font-size: 30px;
        padding: 10px;
    }
}
