/* ─────────────────────────────────────────────
   ACF Product Filter — Sidebar Styles
   سازگار با تم تیره Müller Petroleum
───────────────────────────────────────────── */

.apf-filter-wrap {
    background: #1a1a1a;
    border: 1px solid #2e2e2e;
    border-radius: 8px;
    overflow: hidden;
    font-family: inherit;
    direction: rtl;
}

/* ── Header ── */
.apf-filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    background: #111;
    border-bottom: 1px solid #2e2e2e;
}

.apf-filter-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #f0f0f0;
    flex: 1;
    letter-spacing: 0.3px;
}

.apf-filter-icon {
    color: #c8a84b;   /* طلایی Müller */
    display: flex;
    align-items: center;
}

.apf-reset-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    padding: 4px;
    border-radius: 4px;
    transition: color .2s, background .2s;
}

.apf-reset-btn:hover {
    color: #c8a84b;
    background: rgba(200, 168, 75, .1);
}

/* ── Active badge ── */
.apf-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #c8a84b;
    color: #111;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    margin-right: 6px;
    line-height: 1;
}

/* ── Section ── */
.apf-section {
    border-bottom: 1px solid #2a2a2a;
}

.apf-section:last-of-type {
    border-bottom: none;
}

.apf-section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 13px;
    font-weight: 500;
    text-align: right;
    direction: rtl;
    transition: color .2s, background .2s;
}

.apf-section-toggle:hover {
    color: #f0f0f0;
    background: rgba(255,255,255,.03);
}

.apf-chevron {
    transition: transform .2s;
    flex-shrink: 0;
}

.apf-chevron--open {
    transform: rotate(180deg);
}

/* ── Section body ── */
.apf-section-body {
    padding: 4px 16px 12px;
}

/* ── Item / Checkbox ── */
.apf-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 5px 0;
    direction: rtl;
}

.apf-item input[type="checkbox"] {
    display: none;
}

.apf-checkbox {
    width: 16px;
    height: 16px;
    border: 1.5px solid #444;
    border-radius: 3px;
    flex-shrink: 0;
    position: relative;
    transition: border-color .2s, background .2s;
    background: #222;
}

.apf-item input:checked ~ .apf-checkbox {
    background: #c8a84b;
    border-color: #c8a84b;
}

.apf-item input:checked ~ .apf-checkbox::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 4px;
    width: 4px;
    height: 7px;
    border: 2px solid #111;
    border-top: none;
    border-left: none;
    transform: rotate(45deg);
}

.apf-label {
    flex: 1;
    font-size: 13px;
    color: #aaa;
    line-height: 1.4;
    transition: color .15s;
}

.apf-item:hover .apf-label {
    color: #f0f0f0;
}

.apf-item input:checked ~ .apf-checkbox + .apf-label,
.apf-item input:checked ~ * .apf-label {
    color: #f0f0f0;
}

.apf-count {
    font-size: 11px;
    color: #555;
    background: #252525;
    border-radius: 10px;
    padding: 1px 6px;
    min-width: 20px;
    text-align: center;
}

/* ── زیردسته ── */
.apf-subcats {
    padding-right: 16px;
    border-right: 2px solid #2e2e2e;
    margin: 2px 8px 6px;
}

.apf-child-cat .apf-label {
    font-size: 12px;
}

/* ── زیرفیلد ACF ── */
.apf-subfield {
    margin-bottom: 8px;
}

.apf-subfield-label {
    display: block;
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #252525;
}

.apf-sub-item {
    padding-right: 8px;
}

/* ── Submit ── */
.apf-actions {
    padding: 12px 16px;
    border-top: 1px solid #2a2a2a;
}

.apf-submit-btn {
    width: 100%;
    padding: 9px 0;
    background: #c8a84b;
    color: #111;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background .2s, opacity .2s;
}

.apf-submit-btn:hover {
    background: #d9ba62;
}

.apf-submit-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── Loader ── */
.apf-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    color: #888;
    font-size: 13px;
}

.apf-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #333;
    border-top-color: #c8a84b;
    border-radius: 50%;
    animation: apf-spin .7s linear infinite;
}

@keyframes apf-spin {
    to { transform: rotate(360deg); }
}

/* ── نتیجه‌ها ── */
.apf-result-count {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
    direction: rtl;
}

.apf-no-results {
    text-align: center;
    color: #888;
    padding: 30px 0;
    direction: rtl;
}

/* ── Pagination ── */
.apf-pagination {
    margin-top: 24px;
    text-align: center;
    direction: rtl;
}

.apf-pagination a,
.apf-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    margin: 0 2px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #2e2e2e;
    color: #aaa;
    background: #1a1a1a;
    transition: all .2s;
}

.apf-pagination a:hover {
    background: #c8a84b;
    color: #111;
    border-color: #c8a84b;
}

.apf-pagination .current {
    background: #c8a84b;
    color: #111;
    border-color: #c8a84b;
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .apf-filter-wrap {
        margin-bottom: 20px;
    }
}
