:root {
    --primary: #4f46e5;
    --secondary: #3b82f6;
    --dark: #1e293b;
    --light: #f8fafc;
    --white: #ffffff;
    --gray: #64748b;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--light);
    color: var(--dark);
}

/* Navbar */
.navbar {
    background: var(--white);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

.logo span { color: var(--gray); font-weight: 400; }

.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--dark); font-weight: 500; }
.nav-links a:hover { color: var(--primary); }

.cart-icon {
    position: relative;
    cursor: pointer;
    font-size: 20px;
}

.badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 50%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.hero h1 { margin: 0 0 10px; }
.hero p { margin: 0 0 20px; opacity: 0.9; }

.search-bar {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    background: white;
    border-radius: 30px;
    padding: 5px;
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 10px 15px;
    outline: none;
    border-radius: 30px;
}

.search-bar button {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
}

/* Container & Categories */
.container { max-width: 1200px; margin: 30px auto; padding: 0 20px; }

.categories {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.cat-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.3s;
}

.cat-btn.active, .cat-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.product-card {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.2s;
}

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

.product-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-name { font-weight: bold; margin: 10px 0 5px; font-size: 16px; }
.product-cat { color: var(--gray); font-size: 12px; margin-bottom: 10px; }
.product-price { color: var(--primary); font-weight: bold; font-size: 18px; margin-bottom: 15px; }

.add-btn {
    background: white;
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    transition: 0.3s;
}

.add-btn:hover { background: var(--primary); color: white; }

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -350px;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: 0.3s;
    z-index: 200;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open { right: 0; }

.cart-header {
    padding: 20px;
    background: var(--primary);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-cart { font-size: 24px; cursor: pointer; }

.cart-items { flex: 1; overflow-y: auto; padding: 20px; }

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

.cart-footer { padding: 20px; border-top: 1px solid #eee; }
.total { font-size: 18px; font-weight: bold; margin-bottom: 15px; display: flex; justify-content: space-between; }

.checkout-btn {
    width: 100%;
    background: #10b981;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

.cart-item-info {
    font-weight: bold;
}

.cart-item-details {
    font-size: 12px;
    color: var(--gray);
}

.cart-item-remove {
    color: #ef4444;
    cursor: pointer;
    transition: 0.2s;
}

.cart-item-remove:hover {
    transform: scale(1.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 300;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.close-modal { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; }
.place-order-btn { width: 100%; background: var(--primary); color: white; border: none; padding: 12px; border-radius: 5px; margin-top: 10px; cursor: pointer; }
input, textarea { width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #ddd; border-radius: 5px; box-sizing: border-box; }