@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:wght@400;500;600;700&display=swap');

/* ============================================================
   CATALOGUE-FILTERS.CSS — barra filtri verticale del catalogo
   (pages/catalogue/index.php). Caricato DOPO recre.css: tutte le
   regole sono sotto .cat-layout / .cat-rail / .cat-flyout, così le
   altre pagine che usano recre.css (account, vendor) non cambiano.

   Struttura:
     .cat-layout  grid [rail | main]
       .cat-rail     barra verticale (chiusa = icone, .rail-expanded = icona + nome)
       .cat-main     ricerca + .cat-flyout + .cat-results (.cat-toolbar Filtri mobile/Ordina + #sresa)
     < 900px: .cat-rail = cassetto laterale (.drawer-open), .cat-flyout scorre sopra il cassetto
   ============================================================ */

.cat-layout {
    --rail-w: 76px;
    --rail-w-open: 244px;
    --fly-bg: #0f1b14;
    --fly-bg-2: #13231a;
    --line: rgba(46, 204, 113, 0.16);
    --line-soft: rgba(255, 255, 255, 0.06);
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    align-items: start;
    min-height: calc(100vh - var(--header-h, 72px));
    transition: grid-template-columns 0.22s ease;
}

.cat-layout.rail-expanded { --rail-w: var(--rail-w-open); }

body.cat-lock { overflow: hidden; }

/* ════════════════════════════════════════════════════════════
   RAIL — barra verticale
════════════════════════════════════════════════════════════ */
.cat-rail {
    position: sticky;
    top: var(--header-h, 72px);
    height: calc(100vh - var(--header-h, 72px));
    z-index: 950;
    background: linear-gradient(180deg, #0f1c14 0%, var(--f-bg) 100%);
    border-right: 1px solid var(--line);
    font-family: 'DM Sans', sans-serif;
}

.cat-rail > form {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-align: left;
    padding: 0;
}

.rail-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 10px;
    flex-shrink: 0;
}

.rail-title {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--f-text);
    white-space: nowrap;
    flex: 1;
}

.rail-toggle,
.rail-drawer-close {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px dashed rgba(255, 255, 255, 0.14);
    background: transparent;
    color: var(--f-muted);
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.rail-toggle:hover,
.rail-drawer-close:hover {
    color: var(--f-green);
    border-color: var(--f-green);
    background: var(--f-green-dim);
}

.rail-toggle svg { transition: transform 0.25s ease; }
.cat-layout.rail-expanded .rail-toggle svg { transform: rotate(180deg); }
.rail-drawer-close { display: none; }

.rail-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 16px;
    scrollbar-width: none;
}

.rail-scroll::-webkit-scrollbar { display: none; }

.rail-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cat-rail .frpa {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100% !important;
}

.cat-rail .frpa + .frpa { margin-top: 6px; }

.rail-sep {
    height: 1px;
    margin: 14px 6px;
    background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.rail-foot {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 16px 16px;
    border-top: 1px solid var(--line);
    flex-shrink: 0;
}

/* ── Voce della barra: [cerchio icona] [nome] ── */
.cat-rail .rail-item {
    position: relative;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px;
    width: 100% !important;
    height: 44px !important;
    min-height: 44px;
    flex: 0 0 auto;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 22px !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    overflow: visible;
    color: var(--f-muted);
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    --ic: var(--f-green);
}

/* niente decorazioni legacy (sottolineatura .dropactive, gradiente .frpadiv) */
.cat-rail .rail-item::before,
.cat-rail .rail-item::after { display: none !important; }

.cat-rail .rail-ico {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--ic);
    font-size: 1.05rem;
    text-shadow: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease, opacity 0.2s ease;
}

.cat-rail .rail-ico svg,
.cat-rail .rail-ico i {
    width: 1.1em;
    height: 1.1em;
    font-size: 1.05rem !important;
    color: var(--ic);
    opacity: 0.85;
    filter: none !important;
    transform: none !important;
}

