/* General Body Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    background-color: #f9f9f9;
}

/* Sidebar Styling */
.sidebar {
    width: 250px;
    background-color: #333;
    color: white;
    padding: 20px;
    height: 100vh;
    position: fixed;
    /* Keeps sidebar fixed */
    top: 0;
    left: 0;
    overflow-y: auto;
    /* Scroll if content overflows */
}

/* Sidebar Navigation Styling */
.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar img {
    width: 50px;
    height: 50px;
}

.sidebar nav ul li {
    margin: 10px 0;
}

.sidebar nav ul li a {
    color: white;
    text-decoration: none;
    display: block;
    padding: 10px;
    border-radius: 5px;
}

.sidebar nav ul li a:hover {
    background-color: #575757;
}

/* Main Content Area */
.content {
    margin-left: 250px;
    /* Sidebar width */
    padding: 20px;
    width: calc(100% - 250px);
    /* Adjust for sidebar width */
    box-sizing: border-box;
}

/* Product List Styling */
#productList {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Center products horizontally */
    gap: 20px;
    /* Space between products */
}

/* Individual Product Styling */
.product {
    border: 1px solid #ddd;
    padding: 20px;
    text-align: center;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: calc(25% - 20px);
    /* Four products per row */
    max-width: 300px;
    /* Optional: Max width for each product */
    box-sizing: border-box;
}

/* Product Image Styling */
.product img {
    width: 100%;
    /* Responsive image width */
    height: auto;
    /* Maintain aspect ratio */
    max-height: 200px;
    /* Limit height to prevent overflow */
    object-fit: cover;
    /* Cover image within container */
    border-radius: 5px;
}

/* Product Title and Description Styling */
.product h3,
.product p {
    margin: 10px 0;
    font-size: 1em;
    color: #666;
}

/* Buttons Styling */
.product .buy-btn,
.product .cart-btn {
    padding: 10px 20px;
    margin: 10px 5px;
    cursor: pointer;
    background-color: #007bff;
    border: none;
    color: white;
    border-radius: 5px;
    text-align: center;
    font-size: 1em;
}

.product .buy-btn:hover,
.product .cart-btn:hover {
    background-color: #0056b3;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Cart  Styling */
#cartContainer {
width: 900px;
    margin: 0 auto;
    padding: 20px;
}

#cartList {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cart-item {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
}

.cart-item img {
    max-width: 300px;
    max-height: 200px;
    object-fit: cover;
    margin-right: 20px;
}

.cart-item h3 {
    margin: 0;
    flex: 1;
}

.cart-item p {
    margin: 0;
}

.remove-btn {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

#totalPrice {
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: right;
}

/* Update Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgb(0, 0, 0);
    background-color: rgba(0, 0, 0, 0.4);
    padding-top: 60px;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Form Container Styling */
.form-container {
    max-width: 600px;
    /* Adjust as needed */
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    margin-top: 200px;
}

/* Form Elements Styling */
form {
    display: flex;
    flex-direction: column;
}

/* Label Styling */
form label {
    margin-bottom: 5px;
    font-size: 1em;
    color: #333;
}

/* Input and Textarea Styling */
form input,
form textarea {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    box-sizing: border-box;
}

/* Input Focus Styling */
form input:focus,
form textarea:focus {
    border-color: #007bff;
    outline: none;
}

/* Button Styling */
form button {
    padding: 10px 20px;
    background-color: #007bff;
    border: none;
    color: white;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    text-align: center;
}

form button:hover {
    background-color: #0056b3;
}

/* Error Message Styling */
.error-message {
    color: red;
    font-size: 0.9em;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
        padding: 10px;
    }

    .content {
        margin-left: 200px;
        width: calc(100% - 200px);
    }

    #productList {
        flex-direction: column;
        /* Stack products vertically on small screens */
        align-items: center;
    }

    .product {
        width: 100%;
        /* Full width on small screens */
    }
}