/* ------------------------------
   Author: Prabhjot Kaur
   Student #: 991804196
-------------------------------- */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fafafa;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

header {
    background-color: #4CAF50;
    color: white;
    text-align: center;
    padding: 20px;
}

header .controls {
    margin-top: 10px;
}

header select, header button {
    padding: 8px 12px;
    margin: 5px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

header button {
    background-color: #333;
    color: white;
}

main {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 20px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    flex: 1;
}

.product-card {
    background-color: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.product-card button {
    background-color: #4CAF50;
    color: white;
    padding: 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
}

.product-card button:hover {
    background-color: #45a049;
}

#cart {
    flex: 1;
    margin-top: 20px;
    width: 100%;
}

#cart table {
    width: 100%;
    border-collapse: collapse;
}

#cart th, #cart td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}

#cart th {
    background-color: #4CAF50;
    color: white;
}

.cart-footer {
    margin-top: 10px;
    text-align: right;
}

#clearCart {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
}

#clearCart:hover {
    background-color: #d32f2f;
}

.dark-mode {
    background-color: #222;
    color: #eee;
}

.dark-mode header {
    background-color: #333;
}

.dark-mode .product-card {
    background-color: #333;
    color: #eee;
}

.dark-mode table {
    background-color: #333;
    color: #eee;
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
}
