/* Reset Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body Styles */
body {
    font-family: Arial, sans-serif;
    color: #333;
    background-color: #f4f4f4;
    line-height: 1.6;
}

/* Header and Navigation */
header {
    background-color: #333;
    color: #fff;
    padding: 1em 2em;
    text-align: center;
}

nav {
    background-color: #333;
    color: #fff;
    padding: 1em 2em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

nav .logo img {
    height: 50px;
    width: 50px;
    border-radius: 50%;
    object-fit: cover;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1em;
    flex-wrap: wrap; /* Wrap links on smaller screens */
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 0.5em;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #D61D00;
}

/* Main Section */
main {
    padding: 2em 0;
    background-color: #fff;
}

/* Catalog Section */
#catalog {
    max-width: 1200px;
    margin: auto;
    text-align: center;
}

#catalog h2 {
    font-size: 2em; /* Adjusted for better scaling */
    margin-bottom: 1em;
}

#catalog p {
    font-size: 1em; /* Adjusted for smaller screens */
    margin-bottom: 2em;
}

/* Image Gallery */
.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Adjusted for smaller screens */
    gap: 20px;
    padding: 20px;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

#modal-image {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    display: block;
}

/* Close Button */
.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
}

/* Image container style */
.image-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    border: 1px solid #ddd;
    transition: transform 0.3s ease;
    height: 200px; /* Reduced height for smaller screens */
}

/* Default image styling */
.image-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Hover effect */
.image-item:hover {
    transform: scale(1.05);
    background-color: rgba(0, 0, 0, 0.05);
}

/* Footer */
footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 1em 0;
    margin-top: 3em;
}

/* Responsive Design */
@media (max-width: 768px) {
    nav {
        flex-direction: column; /* Stack elements vertically */
    }

    nav ul {
        flex-direction: column;
        align-items: center; /* Center items */
    }

    #catalog h2 {
        font-size: 1.8em; /* Adjusted for better scaling */
    }

    #catalog p {
        font-size: 0.9em; /* Adjusted for smaller screens */
    }

    .image-item {
        height: 150px; /* Smaller container height */
    }
}

@media (max-width: 480px) {
    nav {
        padding: 1em; /* Reduce padding for smaller screens */
    }

    nav ul li a {
        padding: 0.3em; /* Reduce padding for smaller links */
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Smaller columns */
    }

    #catalog h2 {
        font-size: 1.5em; /* Further adjustments */
    }

    #catalog p {
        font-size: 0.8em;
    }
}
