/* Fotir Famiglia Filter — drill-down B+A — style match WOOF / Fotir shop */

.fotir-ff {
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: inherit;
}

/* ---------- Ricerca prodotto (nome o codice) — globale, sopra il filtro famiglia ---------- */
.fotir-ff__prodsearch {
    margin: 0 0 1rem;
    padding: 0 0 1rem;
    border-bottom: 1px solid #e5e5e5;
}
.fotir-ff__prodsearch-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .4rem;
    color: #0a3a5c;
}
.fotir-ff__prodsearch-field { display: flex; gap: .4rem; }
.fotir-ff__prodsearch-input {
    flex: 1 1 auto;
    min-width: 0;
    padding: .55rem .75rem;
    border: 1px solid #0a3a5c;
    border-radius: 3px;
    font-size: .9rem;
    box-sizing: border-box;
    background: #fff;
    transition: box-shadow .15s;
}
.fotir-ff__prodsearch-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(10, 58, 92, .18);
}
.fotir-ff__prodsearch-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    padding: 0;
    border: 1px solid #0a3a5c;
    background: #0a3a5c;
    color: #fff;
    border-radius: 3px;
    cursor: pointer;
    transition: background .15s;
}
.fotir-ff__prodsearch-btn:hover { background: #0c4a73; }
.fotir-ff__prodsearch-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-top: .5rem;
    font-size: .85rem;
    color: #444;
}
.fotir-ff__prodsearch-clear {
    color: #0a3a5c;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.fotir-ff__prodsearch-clear:hover { text-decoration: underline; }

/* ---------- Header (search box) ---------- */
.fotir-ff__header { margin-bottom: .75rem; }
.fotir-ff__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 .5rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.fotir-ff__search { position: relative; }
.fotir-ff__search-input {
    width: 100%;
    padding: .55rem .75rem;
    border: 1px solid #d4d4d4;
    border-radius: 3px;
    font-size: .9rem;
    box-sizing: border-box;
    background: #fff;
    transition: border-color .15s;
}
.fotir-ff__search-input:focus {
    outline: none;
    border-color: #0a3a5c;
}

/* ---------- Breadcrumb bar (sopra la griglia prodotti, sostituisce il top panel WOOF) ---------- */
.fotir-ff-bcbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem 1rem;
    width: 100%;
    padding: .6rem .9rem;
    margin: 0 0 1rem;
    background: #f6f8fa;
    border: 1px solid #e3e8ee;
    border-radius: 6px;
    font-size: .9rem;
}
.fotir-ff-bcbar[data-empty] { display: none; }
.fotir-ff-bcbar__path {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .15rem .4rem;
}
.fotir-ff-bcbar__clear {
    flex: 0 0 auto;
    margin-left: auto;
    background: transparent;
    border: 1px solid #c9d2dc;
    color: #0a3a5c;
    padding: .25rem .65rem;
    border-radius: 4px;
    font-size: .82rem;
    line-height: 1.3;
    cursor: pointer;
    transition: background .12s, border-color .12s;
}
.fotir-ff-bcbar__clear:hover {
    background: rgba(10,58,92,.08);
    border-color: #0a3a5c;
}
.fotir-ff-bcbar__clear[hidden] { display: none; }

/* ---------- Crumb (condivisi barra) ---------- */
.fotir-ff__crumb {
    color: #0a3a5c;
    text-decoration: none;
    padding: .1rem .25rem;
    border-radius: 2px;
    transition: background .12s;
}
.fotir-ff__crumb:hover {
    background: rgba(10,58,92,.06);
    text-decoration: underline;
}
.fotir-ff__crumb--root { font-weight: 500; }
.fotir-ff__crumb-sep { color: #999; font-size: .9em; }

/* ---------- Tree list (WOOF-like radio look) ---------- */
.fotir-ff__list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.fotir-ff__item { position: relative; }

/* Button look = WOOF radio: cerchio sinistra + label */
/* Reset aggressivo per superare style globale del theme su <button> */
.fotir-ff button.fotir-ff__btn,
.fotir-ff .fotir-ff__btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .35rem .5rem .35rem .25rem;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: 2px !important;
    box-shadow: none !important;
    cursor: pointer;
    text-align: left;
    font: inherit;
    font-weight: 400;
    color: inherit !important;
    text-transform: none;
    letter-spacing: normal;
    transition: background-color .12s;
    margin: 0;
    min-height: auto;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
    line-height: 1.4;
}
.fotir-ff__btn::before {
    content: '';
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    border: 1px solid #aaa;
    border-radius: 50%;
    background: #fff;
    transition: all .12s;
    box-sizing: border-box;
}
.fotir-ff__btn:hover {
    background: rgba(0,0,0,.03);
}
.fotir-ff__btn:hover::before {
    border-color: #666;
}

