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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    /* background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
    margin-bottom: 20px;
}

.search-bar {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s;
}

.search-bar:focus {
    border-color: #4caf50;
}

.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 20px;
    align-items: start;
}

.filters-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.filters-panel h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    border-bottom: 2px solid #4caf50;
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
    font-size: 14px;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

.filter-group input[type='checkbox'] {
    width: auto;
    margin-right: 8px;
}

.filter-group .two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.checkbox-group label {
    margin: 0px;
}

.reset-filters {
    width: 100%;
    padding: 10px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 15px;
    transition: background 0.3s;
}

.reset-filters:hover {
    background: #d32f2f;
}

.products-grid {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 600px;
}

#productsContainer {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.results-count {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.product-card {
    display: flex;
    flex-direction: column;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
    gap: 10px;
}

.product-card:hover {
    border-color: #4caf50;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-card.active {
    border-color: #4caf50;
    background: #e8f5e9;
}

.product-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-header > div {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.product-code {
    font-weight: 700;
    font-size: 16px;
    color: #2c3e50;
}

.product-name {
    color: #555;
    font-size: 14px;
    line-height: 1.4;
    flex: 0 0 auto;
}

.product-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
}

.spec-item {
    font-size: 12px;
    color: #666;
    background: white;
    padding: 4px 8px;
    border-radius: 4px;
    flex: 0 1 calc(50% - 4px);
    min-width: 120px;
}

.spec-label {
    font-weight: 600;
    color: #333;
}

.download-btn {
    padding: 8px 16px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: background 0.3s;
    width: 100%;
    flex-shrink: 0;
    align-self: stretch;
}

.download-btn:hover {
    background: #45a049;
}

.related-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.related-panel h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
    border-bottom: 2px solid #4caf50;
    padding-bottom: 10px;
}

.related-product {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafafa;
    transition: all 0.2s;
}

.related-product:hover {
    border-color: #4caf50;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.related-code {
    font-weight: 700;
    font-size: 14px;
    color: #2c3e50;
    margin-bottom: 6px;
}

.related-specs {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.empty-related {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #4caf50;
    font-size: 16px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%,
    20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60%,
    100% {
        content: '...';
    }
}

@media (min-width: 1201px) {
    #productsContainer {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .product-card {
        flex: 0 1 calc(50% - 6px);
        margin-bottom: 0;
    }
}

@media (max-width: 1400px) {
    .main-content {
        grid-template-columns: 250px 1fr 300px;
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .filters-panel,
    .related-panel {
        position: static;
        max-height: none;
    }
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 5px;
}

.badge-ip {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-volt {
    background: #fff3e0;
    color: #f57c00;
}

.badge-brand {
    background: #f3e5f5;
    color: #7b1fa2;
}

.badge-ct {
    background: #fff9c4;
    color: #bf6312;
}

.badge-cri {
    background: #d5ffc4;
    color: #26aa0e;
}
