/* ===== PILEHEAD CUSTOM FILTER STYLING ===== */

/* Main Filter Container */
.ppf-filter-box {
    background: white;
    border: 1px solid #E6E6E6;
    border-radius: 8px;
    padding: 16px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Filter Header */
.ppf-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #F0F0F0;
    margin-bottom: 16px;
}

.ppf-filter-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #000;
}

/* Clear All Button */
.ppf-clear-all {
    background: transparent;
    border: none;
    color: #F35024;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
}

.ppf-clear-all:hover {
    color: #d43d1a;
}

/* Filter Sections */
.ppf-filter-section {
    padding: 16px 0;
    border-bottom: 1px solid #F0F0F0;
}

.ppf-filter-section:last-child {
    border-bottom: none;
}

.ppf-filter-section:first-child {
    padding-top: 0;
}

/* Filter Toggle Button (Section Headers) */
.ppf-filter-toggle {
    width: 100%;
    background: transparent;
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
}

.ppf-filter-toggle span {
    font-size: 14px;
    font-weight: 600;
    color: #000;
}

.ppf-filter-toggle i {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

.ppf-filter-toggle.collapsed i {
    transform: rotate(180deg);
}

/* Search Input */
.ppf-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.ppf-search-input:focus {
    outline: none;
    border-color: #0aa572;
}

.ppf-search-input::placeholder {
    color: #999;
}

/* Filter Content */
.ppf-filter-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ppf-filter-content.collapsed {
    max-height: 0 !important;
}

/* Filter Options List */
.ppf-filter-options {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Individual Filter Items */
.ppf-filter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    cursor: pointer;
    transition: background 0.2s ease;
}

.ppf-filter-item:hover {
    background: #f9f9f9;
    margin: 0 -8px;
    padding: 8px;
    border-radius: 4px;
}

.ppf-filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.ppf-filter-item > span:first-of-type {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.ppf-filter-item input:checked + span {
    font-weight: 600;
    color: #0aa572;
}

/* Product Count */
.ppf-count {
    color: #999;
    font-size: 14px;
    margin-left: auto;
    padding-left: 8px;
}

/* Hidden Items (for Show More) */
.ppf-hidden {
    display: none !important;
}

/* Show More Button */
.ppf-show-more {
    background: transparent;
    border: none;
    color: #1E40AF;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ppf-show-more:hover {
    color: #0c2d7a;
}

.ppf-show-more::before {
    content: '+';
    font-size: 18px;
    font-weight: bold;
}

.ppf-show-more.showing::before {
    content: '−';
}

/* Loading State */
.ppf-loading {
    text-align: center;
    padding: 20px;
    font-size: 16px;
    color: #666;
}

.ppf-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0aa572;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom Scrollbar */
.ppf-filter-box::-webkit-scrollbar {
    width: 6px;
}

.ppf-filter-box::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ppf-filter-box::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.ppf-filter-box::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ppf-filter-box {
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 30px;
    }
}
