/**
 * Sidebar Widgets Styles
 *
 * Collapsible widgets with noUiSlider range filters
 */

/* Collapsible Widget Container */
.pc-collapsible-widget {
    margin-bottom: 24px;
    border: 1px solid #e3e8dc;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: all 0.2s ease;
}

.pc-collapsible-widget:hover {
    box-shadow: 0 2px 8px rgba(137, 165, 80, 0.1);
}

/* Widget Toggle Button */
.pc-widget-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8faf6 0%, #ffffff 100%);
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: inherit;
}

.pc-widget-toggle:hover {
    background: #f0f4e8;
}

.pc-widget-toggle .widgettitle {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2d3e1f;
    flex: 1;
    text-align: left;
}

.pc-toggle-icon {
    flex-shrink: 0;
    margin-left: 12px;
    color: #6b8e23;
    transition: transform 0.3s ease;
}

.pc-collapsible-widget.pc-collapsed .pc-toggle-icon {
    transform: rotate(-90deg);
}

/* Widget Content */
.pc-widget-content {
    max-height: none;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pc-collapsible-widget.pc-collapsed .pc-widget-content {
    max-height: 0;
}

/* Slider Widget */
.pc-slider-widget {
    padding: 20px;
}

/* noUiSlider Customization */
.pc-nouislider {
    height: 8px;
    margin: 24px 0 16px;
}

.pc-nouislider .noUi-connect {
    background: linear-gradient(90deg, #6b8e23, #89a550);
}

.pc-nouislider .noUi-handle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 3px solid #6b8e23;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.pc-nouislider .noUi-handle:hover {
    transform: scale(1.15);
    border-color: #89a550;
}

.pc-nouislider .noUi-handle:active {
    transform: scale(0.95);
}

.pc-nouislider .noUi-target {
    background: #e3e8dc;
    border: none;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.pc-nouislider .noUi-base {
    height: 8px;
}

.pc-nouislider .noUi-horizontal {
    height: 8px;
}

/* Slider Values */
.pc-slider-values {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #6b8e23;
    font-weight: 500;
    margin-top: 12px;
}

.pc-slider-min,
.pc-slider-max {
    padding: 4px 10px;
    background: #f8faf6;
    border-radius: 4px;
    border: 1px solid #e3e8dc;
}

/* Widget List Styles (for layered nav) */
.pc-collapsible-widget .woocommerce-widget-layered-nav-list {
    margin: 0;
    padding: 16px 20px;
    list-style: none;
}

.pc-collapsible-widget .woocommerce-widget-layered-nav-list li {
    margin-bottom: 10px;
}

.pc-collapsible-widget .woocommerce-widget-layered-nav-list li:last-child {
    margin-bottom: 0;
}

.pc-collapsible-widget .woocommerce-widget-layered-nav-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8faf6;
    border: 1px solid #e3e8dc;
    border-radius: 6px;
    color: #2d3e1f;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.pc-collapsible-widget .woocommerce-widget-layered-nav-list a:hover {
    background: #6b8e23;
    color: #fff;
    border-color: #6b8e23;
}

.pc-collapsible-widget .woocommerce-widget-layered-nav-list .count {
    font-size: 12px;
    opacity: 0.7;
}

.pc-collapsible-widget .woocommerce-widget-layered-nav-list .chosen a {
    background: #6b8e23;
    color: #fff;
    border-color: #6b8e23;
    font-weight: 500;
}

/* Reset Button */
.pc-reset-filters {
    display: inline-block;
    margin: 16px 20px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid #6b8e23;
    border-radius: 6px;
    color: #6b8e23;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pc-reset-filters:hover {
    background: #6b8e23;
    color: #fff;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pc-widget-toggle {
        padding: 14px 16px;
    }

    .pc-widget-toggle .widgettitle {
        font-size: 14px;
    }

    .pc-slider-widget {
        padding: 16px;
    }

    .pc-nouislider {
        margin: 20px 0 12px;
    }
}

/* Sidebar Widget Spacing */
.sidebar .widget,
.widget-area .widget {
    margin-bottom: 0 !important;
    border: none !important;
    padding: 0 !important;
}

.sidebar .pc-collapsible-widget + .pc-collapsible-widget,
.widget-area .pc-collapsible-widget + .pc-collapsible-widget {
    margin-top: 16px;
}

/* WooCommerce Widget Overrides */
.pc-collapsible-widget.woocommerce .widget-title,
.pc-collapsible-widget.woocommerce h3 {
    display: none;
}

.pc-collapsible-widget .widget-title {
    margin: 0;
}
