/*------SECCION PORTFOLIO------*/

.portfolio{
    max-width: 1000px;
    margin: 50px auto;
    padding: 20px;
    text-align: center;
}

.portfolio h2{
    color: var(--color-titulos-grandes);
    font-size: 2.5rem;
    padding-bottom: 1rem;
}

.gallery{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.gallery-item{
    position: relative;
    cursor: pointer;
    padding-top: 1rem;
}

.gallery-item::after{
    content: "🔎 Haz click para ampliar";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: var(--color-texto-header);
    padding: 5px 10px;
    border-radius: 5px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after{
    opacity: 1;
}


/*PARA QUE SE VEA FIJO EN MOVIL*/

.gallery-item .gallery-hint{
    display: none;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 5px;
    background: rgba(0,0,0,0.6);
    color: var(--color-texto-header);
    margin-top: 5px;
    padding: 5px 10px;
    border-radius: 5px;

}

/*FIN PARA QUE SE VEA FIJO EN MOVIL*/

.gallery-item img{
    width: 100%;
    height: 250px;
    border-radius: 10px;
    transition: transform 0.3s ease, filter 0.3s ease;
    object-fit: cover;
}

.gallery-item video{
    width: 100%;
    border-radius: 10px;
    cursor: pointer;
}

.gallery-item:hover img{
    transform: scale(1.05);
    filter: brightness(0.8);
}


/*------------POP UP--------------*/

.popup{
    position: fixed;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: rgba(0,0,0,0);
    z-index: 1000;
    padding-top: 50px;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.popup.show{
    background: rgba(0,0,0,0.8);
    opacity: 1;
    pointer-events: auto;
}

.popup-inner{
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    max-height: 90%;
    text-align: center;

    opacity: 0;
    transition: top 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
}

.popup.show .popup-inner{
    transform: translate(-50%, 0);
    opacity: 1;
}

.popup-content{
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}


.popup-inner img,
.popup-inner video{
    max-width: 90%;
    width: auto;
    height: auto;
    max-height: 90vh;
    border-radius: 10px;
}


.popup .close{
    position: absolute;
    display: inline-block;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.close .tooltip-text{
    visibility: hidden;
    opacity: 0;
    width: max-content;
    background-color: var(--submenu-hover);
    color: var(--color-tarjetas);
    text-align: center;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 0.9rem;
    position: absolute;
    top: 50%;
    left: 105%;
    transition: opacity 0.3s ease, transform 0.3s ease;
    transform: translateY(-150%);
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

.close:hover .tooltip-text{
    visibility: visible;
    opacity: 1;
    transform: translateY(-130%) translateX(0);
}


.popup-inner .close{
    width: 40px;
    height: 40px;
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: white;
    font-weight: bold;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    padding: 5px 10px;
    cursor: pointer;
}



/*RESPONSIVE*/

@media (max-width: 768px){
    .gallery{
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }

    .portfolio h2{
        font-size: 2rem;
    }

    .popup-inner{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 90%;
        max-height: 90vh;
        
    }

    .popup-inner img,
    .popup-inner video{
        max-width: 90%;
        max-height: 80vh;
        width: auto;
        height: auto;    
    }

    .popup-inner .close{
        width: 30px;
        height: 30px;
        top: 10px;
        right: 10px;
        font-size: 1.5rem;
    }

    .close .tooltip-text{
        visibility: visible;
        opacity: 1;
        top: -25px;
        left: 50%;
        transform: translateX(-50%);
    }

    .gallery-item::after{
        visibility: hidden;
    }

    .gallery-item .gallery-hint{
        display: block;
    }

}

@media (max-width: 576px){
    .popup-inner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90%;
    text-align: center;

    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
}

@media (max-width: 461px){
    .popup-inner{
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        max-width: 90%;
        max-height: 90%;
        text-align: center;
        padding: 10px;
        box-sizing: border-box;
        opacity: 0;
        transition: top 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    }
}
