/* WooCommerce Product Filter - Frontend Styles */

.wpf-filter-widget {
    /* CSS 变量定义 - 默认颜色 */
    --wpf-primary: #0073aa;
    --wpf-text: #333;
    --wpf-text-light: #666;
    --wpf-text-lighter: #999;
    --wpf-border: #e0e0e0;
    --wpf-border-light: #ddd;
    --wpf-bg: #fff;
    --wpf-bg-alt: #f1f1f1;
    --wpf-scrollbar: #888;
    --wpf-scrollbar-dark: #555;
    --wpf-danger: #d00;

    background: var(--wpf-bg);
    padding: 0;
    margin-top: 30px;
    margin-bottom: 30px;
}

/* 已选筛选条件区域 */
.wpf-active-filters {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.wpf-active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpf-active-filters-label {
    font-weight: 600;
    color: var(--wpf-text-light);
    font-size: 14px;
}

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

.wpf-filter-tag {
    display: block;
    padding: 2px 10px;
    background: var(--wpf-bg);
    border: 1px solid var(--wpf-border-light);
    border-radius: 5px;
    font-size: 13px;
    color: var(--wpf-text);
}

.wpf-filter-tag-remove {
    cursor: pointer;
    color: var(--wpf-text-lighter);
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.wpf-filter-tag-remove:hover {
    color: var(--wpf-danger);
}

.wpf-clear-all-filters {
    cursor: pointer;
    font-size: 14px;
    color: var(--wpf-text-light);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: text-decoration-thickness 0.2s;
}

.wpf-clear-all-filters:hover {
    text-decoration-thickness: 2px;
    color: var(--wpf-text);
}

.wpf-filter-form {
    position: relative;
}

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

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

.wpf-filter-label {
    margin: 0 0 12px 0;
    font-size: 16px !important;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.wpf-filter-label:hover {
    color: var(--wpf-primary);
}

.wpf-toggle-icon {
    font-size: 18px;
    line-height: 1;
    transition: transform 0.3s ease;
}

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

.wpf-filter-options {
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.wpf-filter-options::-webkit-scrollbar {
    width: 6px;
}

.wpf-filter-options::-webkit-scrollbar-track {
    background: var(--wpf-bg-alt);
    border-radius: 3px;
}

.wpf-filter-options::-webkit-scrollbar-thumb {
    background: var(--wpf-scrollbar);
    border-radius: 3px;
}

.wpf-filter-options::-webkit-scrollbar-thumb:hover {
    background: var(--wpf-scrollbar-dark);
}

.wpf-checkbox-label {
    display: block;
    margin-top: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
}

.wpf-checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    vertical-align: middle;
}

.wpf-checkbox-label:hover {
    color: var(--wpf-primary);
}

/* Price Input Styles */
.wpf-price-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 0;
}

.wpf-price-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.wpf-price-input-group label {
    font-size: 12px;
    color: var(--wpf-text-light);
    font-weight: 500;
}

.wpf-price-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--wpf-border-light);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

/* 隐藏 number 输入框的上下箭头 */
.wpf-price-input::-webkit-outer-spin-button,
.wpf-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wpf-price-input[type=number] {
    -moz-appearance: textfield;
}

.wpf-price-input:focus {
    outline: none;
    border-color: var(--wpf-primary);
}

.wpf-price-separator {
    margin-bottom: 8px;
    color: var(--wpf-text-lighter);
    font-weight: 500;
}


/* Loading Overlay */
.wpf-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpf-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--wpf-primary);
    border-radius: 50%;
    animation: wpf-spin 1s linear infinite;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .wpf-filter-options {
        max-height: 200px;
    }
}

/* Collapsed State */
.wpf-filter-section.collapsed .wpf-filter-options {
    display: none;
}
