/* ========== MAIN FILTER CONTAINER ========== */

/* Add these styles to your existing filter-enhanced.css file */
.cpf-reset-filters .cpf-btn{
	display:none !important;
}
/* CPF Pagination Styles */
.cpf-pagination-wrapper {
    margin: 2rem 0;
    clear: both;
}
/* Hide Elementor pagination when filters are active */
body.cpf-filters-active .elementor-pagination,
body.cpf-filters-active .e-pagination,
body.cpf-filters-active .elementor-posts__pagination,
body.cpf-filters-active .elementor-widget-posts .elementor-pagination {
    display: none !important;
}
.cpf-pagination-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cpf-results-info {
    text-align: center;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.cpf-pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.cpf-page-btn {
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.cpf-page-btn:hover:not(.cpf-current-page):not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cpf-page-btn.cpf-current-page {
    background: #007cba;
    color: white;
    border-color: #007cba;
    cursor: default;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,124,186,0.2);
}

.cpf-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    color: #6c757d;
}

.cpf-page-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cpf-prev-page,
.cpf-next-page {
    font-weight: 600;
    padding: 10px 16px;
}

.cpf-pagination-ellipsis {
    padding: 10px 8px;
    color: #6c757d;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
}

/* Loading state for pagination */
.cpf-pagination-container.cpf-loading {
    opacity: 0.6;
    pointer-events: none;
}

.cpf-pagination-container.cpf-loading .cpf-page-btn {
    cursor: wait;
}



/* Responsive pagination */
@media (max-width: 768px) {
    .cpf-pagination-container {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .cpf-pagination-links {
        gap: 0.125rem;
    }
    
    .cpf-page-btn {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 36px;
        height: 36px;
    }
    
    .cpf-prev-page,
    .cpf-next-page {
        padding: 8px 12px;
    }
    
    .cpf-results-info {
        font-size: 13px;
    }
    
    /* Hide some page numbers on very small screens */
    @media (max-width: 480px) {
        .cpf-pagination-links .cpf-page-btn:not(.cpf-current-page):not(.cpf-prev-page):not(.cpf-next-page) {
            display: none;
        }
        
        .cpf-pagination-links .cpf-page-btn:not(.cpf-current-page):not(.cpf-prev-page):not(.cpf-next-page):nth-child(-n+3),
        .cpf-pagination-links .cpf-page-btn:not(.cpf-current-page):not(.cpf-prev-page):not(.cpf-next-page):nth-last-child(-n+3) {
            display: flex;
        }
    }
}

/* Smooth scroll behavior when paginating */
html {
    scroll-behavior: smooth;
}

/* Focus styles for accessibility */
.cpf-page-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Animation for page transitions */
@keyframes cpf-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpf-pagination-container {
    animation: cpf-fade-in 0.3s ease-out;
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    .cpf-pagination-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .cpf-page-btn {
        background: #4a5568;
        border-color: #6b7280;
        color: #e2e8f0;
    }
    
    .cpf-page-btn:hover:not(.cpf-current-page):not(:disabled) {
        background: #5a6374;
        border-color: #9ca3af;
        color: #f9fafb;
    }
    
    .cpf-page-btn:disabled {
        background: #374151;
        color: #9ca3af;
    }
    
    .cpf-results-info {
        color: #cbd5e0;
    }
    
    .cpf-pagination-ellipsis {
        color: #a0aec0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cpf-page-btn {
        border-width: 2px;
    }
    
    .cpf-page-btn.cpf-current-page {
        background: #000;
        color: #fff;
        border-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cpf-page-btn {
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .cpf-pagination-container {
        animation: none;
    }
}

/* ========== SELECTED FILTERS ========== */
.cpf-selected-filters {
    margin-bottom: 12px;
    padding: 12px 16px;
}

#cpf-selected-filters {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    min-height: auto;
}

.cpf-filter-chip {
    display: inline-flex;
    align-items: center;
    background: #e7f3ff;
    color: #007cba;
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    gap: 4px;
}

.cpf-remove-chip {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #007cba;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.cpf-remove-chip:hover {
    background: rgba(0, 124, 186, 0.1);
}

.cpf-clear-all-filters {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    text-decoration: underline;
    font-size: 12px;
    margin-left: 8px;
    padding: 4px 8px;
}

/* ========== FILTER SECTIONS ========== */
.cpf-filter-form {
    margin: 0;
    padding: 0;
}

.cpf-filter-section {
    border-bottom: 1px solid #e5e5e5 !important;
    margin: 0;
    position: relative;
}

.cpf-filter-section:last-child {
    border-bottom: none;
}

/* ========== FILTER HEADERS ========== */
.cpf-filter-header {
    padding: 15px 16px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: none;
    margin: 0;
    width: 100%;
    text-align: left;
    position: relative;
    user-select: none;
    transition: background-color 0.2s ease;
}

.cpf-filter-header:hover {
    background:none !important;
}

.cpf-filter-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    letter-spacing: -0.01em;
}


.cpf-dropdown-arrow.rotated {
    transform: rotate(180deg);
}

/* ========== FILTER CONTENT - OPTIMIZED ========== */
.cpf-filter-content,
.cpf-dropdown-content {
    padding: 0;
    margin: 0;
    background: #ffffff;
    overflow: hidden;
    display: none !important;
    opacity: 0;
    max-height: 0;
    transition: all 0.25s ease;
}

.cpf-filter-section.cpf-open-filter .cpf-filter-content,
.cpf-filter-section.cpf-open-filter .cpf-dropdown-content {
    display: block !important;
    opacity: 1;
    max-height: 500px;
    padding: 4px 16px 12px;
    animation: slideDown 0.25s ease-out;
}

.cpf-dropdown-content.cpf-show,
.cpf-filter-content.cpf-show {
    display: block !important;
    opacity: 1;
    max-height: 500px;
    padding: 4px 16px 12px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

.cpf-filter-section.cpf-open-filter {
    background: #fafafa;
}

.cpf-filter-section.cpf-open-filter .cpf-filter-content *,
.cpf-filter-section.cpf-open-filter .cpf-dropdown-content * {
    visibility: visible;
}

/* ========== CHECKBOX STYLING - OPTIMIZED ========== */
.cpf-checkbox-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cpf-checkbox-item {
    margin-bottom: 8px;
}

.cpf-checkbox-item:last-child {
    margin-bottom: 0;
}

.cpf-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    margin: 0;
    font-weight: 400;
    gap: 8px;
    position: relative;
    padding: 4px 0;
    transition: all 0.2s ease;
}

.cpf-checkbox-label:hover {
    color: #1a1a1a;
}

.cpf-checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    border: 2px solid #d1d5db;
    border-radius: 3px;
    background: #ffffff;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
   
}

