/* WooCommerce Product Filters - Dropdown Style Design */

.wcpf-shop-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 20px;
}

.wcpf-filters-sidebar {
    width: 100%;
    margin-bottom: 30px;
}

.wcpf-products-area {
    width: 100%;
}

.wcpf-filter-widget {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: none;
}

.wcpf-filter-title {
    display: none;
}

.wcpf-mobile-close {
    display: none;
}

.wcpf-filter-form {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0;
    align-items: flex-start;
}

.wcpf-filter-group {
    position: relative;
    border: none;
    background: transparent;
    flex: 0 0 auto;
    margin: 0;
}

.wcpf-filter-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    min-width: 150px;
    position: relative;
    z-index: 10;
}

.wcpf-filter-group-header:hover {
    background: #fafafa;
    border-color: #d5d5d5;
}

.wcpf-filter-group-header.active {
    background: #fff;
    border-color: #333;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    z-index: 20;
}

.wcpf-filter-group-title {
    font-size: 14px;
    font-weight: 400;
    margin: 0;
    color: #333;
    text-transform: none;
    letter-spacing: 0;
    display: flex;
    align-items: center;
    gap: 0;
}

.wcpf-filter-group-title::before {
    display: none;
}

.wcpf-accordion-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    position: relative;
    transition: transform 0.3s ease;
    margin-left: 10px;
    flex-shrink: 0;
}

.wcpf-accordion-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #666;
    border-bottom: 2px solid #666;
    transform: translate(-30%, -50%) rotate(45deg);
    transition: all 0.3s ease;
}

.wcpf-filter-group-header:hover .wcpf-accordion-icon::before {
    border-color: #333;
}

.wcpf-filter-group-header.active .wcpf-accordion-icon {
    transform: rotate(0deg);
}

.wcpf-filter-group-header.active .wcpf-accordion-icon::before {
    transform: translate(-30%, -50%) rotate(225deg);
    border-color: #333;
}

.wcpf-filter-group-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.4s ease;
    padding: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 15;
    opacity: 0;
    margin-top: -1px;
}

.wcpf-filter-group-content.active {
    max-height: 400px;
    padding: 15px 20px;
    opacity: 1;
    overflow-y: auto;
}

.wcpf-filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
}

.wcpf-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 0;
    border-radius: 0;
    transition: all 0.2s ease;
    position: relative;
}

.wcpf-filter-option::before {
    display: none;
}

.wcpf-filter-option:hover {
    transform: none;
}

.wcpf-filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #333;
    position: relative;
    z-index: 1;
    border-radius: 2px;
    border: 1px solid #d5d5d5;
    transition: all 0.2s ease;
    margin: 0;
    flex-shrink: 0;
}

.wcpf-filter-option input[type="checkbox"]:checked {
    background: #333;
    border-color: #333;
    box-shadow: none;
}

.wcpf-filter-option input[type="checkbox"]:hover {
    border-color: #333;
    transform: none;
}

.wcpf-filter-label {
    flex: 1;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    position: relative;
    z-index: 1;
    font-weight: 400;
    transition: color 0.2s ease;
}

.wcpf-filter-option:hover .wcpf-filter-label {
    color: #333;
}

.wcpf-filter-option input[type="checkbox"]:checked ~ .wcpf-filter-label {
    color: #333;
    font-weight: 500;
}

.wcpf-filter-count {
    font-size: 12px;
    color: #999;
    background: transparent;
    padding: 0;
    border-radius: 0;
    position: relative;
    z-index: 1;
    font-weight: 400;
    transition: all 0.2s ease;
}

.wcpf-filter-option:hover .wcpf-filter-count {
    background: transparent;
    color: #666;
}

/* Price Filter Styles */
.wcpf-price-range-wrapper {
    padding: 0;
}

.wcpf-price-slider {
    margin: 20px 0;
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    position: relative;
    box-shadow: none;
}

.wcpf-price-slider .ui-slider-handle {
    width: 16px;
    height: 16px;
    background: #333;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    top: -6px;
    position: absolute;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    outline: none;
}

.wcpf-price-slider .ui-slider-handle:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.wcpf-price-slider .ui-slider-handle:active {
    transform: scale(1.05);
}

