.gallery-pop-up {
    overflow: hidden;
    max-width: 900px;
    width: 100%;
    padding: 0;
}

.gallery-message-body {
    overflow: hidden;
    border-bottom: 1px solid #DFDFDF;
}

.btn-product {
    background-color: #9B9B9B;
    max-width: 150px;
    font-size: 14px;
    padding: 6px 10px 7px;
    width: 100%;
    margin-bottom: 10px;
}

.search-image {
    margin: 8px 20px 8px 0;
    max-width: 190px;
    width: 100%;
}

.gallery-wrapper {
    max-width: 950px;
    width: 100%;
}

.nav-bar {
    background-color: #F8F9FA;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reverse-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 56px;
}

.reverse-section > .btn-product {
    margin: 10px 0 0 0;
    position: relative;
    width: 125px;
}

.flag-buttons-container {
    position: relative;
    display: flex;
    margin: 0 15px;
    gap: 15px;
    max-height: 37px;
    overflow: visible;
}

.button-flag {
    z-index: 0;
    padding: 6px 0 7px 0;
    border: 1px solid #DFDFDF;
    border-bottom: none;
    background-color: #F8F9FA;
    border-radius: 10px 10px 0 0;
    letter-spacing: -0.3px;
    line-height: 22px;
    color: #666666;
    font-size: 16px;
    width: 130px;
    height: 47px;
    margin: 0;
}

.button-flag.active {
    z-index: 10;
    background-color: #FFFFFF;
}

.button-flag:hover {
    color: #666666;
    background-color: #FFFFFF;
}

.images-tiles {
    position: relative;
    border-top: 1px solid #DFDFDF;
    padding: 15px;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fill, 135px);
    grid-template-rows: repeat(auto-fill, 135px);
    justify-content: center;
    gap: 10px;
}

.image-tile {
    width: 135px;
    height: 135px;
    cursor: pointer;
}

.image-tile:hover img {
    opacity: 0.2;
}

.image-tile > img {
    transition-duration: 0.3s;
    width: 100%;
    height: 80%;
    margin: 0 auto;
    object-fit: contain;
}

.image-tile.selected {
    border: #9B9B9B solid 3px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;

}

.image-tile.selected > img {
    width: 95%;
    height: 95%;
}

.context-menu {
    padding: 5px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    border: 1px solid #DFDFDF;
    background-color: #fff;
    border-radius: 5px;
    z-index: 999;
}

.context-menu:hover {
    background-color: #DFDFDF;
    color: #FFFFFF;
}

.delete {
    position: absolute;
    top: 0;
    right: 0;
    margin-right: 5px!important;
    font-size: 23px!important;
    height: 23px!important;
    z-index: 999;
    color: black!important;
}

.delete:hover {
    color: dimgrey!important;
}

.images-tiles {
    overflow: auto;
    max-height: 60vh;
    min-height: 60vh
}

@media screen and (max-width: 900px) {
    .gallery-pop-up {
        max-height: 100%;
        width: 90%;
    }
}

@media screen and (max-height: 480px) {
    .gallery-pop-up {
        max-height: 90%;
    }

    .images-tiles {
        max-height: 450px;
    }
}

@media screen and (max-width: 650px) {
    .nav-bar {
        flex-direction: column-reverse;
        align-items: start;
    }

    .reverse-section > .btn-product {
        margin: 0 0 0 15px;
    }

    .button-flag {
        height: 38px;
    }
}