/**
 * Product Filters Styling
 * Based on Camper Jack Service style specifications
 */

/* Custom Filter Sidebar */
.custom-filter-sidebar {
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    border: 1px solid #e0e0e0;
}

/* Filter Section */
.filter-section {
    margin-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #000000;
    position: relative;
    font-family: Helvetica, Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-content {
    margin-top: 12px;
}

/* Category List */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 10px;
    font-size: 14px;
}

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

.category-item a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #000000;
    text-decoration: none;
    padding: 6px 0;
    transition: all 0.2s ease;
    font-family: Helvetica, Arial, sans-serif;
    border-radius: 4px;
    padding-left: 3px;
}

.category-item > a:hover {
    color: #ff6b35;
    background-color: rgba(255, 140, 0, 0.05);
}

.category-item > a:hover .count {
    background: #ff8c00;
    color: white;
}

.category-item.active > a,
.child-category-link.active {
    color: #ff8c00;
    font-weight: 500;
    background-color: rgba(255, 140, 0, 0.1);
    border-left: 2px solid #ff8c00;
}

.category-item .count {
    color: #666;
    font-size: 12px;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    min-width: 32px;
    text-align: center;
}

/* Parent Category Styles */
.parent-category {
    position: relative;
    margin-bottom: 12px;
}

.parent-category > a {
    font-weight: 500;
    position: relative;
}

/* Category Toggle Button - now a separate element */
.category-toggle {
    position: absolute;
    right: 0;
    top: 6px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 2;
    border-radius: 50%;
    /* background-color: #f5f5f5; */
    transition: all 0.2s ease;
}

.category-toggle:hover {
    /* background-color: #e0e0e0; */
}

.category-toggle::before,
.category-toggle::after {
    content: '';
    position: absolute;
    background-color: #666;
    transition: transform 0.3s ease;
}

/* Horizontal line */
.category-toggle::before {
    top: 9px;
    left: 5px;
    width: 10px;
    height: 2px;
}

/* Vertical line (for plus) */
.category-toggle::after {
    top: 5px;
    left: 9px;
    width: 2px;
    height: 10px;
    transform: scaleY(1);
}

.parent-category.active > .category-toggle::after {
    transform: scaleY(0);
}

.highlighted {
    background-color: rgba(255, 140, 0, 0.371);
}

.parent-category.active > .category-toggle {
    /* background-color: rgba(255, 140, 0, 0.2); */
}

/* Subcategory List */
.subcategory-list {
    list-style: none;
    padding-left: 20px;
    margin: 8px 0 8px 0;
    border-left: 1px solid #e0e0e0;
    display: none;
}

.parent-category.active > .subcategory-list {
    display: block;
    animation: slideDown 0.3s ease-out;
}

.child-category {
    margin-bottom: 6px;
}

.child-category:last-child {
    margin-bottom: 0;
}

.child-category-link {
    font-size: 13px;
    padding: 4px 0;
    color: black!important;
}

