/* Gallery Responsive Styles */
.tm-catalog-item-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 30px;
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

/* Mobile and Tablet */
@media (max-width: 767px) {
    .tm-thumbnail-container {
        width: 300px;
        height: 300px;
    }
    
    .tm-catalog-item-list {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .tm-catalog-item {
        display: flex;
        justify-content: center;
    }
}

.tm-catalog-item {
    width: 100%;
    margin-bottom: 0;
    transition: transform 0.3s ease;
}

.tm-catalog-item:hover {
    transform: translateY(-5px);
}

/* Desktop improvements */
@media (min-width: 1400px) {
    .tm-catalog-item-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .tm-catalog-item-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .tm-catalog-item-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tm-thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio for square images */
    overflow: hidden;
    max-width: 600px;
    margin: 0 auto;
}

.tm-catalog-item-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Lightbox styles */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    z-index: 1000;
}

.lightbox-content {
    position: relative;
    width: 90%;
    max-width: 800px;
    margin: 40px auto;
    height: 80vh;
}

.lightbox-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.lightbox-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 24px;
}

.lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
}

/* Mobile-first responsive styles */
@media (max-width: 768px) {
    .tm-catalog-item-list {
        grid-template-columns: 1fr;
    }
    
    .lightbox-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .lightbox-nav {
        padding: 0 10px;
    }
    
    .lightbox-btn {
        padding: 8px 15px;
        font-size: 20px;
    }
}

/* Filter list responsive styles */
.filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 0;
    margin: 20px 0;
    list-style: none;
}

.filter-list li {
    margin: 5px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Pagination responsive styles */
.tm-paging-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 20px 0;
}

.nav-item {
    margin: 5px;
}

.tm-paging-link {
    padding: 8px 15px;
    min-width: 40px;
    text-align: center;
    display: inline-block;
}