.cat-rail .rail-label {
    display: block !important;
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem !important;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-align: left !important;
    color: inherit !important;
    text-shadow: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-rail .rail-caret {
    flex: 0 0 auto;
    margin-right: 14px;
    font-size: 0.7rem;
    opacity: 0.35;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

/* recre.css: ".drop span" / ".drop:hover span" / ".drop.dropactive span" forzano margini e colore verde */
.cat-rail .drop .rail-label { color: inherit !important; }
.cat-rail .drop .rail-ico { color: var(--ic) !important; margin: 0 !important; }
.cat-rail .drop .drop-badge { margin: 0 !important; color: #0e1a12 !important; font-size: 0.62rem; letter-spacing: 0; text-transform: none; }

/* colore di ogni voce */
.cat-rail .rail-fem   { --ic: #ff6b9d; }
.cat-rail .rail-reg   { --ic: #4facfe; }
.cat-rail .rail-photo { --ic: #feca57; }
.cat-rail .rail-auto  { --ic: #1dd1a1; }
.cat-rail #sbdrop     { --ic: #e0bf5a; }
.cat-rail #fldrop     { --ic: #2ecc71; }
.cat-rail #disdrop    { --ic: #d45cf0; }
.cat-rail #effdrop    { --ic: #ffb917; }
.cat-rail #avadrop    { --ic: #4fb3ea; }
.cat-rail #gendrop    { --ic: #a978ff; }
.cat-rail .rail-random { --ic: #e0bf5a; }
.cat-rail .rail-reset  { --ic: rgba(212, 237, 216, 0.7); }

/* hover */
.cat-rail .rail-item:hover { color: var(--f-text); }
.cat-rail .rail-item:hover .rail-ico {
    border-color: var(--ic);
    background: color-mix(in srgb, var(--ic) 10%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ic) 14%, transparent);
    transform: scale(1.05);
}
.cat-rail .rail-item:hover .rail-ico svg { opacity: 1; }
.cat-rail .rail-item:focus-visible { outline: none; }
.cat-rail .rail-item:focus-visible .rail-ico { outline: 2px solid var(--ic); outline-offset: 2px; }

/* attivo: radio selezionati (FEM/REG/PHOTO/AUTO) e pannello aperto */
.cat-rail .rail-item.filteractive,
.cat-rail .rail-item.dropactive { color: #fff; }

.cat-rail .rail-item.filteractive .rail-ico,
.cat-rail .rail-item.dropactive .rail-ico {
    border-color: var(--ic);
    background: color-mix(in srgb, var(--ic) 20%, transparent);
    box-shadow: 0 0 16px color-mix(in srgb, var(--ic) 45%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--ic) 40%, transparent);
}

.cat-rail .rail-item.filteractive .rail-ico svg,
.cat-rail .rail-item.dropactive .rail-ico svg { opacity: 1; }

.cat-rail .rail-item.filterinactive .rail-ico { opacity: 0.6; }
.cat-rail .rail-item.filterinactive:hover .rail-ico { opacity: 1; }

.cat-rail .rail-item.dropactive .rail-caret { opacity: 0.9; transform: translateX(3px); color: var(--ic); }

/* badge contatore (creato da catalogue.js → aggiornaBadgeDropdown) sul cerchio */
.cat-rail .drop-badge {
    position: absolute;
    top: -3px;
    left: 29px;
    right: auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--ic);
    color: #0e1a12;
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--f-bg);
    pointer-events: none;
}

/* barra aperta: la voce diventa una riga arrotondata */
.cat-layout.rail-expanded .cat-rail .rail-item:hover { background: rgba(255, 255, 255, 0.035) !important; }
.cat-layout.rail-expanded .cat-rail .rail-item.dropactive,
.cat-layout.rail-expanded .cat-rail .rail-item.filteractive {
    background: color-mix(in srgb, var(--ic) 9%, transparent) !important;
}

.rail-done { display: none; }

/* barra chiusa (solo desktop): solo i cerchi */
@media (min-width: 900px) {
    .cat-layout:not(.rail-expanded) .rail-title,
    .cat-layout:not(.rail-expanded) .rail-label,
    .cat-layout:not(.rail-expanded) .rail-caret { display: none !important; }

    .cat-layout:not(.rail-expanded) .rail-head { padding-left: 16px; padding-right: 16px; }
}

/* tooltip col nome (barra chiusa), creato da catalogue.js */
.rail-tip {
    position: fixed;
    z-index: 1200;
    padding: 6px 11px;
    border-radius: 8px;
    background: #0b140f;
    border: 1px solid var(--f-border, rgba(46, 204, 113, 0.18));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    color: #d4edd8;
    font: 600 0.72rem 'DM Sans', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-4px, -50%);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.rail-tip.is-visible { opacity: 1; transform: translate(0, -50%); }

/* ════════════════════════════════════════════════════════════
   MAIN + TOOLBAR (Filtri mobile · Ordina per)
════════════════════════════════════════════════════════════ */
.cat-main { min-width: 0; position: relative; }

.cat-toolbar {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 10px 16px;
    background: var(--f-bg);
    border-bottom: 1px solid var(--line);
    font-family: 'DM Sans', sans-serif;
}

.cat-filters-btn {
    display: none;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--fly-bg-2);
    color: var(--f-text);
    font: 700 0.8rem 'DM Sans', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
}

.cat-filters-btn svg { color: var(--f-green); }

.cat-filters-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--f-green);
    color: #0e1a12;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 20px;
    text-align: center;
}

.cat-filters-count[hidden] { display: none; }

.cat-sort {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-sort-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--f-muted);
}

.cat-sort-menu { position: relative; }

.cat-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 14px 0 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--fly-bg-2);
    color: var(--f-text);
    font: 600 0.85rem 'DM Sans', sans-serif;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.cat-sort-btn:hover,
