/* Intro Section */
.intro-section {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1000px;
    margin: 50px auto;
    gap: 40px;
    text-align: left;
}

.intro-section img {
    width: 45%;
    border-radius: 10px;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
}

.intro-text {
    width: 50%;
}

.intro-text h2 {
    font-size: 2rem;
    color: #036308;
    margin-bottom: 15px;
}

.intro-text p {
    font-size: 1.2rem;
    line-height: 1.6;
}

/* Filter Section */
.filter-section {
    text-align: center;
    margin: 40px auto;
    max-width: 800px;
    padding: 0 20px;
}

#searchBar {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 2px solid #036308;
    border-radius: 5px;
    max-width: 600px;
}

.checkbox-group {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Ensures wrapping on small screens */
    gap: 15px;
    margin-top: 15px;
}

.checkbox-group label {
    font-size: 1rem;
    cursor: pointer;
}

/* Location Filter */
.location-filter {
    margin-top: 20px;
    text-align: center;
}

#locationFilter {
    font-size: 1rem;
    padding: 8px;
    border: 2px solid #036308;
    border-radius: 5px;
    max-width: 200px;
}

/* Producer Grid */
.producers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Ensure a consistent size */
    gap: 20px;
    max-width: 1000px;
    margin: 50px auto;
    padding: 0 20px;
    justify-content: center; /* Center items when fewer are displayed */
}

/* Producer Cards */
.producer-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    max-width: 300px; /* Ensures card stays same width */
    width: 100%; /* Responsive within grid */
    justify-self: center; /* Keeps it centered when there’s only one */
}

.producer-card:hover {
    transform: scale(1.03); /* Slight pop effect for interactivity */
}

.producer-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

.producer-card h3 {
    font-size: 1.5rem;
    color: #036308;
    margin: 10px 0;
}

.producer-card p {
    font-size: 1rem;
    color: #555;
}

.producer-card .top-sellers {
    font-weight: bold;
    margin-top: 10px;
    color: #108505;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Stack image and text in intro section */
    .intro-section {
        flex-direction: column;
        text-align: center;
        gap: 20px;
        padding: 0 20px;
    }

    .intro-section img {
        width: 80%;
    }

    .intro-text {
        width: 100%;
    }

    .intro-text h2 {
        font-size: 1.8rem;
    }

    .intro-text p {
        font-size: 1.1rem;
    }

    /* Adjust filter checkboxes for mobile */
    .checkbox-group {
        gap: 10px;
        font-size: 0.9rem;
    }

    #searchBar {
        font-size: 0.9rem;
    }

    #locationFilter {
        font-size: 0.9rem;
        max-width: 150px;
    }

    /* Adjust producer cards for smaller screens */
    .producers-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .producer-card {
        padding: 15px;
    }

    .producer-card h3 {
        font-size: 1.3rem;
    }

    .producer-card p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    /* Further optimize intro section */
    .intro-section img {
        width: 90%;
    }

    .intro-text h2 {
        font-size: 1.6rem;
    }

    .intro-text p {
        font-size: 1rem;
    }

    /* Optimize filters */
    .checkbox-group {
        flex-direction: column;
        align-items: center;
    }

    #searchBar {
        font-size: 0.9rem;
        padding: 10px;
    }

    #locationFilter {
        font-size: 0.9rem;
        max-width: 140px;
    }

    /* Ensure producer cards fit well */
    .producers-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .producer-card h3 {
        font-size: 1.2rem;
    }

    .producer-card p {
        font-size: 0.9rem;
    }
}
