/* Blocksy Custom Filter Styles */
.blocksy-custom-filter {
    background: #ffffff;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 30px;
    border: 1px solid #DEE2E6;
}

.blocksy-filter-form {
    padding: 0;
}

/* Filter Section */

.blocksy-filter-section:last-child {
    border-bottom: none;
}

/* Section Header */
.blocksy-filter-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.blocksy-filter-section-header:hover {
    background-color: #f8f9fa;
}

.blocksy-filter-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.4;
}

.blocksy-filter-toggle {
    font-size: 20px;
    color: #adb5bd;
    font-weight: 300;
    line-height: 1;
    transition: transform 0.3s ease;
    user-select: none;
}

.blocksy-filter-section.collapsed .blocksy-filter-toggle {
    transform: rotate(0deg);
}

.blocksy-filter-section:not(.collapsed) .blocksy-filter-toggle {
    transform: rotate(0deg);
}

/* Section Content */
.blocksy-filter-section-content {
    padding: 0 20px 20px 20px;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
}

.blocksy-filter-section.collapsed .blocksy-filter-section-content {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

/* Checkbox Styles */
.blocksy-filter-checkbox {
    display: flex;
    align-items: center;
    padding: 10px 0;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.blocksy-filter-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.blocksy-checkbox-custom {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    background-color: #ffffff;
    margin-right: 12px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.blocksy-filter-checkbox:hover .blocksy-checkbox-custom {
    border-color: #fbb042;
}

.blocksy-filter-checkbox input[type="checkbox"]:checked ~ .blocksy-checkbox-custom {
    background-color: #fbb042;
    border-color: #fbb042;
}

.blocksy-filter-checkbox input[type="checkbox"]:checked ~ .blocksy-checkbox-custom::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.blocksy-filter-label-text {
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.5;
    flex: 1;
}

.blocksy-filter-checkbox:hover .blocksy-filter-label-text {
    color: #fbb042;
}

/* Category Links styled as checkboxes */
.blocksy-category-link {
    text-decoration: none;
    color: inherit;
}

.blocksy-category-link:hover {
    text-decoration: none;
}

.blocksy-category-link:hover .blocksy-filter-label-text {
    color: #fbb042;
}

.blocksy-category-link.current .blocksy-filter-label-text {
    color: #fbb042;
    font-weight: 500;
}

.blocksy-category-link .blocksy-checkbox-custom.checked {
    background-color: #fbb042;
    border-color: #fbb042;
}

.blocksy-category-link .blocksy-checkbox-custom.checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Price Filter */
.blocksy-price-filter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.blocksy-price-filter input[type="number"] {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1a1a1a;
    transition: border-color 0.2s ease;
}

.blocksy-price-filter input[type="number"]:focus {
    outline: none;
    border-color: #fbb042;
}

.blocksy-price-separator {
    color: #666;
    font-weight: 500;
}

/* Filter Actions */
.blocksy-filter-actions {
    padding: 20px;
    display: flex;
    gap: 12px;
}

.blocksy-filter-submit,
.blocksy-filter-reset {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.blocksy-filter-submit {
    background-color: #fbb042;
    color: #ffffff;
}

.blocksy-filter-submit:hover {
    background-color: #fbb042;
    color: #ffffff;
}

.blocksy-filter-reset {
    background-color: #f3f4f6;
    color: #1a1a1a;
}

.blocksy-filter-reset:hover {
    background-color: #e5e7eb;
    color: #1a1a1a;
}

/* Responsive */
@media (max-width: 768px) {
    .blocksy-filter-section-header {
        padding: 16px 15px;
    }
    
    .blocksy-filter-section-content {
        padding: 0 15px 15px 15px;
    }
    
    .blocksy-filter-actions {
        flex-direction: column;
        padding: 15px;
    }
    
    .blocksy-filter-submit,
    .blocksy-filter-reset {
        width: 100%;
    }
}

/* Animation for expand/collapse */
.blocksy-filter-section-content {
    max-height: 2000px;
    opacity: 1;
}

.blocksy-filter-section.collapsed .blocksy-filter-section-content {
    max-height: 0;
    opacity: 0;
    padding: 0 20px;
}

/* Parent checkbox click to show/hide children */
.blocksy-filter-category-item.has-children .blocksy-filter-parent {
    position: relative;
}

.blocksy-filter-category-item.has-children .blocksy-filter-parent::after {
    content: '▶';
    position: absolute;
    right: 0;
    font-size: 10px;
    color: #999;
    transition: transform 0.2s ease;
}

.blocksy-filter-category-item.has-children.expanded .blocksy-filter-parent::after {
    transform: rotate(90deg);
}
span.blocksy-filter-toggle {
    border: 1px solid #adb5bd;
    padding: 0px 4px;
    border-radius: 4px;
}