.cat-sort-btn[aria-expanded="true"] { border-color: var(--f-green); background: var(--f-green-dim); }
.cat-sort-btn svg { font-size: 0.7rem; opacity: 0.6; transition: transform 0.2s ease; }
.cat-sort-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

.cat-sort-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 970;
    min-width: 230px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--fly-bg);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
    animation: catPop 0.14s ease;
}

.cat-sort-list[hidden] { display: none; }

@keyframes catPop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

.cat-sort-list .orderby { display: block; margin: 0; cursor: pointer; }

.cat-sort-list .ord {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 !important;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px !important;
    background: transparent;
    font: 500 0.85rem 'DM Sans', sans-serif;
    text-align: left;
    text-transform: none;
}

.cat-sort-list .ord.ordinactive:hover { background: rgba(255, 255, 255, 0.05) !important; }
.cat-sort-list .ord.ordactive { font-weight: 700; }
.cat-sort-list .ord.ordactive::after { content: '✓'; font-weight: 800; color: var(--f-green); }

.cat-toolbar #moderadio {
    display: flex !important;
    width: auto !important;
    gap: 0;
    padding: 3px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: var(--fly-bg-2);
}

.cat-toolbar .orrad {
    flex: 0 0 auto;
    width: 36px !important;
    height: 32px;
    padding: 0;
    border: 0 !important;
    border-radius: 16px !important;
    background: transparent;
    font-size: 0.9rem !important;
    box-shadow: none;
}

.cat-toolbar .orrad::before { display: none; }
.cat-toolbar .orrad:hover { transform: none; }

/* ════════════════════════════════════════════════════════════
   TOOLBAR SULLA RIGA DELLA PAGINAZIONE (desktop)
   .cat-results = .cat-toolbar + #sresa. Con spazio sufficiente la toolbar esce dal flusso
   e si sovrappone alla colonna sinistra (vuota) di .results-bar (partials/strain-grid.php):
   left = margine della barra (16px) + suo padding (12px), top = margin-top della barra (16px),
   altezza = barra (8+36+8). Vedi strain-card.css. La soglia (1020px) coincide con quella sotto cui
   .results-bar va su due righe (catalogue.css): sotto resta la toolbar a tutta larghezza sopra la griglia.
════════════════════════════════════════════════════════════ */
.cat-results { position: relative; container: catres / inline-size; }

@container catres (min-width: 1020px) {
    .cat-toolbar {
        position: absolute;
        top: 16px;
        left: 28px;
        height: 52px;
        padding: 0;
        justify-content: flex-start;
        background: none;
        border: 0;
    }

    .cat-sort-btn { height: 36px; }
    .cat-toolbar #moderadio { padding: 2px; }
    .cat-toolbar .orrad { height: 30px; }
    .cat-sort-list { left: 0; right: auto; }
}

/* etichetta "Ordina per" solo quando c'è spazio accanto alla paginazione centrata */
@container catres (min-width: 1020px) and (max-width: 1259px) {
    .cat-sort-label { display: none; }
}

