/* --------------------------------------
   1. STILE BASE (Desktop + Mobile non-sticky)
   -------------------------------------- */

/* Di base nascondiamo la barra sticky (su desktop non serve) */
.custom-share-bar.lss-mobile-sticky {
    display: none !important;
}

.custom-share-bar {
    display: flex;
    align-items: center;
    /*justify-content: center;*/
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0px;
    /* background-color: #f8f9fa; 
    border-top: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;*/
    margin: 20px 0;
}

/* Fix allineamento verticale testo */
.custom-share-bar .share-label {
    font-weight: normal;
    text-transform: uppercase;
    font-size: 15px;
    color: #000;
    margin: 0 10px 0 0;
    line-height: 1; /* Previene disallineamenti */
    display: flex;
    align-items: center;
}

/* Normalizzazione aggressiva per Button e Link */
.custom-share-bar .share-btn,
.custom-share-bar a.share-btn,
.custom-share-bar button.share-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    color: #ffffff !important; 
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer;
    text-decoration: none !important;
    padding: 0 !important; 
    margin: 0 !important;
    box-sizing: border-box !important; 
    background-image: none !important;
    line-height: 0 !important;
}

.custom-share-bar .share-btn:hover {
    opacity: 0.8;
}

/* Uccide i margini dei paragrafi inseriti da WordPress dentro la barra */
.custom-share-bar p {
    margin: 0 !important;
    padding: 0 !important;
    display: contents !important;
}

/* Forza la dimensione e l'allineamento delle icone interne */
.custom-share-bar .share-btn svg {
    width: 20px !important;
    height: 20px !important;
    pointer-events: none;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

/* Colori network */
.share-fb { background-color: #1877F2 !important; }
.share-pi { background-color: #BD081C !important; }
.share-wa { background-color: #25D366 !important; }
.share-tg { background-color: #0088CC !important; }
.share-email { background-color: #848484 !important; }
.share-print { background-color: #4a4a4a !important; }
.share-sms { background-color: #ff9800 !important; }

/* Adattamento base per mobile (Quando la sticky è DISATTIVATA) */
@media (max-width: 768px) {
    .custom-share-bar {
        padding: 10px 0px;
    }
    .share-label {
        width: 100%;
        text-align: center;
        margin-right: 0;
        margin-bottom: 15px;
    }
}

@media (max-width: 768px) {

    /* Nascondiamo la barra inline su mobile SOLO SE c'è la classe dinamica della sticky */
    .custom-share-bar.lss-desktop-inline.lss-hide-on-mobile {
        display: none !important;
    }
    
    /* Questa regola ora agisce sulla barra spostata in fondo al body */
    .custom-share-bar.lss-mobile-sticky {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 32px !important;
        z-index: 2147483647 !important;
        
        display: flex !important;
        flex-direction: row !important;
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
        background-color: #fff !important;
        border: none !important;
        border-radius: 0 !important;
        
        /* Forza l'hardware acceleration per stare sopra a tutto */
        transform: translateZ(0) !important;
        will-change: transform;

        transition: opacity 0.4s ease, visibility 0.4s ease !important;
        opacity: 1;
    }

    .lss-is-hidden {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .custom-share-bar.lss-mobile-sticky .share-btn {
        flex: 1 1 0% !important;
        height: 32px !important;
        border-radius: 0 !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        /*justify-content: center !important;*/
    }

    .custom-share-bar.lss-mobile-sticky .share-btn svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    /* Nascondi etichetta */
    .custom-share-bar.lss-mobile-sticky .share-label {
        display: none !important;
    }
}
