/* ── Hedenhus Filters – Frontend (pages with filters) ── */

.hedenhus-filters {
    margin-bottom: 20px;
}

/* ── Mobile toggle button ── */
.hf-mobile-toggle {
    display: none;
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    position: relative;
}
.hf-mobile-toggle::after {
    content: "\25BE";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.hf-mobile-toggle .hf-active-count {
    display: inline-block;
    background: #2271b1;
    color: #fff;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 6px;
}

/* ── Mobile header/footer (hidden on desktop) ── */
.hf-mobile-header,
.hf-mobile-footer {
    display: none;
}

/* ── Filter panel ── */
.hf-filter-panel {
    display: block;
}

/* ── Filter group ── */
.hf-group {
    margin-bottom: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    overflow: hidden;
}

.hf-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #fafafa;
    cursor: pointer;
    user-select: none;
}
.hf-heading-text {
    font-weight: 600;
    font-size: 14px;
}

.hf-toggle::after {
    content: "\25BE";
    font-size: 14px;
    color: #999;
    transition: transform 0.2s;
}
.hf-collapsed .hf-toggle::after {
    transform: rotate(-90deg);
}
.hf-collapsed .hf-options {
    display: none;
}

/* ── Filter options ── */
.hf-options {
    padding: 8px 14px 12px;
    max-height: 250px;
    overflow-y: auto;
}

.hf-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.15s;
}
.hf-option:hover {
    color: #2271b1;
}
.hf-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #2271b1;
}
.hf-option-name {
    flex: 1;
}
.hf-option-count {
    color: #999;
    font-size: 12px;
}
.hf-option.hf-checked .hf-option-name {
    font-weight: 600;
}
.hf-option.hf-disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: default;
}

/* ── Expand/Collapse all ── */
.hf-toggle-all {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 4px;
}
.hf-expand-all,
.hf-collapse-all {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    cursor: pointer;
}
.hf-expand-all:hover,
.hf-collapse-all:hover {
    color: #2271b1;
    text-decoration: underline;
}

/* ── Reset button ── */
.hf-reset {
    display: block;
    width: 100%;
    padding: 10px;
    margin-top: 6px;
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.15s;
}
.hf-reset:hover {
    border-color: #c00;
    color: #c00;
}

/* ── Loading state ── */
ul.products.hf-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ── No results ── */
.hf-no-results {
    list-style: none;
    padding: 40px 20px;
    text-align: center;
    font-size: 15px;
    color: #666;
}

/* ── Mobile styles ── */
@media (max-width: 767px) {
    .hf-mobile-toggle {
        display: block;
    }

    .hf-filter-panel {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #fff;
        z-index: 9999;
        overflow-y: auto;
        padding: 0 16px 80px;
        -webkit-overflow-scrolling: touch;
    }

    .hedenhus-filters.hf-open .hf-filter-panel {
        display: block;
    }

    .hf-mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 16px 0;
        border-bottom: 1px solid #eee;
        margin-bottom: 12px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
    }
    .hf-mobile-title {
        font-size: 18px;
        font-weight: 600;
    }
    .hf-mobile-close {
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        padding: 0 4px;
        color: #666;
    }

    .hf-mobile-footer {
        display: block;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px 16px;
        background: #fff;
        border-top: 1px solid #eee;
        z-index: 10000;
    }
    .hf-mobile-apply {
        display: block;
        width: 100%;
        padding: 14px;
        background: #2271b1;
        color: #fff;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
    }
    .hf-mobile-apply:hover {
        background: #135e96;
    }

    body.hf-mobile-active {
        overflow: hidden;
    }

    .hf-options {
        max-height: none;
    }
}