/* ════════════════════════════════════════════════════════════
   BACKDROP
════════════════════════════════════════════════════════════ */
.cat-backdrop {
    position: fixed;
    top: var(--header-h, 72px);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 930;
    background: rgba(3, 8, 5, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.cat-layout.fly-open .cat-backdrop,
.cat-layout.drawer-open .cat-backdrop {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease;
}

/* ════════════════════════════════════════════════════════════
   FLYOUT — pannello del filtro, a destra della barra, sopra la griglia
════════════════════════════════════════════════════════════ */
.cat-flyout {
    position: fixed;
    top: calc(var(--header-h, 72px) + 12px);
    left: calc(var(--rail-w) + 14px);
    width: min(1180px, calc(100vw - var(--rail-w) - 32px));
    max-height: calc(100vh - var(--header-h, 72px) - 24px);
    z-index: 940;
    display: flex;
    flex-direction: column;
    background: var(--fly-bg);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 0, 0, 0.3);
    color: var(--f-text);
    font-family: 'DM Sans', sans-serif;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-14px);
    transition: opacity 0.18s ease, transform 0.18s ease, left 0.22s ease, visibility 0s linear 0.18s;
}

.cat-flyout.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 0.18s ease, transform 0.18s ease, left 0.22s ease;
}

.cat-flyout > form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
}

.cat-flyout .droppy {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    flex: 1;
    min-height: 0;
    width: 100%;
    padding: 0 !important;
    gap: 0;
    animation: none;
    font-weight: normal;
}

.cat-flyout .droppy.droppyactive { display: flex !important; }

.cat-flyout #rangedrop {
    padding: 0 !important;
    justify-content: flex-start;
    align-items: stretch;
}

.cat-flyout #seedbanks  { --ic: #e0bf5a; }
.cat-flyout #checkflav  { --ic: #2ecc71; }
.cat-flyout #disdroppy  { --ic: #d45cf0; }
.cat-flyout #effdroppy  { --ic: #ffb917; }
.cat-flyout #dispo      { --ic: #4fb3ea; }
.cat-flyout #rangedrop  { --ic: #a978ff; }

/* ── Header comune ── */
.fly-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px 14px 18px;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(90deg, color-mix(in srgb, var(--ic) 9%, transparent), transparent 55%);
    flex-shrink: 0;
}

.fly-ico {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid var(--ic);
    background: color-mix(in srgb, var(--ic) 16%, transparent);
    color: var(--ic);
}

.fly-title {
    margin: 0;
    font: 800 1rem 'Syne', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
}

.fly-count {
    padding: 2px 9px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--ic) 22%, transparent);
    color: var(--ic);
    font-size: 0.72rem;
    font-weight: 700;
}

.fly-count[hidden] { display: none; }
.fly-spacer { flex: 1; }

.fly-clear {
    padding: 7px 14px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--f-muted);
    font: 600 0.75rem 'DM Sans', sans-serif;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.fly-clear:hover { color: var(--f-gold); border-color: rgba(200, 168, 75, 0.35); }
.fly-clear:disabled { opacity: 0.3; cursor: default; border-color: transparent; color: var(--f-muted); }

.fly-close,
.fly-back {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.03);
    color: var(--f-muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.fly-close:hover,
.fly-back:hover { color: #fff; border-color: rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.08); }
.fly-back { display: none; }

/* ── Corpo scorrevole ── */
.cat-flyout .fly-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 18px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(46, 204, 113, 0.4) transparent;
}

.cat-flyout .fly-body::-webkit-scrollbar { width: 6px; }
.cat-flyout .fly-body::-webkit-scrollbar-thumb { background: rgba(46, 204, 113, 0.35); border-radius: 3px; }

/* ════════════════════════════════════════════════════════════
   SEEDBANKS — rubrica alfabetica
════════════════════════════════════════════════════════════ */
.cat-flyout .bank-panel {
    display: block;
    padding: 0 !important;
    gap: 0;
}

.bank-tools {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 18px 12px;
    background: var(--fly-bg);
    border-bottom: 1px solid var(--line-soft);
}

.cat-flyout .bank-search-wrap svg { left: 14px; width: 15px; height: 15px; }

.cat-flyout .bank-search-input {
    height: 42px;
    padding: 0 14px 0 40px;
    border-radius: 21px;
    font-size: 0.9rem;
    background: var(--fly-bg-2);
}

.bank-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.bank-alpha-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--f-text);
    font: 800 0.74rem 'Syne', sans-serif;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.bank-alpha-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ic) 18%, transparent); border-color: var(--ic); color: var(--ic); }