.wcpf-price-slider .ui-slider-range {
    background: #333;
    height: 4px;
    border-radius: 2px;
    box-shadow: none;
}

.wcpf-price-inputs {
    margin-top: 15px;
}

.wcpf-price-display {
    text-align: center;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    padding: 10px;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.wcpf-currency {
    font-size: 14px;
    margin-right: 2px;
    color: #333;
    font-weight: 400;
}

.wcpf-price-min,
.wcpf-price-max {
    color: #333;
}

.wcpf-price-separator {
    margin: 0 5px;
    color: #999;
    font-weight: 400;
}

/* Filter Actions */
.wcpf-filter-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    border-top: none;
    width: 100%;
    flex-basis: 100%;
}

.wcpf-filter-submit,
.wcpf-filter-reset {
    flex: 0 0 auto;
    padding: 12px 24px;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0;
    position: relative;
    overflow: visible;
}

.wcpf-filter-submit {
    background: #333;
    color: #fff;
    box-shadow: none;
}

.wcpf-filter-submit::before {
    display: none;
}

.wcpf-filter-submit:hover {
    background: #000;
    border-color: #000;
    transform: none;
    box-shadow: none;
}

.wcpf-filter-submit:active {
    transform: none;
}

.wcpf-filter-reset {
    background: #fff;
    color: #333;
    border: 1px solid #e5e5e5;
}

.wcpf-filter-reset:hover {
    background: #fafafa;
    color: #000;
    border-color: #333;
    transform: none;
}

.wcpf-filter-reset:active {
    transform: none;
}

/* Loading State */
.wcpf-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.wcpf-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Filter Button */
.wcpf-mobile-filter-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin: 0 auto 20px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
    width: auto;
}

.wcpf-mobile-filter-toggle:hover {
    background: #000;
}

.wcpf-filter-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    line-height: 1;
}

.wcpf-filter-icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

.wcpf-filter-text {
    font-size: 14px;
}

/* Mobile Overlay */
.wcpf-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.wcpf-mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wcpf-mobile-filter-toggle {
        display: flex;
    }
    
    .wcpf-filter-widget {
        position: fixed;
        top: 0;
        right: -100%;
        width: 85%;
        max-width: 400px;
        height: 100vh;
        overflow-y: auto;
        z-index: 999;
        transition: right 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        margin: 0;
        border-radius: 0;
    }
    
    .wcpf-filter-widget.mobile-open {
        right: 0;
    }
    
    .wcpf-mobile-overlay {
        display: block;
    }
    
    .wcpf-filter-form {
        flex-direction: column;
        padding: 20px;
    }
    
    .wcpf-filter-group {
        width: 100%;
    }
    
    .wcpf-filter-group-header {
        width: 100%;
    }
    
    .wcpf-filter-group-content {
        position: relative;
        box-shadow: none;
        border: 1px solid #e5e5e5;
        border-top: none;
        max-height: none;
    }
    
    .wcpf-filter-group-content.active {
        max-height: none;
    }
    
    .wcpf-filter-actions {
        flex-direction: column;
        position: sticky;
        bottom: 0;
        background: #fff;
        padding: 15px 0;
        margin: 20px 0 0;
        border-top: 1px solid #e5e5e5;
    }
    
    .wcpf-filter-submit,
    .wcpf-filter-reset {
        width: 100%;
    }
    
    /* Close button for mobile */
    .wcpf-mobile-close {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
        background: transparent;
        border: none;
        font-size: 24px;
        color: #333;
        cursor: pointer;
        z-index: 1000;
        line-height: 1;
        padding: 0;
    }
    
    .wcpf-mobile-close:hover {
        color: #000;
    }
    
    .wcpf-filter-title {
        padding-right: 50px;
    }
}

/* Integration with WooCommerce shop page */
.woocommerce .wcpf-shop-wrapper .products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Smooth scrollbar for filter options */
.wcpf-filter-group-content::-webkit-scrollbar {
    width: 6px;
}

.wcpf-filter-group-content::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.wcpf-filter-group-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.wcpf-filter-group-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Close dropdown when clicking outside */
.wcpf-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
}

.wcpf-overlay.active {
    display: block;
}
