/* Product Grid Filters Styles */

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

/* Active Filters Bar */
.pge-active-filters {
    background: #f8f8f8;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.pge-active-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pge-refine-by {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.pge-clear-all {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    padding: 0;
    transition: color 0.3s;
}

.pge-clear-all:hover {
    color: #000;
}

/* Active Filter Items */
.pge-active-filter-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pge-active-filter-item {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: #333;
}

.pge-active-filter-label {
    margin-right: 8px;
}

.pge-active-filter-remove {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #666;
    transition: color 0.2s;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pge-active-filter-remove:hover {
    color: #000;
}

/* Filter Sections */
.pge-filter-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pge-filter-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

/* Filter Header */
.pge-filter-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #fafafa;
    cursor: pointer;
    position: relative;
}

.pge-filter-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.pge-filter-toggle {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s;
    margin-left: 10px;
}

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

.pge-filter-clear {
    position: absolute;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    text-decoration: underline;
    padding: 0;
    transition: color 0.3s;
}

.pge-filter-clear:hover {
    color: #000;
}

/* Filter Content */
.pge-filter-content {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    transition: max-height 0.3s;
}

.pge-filter-section.collapsed .pge-filter-content {
    max-height: 0;
    padding: 0 20px;
    overflow: hidden;
}

/* Filter Items */
.pge-filter-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.2s;
}

.pge-filter-item:hover {
    background: #f8f8f8;
    margin: 0 -10px;
    padding: 8px 10px;
}

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

.pge-filter-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-radius: 3px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s;
}

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

.pge-filter-item input[type="checkbox"]:checked + .pge-filter-checkbox::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
}

.pge-filter-label {
    flex: 1;
    color: #333;
    font-size: 14px;
}

.pge-filter-count {
    color: #999;
    font-size: 13px;
    margin-left: 5px;
}

/* Tag Filters (Sub Categories) */
.pge-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 20px;
}

.pge-filter-tag {
    display: inline-block;
    cursor: pointer;
}

.pge-filter-tag input[type="checkbox"] {
    display: none;
}

.pge-tag-label {
    display: inline-block;
    padding: 6px 16px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.pge-filter-tag:hover .pge-tag-label {
    background: #e8e8e8;
    color: #333;
}

.pge-filter-tag input[type="checkbox"]:checked + .pge-tag-label {
    background: #333;
    color: white;
    border-color: #333;
}

/* Scrollbar Styling */
.pge-filter-content::-webkit-scrollbar {
    width: 6px;
}

.pge-filter-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.pge-filter-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.pge-filter-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading State */
.pge-filters-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.pge-filters-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: pge-filter-spin 1s linear infinite;
}

@keyframes pge-filter-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .pge-active-filters {
        padding: 12px 15px;
    }
    
    .pge-active-filters-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .pge-filter-header {
        padding: 12px 15px;
    }
    
    .pge-filter-content {
        padding: 15px;
    }
    
    .pge-filter-tags {
        padding: 12px 15px;
    }
}