.cpf-checkbox-label input[type="checkbox"]:hover {
    border-color: #dc2626;
}

.cpf-checkbox-label input[type="checkbox"]:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.cpf-checkbox-label input[type="checkbox"]:checked {
    background: #dc2626;
    border-color: #dc2626;
}

.cpf-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 5px;
    width: 3px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.cpf-checkbox-text {
    flex: 1;
    user-select: none;
    line-height: 1.3;
     font-weight: 300;
}

.cpf-checkbox-right {
    flex-direction: row-reverse;
    justify-content: space-between;
}

.cpf-checkbox-right input[type="checkbox"] {
    margin-left: 8px;
    margin-right: 0;
}

/* ========== RANGE SLIDER - OPTIMIZED ========== */
.cpf-range-slider-container {
    margin-top: 8px;
}

.cpf-range-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.cpf-range-input {
    width: 65px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    background: white;
}

.cpf-range-inputs span {
    color: #666;
    font-size: 13px;
    font-weight: 500;
}

.cpf-slider {
    height: 6px !important;
    background: #e5e5e5 !important;
    border: none !important;
    border-radius: 3px !important;
    margin: 8px 0;
    position: relative;
}

.cpf-slider .ui-slider-range {
    background: #dc2626 !important;
    border: none !important;
    border-radius: 3px !important;
    height: 6px !important;
    top: 0 !important;
}

.cpf-slider .ui-slider-handle {
    width: 16px !important;
    height: 16px !important;
    background: #dc2626 !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    outline: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
    top: -5px !important;
}

.cpf-slider .ui-slider-handle:hover {
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3) !important;
}

/* ========== FILTER ACTIONS - OPTIMIZED ========== */
.cpf-filter-actions {
    padding:0px !important;
    border-top: 1px solid #e5e5e5;
    display: flex;
    gap: 8px;
    background: #f8f9fa;
    margin-top: 15px;
}

.cpf-apply-filters {
    background: #dc2626;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    flex: 1;
    transition: background-color 0.2s ease;
}

.cpf-apply-filters:hover {
    background: #b91c1c;
}

.cpf-reset-filters {
    background: white;
    color: #666;
    border: 1px solid #d1d5db;
    padding: 10px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.cpf-reset-filters:hover {
    border-color: #9ca3af;
    color: #4b5563;
    background: #f9fafb;
}

/* ========== MOBILE FILTER BUTTON ========== */
.cpf-mobile-filter-wrapper {
    display: none;
    margin-bottom: 16px;
}

.cpf-mobile-filter-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
    position: relative;
}

.cpf-mobile-filter-button:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.cpf-mobile-filter-button.cpf-has-filters {
    border-color: #007cba;
    background: #e7f3ff;
    color: #007cba;
}