/* Active state: radio "checked" + bold */
.fotir-ff__item.is-active > .fotir-ff__btn::before {
    border-color: #0a3a5c;
    background: radial-gradient(#0a3a5c 40%, #fff 50%);
}
.fotir-ff__item.is-active > .fotir-ff__btn {
    font-weight: 600;
    color: #0a3a5c;
}

/* In path = grassetto leggero */
.fotir-ff__item.is-in-path:not(.is-active) > .fotir-ff__btn {
    font-weight: 500;
}
.fotir-ff__item.is-in-path > .fotir-ff__btn::before {
    border-color: #0a3a5c;
}

/* Toggle icon nativo nascosto (lo facciamo via ::after) */
.fotir-ff__toggle { display: none; }

.fotir-ff__label { flex: 1; min-width: 0; }
.fotir-ff__count {
    color: #888;
    font-size: .82em;
    font-weight: normal;
    margin-left: .2rem;
}

/* Indicatore espansione + / − per items con figli */
.fotir-ff__item[data-has-children="1"] > .fotir-ff__btn::after {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: auto;
    flex-shrink: 0;
    color: #888;
    font-size: 1.1em;
    font-weight: 500;
    line-height: 1;
    transition: color .12s, transform .12s;
}
.fotir-ff__item[data-has-children="1"][aria-expanded="true"] > .fotir-ff__btn::after {
    content: "−";
    color: #0a3a5c;
}
.fotir-ff__item[data-has-children="1"] > .fotir-ff__btn:hover::after {
    color: #0a3a5c;
}

/* ---------- Children list (indentazione semplice) ---------- */
.fotir-ff__children {
    list-style: none;
    margin: 0;
    padding: 0 0 0 1.4rem;
}
.fotir-ff__children .fotir-ff__btn {
    padding: .3rem .5rem .3rem .25rem;
    font-size: .92em;
}
.fotir-ff__children .fotir-ff__btn::before {
    width: 12px;
    height: 12px;
}

/* Loading state */
.fotir-ff__loading {
    color: #999;
    font-size: .85em;
    padding: .35rem .5rem;
    font-style: italic;
}

/* Noscript fallback */
.fotir-ff__noscript {
    font-size: .85em;
    color: #c00;
    padding: .5rem;
    border: 1px solid #fcc;
    background: #fee;
    border-radius: 3px;
}

/* Search filter visual */
.fotir-ff__item[data-search-hidden="1"] { display: none; }
.fotir-ff__item[data-search-match="1"] > .fotir-ff__btn {
    background: #fffbe6;
}

/* Drill-down: sorelle root non in path → opacità ridotta per focus */
.fotir-ff.has-active .fotir-ff__item--root:not(.is-in-path) > .fotir-ff__btn {
    opacity: .65;
}
.fotir-ff.has-active .fotir-ff__item--root:not(.is-in-path):hover > .fotir-ff__btn {
    opacity: 1;
}

/* --- Fix responsive: nomi lunghi vanno a capo a parole intere invece di
   accavallarsi col conteggio quando la sidebar si stringe (prima della mobile view).
   Il tema eredita white-space:nowrap; qui lo forziamo a normal sul label, fissiamo il
   conteggio (flex-shrink:0, sempre leggibile) e allineiamo radio/conteggio/chevron alla
   PRIMA riga del nome. overflow-wrap:break-word spezza una parola solo come ultima spiaggia
   (mai overlap); in pratica, a larghezze sidebar reali, le parole restano intere.
   Scelta wrap (non ellissi/scroll) perché il dettaglio che distingue i prodotti è a fine
   nome (es. "CURVA 45°" vs "CURVA 87,5°") e non va nascosto. Sessione 2026-07-02. --- */
.fotir-ff button.fotir-ff__btn,
.fotir-ff .fotir-ff__btn { align-items: flex-start; }
.fotir-ff__label { white-space: normal; overflow-wrap: break-word; }
.fotir-ff__count { flex-shrink: 0; }
.fotir-ff__btn::before { margin-top: .18em; }
.fotir-ff__item[data-has-children="1"] > .fotir-ff__btn::after { margin-top: -.05em; }
