/* site v1.3 : catalog (filtres du shop et de Créations, arbre des catégories, infos des pièces) */

/* ---------- barre de filtres ---------- */
.ff { display: flex; flex-direction: column; gap: 14px; }
.ff-top { display: flex; align-items: center; gap: 10px; }
.ff-open, .ff-sheet-bg, .ff-sheet-head, .ff-sheet-foot { display: none; }
.ff-panel { flex: 1 1 auto; min-width: 0; }
.ff-drops { display: flex; flex-wrap: wrap; gap: 10px; }
.ff-drops.is-empty { display: none; }
.ff-drop { position: relative; }
.ff-drop[hidden] { display: none; }
.ff-btn { display: inline-flex; align-items: center; gap: 9px; max-width: 320px; padding: 10px 14px; border-radius: var(--r); background: var(--card-2); color: var(--ink); font-size: 13px; transition: transform .35s var(--back), background .25s; }
.ff-btn:hover { transform: rotate(-2.5deg); background: rgba(255,255,255,.12); }
.ff-btn:focus-visible { outline: 2px solid var(--magenta-hi); outline-offset: 2px; }
.ff-btn svg { flex: 0 0 auto; width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--back); }
.ff-drop.is-open .ff-btn svg { transform: rotate(180deg); }
.ff-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 48% 52% 60% 40% / 50% 42% 58% 50%; background: rgba(255,255,255,.2); transition: background .3s, transform .45s var(--back); }
.ff-lab { white-space: nowrap; }
.ff-val { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #fff; }
.ff-val:empty { display: none; }
.ff-drop.is-active .ff-btn { background: rgba(var(--mg), .24); }
.ff-drop.is-active .ff-lab { color: var(--magenta-soft); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.ff-drop.is-active .ff-dot { background: var(--magenta-hi); transform: scale(1.3); }

/* menu déroulant peint : fond violet nuit, goutte d'attache, coulure en bas */
.ff-menu { position: absolute; top: calc(100% + 12px); left: 0; z-index: 70; width: max-content; min-width: 250px; max-width: 320px; padding: 8px; border-radius: var(--r); background: #1f1230; box-shadow: 0 34px 60px -22px rgba(0,0,0,.95), 0 10px 24px -14px rgba(var(--mg), .35); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-10px) rotate(-1.2deg) scale(.97); transform-origin: 20px 0; transition: opacity .2s, transform .45s var(--back), visibility 0s .45s; }
.ff-menu.to-left { left: auto; right: 0; transform-origin: calc(100% - 20px) 0; }
.ff-drop.is-open .ff-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
.ff-menu::before { content: ""; position: absolute; top: -8px; left: 16px; width: 18px; height: 15px; background: #1f1230; border-radius: 48% 52% 60% 40% / 50% 42% 58% 50%; }
.ff-menu.to-left::before { left: auto; right: 16px; }
.ff-drip { position: absolute; left: 6px; right: 6px; top: calc(100% - 1px); width: calc(100% - 12px); height: 26px; fill: #1f1230; transform: scaleY(0); transform-origin: top; transition: transform .6s var(--back) .12s; pointer-events: none; }
.ff-drop.is-open .ff-drip { transform: scaleY(1); }
.ff-menu-in { position: relative; display: flex; flex-direction: column; gap: 2px; max-height: 360px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(var(--mg), .5) transparent; }

.ff-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r); text-align: left; font-size: 13px; color: var(--ink); transition: background .2s, transform .35s var(--back); }
.ff-opt i { flex: 0 0 auto; position: relative; width: 11px; height: 11px; border-radius: 48% 52% 60% 40% / 50% 42% 58% 50%; background: rgba(255,255,255,.16); transition: background .25s, transform .45s var(--back); }
.ff-opt span { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ff-opt small { flex: 0 0 auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ff-opt svg { flex: 0 0 auto; width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ff-opt:not(:disabled):hover, .ff-opt:focus-visible { background: rgba(var(--mg), .18); transform: translateX(3px); outline: none; }
.ff-opt.is-on { background: rgba(var(--mg), .34); }
.ff-opt.is-on i { background: var(--tc, var(--magenta-hi)); transform: scale(1.35); }
.ff-opt.is-in i { background: var(--magenta-soft); }
.ff-opt.is-zero { opacity: .42; cursor: default; }
.ff-opt.ff-all span { font-weight: 600; }
.ff-check i { width: 14px; height: 14px; border-radius: 40% 60% 55% 45% / 55% 40% 60% 45%; background: rgba(255,255,255,.12); }
.ff-check:not(.is-on) i { box-shadow: inset 0 0 0 5px rgba(20,10,28,.55); background: var(--tc, rgba(255,255,255,.3)); }
.ff-check.is-on i::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ff-tags { display: flex; flex-direction: column; gap: 2px; }
.ff-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--lavender); transition: color .2s, transform .35s var(--back); }
.ff-back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ff-back:hover { color: #fff; transform: translateX(-3px); }
.ff-level { padding: 2px 10px 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.ff-level b { color: var(--magenta-soft); font-weight: 700; }
.ff-mode { display: flex; gap: 4px; padding: 4px; border-radius: var(--r); background: rgba(255,255,255,.05); }
.ff-mode button { flex: 1 1 0; padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); border-radius: var(--r); transition: color .2s, background .3s, border-radius .4s, transform .35s var(--back); }
.ff-mode button:hover { color: var(--ink); }
.ff-mode button.is-on { background: var(--magenta); color: #fff; border-radius: 44% 56% 52% 48% / 58% 46% 54% 42%; transform: rotate(-1.5deg); }
.ff-hint { margin: 6px 6px 8px; font-size: 12px; line-height: 1.55; color: var(--muted); }
.ff-hint b { color: var(--ink); }
.ff-reset { align-self: flex-start; margin-top: 4px; padding: 7px 10px; font-size: 12px; font-weight: 600; color: var(--lavender); transition: color .2s, transform .35s var(--back); }
.ff-reset:hover { color: #fff; transform: rotate(-2deg); }

/* fourchette de prix : piste peinte, curseurs en gouttes */
.ff-range { display: flex; flex-direction: column; gap: 16px; width: 270px; max-width: 100%; padding: 12px 8px 4px; }
.ff-track { position: relative; height: 26px; }
.ff-track::before { content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 6px; border-radius: 40% 60% 55% 45% / 50% 50% 50% 50%; background: rgba(255,255,255,.1); }
.ff-fill { position: absolute; top: 9px; height: 8px; border-radius: 45% 55% 50% 50% / 60% 40% 60% 40%; background: linear-gradient(90deg, var(--magenta), var(--lavender)); }
.ff-track input[type=range] { position: absolute; inset: 0; width: 100%; height: 26px; margin: 0; padding: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.ff-track input[type=range]::-webkit-slider-runnable-track { background: transparent; height: 26px; }
.ff-track input[type=range]::-moz-range-track { background: transparent; }
.ff-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 22px; margin-top: 2px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #fff5fa; box-shadow: 0 6px 14px -4px rgba(var(--mg), .9); cursor: grab; transition: transform .3s var(--back); }
.ff-track input[type=range]::-moz-range-thumb { pointer-events: auto; width: 20px; height: 22px; border: none; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #fff5fa; box-shadow: 0 6px 14px -4px rgba(var(--mg), .9); cursor: grab; }
.ff-track input[type=range]:active::-webkit-slider-thumb { transform: scale(1.15) rotate(-6deg); cursor: grabbing; }
.ff-track input[type=range]:focus-visible { outline: none; }
.ff-track input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px rgba(var(--mg), .6); }
.ff-nums { display: flex; gap: 10px; }
.ff-nums label { flex: 1 1 0; display: flex; flex-direction: column; gap: 6px; font-size: 11px; letter-spacing: .06em; color: var(--muted); }
.ff-num { display: flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: var(--r); background: rgba(255,255,255,.06); transition: box-shadow .25s; }
.ff-num:focus-within { box-shadow: inset 0 -2px 0 var(--magenta-hi); }
.ff-num input { width: 100%; min-width: 0; padding: 10px 0; border: none; background: none; color: var(--ink); font-family: var(--font-body); font-size: 14px; outline: none; -moz-appearance: textfield; }
.ff-num input::-webkit-outer-spin-button, .ff-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ff-num b { font-weight: 500; color: var(--muted); }

/* pastilles des filtres actifs */
.ff-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ff-active[hidden] { display: none; }
.ff-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ff-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px 7px 14px; border-radius: 44% 56% 52% 48% / 58% 46% 54% 42%; background: var(--magenta); color: #fff; font-size: 12.5px; font-weight: 600; box-shadow: 0 10px 22px -14px rgba(var(--mg), .9); transition: transform .35s var(--back), background .25s; }
.ff-chip:nth-child(3n+2) { border-radius: 52% 48% 44% 56% / 46% 58% 42% 54%; }
.ff-chip:nth-child(3n) { border-radius: 40% 60% 58% 42% / 55% 45% 55% 45%; }
.ff-chip[data-rm="tag"] { background: #7d62d9; }
.ff-chip[data-rm="q"] { background: #4f7fd6; }
.ff-chip small { font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.ff-chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; transition: transform .35s var(--back); }
.ff-chip:hover { transform: rotate(-2.5deg); background: var(--magenta-hi); }
.ff-chip:hover svg { transform: rotate(90deg); }
.ff-chip.is-new { animation: ff-pop .55s var(--back); }
@keyframes ff-pop { from { transform: scale(.5) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ff-clear { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--r); background: rgba(255,255,255,.06); color: var(--lavender); font-size: 12.5px; font-weight: 600; transition: transform .35s var(--back), color .2s, background .25s; }
.ff-clear svg { width: 12px; height: 12px; }
.ff-clear:hover { transform: rotate(-2.5deg); color: #fff; background: rgba(255,255,255,.1); }

/* ---------- arbre des catégories (colonne latérale) ---------- */
.cats.ct-tree { gap: 2px; max-height: calc(100vh - 130px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(var(--mg), .4) transparent; padding-right: 6px; }
.ct { display: flex; flex-direction: column; }
.ct[hidden] { display: none; }
.ct-row { display: flex; align-items: center; gap: 2px; }
.ct-tree .ct-row a { align-self: auto; }
.ct-tree a span { min-width: 0; }
.ct-n { font-size: 10.5px; color: var(--muted); opacity: .75; font-variant-numeric: tabular-nums; }
.ct-tree a.is-active .ct-n { color: var(--magenta-soft); opacity: 1; }
.ct-tog { flex: 0 0 auto; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r); color: var(--muted); transition: transform .35s var(--back), background .2s, color .2s; }
.ct-tog svg { width: 13px; height: 13px; transition: transform .4s var(--back); }
.ct-tog:hover { background: var(--card-2); color: var(--ink); transform: rotate(-4deg); }
.ct.is-open > .ct-row .ct-tog svg { transform: rotate(180deg); }
.ct-kids { position: relative; margin-left: 3px; padding-left: 14px; }
.ct-kids::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 10px; width: 2px; border-radius: 2px; background: linear-gradient(rgba(var(--mg), .45), rgba(179,157,255,.12)); }
.ct:not(.is-open) > .ct-kids { display: none; }
.ct.is-open > .ct-kids { animation: ct-drop .45s var(--back); }
@keyframes ct-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.ct-kids a { font-size: 13px; padding-top: 6px; padding-bottom: 6px; }
.ct.is-zero > .ct-row a { opacity: .45; }

/* ---------- Créations : filtres et compteur ---------- */
.cr-filters { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: -10px 0 36px; }
.cr-filters .ff { align-items: center; }
.cr-filters .ff-drops, .cr-filters .ff-active, .cr-filters .ff-chips { justify-content: center; }

/* ---------- fiche : ligne d'infos peinte et tags ---------- */
.crumb { flex-wrap: wrap; row-gap: 4px; }
.pmeta { display: flex; flex-wrap: wrap; gap: 10px; }
.pmeta-i { position: relative; isolation: isolate; display: inline-flex; flex-direction: column; gap: 2px; padding: 9px 16px 10px; transition: transform .4s var(--back); }
.pmeta-i::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 44% 56% 52% 48% / 58% 46% 54% 42%; background: var(--pc); opacity: .2; transition: opacity .3s; }
.pmeta-i:nth-child(2)::before { border-radius: 52% 48% 44% 56% / 46% 58% 42% 54%; }
.pmeta-i:nth-child(3)::before { border-radius: 40% 60% 58% 42% / 55% 45% 55% 45%; }
.pmeta-i:hover { transform: rotate(-2.5deg); }
.pmeta-i:hover::before { opacity: .34; }
.pmeta-i small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pmeta-i a, .pmeta-i span { font-size: 14px; font-weight: 600; color: var(--ink); }
.pmeta-i a { transition: color .2s; }
.pmeta-i a::after { content: ""; position: absolute; inset: 0; }
.pmeta-i a:hover { color: #fff; }
.ptags { display: flex; flex-wrap: wrap; gap: 8px; }
.ptags a { position: relative; isolation: isolate; padding: 6px 12px 7px; font-size: 12.5px; font-weight: 600; color: var(--ink); transition: transform .35s var(--back), color .2s; }
.ptags a::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 48% 52% 60% 40% / 50% 42% 58% 50%; background: var(--tc); opacity: .28; transition: opacity .25s, transform .45s var(--back); }
.ptags a:nth-child(2n)::before { border-radius: 42% 58% 50% 50% / 55% 45% 55% 45%; }
.ptags a:hover { transform: rotate(-3deg); color: #fff; }
.ptags a:hover::before { opacity: .85; transform: scale(1.05); }

/* ---------- mobile : panneau plein écran peint ---------- */
html.ff-lock, html.ff-lock body { overflow: hidden; }
@media (max-width: 760px) {
  .shop:has(.ff-drop[data-key="categorie"]:not([hidden])) .ct-tree { display: none; }
  .ff-open { display: inline-flex; align-items: center; gap: 9px; }
  .ff-open .ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .ff-panel:not(.is-sheet) { display: none; }
  .cr-filters .ff { align-items: stretch; }
  .cr-filters .ff-top { justify-content: center; }
  .ff-active { gap: 6px; }
}
.ff-panel.is-sheet { position: fixed; inset: 0; z-index: 960; display: flex; flex-direction: column; background: #170b21; opacity: 0; transform: translateY(26px); transition: opacity .3s, transform .5s var(--back); }
.ff-panel.is-sheet.is-in { opacity: 1; transform: none; }
.ff-panel.is-sheet .ff-sheet-bg { display: block; position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ff-panel.is-sheet .ff-sheet-bg svg { width: 100%; height: 100%; }
.ff-panel.is-sheet .ff-sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 22px 16px 12px; }
.ff-sheet-title { font-family: var(--font-head); font-size: 30px; font-weight: 700; color: var(--ink); }
.ff-close { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 48% 52% 60% 40% / 50% 42% 58% 50%; background: var(--card-2); color: var(--ink); transition: transform .35s var(--back); }
.ff-close svg { width: 18px; height: 18px; }
.ff-close:active { transform: rotate(-8deg) scale(.95); }
.ff-panel.is-sheet .ff-drops { position: relative; flex: 1 1 auto; flex-direction: column; flex-wrap: nowrap; gap: 8px; padding: 4px 16px 24px; overflow-y: auto; overscroll-behavior: contain; }
.ff-panel.is-sheet .ff-drop { width: 100%; }
.ff-panel.is-sheet .ff-btn { width: 100%; max-width: none; padding: 15px 16px; font-size: 15px; background: rgba(255,255,255,.07); }
.ff-panel.is-sheet .ff-btn:hover { transform: none; }
.ff-panel.is-sheet .ff-val { flex: 1 1 auto; text-align: right; }
.ff-panel.is-sheet .ff-btn svg { margin-left: auto; }
.ff-panel.is-sheet .ff-val:not(:empty) + svg { margin-left: 0; }
.ff-panel.is-sheet .ff-menu { position: static; display: none; width: auto; min-width: 0; max-width: none; margin-top: 6px; padding: 6px; background: rgba(20,10,28,.6); box-shadow: none; opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
.ff-panel.is-sheet .ff-menu::before, .ff-panel.is-sheet .ff-drip { display: none; }
.ff-panel.is-sheet .ff-drop.is-open .ff-menu { display: block; animation: ct-drop .4s var(--back); }
.ff-panel.is-sheet .ff-menu-in { max-height: none; }
.ff-panel.is-sheet .ff-opt { padding: 12px 10px; font-size: 14px; }
.ff-panel.is-sheet .ff-range { width: auto; }
.ff-panel.is-sheet .ff-sheet-foot { position: relative; display: flex; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: rgba(20,10,28,.88); box-shadow: 0 -18px 30px -18px rgba(0,0,0,.9); }
.ff-panel.is-sheet .ff-sheet-foot .btn { flex: 1 1 0; justify-content: center; padding-left: 12px; padding-right: 12px; }
.ff-panel.is-sheet .ff-sheet-foot .btn-primary { flex-grow: 1.6; }

@media (prefers-reduced-motion: reduce) {
  .ff-menu, .ff-drip, .ff-chip.is-new, .ct.is-open > .ct-kids, .ff-panel.is-sheet { transition: none !important; animation: none !important; }
}
