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

:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f8f9fa;
    --border-color: #e9ecef;
    --primary-color: #ff9500;
    --secondary-color: #232f3e;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --hover-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
    --hover-shadow: 0 5px 20px rgba(0,0,0,0.4);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: all 0.3s ease;
}

header {
    background: var(--secondary-color);
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.search-container {
    max-width: 300px;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    background: white;
    color: #333;
}

.theme-toggle {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,149,0,0.3);
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

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

.section-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-color);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

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

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: white;
    padding: 0.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.buy-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.buy-button:hover {
    background: #e6850e;
    transform: translateY(-1px);
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: var(--text-color);
    font-size: 1.2rem;
}

footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .search-container {
        order: 2;
        max-width: 100%;
    }

    .theme-toggle {
        order: 3;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-card {
        padding: 1rem;
    }
}