/* ── Pulsanti flottanti unificati (iubenda privacy + widget accessibilità) ──
   Un unico pulsante sostituisce i due float in basso a sinistra e apre un
   piccolo menu con le due azioni. Gli originali restano nel DOM (nascosti)
   così i loro handler continuano a funzionare al click. */

html body button.iubenda-tp-btn.iubenda-cs-preferences-link,
html body .iubenda-floatable-aw-btn,
html body .floatable-wrapper[class*="iub-floatable-wrapper-aw"] {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#cm-floater-trigger {
    position: fixed;
    left: 16px;
    bottom: 16px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #d9d9d9;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2147483646;
    color: #1a1a1a;
    padding: 0;
    transition: box-shadow 0.15s, transform 0.15s;
}

#cm-floater-trigger:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}

#cm-floater-trigger:focus-visible {
    outline: 2px solid #1a7a1a;
    outline-offset: 2px;
}

#cm-floater-trigger svg {
    width: 20px;
    height: 20px;
    display: block;
}

#cm-floater-popover {
    position: fixed;
    left: 16px;
    bottom: 62px;
    min-width: 230px;
    z-index: 2147483647;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
    padding: 6px;
    display: none;
}

#cm-floater-popover.cm-open {
    display: block;
}

#cm-floater-popover button {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    border: 0;
    background: none;
    padding: 11px 12px;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    color: #1a1a1a;
}

#cm-floater-popover button:hover {
    background: #f4f4f4;
}

#cm-floater-popover button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: #4a4a4a;
}

@media (max-width: 480px) {
    #cm-floater-trigger {
        left: 12px;
        bottom: 12px;
    }
    #cm-floater-popover {
        left: 12px;
        right: 12px;
        bottom: 58px;
        min-width: 0;
    }
}

/* ── Checkout: il wizard ha la barra sticky dei pulsanti in fondo
   (#clg-wizard-nav, bottone "Continua"). Il pulsante flottante si alza sopra
   la barra per non sovrapporsi: desktop nav fino a ~93px dal basso, mobile
   fino a ~58px. Popover spostato di conseguenza. */
body.woocommerce-checkout #cm-floater-trigger {
    bottom: 108px;
}
body.woocommerce-checkout #cm-floater-popover {
    bottom: 156px;
}
@media (max-width: 600px) {
    body.woocommerce-checkout #cm-floater-trigger {
        bottom: 78px;
    }
    body.woocommerce-checkout #cm-floater-popover {
        bottom: 126px;
    }
}
