.ctm-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 0px;
}

.ctm-gallery-item {
    width: 20%;
    position: relative;
    font-size: 28px;
    overflow: hidden;
}

.ctm-gallery-item img {
    width: 100%;
    height: 300px;
    display: block;
    object-fit: cover;
}


.ctm-gallery-item {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.display-path {
    position: absolute; 
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    padding: 5px;
    background-color: transparent !important;
    z-index: 10;
}

.ctm-gallery-item:hover .display-path {
    z-index: 999;
    
}

.ctm-gallery-item .display-text{
    position: relative !important; /* Dodałem z powrotem absolute */
    max-width: 60%;
}

/* Dla ekranów do 1024px */
@media (max-width: 1024px) {
    .ctm-gallery-item {
        width: 33.33%; /* 3 elementy w jednym wierszu */
    }
}

/* Dla ekranów do 768px */
@media (max-width: 768px) {
    .ctm-gallery-item {
        width: 50%; /* 2 elementy w jednym wierszu */
    }
}

/* Dla ekranów do 480px */
@media (max-width: 480px) {
    .ctm-gallery-item {
        width: 100%; /* 1 element w jednym wierszu */
    }
}

.display-text{
    text-align: center;
}

.display-text{
}