.cpf-filter-badge {
    background: #dc2626;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    margin-left: auto;
}

/* ========== TABLET STYLES ========== */
@media (min-width: 768px) and (max-width: 1199px) {
    .cpf-filter-container {
        max-width: 300px;
    }
    
    .cpf-filter-header {
        padding: 14px 18px;
    }
    
    .cpf-filter-header h4 {
        font-size: 15px;
    }
    
    .cpf-checkbox-label {
        font-size: 14px;
    }
    
    .cpf-filter-actions {
        padding: 18px;
    }
}

/* ========== LARGE DESKTOP STYLES ========== */
@media (min-width: 1200px) {
    .cpf-filter-header {
        padding: 16px 20px;
    }
    
    .cpf-filter-header h4 {
        font-size: 15px;
    }
    
    .cpf-checkbox-label {
        font-size: 14px;
    }
    
    .cpf-filter-actions {
        padding: 20px;
    }
    
    .cpf-selected-filters {
        padding: 16px 20px;
    }
    
    .cpf-filter-section.cpf-open-filter .cpf-filter-content,
    .cpf-filter-section.cpf-open-filter .cpf-dropdown-content {
        padding: 6px 20px 16px;
    }
    
    .cpf-filter-chip {
        font-size: 13px;
    }
}

/* ========== MOBILE STYLES ========== */
@media (max-width: 767px) {
    .cpf-mobile-filter-wrapper {
        display: block;
    }
    
    .cpf-filter-container.cpf-mobile-hidden {
        display: none;
    }
    
    .cpf-filter-container.cpf-mobile-visible {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: white;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        transform: translateY(100%);
        transition: transform 0.3s ease-out;
    }
    
    .cpf-filter-container.cpf-mobile-visible.cpf-mobile-animate-in {
        transform: translateY(0);
    }
    
    .cpf-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        border-bottom: 1px solid #e5e5e5;
        background: white;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .cpf-mobile-title {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }
    
    .cpf-mobile-close {
        background: none;
        border: none;
        padding: 6px;
        cursor: pointer;
        color: #666;
        border-radius: 4px;
        font-size: 16px;
        line-height: 1;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-form {
        flex: 1;
        padding: 12px;
        overflow-y: auto;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-section {
        margin-bottom: 16px;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        overflow: hidden;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-header {
        padding: 12px 16px;
        background: #f8f9fa;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-content {
        padding: 12px 16px;
        display: none;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-section.cpf-open-filter .cpf-filter-content {
        display: block;
        padding: 12px 16px;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-checkbox-label {
        padding: 8px 0;
        font-size: 14px;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-checkbox-label input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    .cpf-mobile-footer {
        padding: 12px 16px;
        border-top: 1px solid #e5e5e5;
        background: white;
        display: flex;
        gap: 8px;
        position: sticky;
        bottom: 0;
    }
    
    .cpf-mobile-clear {
        flex: 1;
        padding: 12px;
        background: white;
        border: 2px solid #e5e5e5;
        border-radius: 6px;
        color: #666;
        font-size: 14px;
        cursor: pointer;
    }
    
    .cpf-mobile-apply {
        flex: 2;
        padding: 12px;
        background: #dc2626;
        color: white;
        border: none;
        border-radius: 6px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-actions {
        display: none;
    }
    
    .cpf-mobile-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9998;
        opacity: 0;
        animation: fadeIn 0.3s ease-out forwards;
    }
    
    @keyframes fadeIn {
        to { opacity: 1; }
    }
    
    body.cpf-mobile-filter-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* ========== VERY SMALL SCREENS ========== */
@media (max-width: 480px) {
    .cpf-filter-container.cpf-mobile-visible .cpf-mobile-header {
        padding: 10px 12px;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-form {
        padding: 10px 12px;
    }
    
    .cpf-mobile-footer {
        padding: 10px 12px;
    }
    
    .cpf-mobile-title {
        font-size: 15px;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-section {
        margin-bottom: 12px;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-header {
        padding: 10px 12px;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-content {
        padding: 10px 12px;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-filter-section.cpf-open-filter .cpf-filter-content {
        padding: 10px 12px;
    }
    
    .cpf-checkbox-item {
        margin-bottom: 6px;
    }
    
    .cpf-filter-container.cpf-mobile-visible .cpf-checkbox-label {
        padding: 6px 0;
        font-size: 13px;
    }
}

/* ========== LOADING STATES ========== */
.cpf-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.cpf-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.cpf-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e5e5;
    border-top: 2px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ========== ACCESSIBILITY ========== */
.cpf-filter-header:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: -2px;
}

.cpf-checkbox-label:focus-within {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ========== UTILITY CLASSES ========== */
.cpf-excluded-container {
    position: relative;
    opacity: 1 !important;
}: transform;
}