.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.category-section {
    margin-bottom: 40px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.category-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-gap: 15px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    aspect-ratio: 1/1;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s;
}

.gallery-img:hover {
    opacity: 0.9;
}

.modal {
    display: none;
    position: fixed;
    z-index: 21474836479;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal-content {
    display: block;
    max-width: 90%;
    max-height: 80vh;
    margin: 5% auto;
    animation: zoomIn 0.3s;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-content.hidden {
    opacity: 0;
}

@keyframes zoomIn {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}

.caption {
    margin: 15px auto;
    width: 80%;
    text-align: center;
    color: #fff;
    font-size: 18px;
}

.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #ccc;
}

/* Адаптивность */
@media (max-width: 768px) {
    .gallery-container {
        padding: 10px;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .modal-content {
        max-width: 95%;
    }
    
    .filters {
        flex-direction: column;
    }
}

/* Навигация в модальном окне */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    padding: 0 20px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.modal-nav:hover {
    opacity: 1;
}

#prev {
    left: 10px;
}

#next {
    right: 10px;
}

/* Крестик для закрытия */
.close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 99999998;
}

.close:hover {
    color: #ccc;
}

/* Индикатор текущего изображения */
.image-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 16px;
    background: rgba(0,0,0,0.5);
    padding: 5px 10px;
    border-radius: 3px;
    z-index: 99999999;
}