/* =========================================================
   IMAGE POPUP / SLIDER
   ========================================================= */

body.trf-gallery-open {
    overflow: hidden;
}


.trf-gallery-popup {
    display: none;

    position: fixed;

    z-index: 999999;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;
}


.trf-gallery-popup.is-open {
    display: block;
}


.trf-gallery-overlay {
    position: absolute;

    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.90);
}


.trf-gallery-popup-content {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    width: calc(100% - 180px);
    height: calc(100% - 100px);

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    pointer-events: none;
}


.trf-gallery-image-area {
    width: 100%;

    height: calc(100% - 70px);

    display: flex;

    align-items: center;
    justify-content: center;
}


.trf-gallery-popup-image {
    display: block;

    max-width: 100%;
    max-height: 100%;

    width: auto;
    height: auto;

    object-fit: contain;

    pointer-events: auto;
}


/* =========================================================
   CLOSE
   ========================================================= */

.trf-gallery-close {
    position: absolute;

    z-index: 10;

    top: 20px;
    right: 30px;

    min-width: 135px;

    padding: 7px 25px;

    border: 2px solid #ffffff;

    background: #169bb8;

    color: #ffffff;

    font-size: 20px;
    line-height: 1.2;

    cursor: pointer;

    box-shadow:
        0 0 0 3px rgba(22, 155, 184, 0.35);
}


/* =========================================================
   PREVIOUS / NEXT
   ========================================================= */

.trf-gallery-navigation {
    height: 70px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 24px;

    pointer-events: auto;
}


.trf-gallery-prev,
.trf-gallery-next {
    min-width: 140px;

    padding: 10px 25px;

    border: 1px solid #ffffff;

    background: rgba(0, 0, 0, 0.65);

    color: #ffffff;

    font-size: 18px;
    line-height: 1.2;

    cursor: pointer;
}


.trf-gallery-prev:hover,
.trf-gallery-next:hover {
    background: rgba(0, 0, 0, 0.9);
}


/* =========================================================
   GRID
   ========================================================= */

.trf-gallery-image {
    display: block;

    cursor: pointer;

    text-decoration: none;
}


.trf-gallery-image img {
    display: block;

    width: 100%;
    height: auto;

    cursor: pointer;
}


/*
 * Hide old Colio hover elements.
 */
.trf-custom-colio .colio-view,
.trf-custom-colio .colio-button,
.trf-custom-colio .colio-summary {
    display: none !important;
}


/* =========================================================
   AJAX LOADING
   ========================================================= */

.trf-colio-list.trf-is-loading {
    opacity: 0.35;

    pointer-events: none;
}


.trf-colio-loader {
    display: none;

    padding: 20px;

    text-align: center;
}


.trf-colio-loader.active {
    display: block;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .trf-gallery-popup-content {

        width: calc(100% - 30px);

        height: calc(100% - 100px);
    }


    .trf-gallery-close {

        top: 15px;
        right: 15px;

        min-width: auto;

        padding: 7px 18px;

        font-size: 16px;
    }


    .trf-gallery-prev,
    .trf-gallery-next {

        min-width: 110px;

        padding: 9px 15px;

        font-size: 15px;
    }


    .trf-gallery-navigation {

        gap: 10px;
    }
}



.trf-gallery-image {
    display: block;
    width: 100%;
    height: auto;
    cursor: pointer;
}

.trf-custom-colio .colio-view,
.trf-custom-colio .colio-button,
.trf-custom-colio .colio-summary {
    display: none !important;
}

.trf-colio-list.trf-is-loading {
    opacity: 0.4;
    pointer-events: none;
}

body.trf-popup-open {
    overflow: hidden;
}


/* ==========================================
   GALLERY POPUP
   ========================================== */

#popup {
    display: none;

    position: fixed !important;
    top: 0 !important;
    left: 0 !important;

    width: 100% !important;
    height: 100% !important;

    background: rgba(0, 0, 0, 0.88);

    z-index: 999999 !important;

    overflow: hidden;
}


/* Popup inner container */
#popup #popsub {
    position: absolute;

    top: 50%;
    left: 50%;

    transform: translate(-50%, -50%);

    width: calc(100% - 100px);
    height: calc(100% - 60px);

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;
}


/* ==========================================
   POPUP IMAGE
   ========================================== */

#popup #popupimg {
    display: block;

    width: auto !important;
    height: auto !important;

    max-width: 90vw !important;
    max-height: calc(100vh - 150px) !important;

    object-fit: contain;

    margin: 0 auto;
}


/* ==========================================
   PREVIOUS / NEXT BUTTON AREA
   ========================================== */

#popup .butonsSection {
    position: absolute;

    left: 50%;
    bottom: 10px;

    transform: translateX(-50%);

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 25px;

    z-index: 10;
}


#popup .btn-next-pre {
    min-width: 140px;

    padding: 10px 25px;

    background: rgba(0, 0, 0, 0.65);

    border: 1px solid #ffffff;

    color: #ffffff;

    font-size: 18px;
    line-height: 1.2;

    cursor: pointer;
}


#popup .btn-next-pre:hover {
    background: #000000;
}


/* ==========================================
   CLOSE BUTTON
   ========================================== */

#popup #hidepopup {
    position: fixed;

    top: 20px;
    right: 30px;

    z-index: 20;

    min-width: 135px;

    padding: 7px 25px;

    background: #169bb8;

    border: 2px solid #ffffff;

    color: #ffffff;

    font-size: 20px;
    line-height: 1.2;

    cursor: pointer;

    box-shadow:
        0 0 0 3px rgba(22, 155, 184, 0.35);
}


/* ==========================================
   GRID IMAGE
   ========================================== */

.trf-gallery-image {
    display: block;

    width: 100%;
    height: auto;

    cursor: pointer;
}


/* While popup is open */
body.trf-popup-open {
    overflow: hidden;
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 767px) {

    #popup #popsub {
        width: calc(100% - 30px);
        height: calc(100% - 50px);
    }


    #popup #popupimg {
        max-width: 95vw !important;
        max-height: calc(100vh - 140px) !important;
    }


    #popup #hidepopup {
        top: 10px;
        right: 10px;

        min-width: auto;

        padding: 7px 15px;

        font-size: 16px;
    }


    #popup .butonsSection {
        gap: 10px;
    }


    #popup .btn-next-pre {
        min-width: 105px;

        padding: 8px 15px;

        font-size: 15px;
    }
}