.marketplace-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 20px;
}

.filters-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.filters-header h3 {
    font-size: 1.25rem;
}

.filters-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
}

.filter-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.filter-section:last-of-type {
    border-bottom: none;
}

.filter-section h4 {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.filter-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.filter-section input[type="checkbox"],
.filter-section input[type="radio"] {
    cursor: pointer;
}

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
}

.search-box button {
    padding: 0.75rem;
    border: 1px solid var(--border);
    background: var(--secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--bg-light);
}

.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-range input {
    width: 100%;
}

.products-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 8px;
}

.toolbar-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.results-info {
    font-weight: 500;
}

#sortSelect {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--secondary);
    cursor: pointer;
}

.featured-section {
    margin-bottom: 3rem;
}

.featured-section h3 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.featured-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

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

.product-card.featured {
    border: 2px solid var(--primary);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--bg-light);
}

.product-info {
    padding: 1rem;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.product-name {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.product-seller {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.9rem;
}

.product-prices {
    margin: 0.75rem 0;
}

.price-tier {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.price-label {
    color: var(--text-secondary);
}

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

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.meta-badge {
    padding: 0.25rem 0.5rem;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 0.75rem;
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.product-actions button {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.9rem;
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--bg-light);
}

.icon-btn.active {
    background: var(--primary);
    color: var(--secondary);
    border-color: var(--primary);
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 3rem;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.modal-large {
    max-width: 900px;
    width: 95%;
}

#compareTable {
    overflow-x: auto;
}

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

.compare-item {
    text-align: center;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.compare-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

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

@media (max-width: 768px) {
    .marketplace-container {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
    }
    
    .products-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .toolbar-actions {
        width: 100%;
        flex-direction: column;
    }
    
    #sortSelect {
        width: 100%;
    }
}

