/* ── APF Reset ───────────────────────────────────────────────── */
.apf-sidebar *, .apf-results-wrapper * { box-sizing: border-box; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.apf-sidebar {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 18px 16px;
    font-family: inherit;
    font-size: 14px;
    color: #333;
}

/* ── Section heading ─────────────────────────────────────────── */
.apf-section { margin-bottom: 0; }
.apf-section + .apf-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #efefef;
}
.apf-section-title {
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #888 !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    line-height: 1 !important;
}

/* ── Category list ───────────────────────────────────────────── */
.apf-cat-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.apf-cat-item { margin-bottom: 1px; }
.apf-cat-link {
    display: block;
    padding: 4px 8px 4px 10px;
    font-size: 13px;
    color: #555;
    text-decoration: none !important;
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
    line-height: 1.5;
    transition: color .13s, border-color .13s, background .13s;
}
.apf-cat-link:hover { color: #333; background: #f7f5f2; }
.apf-cat-link.apf-active {
    color: #5a3e1b;
    font-weight: 600;
    border-left-color: #5a3e1b;
}
.apf-cat-link.apf-active::before { content: '\2022 '; color: #5a3e1b; }

/* ── Tag pills ───────────────────────────────────────────────── */
.apf-tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.apf-tag {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 3px 13px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    line-height: 1.6;
    transition: background .13s, border-color .13s, color .13s;
}
.apf-tag:hover { background: #ede8df; border-color: #c5a96b; color: #333; }
.apf-tag.apf-active {
    background: #5a3e1b;
    border-color: #5a3e1b;
    color: #fff;
}

/* ── Quote block ─────────────────────────────────────────────── */
.apf-quote-block {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #efefef;
}
.apf-quote-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fdf3dc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    color: #92660a;
}
.apf-quote-label {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #333 !important;
    margin: 0 0 6px !important;
    letter-spacing: .02em;
}
.apf-quote-text {
    font-size: 11px !important;
    line-height: 1.6 !important;
    color: #777 !important;
    font-style: italic;
    margin: 0 !important;
}

/* ── Active filters ──────────────────────────────────────────── */
.apf-active-filters {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #efefef;
}
.apf-active-filters-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.apf-active-label { font-size: 11px; color: #999; font-weight: 600; }
.apf-active-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.apf-active-tag {
    background: #5a3e1b;
    color: #fff;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.apf-active-tag-remove { cursor: pointer; font-size: 14px; line-height: 1; opacity: .8; }
.apf-active-tag-remove:hover { opacity: 1; }
.apf-clear-all {
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 11px;
    color: #777;
    cursor: pointer;
    margin-left: auto;
}
.apf-clear-all:hover { border-color: #999; color: #333; }

/* ── Results wrapper ─────────────────────────────────────────── */
.apf-results-wrapper { position: relative; min-height: 200px; }
.apf-results-wrapper.apf-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.65);
    z-index: 10;
}
.apf-results-wrapper.apf-loading::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 34px; height: 34px;
    border: 3px solid #e8e0d0;
    border-top-color: #5a3e1b;
    border-radius: 50%;
    animation: apf-spin .7s linear infinite;
    z-index: 11;
}
@keyframes apf-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* ── Results header ──────────────────────────────────────────── */
.apf-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #efefef;
    flex-wrap: wrap;
    gap: 8px;
}
.apf-count { font-size: 13px; color: #666; }
.apf-sort-wrap { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #555; }
.apf-sort {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 13px;
    background: #fff;
    color: #333;
    cursor: pointer;
}

/* ── Product grid ────────────────────────────────────────────── */
.apf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.apf-product-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow .18s;
}
.apf-product-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.08); }

/* image */
.apf-card-img-wrap {
    display: block;
    position: relative;
    background: #f5ede0;
    aspect-ratio: 4 / 3;
    overflow: hidden;
}
.apf-card-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .28s;
}
.apf-product-card:hover .apf-card-img { transform: scale(1.04); }
.apf-no-img {
    display: flex; align-items: center; justify-content: center;
    color: #bbb; font-size: 12px; width: 100%; height: 100%;
}

/* badge */
.apf-badge {
    position: absolute;
    bottom: 8px; left: 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 7px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    color: #555;
    text-transform: uppercase;
}

/* card body */
.apf-card-body {
    padding: 11px 12px 10px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.apf-card-title {
    font-size: 13px !important;
    font-weight: 500 !important;
    margin: 0 0 3px !important;
    line-height: 1.4 !important;
    color: #222 !important;
}
.apf-card-title a { color: inherit !important; text-decoration: none !important; }
.apf-card-title a:hover { color: #5a3e1b !important; }
.apf-card-sub {
    font-size: 11px !important;
    color: #888 !important;
    margin: 0 0 10px !important;
    line-height: 1.4 !important;
}
.apf-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}
.apf-card-price { font-size: 14px; font-weight: 500; color: #222; }
.apf-card-price .woocommerce-Price-amount { color: inherit; }
.apf-card-details {
    font-size: 12px;
    color: #7a5a2a;
    text-decoration: none !important;
    font-weight: 400;
}
.apf-card-details:hover { text-decoration: underline !important; }

/* ── Pagination ──────────────────────────────────────────────── */
.apf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
}
.apf-page-btn {
    min-width: 34px; height: 34px;
    padding: 0 6px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: #fff;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .13s, border-color .13s, color .13s;
}
.apf-page-btn:hover { background: #f5f0e8; border-color: #c5a96b; color: #333; }
.apf-page-btn.apf-page-active {
    background: #5a3e1b;
    border-color: #5a3e1b;
    color: #fff;
    font-weight: 600;
}
.apf-prev, .apf-next { font-size: 17px; }

/* ── No results ──────────────────────────────────────────────── */
.apf-no-results {
    text-align: center;
    padding: 48px 20px;
    color: #888;
}
.apf-no-results p { margin: 12px 0 16px; }
.apf-reset-btn {
    background: #5a3e1b;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 8px 20px;
    font-size: 13px;
    cursor: pointer;
}
.apf-reset-btn:hover { background: #4a3010; }
