/* ======================================
   Desktop Filters Panel
   ====================================== */

.ewf-desktop-panel {
    background: #ffffff;
    padding: 25px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    align-self: flex-start;
}

.ewf-filter-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.ewf-filter-group:last-of-type {
    border-bottom: none;
}

.ewf-filter-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ewf-filter-toggle {
    cursor: pointer;
    user-select: none;
    transition: color 0.3s ease;
}

.ewf-filter-toggle:hover {
    color: #ff8827;
}

.ewf-toggle-icon {
    font-size: 20px;
    font-weight: 400;
    transition: transform 0.3s ease;
}

.ewf-filter-toggle.active .ewf-toggle-icon {
    transform: rotate(45deg);
}

/* Price Filter */
.ewf-price-filter {
    padding: 10px 5px;
}

#ewf-price-slider,
#ewf-mobile-price-slider {
    margin: 20px 0;
}

.ewf-price-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-top: 15px;
}

/* noUiSlider Overrides */
.noUi-target {
    background: #e0e0e0;
    border: none;
    box-shadow: none;
    border-radius: 2px;
    height: 3px; /* Thinner slider bar */
}

.noUi-connect {
    background: #ff8827;
}

.noUi-handle {
    width: 16px;  /* Smaller white circles */
    height: 16px;
    border-radius: 50%;
    background: #ffffff;  /* White circles */
    border: 2px solid #ff8827;  /* Orange border */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.noUi-handle:before,
.noUi-handle:after {
    display: none;
}

.noUi-horizontal .noUi-handle {
    right: -8px;  /* Adjusted for smaller size */
    top: -7px;
}

/* Filter Options */
.ewf-filter-options {
    padding-top: 10px;
}

.ewf-filter-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.ewf-filter-item:hover {
    background: #f0f0f0;
    border-color: #ff8827;
}

.ewf-filter-item input[type="checkbox"] {
    margin: 0 10px 0 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #ff8827;
}

.ewf-filter-item span {
    font-size: 14px;
    color: #555;
    user-select: none;
}

.ewf-filter-item.active {
    background: #fff5ed;
    border-color: #ff8827;
}

.ewf-filter-item.active span {
    color: #ff8827;
    font-weight: 500;
}

/* Apply Button */
.ewf-apply-btn {
    width: 100%;
    padding: 14px 20px;
    background: #ff8827;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 20px;
}

.ewf-apply-btn:hover {
    background: #e67820;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 136, 39, 0.3);
}

.ewf-apply-btn:active {
    transform: translateY(0);
}

.ewf-reset-btn {
    width: 100%;
    padding: 12px 20px;
    background: transparent;
    color: #999;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.ewf-reset-btn:hover {
    border-color: #ff8827;
    color: #ff8827;
}

/* ======================================
   Mobile Filters Widget
   ====================================== */

.ewf-mobile-widget {
    position: relative;
}

.ewf-mobile-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: #ff8827;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.ewf-mobile-trigger:hover {
    background: #e67820;
}

.ewf-mobile-trigger svg {
    width: 20px;
    height: 20px;
}

/* Mobile Panel */
.ewf-mobile-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 9999;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.ewf-mobile-panel.active {
    transform: translateY(0);
}

.ewf-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.ewf-mobile-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.ewf-mobile-close {
    background: transparent;
    border: none;
    padding: 5px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.ewf-mobile-close:hover {
    color: #ff8827;
}

.ewf-mobile-close svg {
    width: 24px;
    height: 24px;
}

/* Mobile Content */
.ewf-mobile-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.ewf-mobile-content .ewf-filter-group {
    margin-bottom: 20px;
}

/* Mobile Footer */
.ewf-mobile-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #e0e0e0;
    background: #ffffff;
    position: sticky;
    bottom: 0;
}

.ewf-mobile-reset-btn {
    flex: 1;
    padding: 14px 20px;
    background: transparent;
    color: #999;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ewf-mobile-reset-btn:hover {
    border-color: #ff8827;
    color: #ff8827;
}

.ewf-mobile-apply-btn {
    flex: 2;
    padding: 14px 20px;
    background: #ff8827;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ewf-mobile-apply-btn:hover {
    background: #e67820;
}

/* Mobile Overlay */
.ewf-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ewf-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ======================================
   Responsive Adjustments
   ====================================== */

@media (max-width: 768px) {
    .ewf-desktop-panel {
        width: 100% !important;
        position: relative;
        top: 0;
        max-height: none;
    }
    
    .ewf-filter-item {
        padding: 12px;
    }
    
    .ewf-filter-title {
        font-size: 15px;
    }
}

/* ======================================
   Loading State
   ====================================== */

.ewf-loading .ewf-apply-btn,
.ewf-loading .ewf-mobile-apply-btn {
    position: relative;
    color: transparent;
    pointer-events: none;
}

.ewf-loading .ewf-apply-btn::after,
.ewf-loading .ewf-mobile-apply-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: ewf-spin 0.8s linear infinite;
}

@keyframes ewf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ======================================
   Scrollbar Styling
   ====================================== */

.ewf-desktop-panel::-webkit-scrollbar,
.ewf-mobile-content::-webkit-scrollbar {
    width: 8px;
}

.ewf-desktop-panel::-webkit-scrollbar-track,
.ewf-mobile-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.ewf-desktop-panel::-webkit-scrollbar-thumb,
.ewf-mobile-content::-webkit-scrollbar-thumb {
    background: #ff8827;
    border-radius: 10px;
}

.ewf-desktop-panel::-webkit-scrollbar-thumb:hover,
.ewf-mobile-content::-webkit-scrollbar-thumb:hover {
    background: #e67820;
}

/* ======================================
   Accessibility
   ====================================== */

.ewf-filter-item:focus-within {
    outline: 2px solid #ff8827;
    outline-offset: 2px;
}

.ewf-apply-btn:focus,
.ewf-mobile-apply-btn:focus,
.ewf-reset-btn:focus,
.ewf-mobile-reset-btn:focus,
.ewf-mobile-trigger:focus {
    outline: 2px solid #ff8827;
    outline-offset: 2px;
}