.child-category-item a {
    padding-left: 4px;
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Price Range Slider */
.price-slider-container {
    padding: 8px 0 15px;
}

.price-slider-values {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
}

.price-slider-values .min-value,
.price-slider-values .max-value {
    background: #f5f5f5;
    padding: 5px 10px;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
    transition: background-color 0.2s ease;
}

/* When the values are being updated by the slider */
.price-slider-values .updating {
    background-color: #fff3e0;
    color: #ff8c00;
}

/* noUiSlider Customization - Improved appearance */
.nouislider-price-range {
    height: 8px;
    position: relative;
    margin: 30px 0;
}

/* Connect element between the handles */
.nouislider-price-range .noUi-connect {
    background-color: #ff8c00;
}

/* Base styles for the handles */
.nouislider-price-range .noUi-handle {
    width: 20px;
    height: 20px;
    background: #ffffff;
    border: 2px solid #ff8c00;
    border-radius: 50%;
    top: -7px;
    right: -10px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* Base bar styling */
.nouislider-price-range .noUi-base {
    background-color: #e0e0e0;
    border-radius: 5px;
}

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

.price-filter-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.filter-button {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: Helvetica, Arial, sans-serif;
    width: 100%;
    text-align: center;
}

.filter-button:hover {
    opacity: 0.9;
}

.clear-filters-button {
    background-color: #222222;
    color: #ffffff;
    order: 2;
}

.clear-filters-button:hover {
    background-color: #333333;
}

.price-range-hint {
    color: #666;
    font-size: 12px;
    margin-top: 10px;
    font-style: italic;
}

/* Attribute List */
.attribute-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.attribute-item {
    margin-bottom: 10px;
}

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

.attribute-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #4a4a4a;
    font-family: Helvetica, Arial, sans-serif;
}

.attribute-checkbox {
    margin-right: 10px;
    flex-shrink: 0;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 3px;
    outline: none;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
    background-color: #ffffff;
}

.attribute-checkbox:checked {
    background-color: #ff8c00;
    border-color: #ff8c00;
}

.attribute-checkbox:checked::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    display: block;
}

.attribute-checkbox:hover {
    border-color: #ff8c00;
}

.attribute-item .count {
    color: #666;
    font-size: 12px;
    margin-left: 5px;
}

/* Active Filters */
.active-filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.active-filter-item {
    display: inline-block;
    margin-right: 8px;
    margin-bottom: 10px;
}

.active-filter-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    font-size: 13px;
    color: #4a4a4a;
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: Helvetica, Arial, sans-serif;
}

.active-filter-link:hover {
    background-color: #fff0e3;
    border-color: #ff8c00;
    color: #ff8c00;
}

.remove-filter {
    margin-left: 8px;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
    color: #ff8c00;
}

.clear-all-filters {
    display: inline-block;
    margin-left: 10px;
}

.clear-all-filters a {
    color: #ff8c00;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    font-family: Helvetica, Arial, sans-serif;
    transition: color 0.2s ease;
}

.clear-all-filters a:hover {
    color: #ff6b35;
    text-decoration: underline;
}

/* Loading Indicator */
.filter-loading {
    cursor: wait;
}

.filter-loading:before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 999;
}

.filter-loading:after {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    margin-left: -20px;
    border-radius: 50%;
    border: 3px solid #f5f5f5;
    border-top-color: #ff8c00;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
    .custom-filter-sidebar {
        margin-bottom: 20px;
    }
    
    .filter-title {
        cursor: pointer;
        position: relative;
        padding-right: 20px; /* Space for the toggle icon */
    }
    
    .filter-title:after {
        content: "+";
        position: absolute;
        right: 0;
        top: 0;
        font-size: 18px;
        color: #ff8c00;
        transition: transform 0.3s ease;
    }
    
    .filter-title[aria-expanded="true"]:after {
        content: "−";
    }

    
    .filter-title[aria-expanded="true"] + .filter-content {
        display: block;
        animation: slideDown 0.3s ease-out;
    }
    
    .price-slider-values {
        font-size: 12px;
    }
    
    .nouislider-price-range {
        margin: 30px 0 25px;
    }
    
    .nouislider-price-range .noUi-handle {
        width: 22px;
        height: 22px;
        top: -9px;
        border-width: 3px;
    }
    
    .price-filter-actions {
        justify-content: center;
    }
    
    .filter-button {
        flex: 1 1 auto;
        padding: 10px 15px;
        font-size: 13px;
        min-width: 100px;
    }
}

@media (max-width: 480px) {
    .custom-filter-sidebar {
        padding: 16px;
    }
    
    .filter-button {
        flex: 1 1 100%;
        width: 100%;
        padding: 12px 10px;
        font-size: 14px;
    }
    
    .clear-filters-button {
        order: 2;
    }
} 