/* General Styles */
body {
    background-color: grey;
    color: #333;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

h1 {
    text-align: center;
    margin: 20px 0;
    font-size: 2.5rem;
    color: #0078d7;
}

/* Wrapper Styles */
.wrapper {
    display: flex;
    justify-content: center;
    padding: 20px;
    flex-wrap: wrap;
}

/* Card Styles */
.product-card {
    display: flex;
    background: white;
    width: 90%; /* Take up most of the screen width */
    max-width: 1500px; /* Increased width for a wider card */
    height: 450px; /* Reduced height for a shorter card */
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.product-card img {
    width: 35%; /* Adjust image size for better fit */
    object-fit: contain;
    padding: 10px;
}

.product-card .card-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.product-card h2 {
    font-size: 1.5rem;
    color: #0078d7;
    margin: 10px 0;
}

.product-card p {
    font-size: 1rem;
    color: #666;
    margin: 10px 0 20px;
}

.product-card .price {
    font-size: 1.2rem;
    color: #28a745;
    font-weight: bold;
}

.product-card ul {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.product-card ul li {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.5;
}

/* Add to Cart Button */
.add-to-cart-container {
    display: flex;
    justify-content: flex-end; /* Align the button to the right */
    position: absolute;
    bottom: 20px;
    right: 20px;
}

button.add-to-cart {
    padding: 10px 20px;
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button.add-to-cart:hover {
    background-color: #008ECC;
}

/* Checkout Button */
.checkout-button {
    width: 100%;
    padding: 15px;
    background-color: #0078d7;
    color: white;
    border: none;
    border-radius: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 20px;
}

.checkout-button:hover {
    background-color: #008ECC;
}

.checkout-button:focus {
    outline: none;
}

.checkout-button-container {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Cart Styles */
.cart {
    position: fixed;
    top: 0;
    right: -450px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.cart.open {
    right: 0;
}

.cart h2 {
    text-align: center;
    color: #0078d7;
    margin-bottom: 20px;
}

.cart ul {
    list-style: none;
    padding: 0;
}

.cart li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}

.cart li img {
    max-width: 60px;
    max-height: 60px;
    object-fit: cover;
    margin-right: 10px;
}

#cart-icon {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #0078d7;
    color: white;
    padding: 15px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
}

#cart-icon:hover {
    background-color: #008ECC;
}

#cart-count {
    font-size: 14px;
    background-color: red;
    color: white;
    border-radius: 50%;
    padding: 5px;
    margin-left: 5px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .product-card {
        flex-direction: column; /* Stack elements on mobile */
        width: 100%; /* Full width for mobile */
        height: auto; /* Let the height adjust on mobile */
    }

    .product-card img {
        width: 100%; /* Full-width image */
        max-height: 300px; /* Ensure image isn’t too large */
    }

    .product-card .card-content {
        padding: 15px;
    }

    .product-card h2 {
        font-size: 1.3rem; /* Smaller title on mobile */
    }

    .product-card .price {
        font-size: 1rem; /* Smaller price on mobile */
    }

    button.add-to-cart {
        width: 100%; /* Full-width button on mobile */
    }

    .cart {
        width: 80%; /* Smaller cart on mobile */
    }

    #cart-icon {
        font-size: 20px; /* Smaller cart icon */
        padding: 10px;
    }
}
