/* Product Filter Widget Styles */

.pf-filter-container {
    width: 100%;
}

.pf-filter-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.pf-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

/* 左侧筛选 */
.pf-filter-left {
    flex: 1;
}

.pf-filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pf-filter-group {
    position: relative;
}

.pf-filter-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 0;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    transition: all 0.2s ease;
    min-width: 180px;
    justify-content: space-between;
}

.pf-filter-btn:hover {
    border-color: #999;
    background: transparent;
}

.pf-filter-btn.active {
    border-color: #000;
    background: transparent;
}

.pf-btn-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.pf-filter-btn.active .pf-btn-arrow {
    transform: rotate(180deg);
}

/* 下拉面板 */
.pf-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: #fff;
    border: 1px solid #ccc;
    z-index: 100;
    display: none;
    margin-top: 5px;
}

.pf-dropdown.active {
    display: block;
}

.pf-dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
}

.pf-selected-count {
    font-size: 14px;
    color: #333;
}

.pf-reset-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.pf-reset-btn:hover {
    color: #000;
}

.pf-dropdown-list {
    max-height: 300px;
    overflow-y: auto;
}

/* 复选框样式 */
.pf-checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pf-checkbox-item:hover {
    background: #f9f9f9;
}

.pf-checkbox-item input[type="checkbox"] {
    display: none;
}

.pf-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    margin-right: 12px;
    position: relative;
    flex-shrink: 0;
}

.pf-checkbox-item input[type="checkbox"]:checked + .pf-checkbox-custom {
    background: #333;
    border-color: #333;
}

.pf-checkbox-item input[type="checkbox"]:checked + .pf-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.pf-term-name {
    font-size: 14px;
    color: #333;
    flex: 1;
}

.pf-term-count {
    font-size: 14px;
    color: #999;
    margin-left: 5px;
}

/* 右侧排序 */
.pf-filter-right {
    min-width: 250px;
}

.pf-sort-wrapper {
    position: relative;
}

.pf-sort-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 24px;
    background: transparent;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 15px;
    color: #333;
    min-width: 180px;
}

.pf-sort-btn:hover {
    border-color: #999;
}

.pf-sort-btn .pf-btn-arrow {
    color: #333;
}

.pf-sort-btn.active {
    border-color: #000;
}

.pf-sort-btn.active .pf-btn-arrow {
    transform: rotate(180deg);
}

.pf-sort-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: none;
}

.pf-sort-dropdown.active {
    display: block;
}

.pf-sort-option {
    padding: 12px 16px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease;
}

.pf-sort-option:hover {
    background: #f5f5f5;
}

.pf-sort-option.active {
    background: #666;
    color: #fff;
}

/* 产品列表与筛选区域间距 */
.pf-filter-container .cp-products-grid {
    margin-top: 50px !important;
}

.pf-filter-container .cp-no-products {
    margin-top: 50px !important;
}

/* 选中筛选标签 */
.pf-active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.pf-clear-all {
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pf-clear-all:hover {
    border-color: #333;
}

.pf-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    color: #333;
}

.pf-tag-remove {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    line-height: 1;
    display: flex;
    align-items: center;
}

.pf-tag-remove:hover {
    color: #000;
}

/* 手机端触发按钮 */
.pf-mobile-trigger {
    display: none;
    width: 100%;
    padding: 16px 24px;
    background: #222;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    align-items: center;
    justify-content: center;
}

/* 遮罩 */
.pf-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

.pf-mobile-overlay.active {
    display: block;
}

/* 侧边栏 */
.pf-mobile-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -340px !important;
    right: auto !important;
    width: 320px !important;
    max-width: 90vw;
    height: 100vh !important;
    background: #fff;
    z-index: 100000 !important;
    overflow-y: auto;
    transition: left 0.3s ease;
}

.pf-mobile-sidebar.active {
    left: 0 !important;
}

.pf-mobile-sidebar-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.pf-mobile-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.pf-mobile-sidebar-body {
    padding: 0 20px 40px;
}

.pf-mobile-section {
    margin-top: 24px;
}

.pf-mobile-section-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #666;
    margin-bottom: 12px;
    text-transform: uppercase;
}

/* 侧边栏排序 */
.pf-mobile-sort-group {
    position: relative;
}

.pf-mobile-sort-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.pf-mobile-sort-dropdown {
    display: none;
    border: 1px solid #ccc;
    border-top: none;
}

.pf-mobile-sort-dropdown.active {
    display: block;
}

/* 侧边栏筛选 */
.pf-mobile-filter-group {
    margin-bottom: 8px;
}

.pf-mobile-filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.pf-mobile-filter-btn.active {
    border-color: #000;
}

.pf-mobile-dropdown {
    display: none;
    border: 1px solid #ccc;
    border-top: none;
    padding: 8px 0;
}

.pf-mobile-dropdown.active {
    display: block;
}

.pf-mobile-dropdown .pf-checkbox-item {
    padding: 10px 16px;
}

/* 分页样式 */
.pf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
    padding: 20px 0;
}

.pf-page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.pf-page-link:hover {
    border-color: #111;
    background: #111;
    color: #fff;
}

.pf-page-link.current {
    border-color: #111;
    background: #111;
    color: #fff;
    cursor: default;
}

.pf-prev,
.pf-next {
    font-size: 16px;
    font-weight: 700;
}

/* 响应式 */
@media (max-width: 768px) {
    .pf-mobile-trigger {
        display: flex;
    }

    .pf-filter-container,
    .pf-active-filters {
        display: none;
    }
}
