/* Icone allergeni sotto la descrizione */
.bionfc-allergeni-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 0;
    align-items: center;
}

.allergene-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.allergene-img {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
    filter: grayscale(100%) brightness(0.5);
    opacity: 0.7;
}

/* Popup allergeni */
.allergeni-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.allergeni-popup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.allergeni-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupFadeIn 0.3s ease-out;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.allergeni-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.allergeni-popup-close:hover {
    background: #f5f5f5;
    color: #333;
}

.allergeni-popup-content h3 {
    margin: 0 0 20px 0;
    font-size: 24px;
    color: #333;
    font-weight: 600;
}

#allergeni-popup-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.allergene-popup-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
    text-align: center;
    transition: all 0.2s;
}

.allergene-popup-item:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.allergene-popup-item img {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    object-fit: contain;
}

.allergene-popup-item span {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* Mobile responsive - STESSO SPACING */
@media (max-width: 768px) {
    /* Mantieni stessi margini e gap */
    .bionfc-allergeni-icons {
        gap: 8px;
        margin-top: 10px;
    }
    
    /* Stessa dimensione icone */
    .allergene-img {
        width: 20px;
        height: 20px;
    }
    
    /* Solo popup più piccolo */
    .allergeni-popup-content {
        width: 95%;
        padding: 20px;
    }
    
    #allergeni-popup-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
}