.bank-alpha-btn.is-current { background: var(--ic); border-color: var(--ic); color: #0e1a12; }
.bank-alpha-btn:disabled,
.bank-alpha-btn.is-hidden { opacity: 0.18; cursor: default; pointer-events: none; }

.bank-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bank-selected:empty { display: none; }

.bank-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 6px 0 4px;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--ic) 45%, transparent);
    background: color-mix(in srgb, var(--ic) 14%, transparent);
    color: var(--ic);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
}

.bank-chip img,
.bank-chip .bank-chip-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
}

.bank-chip .bank-chip-dot { background: color-mix(in srgb, var(--ic) 30%, transparent); }
.bank-chip-x { opacity: 0.7; font-size: 0.9rem; line-height: 1; padding: 0 2px; }
.bank-chip:hover .bank-chip-x { opacity: 1; }

.cat-flyout .bankol {
    column-width: auto;
    columns: auto;
    max-height: none;
    overflow: visible;
    padding: 4px 18px 18px;
}

.cat-flyout .bank-group {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px dashed var(--line-soft);
    break-inside: auto;
}

.cat-flyout .bank-group:last-child { border-bottom: 0; }
.cat-flyout .bank-group.is-hidden { display: none; }

.cat-flyout .bank-group-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    padding: 0;
    margin: 0;
    border: 0;
}

.cat-flyout .iniziale {
    width: 42px;
    height: 42px;
    font-size: 1.15rem;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--ic) 60%, transparent) !important;
    background: color-mix(in srgb, var(--ic) 12%, transparent) !important;
    color: var(--ic) !important;
}

.bank-group-count {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--f-muted);
}

.cat-flyout .bank-group-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
    align-content: start;
}

.cat-flyout .bnkchk {
    min-height: 42px;
    padding: 6px 10px 6px 26px !important;
    border-radius: 12px !important;
    font-size: 0.82rem !important;
}

.cat-flyout .bnkchk::before { left: 10px; width: 8px; height: 8px; }

.cat-flyout .bnkchk.bankunchecked {
    background: rgba(255, 255, 255, 0.025) !important;
    border-color: var(--line-soft) !important;
}

.cat-flyout .bnkchk.bankunchecked:hover {
    background: color-mix(in srgb, var(--ic) 9%, transparent) !important;
    border-color: color-mix(in srgb, var(--ic) 35%, transparent) !important;
    color: var(--f-text) !important;
}

.cat-flyout .bnkchk.bankchecked {
    background: color-mix(in srgb, var(--ic) 16%, transparent) !important;
    border-color: color-mix(in srgb, var(--ic) 60%, transparent) !important;
    color: #fff !important;
}

.cat-flyout .bnkchk.bankchecked::before {
    background: var(--ic);
    border-color: var(--ic);
    box-shadow: 0 0 6px color-mix(in srgb, var(--ic) 70%, transparent);
}

.cat-flyout .bank-logo {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
}

.cat-flyout .bank-logo-empty {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    color: var(--f-muted);
    font: 800 0.72rem 'Syne', sans-serif;
}

.cat-flyout .bank-no-results { padding: 30px 16px; }

