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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
}

header {
    background-color: #333;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.cart-icon {
    cursor: pointer;
    font-size: 1.5rem;
    position: relative;
}

#cart-count {
    background-color: #ff4444;
    color: white;
    border-radius: 50%;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    position: absolute;
    top: -8px;
    right: -8px;
}

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

.product-card {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card:hover {
    transform: translateY(-5px);
}

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

.product-card h3 {
    margin: 1rem 0 0.5rem;
    color: #333;
}

.product-card p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.price {
    color: #2ecc71;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.add-to-cart {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.add-to-cart:hover {
    background-color: #27ae60;
}

.cart {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background-color: white;
    padding: 2rem;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 999;
}

.cart.active {
    right: 0;
}

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

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    margin-right: 1rem;
    border-radius: 4px;
}

.cart-item-info {
    flex-grow: 1;
}

.remove-item {
    color: #ff4444;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1.2rem;
}

.cart-total {
    margin-top: 2rem;
    padding: 1rem 0;
    border-top: 2px solid #eee;
    text-align: right;
    font-size: 1.1rem;
}

.checkout-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 1rem;
    width: 100%;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.checkout-button:hover {
    background-color: #27ae60;
}

/* Responsividade */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    .products-grid {
        padding: 1rem;
        gap: 1rem;
    }

    .cart {
        width: 100%;
        right: -100%;
        padding: 1.5rem;
    }

    .cart.active {
        right: 0;
    }

    .product-card img {
        height: 180px;
    }

    .checkout-button {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .product-card img {
        height: 150px;
    }

    .product-card h3 {
        font-size: 1rem;
    }

    .product-card p {
        font-size: 0.85rem;
    }

    .price {
        font-size: 1rem;
    }

    .add-to-cart {
        font-size: 0.9rem;
    }

    .cart-total {
        font-size: 1rem;
    }
}