/* Layout Containers */
.npc-filter-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.npc-products-container {
    flex: 1;
}

/* Sidebar Filter Styles */
.npc-filter-sidebar {
    position: sticky;
    top: 20px;
    width: 280px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 0;
    margin-right: 24px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    z-index: 10;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.npc-filter-sidebar::-webkit-scrollbar {
    width: 6px;
}

.npc-filter-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.npc-filter-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.npc-filter-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Filter Header */
.npc-filter-header {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.npc-filter-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.npc-filter-clear {
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.npc-filter-clear:hover {
    background: #e0e0e0;
    color: #333;
}

/* Search Bar */
.npc-search-container {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.npc-search-wrapper {
    position: relative;
}

.npc-search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: all 0.2s;
    box-sizing: border-box;
}

.npc-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.npc-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #666;
}

.npc-search-loading {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Filter Sections */
.npc-filter-section {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.npc-filter-section:last-child {
    border-bottom: none;
}

.npc-filter-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.npc-filter-section-toggle {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.npc-filter-section.collapsed .npc-filter-section-toggle {
    transform: rotate(-90deg);
}

.npc-filter-section-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.npc-filter-section.collapsed .npc-filter-section-content {
    max-height: 0;
    padding: 0;
    margin: 0;
    opacity: 0;
}

/* Filter Options */
.npc-filter-options {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 8px;
}

.npc-filter-options::-webkit-scrollbar {
    width: 4px;
}

.npc-filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.npc-filter-options::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.npc-filter-option {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 4px;
    margin: 2px 0;
}

.npc-filter-option:hover {
    background: #f5f5f5;
}

.npc-filter-checkbox {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    cursor: pointer;
    position: relative;
}

.npc-filter-checkbox input {
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    position: absolute;
}

.npc-filter-checkbox .checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 3px;
    transition: all 0.2s;
}

.npc-filter-checkbox input:checked ~ .checkmark {
    background-color: #007cba;
    border-color: #007cba;
}

.npc-filter-checkbox .checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.npc-filter-checkbox input:checked ~ .checkmark:after {
    display: block;
}

.npc-filter-label {
    font-size: 14px;
    color: #333;
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.npc-filter-count {
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* Price Range Slider */
.npc-price-range {
    margin: 16px 0;
}

.npc-price-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.npc-price-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.npc-price-input:focus {
    outline: none;
    border-color: #007cba;
}

.npc-price-slider {
    position: relative;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    margin: 16px 0;
}

.npc-price-slider-range {
    position: absolute;
    height: 100%;
    background: #007cba;
    border-radius: 3px;
}

.npc-price-slider-thumb {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #007cba;
    border-radius: 50%;
    cursor: pointer;
    top: -5px;
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.npc-price-slider-thumb:hover {
    background: #005a8a;
}

/* Active Filters */
.npc-active-filters {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.npc-active-filters-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.npc-active-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.npc-active-filter-tag {
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.npc-active-filter-remove {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.npc-active-filter-remove:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Sort Options */
.npc-sort-container {
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
}

.npc-sort-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.npc-sort-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.npc-sort-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 0;
}

.npc-sort-radio {
    width: 16px;
    height: 16px;
    margin-right: 12px;
    position: relative;
}

.npc-sort-radio input {
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    position: absolute;
}

.npc-sort-radio .radio-mark {
    position: absolute;
    top: 0;
    left: 0;
    height: 16px;
    width: 16px;
    background-color: #fff;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.2s;
}

.npc-sort-radio input:checked ~ .radio-mark {
    border-color: #007cba;
}

.npc-sort-radio .radio-mark:after {
    content: "";
    position: absolute;
    display: none;
    top: 2px;
    left: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #007cba;
}

.npc-sort-radio input:checked ~ .radio-mark:after {
    display: block;
}

.npc-sort-label {
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

/* Drag and Drop */
.npc-filter-option.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.npc-filter-option.drag-over {
    background: #e3f2fd;
    border: 2px dashed #007cba;
}

/* Results Counter */
.npc-results-counter {
    padding: 16px 24px;
    background: #f9f9f9;
    border-radius: 0 0 16px 16px;
    text-align: center;
}

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

.npc-results-count strong {
    color: #333;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .npc-filter-sidebar {
        width: 250px;
        margin-right: 20px;
    }
}

@media (max-width: 768px) {
    .npc-filter-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        max-height: none;
        z-index: 9999;
        transition: left 0.3s ease;
        border-radius: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .npc-filter-sidebar.mobile-open {
        left: 0;
    }
    
    .npc-filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        display: none;
    }
    
    .npc-filter-overlay.active {
        display: block;
    }
}

/* Loading States */
.npc-filter-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.npc-filter-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* Animation for filter updates */
.npc-filter-option.updating {
    opacity: 0.6;
    pointer-events: none;
}

.npc-filter-section.updating .npc-filter-options {
    opacity: 0.6;
}

/* Brand logos */
.npc-brand-logo {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 3px;
    object-fit: contain;
}

/* Vendor badges */
.npc-vendor-badge {
    font-size: 10px;
    background: #e0e0e0;
    color: #666;
    padding: 2px 6px;
    border-radius: 8px;
    margin-left: 4px;
}

/* Availability indicators */
.npc-availability-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    flex-shrink: 0;
}

.npc-availability-indicator.in-stock {
    background: #4caf50;
}

.npc-availability-indicator.out-of-stock {
    background: #f44336;
}

.npc-availability-indicator.low-stock {
    background: #ff9800;
}

/* Filter animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.npc-filter-option {
    animation: fadeIn 0.3s ease;
}

/* Hover effects */
.npc-filter-option:hover .npc-filter-label {
    color: #007cba;
}

.npc-filter-option:hover .npc-filter-count {
    background: #007cba;
    color: white;
}
