/* === Filter Form Container === */
.opf-filter-form {
    border: 1px solid #e5e7eb;
    padding: 20px;
    border-radius: 8px;
    margin: 0 0 20px 0;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* === Fieldset Base === */
.opf-fieldset {
    border: 0;
    margin: 0 0 20px 0;
    padding: 0;
}

.opf-fieldset:last-of-type {
    margin-bottom: 16px;
}

/* === Legend/Title === */
.opf-fieldset legend {
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 15px;
    color: #1f2937;
    padding: 0;
    width: 100%;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
}

/* === Search box inside taxonomy groups === */
.opf-search {
    display: flex;
    align-items: center;
    margin: 6px 0 10px 0;
}

.opf-search-input {
    width: 100%;
    padding: 8px 10px 8px 34px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fff url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%239ca3af" viewBox="0 0 16 16"><path d="M11.742 10.344l3.387 3.387-1.398 1.398-3.387-3.387a6.5 6.5 0 1 1 1.398-1.398zM12 6.5a5.5 5.5 0 1 0-11 0 5.5 5.5 0 0 0 11 0z"/></svg>') no-repeat 10px center;
    background-size: 16px 16px;
    box-sizing: border-box;
}

.opf-search-input:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
}

/* === Taxonomy Tools (Select all, Show more) === */
.opf-tax-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 2px;
}

.opf-select-all {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    user-select: none;
}

.opf-select-all input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #1f6feb;
}

.opf-toggle-group {
    font-size: 13px;
    color: #1f6feb;
    text-decoration: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.opf-toggle-group:hover {
    background: #f3f4f6;
    text-decoration: none;
}

/* Hide/show-more while searching */
.opf-fieldset.opf-search-active .opf-toggle-group { display: none; }
.opf-fieldset.opf-search-active .opf-checkbox-group { max-height: none; }

/* === Checkbox Group === */
.opf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px 4px 8px 0;
    transition: max-height 0.3s ease-in-out;
}

.opf-checkbox-group.expanded {
    max-height: none;
}

/* Scrollbar styling */
.opf-checkbox-group::-webkit-scrollbar {
    width: 6px;
}

.opf-checkbox-group::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.opf-checkbox-group::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.opf-checkbox-group::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* === Individual Checkbox === */
.opf-checkbox {
    display: flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
    user-select: none;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}

.opf-checkbox:hover {
    background: #f9fafb;
}

.opf-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 10px 0 0;
    cursor: pointer;
    accent-color: #1f6feb;
    flex-shrink: 0;
}

.opf-checkbox span {
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
}

.opf-term-label {
    flex: 1 1 auto;
}

.opf-term-count {
    margin-left: 8px;
    color: #6b7280;
    font-size: 13px;
}

.opf-checkbox:hover span {
    color: #1f2937;
}

/* === Price Filter === */
.opf-price {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
    padding: 8px 0;
}

.opf-price input {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.opf-price input:focus {
    outline: none;
    border-color: #1f6feb;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.1);
}

.opf-sep {
    margin: 0;
    color: #9ca3af;
    font-weight: 600;
}

/* No results message */
.opf-no-results {
    color: #6b7280;
    font-size: 13px;
    padding: 6px 2px;
}
/* === Price Filter === */
.opf-price {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* min - sep - max */
    column-gap: 10px;
    align-items: center;
    padding: 8px 0;
    width: 100%;
}

.opf-price input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
    border-radius: 6px;
    padding: 10px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.opf-submit:hover {
    background: #1557d0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.opf-submit:active {
    transform: translateY(0);
}

.opf-reset {
    color: #6b7280;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
}

.opf-reset:hover {
    background: #f3f4f6;
    color: #1f2937;
    text-decoration: none;
}

/* === Sort Buttons === */
.opf-sort-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 16px 0;
}

.opf-sort-label {
    color: #6b7280;
    font-size: 13px;
}

.opf-sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.opf-sort-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 13px;
    color: #111827;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.opf-sort-btn:hover {
    border-color: #93c5fd;
    color: #1f6feb;
}

.opf-sort-btn.active {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96,165,250,0.25);
    color: #1f6feb;
}

.opf-sort-clear {
    color: #6b7280;
}

/* === Discount Filter === */
.opf-discount {
    position: relative;
}

.opf-discount-slider {
    margin: 10px 0 20px 0;
}

.opf-discount-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
    position: relative;
    margin: 20px 0;
}

.opf-discount-track {
    position: absolute;
    height: 100%;
    background: #1f6feb;
    border-radius: 3px;
}

.opf-discount-values {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.opf-discount-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.opf-discount-btn {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s;
}

.opf-discount-btn:hover {
    border-color: #1f6feb;
    color: #1f6feb;
}

.opf-discount-btn.active {
    background: #1f6feb;
    color: #fff;
    border-color: #1f6feb;
}

/* === Date Filter === */
.opf-date-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.opf-date-preset {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s;
}

.opf-date-preset:hover {
    border-color: #1f6feb;
    color: #1f6feb;
}

.opf-date-preset input[type="radio"] {
    margin-right: 6px;
}

.opf-date-preset input[type="radio"]:checked + span {
    font-weight: 600;
}

.opf-date-custom {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.opf-date-custom input[type="date"] {
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
}

.opf-date-sep {
    color: #9ca3af;
    font-size: 13px;
}

/* === Responsive Design === */
@media (max-width: 768px) {
    .opf-filter-form {
        padding: 16px;
    }
    
    .opf-fieldset legend {
        font-size: 14px;
    }
    
    .opf-price {
        grid-template-columns: 1fr; /* stack inputs */
        row-gap: 8px;
    }
    
    .opf-price input {
        width: 100%;
    }
    
    .opf-sep {
        display: none;
    }
    
    .opf-date-custom {
        grid-template-columns: 1fr;
    }
    
    .opf-date-sep {
        display: none;
    }
    
    .opf-actions {
        flex-direction: column;
    }
    
    .opf-submit,
    .opf-reset {
        width: 100%;
        justify-content: center;
    }
}
