/* Base Layout */
.pf-1041-widget-wrapper {
    width: 100%;
}
.pf-1041-container {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
}
.pf-1041-mobile-toggle {
    display: none;
    width: 100%;
    padding: 12px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    text-align: center;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 15px;
    border-radius: 4px;
}
.pf-1041-main-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

/* Accordion Group */
.pf-1041-attribute-group {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}
.pf-1041-attr-title {
    margin: 0;
    font-size: 1em;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}
.pf-1041-toggle-icon {
    font-size: 0.8em;
    transition: transform 0.3s;
}
.pf-1041-attribute-group.is-expanded .pf-1041-toggle-icon {
    transform: rotate(180deg);
}
.pf-1041-list-wrap {
    display: none;
    margin-top: 10px;
}
.pf-1041-attribute-group.is-expanded .pf-1041-list-wrap {
    display: block;
}

/* List Items */
.pf-1041-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pf-1041-list li {
    margin-bottom: 8px;
}
.pf-1041-list a {
    text-decoration: none;
    color: #444;
    display: flex;
    align-items: center;
    font-size: 0.95em;
}
.pf-1041-term-name {
    flex-grow: 1;
    margin-right: 10px;
}
.pf-1041-list a:hover {
    color: #000;
}
.count {
    color: #888;
    font-size: 0.9em;
}

/* Custom Checkbox */
.pf-1041-checkbox {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-right: 10px;
    display: inline-block;
    position: relative;
    background: #fff;
    flex-shrink: 0;
}
.pf-1041-checkbox.checked {
    background: #333;
    border-color: #333;
}
.pf-1041-checkbox.checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Responsive Rules */
/* Desktop */
@media (min-width: 769px) {
    
    /* Horizontal Layout override */
    .pf-1041-layout-horizontal {
        width: 100% !important;
        float: none !important;
        margin-bottom: 20px;
        clear: both;
    }
    
    .pf-1041-layout-horizontal .pf-1041-groups-wrapper {
        display: flex;
        flex-wrap: wrap;
        gap: 30px;
        align-items: flex-start;
    }
    
    .pf-1041-layout-horizontal .pf-1041-attribute-group {
        flex: 1 1 auto;
        min-width: 200px;
        border-bottom: none;
        border-right: 1px solid #eee;
        padding-right: 30px;
        margin-bottom: 0;
    }
    
    .pf-1041-layout-horizontal .pf-1041-attribute-group:last-child {
        border-right: none;
        padding-right: 0;
    }
    
    /* Force Elementor widget wrapper to be 100% if horizontal is selected */
    .elementor-widget-product_filter_1041:has(.pf-1041-layout-horizontal) {
        width: 100% !important;
    }
}

/* Tablet & Mobile: Show Button, Hide Container by default */
@media (max-width: 768px) {
    .pf-1041-widget-wrapper {
        width: 100% !important;
        float: none !important;
        margin-right: 0;
    }
    .pf-1041-mobile-toggle {
        display: block;
    }
    .pf-1041-container {
        display: none;
        border: 1px solid #eee;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
    .pf-1041-container.is-open {
        display: block;
    }
}