/* ════════════════════════════════════════════════════════════
   FLAVORS — tab categorie + cerchi aroma
════════════════════════════════════════════════════════════ */
.cat-flyout .fly-body.flav-container {
    display: flex;
    flex-direction: row;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.cat-flyout .flav-tabs {
    width: 200px;
    flex: 0 0 200px;
    gap: 3px;
    padding: 12px 10px;
    overflow-y: auto;
    border-right: 1px solid var(--line-soft);
}

.cat-flyout .flav-tab {
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border-left: 3px solid transparent;
}

.cat-flyout .flav-tab:hover { background: rgba(255, 255, 255, 0.04); }

.cat-flyout .flav-tab-active {
    border-left-color: var(--cat-color);
    background: color-mix(in srgb, var(--cat-color) 12%, transparent);
}

.cat-flyout .flav-tab-emoji { font-size: 1.1rem; }
.cat-flyout .flav-tab-nome { font-size: 0.8rem; font-weight: 600; }
.cat-flyout .flav-tab-active .flav-tab-nome { color: #fff; }

.cat-flyout .flav-panels {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 18px 20px 22px;
}

.cat-flyout .flav-panel.flav-panel-active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 16px 10px;
}

.cat-flyout .flav-panel .flavor {
    width: auto !important;
    height: auto !important;
    padding: 0;
    margin: 0;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    filter: none;
    transform: none;
}

.cat-flyout .flav-panel .flavor:hover { transform: none; box-shadow: none; filter: none; }

.cat-flyout .flavor label {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 100%;
    cursor: pointer;
}

.flav-img {
    width: 66px;
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.2s ease, background 0.2s ease;
}

.cat-flyout .flav-img img {
    width: 76% !important;
    height: 76% !important;
    object-fit: contain;
    filter: grayscale(0.85);
    opacity: 0.7;
    transition: filter 0.2s ease, opacity 0.2s ease;
}

.flav-name {
    max-width: 100%;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    color: var(--f-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cat-flyout .flavor:hover .flav-img { border-color: var(--cat-color); transform: translateY(-2px); }
.cat-flyout .flavor:hover .flav-img img { filter: none; opacity: 1; }
.cat-flyout .flavor:hover .flav-name { color: var(--f-text); }

.cat-flyout .flavor.flavactive .flav-img {
    border-color: var(--cat-color);
    background: color-mix(in srgb, var(--cat-color) 16%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat-color) 22%, transparent), 0 0 18px color-mix(in srgb, var(--cat-color) 40%, transparent);
}

.cat-flyout .flavor.flavactive .flav-img img { filter: none; opacity: 1; }
.cat-flyout .flavor.flavactive .flav-name { color: #fff; }

.cat-flyout .flavor.flavactive label::after {
    content: '✓';
    position: absolute;
    top: -2px;
    left: calc(50% + 20px);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--cat-color);
    color: #0e1a12;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
}

/* ════════════════════════════════════════════════════════════
   MEDICAL — tab categorie + chip
════════════════════════════════════════════════════════════ */
.cat-flyout .fly-body.dis-wrapper {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.cat-flyout .dis-selected-bar.has-items { padding: 10px 18px; }
.cat-flyout .dis-tag { border-color: color-mix(in srgb, var(--ic) 45%, transparent); background: color-mix(in srgb, var(--ic) 14%, transparent); color: var(--ic); }

.cat-flyout .dis-container {
    flex: 1;
    min-height: 0;
}

.cat-flyout .dis-tabs {
    width: 210px;
    flex: 0 0 210px;
    padding: 12px 10px;
    gap: 3px;
    overflow-y: auto;
    border-right: 1px solid var(--line-soft);
}

.cat-flyout .dis-tab {
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
}

.cat-flyout .dis-tab:hover { background: rgba(255, 255, 255, 0.04); }
.cat-flyout .dis-tab-active { background: color-mix(in srgb, var(--cat-col) 12%, transparent); }
.cat-flyout .dis-tab-emoji { font-size: 1.1rem; }
.cat-flyout .dis-tab-nome { font-size: 0.74rem; }
.cat-flyout .dis-badge { top: 50%; right: 10px; transform: translateY(-50%); }

.cat-flyout .dis-panels {
    flex: 1;
    min-width: 0;
    max-height: none;
    overflow-y: auto;
    padding: 18px 20px 22px;
}

.cat-flyout .dis-panel.dis-panel-active {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}

.cat-flyout .dis-chip {
    width: auto !important;
    padding: 12px 6px 10px;
    border-radius: 14px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.025);
}

.cat-flyout .dis-chip-img { width: 44px !important; height: 44px !important; }
.cat-flyout .dis-chip-label { font-size: 0.66rem; }

/* ════════════════════════════════════════════════════════════
   EFFECTS — card icona + nome
════════════════════════════════════════════════════════════ */
.cat-flyout .fly-body.effdroppy {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 12px;
    height: auto;
    align-content: start;
    justify-content: stretch;
    padding: 18px 20px 22px;
}

.cat-flyout .effect {
    width: auto;
    height: auto;
    margin: 0;
    border-radius: 16px !important;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.025) !important;
    box-shadow: none !important;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.cat-flyout .effect:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--ic) 50%, transparent);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35) !important;
}

