/* ============================================
   Header Section
   ============================================ */
.apf-filters-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}

.apf-filter-icon {
    font-size: 24px;
}
.apf-clear-filters {
    padding: 0 !important;
    background: transparent !important;
    color: #1a1a1a !important;
    border: 0 !important;
}

/* ============================================
   Filter Sections
   ============================================ */

.apf-filters-form {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.apf-filter-section {
    background: #F8F8F8;
    padding: 30px 40px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.apf-filter-heading {
    margin: 0;
    font-size: 16px !important;
    border-bottom: 1px solid rgb(0 0 0 / 30%);
    padding-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.apf-filter-heading::after {
    content: "";
    background: url(/wp-content/uploads/2025/10/Down.png);
    width: 12px;
    height: 12px;
    background-size: contain;
    background-repeat: no-repeat;
}
.apf-heading-icon {
    font-size: 0;
    display: none;
}

/* ============================================
   Price Filter
   ============================================ */

.apf-price-filter {
    margin-top: 15px;
}

.apf-price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

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

.apf-price-input-group label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
}

.apf-price-input-group input {
    border-radius: 10px !important;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgb(0 0 0 / 30%) !important;
    outline: 0;
    background-color: transparent !important;
    padding: 10px !important;
}

.apf-price-input-group input:focus {
    outline: none;
    border-color: #ff6b35;
}

.apf-price-separator {
    font-size: 18px;
    font-weight: 600;
    color: #9ca3af;
    margin-top: 20px;
}

/* Price Range Slider */
.apf-price-slider-container {
    position: relative;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin: 20px 0;
}

.apf-price-range {
    position: absolute;
    width: 100%;
    height: 6px;
    background: transparent !important;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    padding: 0 !important;
    border: 0 !important;
}

.apf-price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #ff6b35;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.apf-price-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.apf-price-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #ff6b35;
    border: 3px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.apf-price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    font-size: 14px;
    font-weight: 600;
}

.apf-price-display span {
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ============================================
   Checkbox Filters (Categories & Attributes)
   ============================================ */

.apf-filter-options {
    display: flex;
    flex-direction: column;
    gap: 25px;
    /* max-height: 250px;
    overflow-y: auto; */
    padding-right: 5px;
}
.apf-filter-options {
    display: none;
}
.apf-filter-options.active {
    display: flex;
}
/* Custom Scrollbar */
.apf-filter-options::-webkit-scrollbar {
    width: 6px;
}

.apf-filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.apf-filter-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.apf-filter-options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.apf-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

.apf-filter-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #ff6b35;
    appearance: none;
    border: 1px solid #ff6b35 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background-color: transparent !important;
}
input[type="checkbox"]:checked {
    background-color: #ff6b35 !important;
    position: relative;
}
input[type="checkbox"]:checked::after {
    content: "✔";
    color: white;
    font-size: 16px;
    position: absolute;
    top: 25%;
    left: 0px;
    transform: translate(0px, -25%);
}
.apf-checkbox-label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.apf-count {
    font-size: 12px;
}

/* ============================================
   Filter Actions
   ============================================ */

.apf-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.apf-apply-filters {
    width: 100% !important;
    position: relative;
}
button.apf-apply-filters::after {
    position: absolute;
    content: "";
    background: url(/wp-content/uploads/2025/10/Group-33-1.png);
    background-repeat: no-repeat;
    background-size: contain;
    width: 36px;
    height: 36px;
    right: 10px;
    top: 50%;
    transform: translate(0, -50%);
}
.apf-apply-filters:active {
    transform: translateY(0);
}

/* ============================================
   Active Filters Display
   ============================================ */

.apf-active-filters {
    margin-top: 20px;
    padding: 15px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
}

.apf-active-filters h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e40af;
}

.apf-active-filters-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.apf-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 13px;
    color: #1e40af;
    font-weight: 500;
}

.apf-remove-filter {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.apf-remove-filter:hover {
    background: #fee2e2;
}

/* ============================================
   Loading Overlay
   ============================================ */

.apf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(0 0 0 / 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border-radius: 12px;
    z-index: 1000;
}
.apf-filters-header {
    margin-bottom: 20px;
}
.apf-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f4f6;
    border-top-color: #ff6b35;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
button.filter_btn {
    width: 100%;
    background-color: transparent !important;
    border-color: rgb(0 0 0 / 30%) !important;
    color: #3E3E3E !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
button.filter_btn img {
    max-width: 17px;
    height: 18px;
    object-fit: contain;
}
.apf-loading-overlay p {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}
h5.filteroverlay_head {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.filter_overlay.active {
    display: flex;
}
/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .apf-loading-overlay {
        position: fixed;
    }
     .filter_overlay {
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        position: fixed;
        z-index: 999;
        background-color: #ffffff;
        padding: 40px 18px;
        display: none;
        flex-direction: column;
        gap: 40px;
        overflow: auto;

    }
    .apf-filters-container {
        gap: 10px;
    }
}
@media (min-width: 1025px){
    button.filter_btn, h5.filteroverlay_head {
        display: none;
    }
}
@media (max-width: 768px) {
    
    .apf-filters-form {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .apf-filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .apf-clear-filters {
        width: 100%;
        justify-content: center;
    }
    
    .apf-filter-actions {
        margin-top: 5px;
    }
    
    .apf-apply-filters {
        width: 100%;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .apf-filters-title {
        font-size: 18px;
    }
    
    .apf-filter-heading {
        font-size: 14px;
    }
    
    .apf-filter-section {
        padding: 15px;
    }
}

/* ============================================
   Utility Classes
   ============================================ */

.apf-hidden {
    display: none !important;
}

.apf-fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   WooCommerce Integration
   ============================================ */

/* Ensure products grid stays consistent */
.woocommerce ul.products {
    transition: opacity 0.3s ease;
}

.woocommerce ul.products.apf-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Results count */
.woocommerce-result-count {
    font-weight: 600;
    color: #374151;
}

/* No products message */
.woocommerce-info {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
}