:root {
    --primary-color: #4a90e2;
    --background-color: #f4f7f6;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-color: #333;
    --text-light: #777;
    --border-color: #e0e0e0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    padding: 2rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.logo {
    margin-bottom: 2.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.logo .highlight {
    color: var(--primary-color);
}

.filter-section {
    margin-bottom: 2rem;
}

.filter-section h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: #555;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.category-list {
    list-style: none;
}

.category-list li a {
    text-decoration: none;
    color: var(--text-light);
    display: block;
    padding: 0.6rem 0;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.category-list li a:hover,
.category-list li a.active {
    color: var(--primary-color);
    font-weight: 600;
}

.nutrient-selection label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-light);
    cursor: pointer;
}

.nutrient-selection input {
    margin-right: 0.5rem;
    accent-color: var(--primary-color);
}

/* --- Main Content --- */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    overflow-y: auto;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.main-header h1 {
    font-weight: 600;
}

.search-bar input {
    width: 300px;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 1rem;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* --- Product List --- */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.product-info {
    margin-bottom: 1rem;
}

.product-info h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.product-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.product-nutrients .nutrient {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.product-nutrients .nutrient:last-child {
    border-bottom: none;
}

.nutrient-name {
    color: #555;
}

.nutrient-value {
    font-weight: 600;
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 1rem;
    }
    .logo, .filter-section {
        flex: 1 1 200px;
        margin: 0.5rem;
    }
    .main-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-bar {
        margin-top: 1rem;
        width: 100%;
    }
    .search-bar input {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .product-list {
        grid-template-columns: 1fr;
    }
    .sidebar {
        flex-direction: column;
        align-items: stretch;
    }
}