/* ============================================================
   VOAllergenIcons — CSS per avatar, chip e pill allergeni
   Usato in: Allergeni, Dispensa, Builder, Preview
   ============================================================ */

/* ── Avatar base ── */
.vo-ai {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1.5px solid;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.vo-ai:hover {
    transform: scale(1.06);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}
.vo-ai svg {
    display: block;
    flex-shrink: 0;
    filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.35));
}

/* Sizes */
.vo-ai--sm {
    width: 24px;
    height: 24px;
    border-radius: 7px;
}
.vo-ai--sm svg {
    width: 14px;
    height: 14px;
}

.vo-ai--md {
    width: 32px;
    height: 32px;
    border-radius: 9px;
}
.vo-ai--md svg {
    width: 18px;
    height: 18px;
}

.vo-ai--lg {
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 13px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
}
.vo-ai--lg svg {
    width: 24px;
    height: 24px;
}

.vo-ai--xl {
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 15px;
    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.09);
}
.vo-ai--xl svg {
    width: 28px;
    height: 28px;
}

/* Fallback letter */
.vo-ai-letter {
    font-weight: 800;
    font-size: 0.65em;
    letter-spacing: -0.02em;
    line-height: 1;
    text-transform: uppercase;
}
.vo-ai--sm .vo-ai-letter { font-size: 0.68rem; }
.vo-ai--md .vo-ai-letter { font-size: 0.82rem; }
.vo-ai--lg .vo-ai-letter { font-size: 1rem; }
.vo-ai--xl .vo-ai-letter { font-size: 1.15rem; }

/* ── Chip (icon + full name) ── */
.vo-ai-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.55rem 0.2rem 0.2rem;
    border-radius: 999px;
    border: 1px solid;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    transition: background 0.12s, border-color 0.12s;
}
.vo-ai-chip .vo-ai {
    border: none;
    width: 22px;
    height: 22px;
    border-radius: 6px;
}
.vo-ai-chip .vo-ai svg {
    width: 13px;
    height: 13px;
}
.vo-ai-chip .vo-ai-letter {
    font-size: 0.62rem;
}
.vo-ai-chip-label {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Pill (compact, for table cells) ── */
.vo-ai-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.12rem 0.4rem 0.12rem 0.12rem;
    border-radius: 6px;
    border: 1px solid;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    max-width: 7rem;
}
.vo-ai-pill .vo-ai {
    border: none;
    width: 18px;
    height: 18px;
    border-radius: 5px;
}
.vo-ai-pill .vo-ai svg {
    width: 11px;
    height: 11px;
}
.vo-ai-pill .vo-ai-letter {
    font-size: 0.55rem;
}
.vo-ai-pill-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Allergen toggle button (Builder manual allergens) ── */
.vo-ai-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.55rem 0.25rem 0.25rem;
    border-radius: 0.5rem;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.3;
}
.vo-ai-toggle:hover {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}
.vo-ai-toggle.active {
    border-color: #b91c1c;
    background: #b91c1c;
    color: #fff;
}
.vo-ai-toggle.active .vo-ai {
    background: rgba(255,255,255,0.2) !important;
    border-color: rgba(255,255,255,0.3) !important;
    color: #fff !important;
}
.vo-ai-toggle--manual {
    border-style: dashed;
    border-width: 2px;
}
.vo-ai-toggle--manual.active {
    border-style: solid;
}

/* ── Auto-derived allergen card (Builder) ── */
.vo-ai-derived {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.5rem;
    border: 1px solid;
    font-size: 0.78rem;
    line-height: 1.35;
    margin: 0 0.35rem 0.5rem 0;
    max-width: 100%;
}
.vo-ai-derived .vo-ai {
    margin-top: 0.1rem;
    flex-shrink: 0;
}
.vo-ai-derived-body strong {
    font-weight: 700;
    display: block;
}
.vo-ai-derived-body .vo-ai-derived-src {
    font-size: 0.68rem;
    color: #475569;
    font-weight: 400;
    margin-top: 0.1rem;
}
