/* Reset CSS for better cross-browser compatibility */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styling */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    color: #333;
}

/* Main product container grid */
.product-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Styling for each product card */
.product-item {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    padding: 10px;
    display: flex;
    flex-direction: column; /* Stack content vertically */
    justify-content: space-between; /* Push button to the bottom */
    height: 100%; /* Allow the height to fill the container */
}

/* Hover effect for the product item */
.product-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* Product Image container */
.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
    margin-bottom: 15px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.product-image img:hover {
    transform: scale(1.1); /* Slight zoom effect */
}

/* Product details container */
.product-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    flex-grow: 1; /* Allow the details section to grow and fill available space */
}

/* Product title styling */
.product-title {
    font-size: 1.6em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    text-transform: capitalize;
}

/* Product price styling */
.product-price {
    font-size: 1.3em;
    color: #2ecc71;
    margin: 5px 0;
}

.product-price span {
    font-weight: bold;
}

/* Product discount price styling */
.product-discount {
    font-size: 1.1em;
    color: #e74c3c;
    text-decoration: line-through;
    margin: 5px 0;
}

.product-discount span {
    font-weight: bold;
}

/* Product rating styling */
.product-rating {
    font-size: 1em;
    color: #f39c12;
    margin: 10px 0;
}

/* View Details button */
.view-details-btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 12px 20px;
    text-align: center;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 20px;
    transition: background-color 0.3s ease;
    font-weight: bold;
    align-self: center; /* Center the button horizontally */
}

/* Hover effect for the View Details button */
.view-details-btn:hover {
    background-color: #2980b9;
}

/* Container for the product buttons to align them horizontally */
.product-buttons {
    display: flex;
    justify-content: center; /* Center-align buttons horizontally */
    margin-top: 20px; /* Added space above the buttons */
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .product-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 480px) {
    .product-container {
        grid-template-columns: 1fr;
    }

    .product-title {
        font-size: 1.2em;
    }

    .product-price,
    .product-discount {
        font-size: 1.1em;
    }

    .view-details-btn {
        padding: 10px 15px;
    }

    .product-image {
        height: 200px; /* Reduce image height for small screens */
    }
}
