/* TCO Lean Product Filter Styles */
.tco-product-filters {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    font-family: inherit;
}

.tco-product-filters h4 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

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

.filter-group:last-child {
    margin-bottom: 0;
}

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

/* Price Range Inputs */
.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-inputs input[type="number"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    max-width: 80px;
}

.price-inputs span {
    color: #666;
    font-size: 14px;
}

/* Select Dropdown */
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Checkbox Groups */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    font-size: 14px;
    color: #666;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: #333;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 0;
    accent-color: var(--global-palette-highlight, #007cba);
}

/* Filter Buttons */
.tco-filter-btn {
    background: var(--global-palette-highlight, #007cba);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-right: 10px;
    transition: all 0.2s ease;
}

.tco-filter-btn:hover {
    background: var(--global-palette-highlight-alt, #005a8b);
    transform: translateY(-1px);
}

.tco-filter-btn.tco-clear {
    background: #666;
}

.tco-filter-btn.tco-clear:hover {
    background: #555;
}

/* Loading State */
.tco-filters-loading .tco-filter-btn {
    opacity: 0.6;
    cursor: not-allowed;
}

.tco-filters-loading::after {
    content: "Filtering...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .tco-product-filters {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .price-inputs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .price-inputs input[type="number"] {
        max-width: none;
        margin-bottom: 5px;
    }
    
    .price-inputs span {
        text-align: center;
        margin: 5px 0;
    }
    
    .tco-filter-btn {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Integration with existing theme */
.tco-product-filters input,
.tco-product-filters select {
    box-sizing: border-box;
    outline: none;
}

.tco-product-filters input:focus,
.tco-product-filters select:focus {
    border-color: var(--global-palette-highlight, #007cba);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Results update animation */
.products.tco-updating {
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.products.tco-updated {
    opacity: 1;
}

#product-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

#product-search:focus {
    border-color: var(--global-palette-highlight, #007cba);
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

/* Search loading indicator */
#product-search.tco-search-loading {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="none" stroke="%23ccc" stroke-width="2"/><circle cx="10" cy="10" r="8" fill="none" stroke="%23007cba" stroke-width="2" stroke-dasharray="25" stroke-dashoffset="25"><animateTransform attributeName="transform" type="rotate" dur="1s" repeatCount="indefinite" values="0 10 10;360 10 10"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px 16px;
    padding-right: 35px;
}

/* Optional: Reduce Apply button prominence since auto-filter is working */
.tco-filter-btn {
    opacity: 0.8;
    font-size: 13px;
}

.tco-filter-btn:hover {
    opacity: 1;
}