/* Ensure the grid container has correct display settings */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Makes it responsive */
    gap: 20px; /* Adds spacing between grid items */
    justify-content: center; /* Centers grid on larger screens */
    max-width: 1200px; /* Prevents grid from spreading too wide */
    margin: 0 auto; /* Centers the grid in the viewport */
}

/* Style for individual grid items */
.grid-item {
    text-align: center; /* Centers text under images */
}

/* Make sure images are responsive */
.grid-item img {
    width: 100%;  /* Ensures images fill their grid cell */
    height: auto; /* Keeps the aspect ratio */
    max-width: none; /* Limits size on large screens */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr; /* One column for small screens */
    }
}

/* General Styles */
body {
    font-family: Arial, sans-serif; /* Sans-serif for clear text */
    margin: 0;
    padding: 0;
    background-color: #f4f4f4; /* Light background color */
    color: #333; /* Dark text color for contrast */
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    text-align: center;
}

header h1 {
    margin: 0;
    font-size: 2.5em; /* Larger header text */
}

/* Main content */
main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto; /* Center the content */
}

.product-detail {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center all content */
    justify-content: center;
    text-align: center;
}

.product-detail img {
    max-width: 100%;
    height: auto;
    max-height: 500px; /* Limit the image height */
    margin-bottom: 20px;
}

.product-detail p {
    font-size: 1.1em;
    margin-bottom: 20px;
    line-height: 1.5;
    max-width: 800px; /* Limit the width of text for readability */
}

/* Link Styles */
.product-detail a {
    text-decoration: none;
    background-color: #2980b9;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 1.2em;
}

.product-detail a:hover {
    background-color: #3498db;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 15px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    header h1 {
        font-size: 2em; /* Smaller header on mobile */
    }

    .product-detail {
        padding: 10px;
    }

    .product-detail p {
        font-size: 1em;
        padding: 0 10px;
    }

    .product-detail img {
        max-width: 90%; /* Make image smaller on mobile */
    }

    .product-detail a {
        font-size: 1em;
        padding: 8px 16px;
    }
}