.cat-flyout .effect.effactive {
    border-color: var(--ic);
    background: color-mix(in srgb, var(--ic) 13%, transparent) !important;
    box-shadow: 0 0 0 1px var(--ic), 0 0 18px color-mix(in srgb, var(--ic) 30%, transparent) !important;
}

.cat-flyout .effect label {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px 12px;
    cursor: pointer;
}

.eff-img {
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cat-flyout .eff-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    opacity: 0.75;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.cat-flyout .effect:hover .eff-img img,
.cat-flyout .effect.effactive .eff-img img { opacity: 1; transform: scale(1.06); }

.eff-name {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    text-align: center;
    color: var(--f-muted);
}

.cat-flyout .effect.effactive .eff-name { color: #fff; }

.cat-flyout .effect.effactive label::after {
    content: '✓';
    position: absolute;
    top: 7px;
    right: 8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ic);
    color: #0e1a12;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
}

/* ════════════════════════════════════════════════════════════
   SEED PACK — pillole numero semi
════════════════════════════════════════════════════════════ */
.cat-flyout .fly-body.availa {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    align-content: flex-start;
    text-align: center;
    padding: 20px;
}

.cat-flyout .availacheck {
    width: auto !important;
    min-width: 88px;
    margin: 0 !important;
    padding: 12px 16px !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    border-radius: 16px !important;
    border: 1px solid var(--line-soft) !important;
    background: rgba(255, 255, 255, 0.025) !important;
    font-weight: normal;
}

.cat-flyout .availacheck:hover { border-color: color-mix(in srgb, var(--ic) 50%, transparent) !important; }

.cat-flyout .availacheck.avaactive {
    border-color: var(--ic) !important;
    background: color-mix(in srgb, var(--ic) 15%, transparent) !important;
    color: #fff !important;
    box-shadow: 0 0 16px color-mix(in srgb, var(--ic) 30%, transparent);
}

.ava-num { font: 800 1.5rem 'Syne', sans-serif; line-height: 1.1; }
.ava-unit { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.75; }
.cat-flyout .availacheck.avaactive .ava-num { color: var(--ic); }

.ava-price-note {
    display: none;
    width: 100%;
    margin: 6px 0 0;
    font-size: 0.75rem;
    text-align: left;
    color: var(--f-gold);
}

.cat-layout:has(#pricecheck:checked) .ava-price-note { display: block; }

/* ════════════════════════════════════════════════════════════
   GENETICS — card slider
════════════════════════════════════════════════════════════ */
.cat-flyout .fly-body.range-body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 20px;
}

.cat-flyout .range-card {
    width: auto !important;
    max-width: none !important;
    flex: none !important;
    padding: 20px 16px 16px !important;
    border-radius: 18px;
    border: 1px solid var(--line-soft);
    background: rgba(255, 255, 255, 0.02);
}

.cat-flyout .range-card .filter-header-row { margin-bottom: 14px !important; }

.range-ends {
    display: flex;
    justify-content: space-between;
    width: 90%;
    margin: 12px auto 0;
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--f-muted);
}

.range-hint {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 0.72rem;
    text-align: center;
    color: var(--f-muted);
}

