* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

header {
    background: #2c3e50;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#cart-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.product {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.2s;
}

.product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.product h3 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.product .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e74c3c;
    margin: 0.5rem 0;
}

.add-to-cart {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.add-to-cart:hover {
    background: #219a52;
}

.rating {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.star {
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
}

.star.filled {
    color: #f39c12;
}

.star.half {
    color: #f39c12;
}

.star:not(.filled):not(.half) {
    color: #ddd;
}

.star:hover {
    color: #f39c12;
}

.rating-text {
    font-size: 0.9rem;
    color: #666;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    max-width: 500px;
}

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

.close:hover {
    color: black;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.cart-item > div {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.remove-btn:hover {
    background: #c0392b;
}

.cart-total {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 1rem 0;
    text-align: right;
}

#checkout-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
}

#checkout-btn:hover {
    background: #2980b9;
}

#login-btn, #logout-btn {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

#login-btn:hover, #logout-btn:hover {
    background: #8e44ad;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#login-form input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#login-form button {
    background: #27ae60;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

#login-form button:hover {
    background: #219a52;
}

.demo-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}