/* ==========================================================
   OZ Criteria — panneau « Affiner la recherche »
   ========================================================== */
.ozf {
    --ozf-accent: #f97316;
    --ozf-accent-soft: #fff7ed;
    --ozf-accent-dark: #c2410c;
    --ozf-navy: #1e3a8a;
    --ozf-line: #e5e7eb;
    --ozf-bg: #ffffff;
    --ozf-bg-soft: #f8fafc;
    --ozf-text: #111827;
    --ozf-muted: #6b7280;
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 22px;
    padding: 0 16px;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ozf-text);
}
.ozf *, .ozf *::before, .ozf *::after { box-sizing: border-box; }
.lang-ar .ozf { direction: rtl; text-align: right; }

/* ---------- Barre ---------- */
.ozf-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--ozf-bg);
    border: 1px solid var(--ozf-line);
    border-radius: 14px;
    padding: 10px 14px;
    box-shadow: 0 2px 10px rgba(17, 24, 39, .05);
}
.ozf-toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1.5px solid var(--ozf-navy);
    border-radius: 10px;
    background: #fff;
    color: var(--ozf-navy);
    font: inherit;
    font-weight: 600;
    font-size: 14.5px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.ozf-toggle:hover, .ozf.is-open .ozf-toggle { background: var(--ozf-navy); color: #fff; }
.ozf-badge {
    min-width: 22px; height: 22px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px; background: var(--ozf-accent); color: #fff;
    font-size: 12px; font-weight: 700;
}
.ozf-caret { font-size: 11px; transition: transform .2s; }
.ozf.is-open .ozf-caret { transform: rotate(180deg); }

.ozf-sortwrap { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.lang-ar .ozf-sortwrap { margin-left: 0; margin-right: auto; }
.ozf-sortwrap label { font-size: 13px; color: var(--ozf-muted); }
.ozf-reset {
    display: inline-flex; align-items: center; gap: 7px;
    border: 0; background: none; color: var(--ozf-accent-dark);
    font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
    padding: 8px 6px; border-radius: 8px;
}
.ozf-reset:hover { background: var(--ozf-accent-soft); }

/* ---------- Critères actifs ---------- */
.ozf-active { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ozf-active:empty { display: none; }
.ozf-tag {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 5px 6px 5px 12px;
    background: #eff6ff; color: var(--ozf-navy);
    border: 1px solid #dbeafe; border-radius: 999px;
    font-size: 13px;
}
.ozf-tag b { font-weight: 600; }
.ozf-tag button {
    width: 20px; height: 20px; border: 0; border-radius: 50%;
    background: #dbeafe; color: var(--ozf-navy); cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; line-height: 1; padding: 0;
}
.ozf-tag button:hover { background: var(--ozf-navy); color: #fff; }

/* ---------- Panneau ---------- */
.ozf-panel {
    display: none;
    margin-top: 10px;
    padding: 18px;
    background: var(--ozf-bg);
    border: 1px solid var(--ozf-line);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(17, 24, 39, .06);
}
.ozf.is-open .ozf-panel { display: block; animation: ozfIn .22s ease; }
@keyframes ozfIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.ozf-hint {
    margin: 0 0 14px; padding: 10px 14px;
    background: var(--ozf-accent-soft); color: var(--ozf-accent-dark);
    border-radius: 10px; font-size: 13.5px;
}
.ozf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.ozf-group {
    background: var(--ozf-bg-soft);
    border: 1px solid #eef2f7;
    border-radius: 12px;
    padding: 14px;
}
.ozf-wide { grid-column: 1 / -1; }
.ozf-label {
    margin: 0 0 10px;
    font-size: 12px; font-weight: 700;
    letter-spacing: .05em; text-transform: uppercase;
    color: var(--ozf-muted);
}
.ozf-row + .ozf-row { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--ozf-line); }
.ozf-sublabel { display: block; margin-bottom: 8px; font-size: 12.5px; color: var(--ozf-muted); }

/* ---------- Chips ---------- */
.ozf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ozf-chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px;
    border: 1.5px solid var(--ozf-line);
    border-radius: 999px;
    background: #fff; color: var(--ozf-text);
    font: inherit; font-size: 13.5px; cursor: pointer;
    transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.ozf-chip:hover { border-color: var(--ozf-accent); }
.ozf-chip:active { transform: scale(.97); }
.ozf-chip em {
    font-style: normal; font-size: 11.5px; color: var(--ozf-muted);
    background: #f3f4f6; padding: 1px 7px; border-radius: 8px;
}
.ozf-chip.is-on {
    border-color: var(--ozf-accent);
    background: var(--ozf-accent-soft);
    color: var(--ozf-accent-dark);
    font-weight: 600;
}
.ozf-chip.is-on em { background: #fed7aa; color: var(--ozf-accent-dark); }
.ozf-flag i { font-size: 11px; opacity: .35; }
.ozf-flag.is-on i { opacity: 1; }

.ozf-chip.is-zero { opacity: .55; }
.ozf-chip.is-zero em { background: #f3f4f6; }

/* Liste verticale (sous-catégories OZAMarket) */
.ozf-vlist { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.ozf-vitem {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    width: 100%; padding: 9px 12px; text-align: left;
    border: 1.5px solid transparent; border-radius: 10px; background: #fff;
    font: inherit; font-size: 13.5px; color: var(--ozf-text); cursor: pointer;
    transition: border-color .15s, background .15s;
}
.lang-ar .ozf-vitem { text-align: right; }
.ozf-vitem:hover { border-color: var(--ozf-accent); }
.ozf-vitem em { font-style: normal; font-size: 11.5px; color: var(--ozf-muted); background: #f3f4f6; padding: 1px 7px; border-radius: 8px; }
.ozf-vitem.is-on { border-color: var(--ozf-accent); background: var(--ozf-accent-soft); color: var(--ozf-accent-dark); font-weight: 600; }
.ozf-vitem.is-on em { background: #fed7aa; color: var(--ozf-accent-dark); }

/* ---------- Champs ---------- */
.ozf-select, .ozf-input {
    width: 100%; padding: 10px 12px;
    border: 1.5px solid var(--ozf-line); border-radius: 10px;
    background: #fff; color: var(--ozf-text);
    font: inherit; font-size: 14px;
}
.ozf-select:focus, .ozf-input:focus {
    outline: none; border-color: var(--ozf-accent);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, .15);
}
.ozf-sortwrap .ozf-select { width: auto; padding: 8px 12px; }
.ozf-range { display: flex; align-items: center; gap: 8px; }
.ozf-dash { color: var(--ozf-muted); }
.ozf-unit { font-size: 13px; font-weight: 600; color: var(--ozf-muted); }

/* ---------- États ---------- */
#listings-container.ozf-loading { opacity: .45; pointer-events: none; transition: opacity .15s; }
.ozf-empty { text-align: center; padding: 56px 16px; grid-column: 1 / -1; }
.ozf-empty i.fa-search { font-size: 44px; color: #cbd5e1; margin-bottom: 16px; }
.ozf-empty p { margin: 4px 0; }
.ozf-empty .t1 { font-size: 19px; font-weight: 600; color: #111827; }
.ozf-empty .t2 { color: #6b7280; }
.ozf-empty button {
    margin-top: 16px; padding: 10px 20px; border: 0; border-radius: 10px;
    background: var(--ozf-accent, #f97316); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
}

@media (max-width: 700px) {
    .ozf { padding: 0 10px; }
    .ozf-sortwrap { margin-left: 0; width: 100%; }
    .ozf-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   MODE BARRE LATÉRALE (« Affiner la recherche » à gauche)
   ========================================================== */
#ozf-root { display: none; }
#ozf-root.ozf-show { display: block; }

.ozf-count { font-weight: 700; font-size: 15px; color: var(--ozf-navy); margin: 12px 2px 0; }
.ozf-count:empty { display: none; }

/* Accordéon numéroté */
.ozf-group { padding: 0; overflow: hidden; }
.ozf-group-head {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border: 0; background: none; cursor: pointer;
    font: inherit; color: var(--ozf-text); text-align: left;
}
.lang-ar .ozf-group-head { text-align: right; }
.ozf-step {
    flex: 0 0 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ozf-navy); color: #fff; font-size: 12px; font-weight: 700;
}
.ozf-glabel { flex: 1; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ozf-navy); }
.ozf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ozf-accent); }
.ozf-gcaret { font-size: 11px; color: var(--ozf-muted); transition: transform .2s; }
.ozf-group.is-open .ozf-gcaret { transform: rotate(180deg); }
.ozf-group-body { display: none; padding: 0 14px 14px; }
.ozf-group.is-open .ozf-group-body { display: block; }

/* Ordinateur : colonne de gauche, collée en haut pendant le défilement */
@media (min-width: 901px) {
    .listings-section.ozf-side {
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
        column-gap: 24px;
        align-items: start;
        max-width: 1400px;
        margin-left: auto; margin-right: auto;
        padding-left: 16px; padding-right: 16px;
    }
    .listings-section.ozf-side > #ozf-root {
        grid-column: 1; grid-row: 1 / span 10;
        position: sticky; top: var(--ozf-top, 72px); align-self: start;
        max-height: calc(100vh - var(--ozf-top, 72px) - 12px); overflow-y: auto;
        scrollbar-width: thin;
    }
    .listings-section.ozf-side > :not(#ozf-root) { grid-column: 2; }
    .lang-ar .listings-section.ozf-side { grid-template-columns: minmax(0, 1fr) 300px; }
    .lang-ar .listings-section.ozf-side > #ozf-root { grid-column: 2; }
    .lang-ar .listings-section.ozf-side > :not(#ozf-root) { grid-column: 1; }

    .listings-section.ozf-side .ozf { max-width: none; margin: 0; padding: 0; }
    /* Cartes un peu plus étroites à côté de la colonne : on garde 4 annonces par ligne */
    .listings-section.ozf-side #listings-container,
    .listings-section.ozf-side #results-container {
        grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
        gap: 18px; padding: 0 0 20px; max-width: none; margin: 0;
    }
    .ozf-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .ozf-toggle { pointer-events: none; background: none; border: 0; padding: 2px 0; color: var(--ozf-navy); font-size: 16px; }
    .ozf-toggle:hover, .ozf.is-open .ozf-toggle { background: none; color: var(--ozf-navy); }
    .ozf-caret { display: none; }
    .ozf-sortwrap { margin: 0; justify-content: space-between; }
    .ozf-sortwrap .ozf-select { flex: 1; }
    .ozf-reset { justify-content: flex-start; }
    .ozf-panel { display: block !important; box-shadow: none; padding: 12px; margin-top: 12px; animation: none !important; }
    .ozf-grid { grid-template-columns: 1fr; gap: 10px; }
    .ozf-wide { grid-column: auto; }
}

/* Mobile / tablette : bande repliable au-dessus des annonces */
@media (max-width: 900px) {
    .ozf-grid { grid-template-columns: 1fr; }
}

/* ==========================================================
   BANDE DES SOUS-CATÉGORIES (OZAMarket) + bouton OZAMarket
   Style commun : contour orange, fond orange très clair, texte orange foncé
   ========================================================== */
#ozf-subbar { display: none; justify-content: center; width: 100%; padding: 4px 16px 16px; box-sizing: border-box; }
#ozf-subbar.ozf-subshow { display: flex; }
.ozf-subrow {
    display: flex; flex-wrap: nowrap; gap: 10px; max-width: 100%;
    overflow-x: auto; padding: 4px 4px 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.ozf-subpill {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 14px; border: 1.5px solid #f97316; border-radius: 999px;
    background: #fff7ed; color: #c2410c;
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
    transition: background .15s, color .15s, transform .1s, box-shadow .15s;
}
.ozf-subpill:hover { background: #ffedd5; }
.ozf-subpill:active { transform: scale(.97); }
.ozf-subpill em {
    font-style: normal; font-size: 11.5px; font-weight: 600;
    background: #fed7aa; color: #c2410c; padding: 1px 7px; border-radius: 8px;
}
.ozf-subpill.is-on { background: #f97316; color: #fff; box-shadow: 0 4px 12px rgba(249, 115, 22, .35); }
.ozf-subpill.is-on em { background: rgba(255, 255, 255, .28); color: #fff; }
.lang-ar #ozf-subbar { direction: rtl; }

/* Bouton « OZAMarket » de la ligne des catégories (classe ajoutée par le JS) */
/* Bouton « OZAMarket » : mêmes couleurs que les autres catégories,
   + badge du nombre de sous-catégories + effet "pile" discret */
.ozf-oza-btn {
    position: relative;
    /* effet de cartes empilées : 2 fines couches sous le bouton */
    box-shadow:
        0 3px 0 -1px #fff,
        0 4px 0 -1px #d6e0ee !important;
    margin-bottom: 4px;              /* compense l'épaisseur de la pile */
}
.ozf-oza-btn::after,
a[href*="ozamarket" i]::after {
    content: "★";
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; margin-left: 8px; padding: 0;
    border-radius: 50%;
    background: #1e3a8a; color: #fff;
    font-size: 11px; line-height: 1;
}
}
.ozf-oza-btn:hover {
    box-shadow:
        0 3px 0 -1px #fff,
        0 4px 0 -1px #b9c9e3,
        0 8px 16px rgba(30, 58, 138, .12) !important;
}
/* État actif (quand on est dans OZAMarket) */
.ozf-oza-btn.is-current {
    border-color: #1e3a8a !important;
    box-shadow:
        0 3px 0 -1px #fff,
        0 4px 0 -1px #1e3a8a,
        0 0 0 3px rgba(30, 58, 138, .12) !important;
}
.lang-ar .ozf-oza-btn::after { margin-left: 0; margin-right: 8px; }
/* ==========================================================
   EN-TÊTE BLEU « Affiner la recherche » (comme ozannonces.fr)
   ========================================================== */
.ozf-head {
    background: linear-gradient(135deg, #1e3a8a 0%, #3558d6 100%);
    border-radius: 14px;
    padding: 16px 18px 14px;
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 58, 138, .25);
}
.ozf .ozf-head .ozf-toggle {
    width: 100%; justify-content: flex-start;
    background: none; border: 0; padding: 0;
    color: #fff; font-size: 16px; font-weight: 700;
}
.ozf .ozf-head .ozf-toggle:hover,
.ozf.is-open .ozf-head .ozf-toggle { background: none; color: #fff; }
.ozf-head .ozf-caret { margin-left: auto; color: #fff; }
.lang-ar .ozf-head .ozf-caret { margin-left: 0; margin-right: auto; }

.ozf-head .ozf-count {
    margin: 8px 0 0;
    font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .92);
}
.ozf-bar { margin-top: 10px; }

@media (min-width: 901px) {
    .ozf .ozf-head .ozf-toggle { pointer-events: none; }
    .ozf-head .ozf-caret { display: none; }
}.ozf-oza-btn::after,
a[href*="ozamarket" i]::after {
    content: "▾";
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; margin-left: 8px; padding: 0;
    border-radius: 50%;
    background: #1e3a8a; color: #fff;
    font-size: 12px; line-height: 1;
}
#listings-container.ozf-loading {
    min-height: 800px;
}

