/**
 * Frontend Styles
 */

/* Filter Wrapper */
.wcpf-filters-wrapper {
    margin-bottom: 30px;
}

/* Active Filters / Chips */
.wcpf-active-filters {
    margin-bottom: 20px;
}

.wcpf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wcpf-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
}

.wcpf-chip .wcpf-remove {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.wcpf-chip .wcpf-remove:hover {
    color: #333;
}

/* Filter Container */
.wcpf-filters {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

.wcpf-filter {
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 20px;
}

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

/* Filter Title */
.wcpf-filter-title {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wcpf-filter-title.wcpf-collapsible {
    cursor: pointer;
    user-select: none;
}

.wcpf-toggle::before {
    content: '▼';
    font-size: 12px;
    transition: transform 0.2s;
}

.wcpf-filter-title.open .wcpf-toggle::before {
    transform: rotate(-180deg);
}

/* Filter Content */
.wcpf-filter-content {
    display: block;
}

/* Checkbox List */
.wcpf-checkbox-list,
.wcpf-rating-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcpf-checkbox-list li,
.wcpf-rating-list li {
    margin-bottom: 8px;
}

.wcpf-checkbox-list label,
.wcpf-rating-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.wcpf-checkbox-list input,
.wcpf-rating-list input {
    margin: 0;
}

.wcpf-term-count {
    color: #999;
    font-size: 13px;
    margin-left: auto;
}

/* Select Dropdown */
.wcpf-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Color Swatches */
.wcpf-color-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wcpf-color-swatch {
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.wcpf-color-swatch input {
    display: none;
}

.wcpf-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.2s;
}

.wcpf-color-swatch.selected .wcpf-swatch {
    border-color: #333;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #333;
}

.wcpf-swatch-label {
    font-size: 12px;
    text-align: center;
}

/* Price Slider */
.wcpf-price-slider-wrapper {
    padding: 10px 0;
}

.wcpf-price-slider {
    height: 5px;
    background: #e5e5e5;
    border-radius: 3px;
    margin-bottom: 15px;
    position: relative;
}

.wcpf-price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wcpf-price-inputs input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.wcpf-price-inputs span {
    color: #999;
}

/* Rating Stars */
.wcpf-stars {
    color: #ffa500;
    font-size: 16px;
    letter-spacing: 2px;
}

/* Actions */
.wcpf-actions {
    padding: 15px 20px;
    text-align: center;
}

.wcpf-clear-all {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.wcpf-clear-all:hover {
    background: #e5e5e5;
    border-color: #999;
}

/* Loading State */
.wcpf-loader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.wcpf-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: wcpf-spin 1s linear infinite;
}

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

.products.wcpf-loading {
    position: relative;
    min-height: 400px;
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    .wcpf-filters {
        border: none;
        background: transparent;
    }
    
    .wcpf-filter {
        background: #fff;
        margin-bottom: 10px;
        border: 1px solid #e5e5e5;
        border-radius: 4px;
    }
    
    .wcpf-filter-content {
        display: none;
    }
    
    .wcpf-filter-title.open + .wcpf-filter-content {
        display: block;
    }
}
