/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header */
header {
    background-color: #2c5e3a; /* Dark green */
    color: #fff;
    padding: 1rem 0;
    border-bottom: 4px solid #f0ad4e; /* Accent yellow/orange */
}

header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem; /* Add gap for better spacing */
}

header .logo {
    font-size: 1.8rem;
    font-weight: bold;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

header nav {
    order: 3; /* Move nav below logo and location on small screens */
    width: 100%; /* Take full width when wrapped */
    margin-top: 0.5rem;
}

header nav ul {
    list-style: none;
    display: flex;
    justify-content: center; /* Center nav items */
    padding: 0;
}

header nav ul li {
    margin-left: 1.5rem;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: #f0ad4e;
}

/* Location Selector Styles */
.location-selector-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    flex-grow: 1;
    min-width: 250px; /* Ensure it has some minimum width */
    max-width: 600px; /* Limit maximum width */
    order: 2; /* Default order */
}

.location-selector-header label {
    font-size: 0.9rem;
    white-space: nowrap;
}

.location-selector-header select {
    padding: 0.4rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    flex-grow: 1; /* Allow selects to grow */
    min-width: 80px; /* Prevent selects from becoming too small */
}

.location-selector-header select:disabled {
    background-color: #eee;
    cursor: not-allowed;
}

.search-bar {
    display: flex;
    max-width: 400px; /* Adjust max width */
    order: 4; /* Default order */
}

.search-bar input[type="text"] {
    padding: 0.6rem;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    flex-grow: 1;
    min-width: 150px;
}

.search-bar button {
    padding: 0.6rem 1rem;
    background-color: #f0ad4e;
    color: #333;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-bar button:hover {
    background-color: #eea236;
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(44, 94, 58, 0.7), rgba(44, 94, 58, 0.7)), url('https://via.placeholder.com/1500x500/8FBC8F/FFFFFF?text=Farm+Fresh+Produce') center/cover no-repeat;
    color: #fff;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background-color: #f0ad4e;
    color: #333;
    padding: 0.8rem 1.8rem;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.cta-button:hover {
    background-color: #eea236;
    transform: translateY(-2px);
}

/* Categories Section */
.categories, .featured-products {
    padding: 3rem 0;
    background-color: #fff;
    margin-bottom: 1rem;
}

.categories h2, .featured-products h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2c5e3a;
}

.category-grid, .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
}

