/* General Body and Layout */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    display: flex; /* Use flexbox for overall page layout */
    flex-direction: column; /* Stack header, main, footer vertically */
    min-height: 100vh; /* Ensures body takes at least full viewport height */
}

main {
    flex-grow: 1; /* Allows main content to expand and push footer down */
    padding: 20px 0; /* Add padding above and below main content */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px; /* Add horizontal padding to containers */
}


/* Search Results and Product Grid */
.main-content-search h1 {
    text-align: center;
    margin-bottom: 30px;
    padding-top: 20px;
}

.products-grid {

    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* Responsive grid */
    gap: 25px;
    justify-content: center; /* Center items if they don't fill the row */
    padding-bottom: 30px; /* Space below grid */
}

.product-box {
    margin-top: 30%;
    border: 1px solid #eee;
    padding: 15px;
    text-align: center;
    background-color: whitesmoke;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Push button to bottom */
    transition: transform 0.2s ease;
}

.product-box:hover {
    transform: translateY(-5px);
}

.product-box img {
    max-width: 100%;
    height: 180px; /* Fixed height for consistency */
    object-fit: contain; /* Ensures image fits without cropping */
    margin-bottom: 10px;
}

.product-box .name {
    font-weight: bold;
    margin-bottom: 5px;
    color: #555;
    font-size: 1.1em;
}

.product-box .price {
    color: #e67e22; /* Example accent color */
    font-size: 1.2em;
    margin-bottom: 15px;
}

.product-box .btn.view-product-btn {
    background-color: #007bff; /* Primary button color */
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-top: auto; /* Pushes button to the bottom of flex container */
}

.product-box .btn.view-product-btn:hover {
    background-color: #0056b3;
}

.no-results-message {
    text-align: center;
    grid-column: 1 / -1; /* Make message span all columns */
    padding: 50px 0;
    font-size: 1.2em;
    color: #777;
}

/* Footer Styles */
footer {
    width: 100%;
    background-color: #333;
    color: #fff;
    padding: 40px 0;
    text-align: center;
    margin-top: auto; /* Pushes footer to the bottom */
}

footer .footer-heading {
    text-align: center;
    color: #fff;
    margin-bottom: 30px;
    font-size: 2em;
}

footer .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
    max-width: 1200px;
    margin: 40px auto 20px auto; /* Increased top margin for separation */
    padding: 0 15px;
    border-top: 1px solid #555; /* Separator line for main footer content */
    padding-top: 30px;
}

.footer-section {
    flex: 1;
    min-width: 280px;
    margin: 0 15px 20px 15px;
    text-align: left;
}

.footer-section.full-width {
    flex: 0 0 100%; /* Make this section take full width */
    margin-bottom: 30px;
}

.footer-section h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section p, .footer-section ul li a {
    color: #ccc;
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li a {
    text-decoration: none;
    line-height: 1.8;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: #fff;
}

.copyright {
    background-color: #222;
    padding: 15px 0;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    border-top: 1px solid #444;
}

.btn.continue-shopping-btn {
    padding: 12px 25px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.1em;
    transition: background-color 0.3s ease;
}

.btn.continue-shopping-btn:hover {
    background-color: #218838;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .navbar .search-form {
        margin: 10px 0;
        max-width: 90%;
    }

    .navbar nav {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 20px;
    }

    footer .footer-bottom {
        flex-direction: column;
        align-items: center;
    }

    .footer-section {
        text-align: center;
        margin: 0 0 20px 0;
    }
}

@media (max-width: 480px) {
    .navbar .logo {
        font-size: 1.3rem;
    }

    .product-box img {
        height: 150px;
    }
}