/* ════════════════════════════════════════════════════════════
   < 900px — CASSETTO LATERALE
════════════════════════════════════════════════════════════ */
@media (max-width: 899.98px) {
    .cat-layout,
    .cat-layout.rail-expanded {
        --rail-w: 0px;
        grid-template-columns: minmax(0, 1fr);
    }

    .cat-rail {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(88vw, 360px);
        height: 100vh;
        height: 100dvh;
        z-index: 1100;
        border-right: 1px solid var(--line);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform 0.26s ease, visibility 0s linear 0.26s;
    }

    .cat-layout.drawer-open .cat-rail {
        transform: none;
        visibility: visible;
        transition: transform 0.26s ease;
    }

    .rail-head { padding: 14px 16px; border-bottom: 1px solid var(--line); }
    .rail-toggle { display: none; }
    .rail-drawer-close { display: flex; }
    .rail-scroll { padding: 12px 14px; }
    .cat-rail .rail-item { height: 52px !important; min-height: 52px; border-radius: 26px !important; padding-left: 4px !important; }
    .cat-rail .rail-item .rail-caret { margin-right: 16px; }
    .cat-rail .rail-item.filteractive { background: color-mix(in srgb, var(--ic) 9%, transparent) !important; }
    .cat-rail .drop-badge { left: 33px; top: 1px; }

    .rail-done {
        display: block;
        height: 48px;
        margin-top: 6px;
        border: 0;
        border-radius: 24px;
        background: var(--f-green);
        color: #0e1a12;
        font: 800 0.85rem 'DM Sans', sans-serif;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        cursor: pointer;
    }

    .cat-backdrop { top: 0; z-index: 1090; }

    .cat-toolbar {
        position: sticky;
        top: var(--header-h, 72px);
        justify-content: space-between;
        padding: 8px 12px;
    }

    .cat-filters-btn { display: inline-flex; }
    .cat-sort-label { display: none; }
    .cat-sort-btn { max-width: 44vw; }
    .cat-sort-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .cat-flyout {
        top: 0;
        left: 0;
        bottom: 0;
        width: min(88vw, 360px);
        max-height: none;
        height: 100vh;
        height: 100dvh;
        z-index: 1110;
        border-radius: 0;
        border-width: 0 1px 0 0;
        opacity: 1;
        transform: translateX(-102%);
        transition: transform 0.24s ease, visibility 0s linear 0.24s;
    }

    .cat-flyout.is-open { transform: none; transition: transform 0.24s ease; }

    .fly-head { padding: 12px 12px 12px 10px; gap: 8px; }
    .fly-back { display: flex; }
    .fly-close { display: none; }
    .fly-ico { width: 32px; height: 32px; flex-basis: 32px; }
    .fly-title { font-size: 0.9rem; }

    .cat-flyout .fly-body { padding: 14px; }

    /* seedbanks */
    .bank-tools { padding: 12px 14px 10px; }
    .bank-alpha { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .bank-alpha::-webkit-scrollbar { display: none; }
    .bank-alpha-btn { flex: 0 0 30px; }
    .cat-flyout .bankol { padding: 4px 14px 16px; }
    .cat-flyout .bank-group { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
    .cat-flyout .iniziale { width: 34px; height: 34px; font-size: 0.95rem; }
    .cat-flyout .bank-group-chips { grid-template-columns: minmax(0, 1fr); }

    /* flavors / medical: tab in orizzontale scorrevole */
    .cat-flyout .fly-body.flav-container,
    .cat-flyout .dis-container { flex-direction: column; }

    .cat-flyout .flav-tabs,
    .cat-flyout .dis-tabs {
        width: 100%;
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 10px;
        border-right: 0;
        border-bottom: 1px solid var(--line-soft);
        scrollbar-width: none;
    }

    .cat-flyout .flav-tab,
    .cat-flyout .dis-tab {
        flex: 0 0 auto;
        min-width: 0;
        flex-direction: row;
        padding: 8px 12px;
        border-left: 0;
        border-bottom: 2px solid transparent;
        border-radius: 18px;
        white-space: nowrap;
    }

    .cat-flyout .flav-tab-active { border-bottom-color: transparent; box-shadow: inset 0 0 0 1.5px var(--cat-color); }
    .cat-flyout .dis-tab-active { border-bottom-color: transparent; box-shadow: inset 0 0 0 1.5px var(--cat-col); }
    .cat-flyout .dis-tab-nome { font-size: 0.68rem; }
    .cat-flyout .dis-badge { position: static; transform: none; }

    .cat-flyout .flav-panels,
    .cat-flyout .dis-panels { padding: 14px; }

    .cat-flyout .flav-panel.flav-panel-active { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cat-flyout .dis-panel.dis-panel-active { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cat-flyout .dis-chip { width: auto !important; }

    .cat-flyout .fly-body.effdroppy { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 14px; }
    .eff-img { width: 44px; height: 44px; }

    .cat-flyout .availacheck { min-width: calc(33.333% - 7px); }

    .cat-flyout .fly-body.range-body { grid-template-columns: minmax(0, 1fr); padding: 14px; }
}
