@media (max-width: 768px) {

    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        position: relative;
    }

    .theme-toggle {
        width: 44px;
        height: 44px;
        position: relative;
        right: auto;
        margin-top: 10px;
    }

     h1 {
        font-size: clamp(1.5rem, 4vw, 2.5rem); 
    }

    
    .controls {
        flex-direction: column;
        gap: 15px;
    }

    .search-bar input {
        max-width: 100%;
    }

    .category-buttons button {
        width: 90%;
        text-align: center;
        margin-top: 20px;
    }

    .gallery {
        gap: 25px;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
        padding: 0 15px;
    }

    .gallery-item {
        width: 100%;
    }

    .gallery-item img {
        height: 250px;
    }
    
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 10px;
    }
    
    .gallery-item {
        max-width: 100%;
    }
    
    .gallery-item img {
        height: 220px;
    }
    
    .controls {
        gap: 10px;
    }
    
    .category-buttons button {
        width: 100%;
        margin-top: 10px;
    }
}