/* Basic Reset & Typography */
body {
    margin: 0;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f0f2f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.page-header {
    background-color: #2c3e50; /* Dark Blue */
    color: white;
    padding: 40px 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.page-header h1 {
    margin: 0 0 10px;
    font-size: 3em;
    color: white;
}

.page-header p {
    font-size: 1.1em;
    margin: 0;
    color: #ddd;
}

/* Product Grid */
.product-main {
    padding-top: 40px;
    padding-bottom: 40px;
}

.product-grid {
    display: flex; /* Activate Flexbox */
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    justify-content: center; /* Center items horizontally */
    gap: 30px; /* Space between grid items */
}

.product-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden; /* Ensures image corners are rounded with card */
    text-align: center;
    padding-bottom: 20px; /* Space for button */
    
    /* Flex item sizing:
       Approx. 3 cards per row on larger screens, 2 on medium, 1 on small.
       (100% / 3 = 33.33% - gap, adjust as needed) */
    flex: 1 1 calc(33.33% - 40px); /* flex-grow, flex-shrink, flex-basis */
    max-width: 350px; /* Max width for larger screens */
    min-width: 280px; /* Min width before wrapping */
    box-sizing: border-box; /* Include padding/border in element's total width/height */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.product-card:hover {
    transform: translateY(-5px); /* Slight lift effect on hover */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.product-card img {
    max-width: 100%;
    height: auto;
    display: block; /* Removes extra space below image */
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.product-card h3 {
    color: #2c3e50;
    font-size: 1.5em;
    margin: 15px 10px 10px;
}

.product-card .price {
    font-size: 1.3em;
    color: #e74c3c; /* Red */
    font-weight: 700;
    margin-bottom: 15px;
}

.product-card .description {
    font-size: 0.95em;
    color: #555;
    margin: 0 20px 20px;
}

.btn-add-to-cart {
    background-color: #3498db; /* Blue */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 700;
    transition: background-color 0.3s ease;
}

.btn-add-to-cart:hover {
    background-color: #2980b9; /* Darker Blue */
}

/* Footer */
.page-footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
    margin-top: 40px;
}

/* Responsive adjustments for product grid */
@media (max-width: 992px) {
    .product-card {
        flex: 1 1 calc(50% - 30px); /* 2 cards per row on medium screens */
        max-width: 450px;
    }
}

@media (max-width: 600px) {
    .product-card {
        flex: 1 1 90%; /* 1 card per row on small screens */
        max-width: 100%; /* Take full available width */
    }
    .page-header h1 {
        font-size: 2.2em;
    }
}