.category-item {
    text-align: center;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.category-item svg {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.category-item h3 {
    font-size: 1.1rem;
    color: #555;
}

.category-item:hover {
    transform: translateY(-5px);
}

/* Product Card */
.product-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s ease;
    position: relative; /* For potential future additions like badges */
}

.product-card:hover {
     box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-card svg {
    width: 100%;
    height: auto;
    max-height: 150px; /* Control image height */
    object-fit: cover; /* Maintain aspect ratio */
    margin-bottom: 1rem;
    border-radius: 4px;
}

.product-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.product-card .price {
    font-size: 1rem;
    font-weight: bold;
    color: #2c5e3a;
    margin-bottom: 1rem;
}

.product-card .availability-note {
    font-size: 0.8rem;
    color: #5cb85c; /* Green to indicate availability */
    margin-bottom: 0.8rem;
    font-style: italic;
}

.add-to-cart {
    background-color: #5cb85c; /* Green */
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

.add-to-cart:hover {
    background-color: #4cae4c;
}

/* Featured Products Section */
.location-message {
    text-align: center;
    padding: 1.5rem;
    background-color: #eef;
    border: 1px solid #cce;
    border-radius: 5px;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #336;
}

/* Footer */
footer {
    background-color: #333;
    color: #ccc;
    padding: 2rem 0;
    margin-top: 2rem;
}

footer .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem; /* Spacing between columns */
    margin-bottom: 1rem; /* Space before copyright */
}

.footer-links div {
    flex: 1; /* Allow columns to grow */
    min-width: 150px; /* Prevent columns from becoming too narrow */
}

.footer-links h4 {
    color: #fff;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid #555;
    padding-bottom: 0.3rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 0.5rem;
}

.footer-links ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links ul li a:hover {
    color: #f0ad4e;
}

.copyright {
    text-align: center;
    width: 100%; /* Take full width below links */
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #555;
    font-size: 0.9rem;
}

/* Vendor Signup Page */
.vendor-signup {
    padding: 2rem 0;
    background-color: #f4f4f4;
}

.vendor-signup .container {
    max-width: 800px;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.vendor-signup h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c5e3a;
}

.vendor-signup .form-group {
    margin-bottom: 1rem;
}

.vendor-signup label {
    display: block;
    font-weight: bold;
    margin-bottom: 0.3rem;
    color: #555;
}

.vendor-signup input[type="text"],
.vendor-signup input[type="email"],
.vendor-signup textarea,
.vendor-signup select {
    width: 100%;
    padding: 0.7rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.vendor-signup textarea {
    resize: vertical;
}

.vendor-signup button[type="submit"] {
    background-color: #2c5e3a;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.3s ease;
}

.vendor-signup button[type="submit"]:hover {
    background-color: #244d31;
}

.vendor-signup .user-agreement-text {
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.vendor-signup .user-agreement-text textarea {
    width: 100%;
    height: 150px;
    resize: none;
    padding: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    background-color: #f9f9f9;
}

.vendor-signup .agreement-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vendor-signup .agreement-checkbox label {
    font-weight: normal;
}

/* Modal Styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 600px;
    position: relative; /* For close button positioning */
    border-radius: 8px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Tab Styles */
#login-signup-tabs {
    display: flex;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    border: none;
    background-color: #ddd;
    color: #666;
    cursor: pointer;
    border-radius: 5px 5px 0 0;
    flex: 1;
    text-align: center;
    transition: background-color 0.3s ease;
}

.tab-button.active {
    background-color: #f0ad4e;
    color: #333;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Form Styles (can reuse existing) */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Important: Keep padding within the width */
}

#login-form button[type="submit"],
#signup-form button[type="submit"] {
    background-color: #2c5e3a;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

#login-form button[type="submit"]:hover,
#signup-form button[type="submit"]:hover {
    background-color: #244d31;
}

#login-form p {
    text-align: center;
    margin-top: 10px;
}

#login-form p a {
    color: #2c5e3a;
    text-decoration: none;
}

/* Responsive Adjustments */
@media (max-width: 1100px) { /* Adjust breakpoint for location selector */
    .location-selector-header {
         order: 3; /* Move below logo/nav on medium screens */
         width: 100%;
         max-width: none;
         justify-content: center;
         margin-top: 0.5rem;
    }
     .search-bar {
         order: 4; /* Ensure search is last */
         width: 100%;
         max-width: none;
         margin-top: 0.5rem;
     }
     header nav {
         order: 2; /* Keep nav near top */
         width: auto;
         margin-top: 0;
     }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem; /* Reduce gap */
    }
    header nav {
        order: 2; /* Nav below logo */
        width: 100%;
        margin-top: 0.5rem;
    }
    header nav ul {
        margin-top: 0; /* Reset margin */
        margin-bottom: 0;
        justify-content: center;
    }
    .location-selector-header {
        order: 3; /* Location below nav */
        width: 90%;
        margin-top: 0.5rem;
        flex-direction: column; /* Stack labels and selects */
        align-items: stretch; /* Stretch items */
        padding: 0.8rem;
    }
     .location-selector-header label {
         margin-bottom: 0.2rem; /* Add space below label */
     }
     .location-selector-header select {
        width: 100%; /* Full width */
     }
    .search-bar {
        order: 4; /* Search bar last */
        width: 90%;
        margin-top: 0.8rem;
    }
    .category-grid, .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
    .footer-links {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .vendor-signup .container {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
     header .logo {
        font-size: 1.5rem;
    }
    header nav ul li {
        margin-left: 1rem;
    }
    .hero h2 {
        font-size: 2rem;
    }
     .hero p {
        font-size: 1rem;
    }
     .category-grid, .product-grid {
        grid-template-columns: repeat(2, 1fr); /* Ensure 2 columns minimum */
    }
    .product-card h3 {
        font-size: 1rem;
    }
     .product-card .price {
        font-size: 0.9rem;
    }
}