/* CSS styles for the cart page */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f9f9f9;
    color: #333;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
}

.cart-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Adjusted cart-item to match the full width */
.cart-item {
    display: flex;
    flex-wrap: wrap;
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
    align-items: center;
}

/* Added width to cart-item and cart-summary */
.cart-item,
.cart-summary {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.product-image {
    flex: 0 0 100px;
    margin-right: 20px;
}

.product-image img {
    max-width: 100px;
    border-radius: 5px;
}

.product-details {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.product-title {
    flex: 1 1 100%;
    font-size: 18px;
    margin-bottom: 10px;
}

.quantity-control {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.quantity-btn {
    background-color: #ddd;
    border: none;
    padding: 5px 10px;
    font-size: 18px;
    cursor: pointer;
}

.quantity-btn:hover {
    background-color: #ccc;
}

.quantity {
    margin: 0 10px;
    font-size: 16px;
}

.price-per-unit,
.total-price {
    margin-right: 20px;
    font-size: 16px;
}

.remove-form {
    margin-left: auto;
}

.remove-btn {
    background-color: #e74c3c;
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

.remove-btn:hover {
    background-color: #c0392b;
}

/* Adjusted cart-summary to align left and match the cart-item width */
.cart-summary {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    margin-top: 30px;
}

.cart-summary p {
    font-size: 20px;
    font-weight: bold;
}

.checkout-button {
    background-color: #3498db;
    border: none;
    color: #fff;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 10px;
}

.checkout-button:hover {
    background-color: #2980b9;
}

/* Responsive Design */
@media (max-width: 600px) {
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .product-image {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .product-image img {
        max-width: 100%;
    }

    .product-details {
        margin-left: 0;
    }

    .remove-form {
        margin-left: 0;
        margin-top: 10px;
    }
}

.product-title a {
    text-decoration: none; /* Removes the underline */
    color: inherit; /* Inherits the text color from the parent element */
}

/* Optional: Change hover effect */
.product-title a:hover {
    text-decoration: underline; /* Underline on hover, optional */
    color: #000; /* Change to desired hover color */
}

/* Empty Cart Styles */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px); /* Adjust 100px to the combined height of header and footer */
    padding: 50px 20px;
    text-align: center;
}

.empty-cart h2 {
    font-size: 24px;
    margin-bottom: 10px;
}

.empty-cart p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.continue-shopping-button {
    background-color: #3498db;
    border: none;
    color: #fff;
    padding: 12px 20px;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 20px;
    text-decoration: none;
}

.continue-shopping-button:hover {
    background-color: #2980b9;
}

/* Placeholder Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.product-card.placeholder {
    background-color: #fff;
    padding: 15px;
    border-radius: 5px;
}

.product-card .product-image {
    width: 100%;
    height: 150px;
    background-color: #eee;
    border-radius: 5px;
}

.product-card .product-details {
    margin-top: 10px;
}

.product-card .product-title,
.product-card .product-price {
    height: 20px;
    background-color: #eee;
    margin-top: 10px;
    border-radius: 3px;
}

.product-card .product-title {
    width: 60%;
}

.product-card .product-price {
    width: 40%;
}

/* Responsive Design */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: 1fr 1fr;
    }
}