/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    direction: rtl;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Header Styles */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
#hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 5rem 2rem;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
}

.button {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    padding: 0.75rem 2rem;
    text-decoration: none;
    border-radius: 25px;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.button:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Product Grid */
#products {
    padding: 3rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

#products h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2c3e50;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.product {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    text-align: center;
}

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

.product img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.product h3 {
    padding: 1rem;
    font-size: 1.2rem;
    color: #2c3e50;
}

.product p {
    padding: 0 1rem 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: #e74c3c;
}

.add-to-cart {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: background-color 0.3s;
    margin-top: 0.5rem;
}

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

.add-to-cart.added {
    background-color: #2c3e50;
}

/* Cart Section */
#cart {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

#cart h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #2c3e50;
}

#cart-items {
    margin-bottom: 2rem;
}

.cart-item {
    background: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.cart-item-info h4 {
    margin-bottom: 0.3rem;
    color: #2c3e50;
}

.cart-item-info p {
    color: #7f8c8d;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-quantity button {
    background: #3498db;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-item-quantity button:hover {
    background: #2980b9;
}

.cart-item-quantity span {
    min-width: 40px;
    text-align: center;
    font-weight: bold;
}

.cart-item-remove {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}

#cart-total {
    text-align: right;
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    margin: 0.3rem 0;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    nav ul {
        gap: 1rem;
    }
    
    #hero h1 {
        font-size: 2rem;
    }
    
    #hero {
        padding: 3rem 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* Animation for add to cart */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.add-to-cart.added {
    animation: slideIn 0.3s ease;
}