/* Chico Floating Buttons v1.2.0 */

#cfb-wrap {
    position: fixed;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Posições desktop ── */
#cfb-wrap.cfb-pos-bottom-left  { bottom: 24px; left: 24px; flex-direction: row; }
#cfb-wrap.cfb-pos-bottom-right { bottom: 24px; right: 24px; flex-direction: row-reverse; }
#cfb-wrap.cfb-pos-top-left     { top: 24px; left: 24px; flex-direction: row; }
#cfb-wrap.cfb-pos-top-right    { top: 24px; right: 24px; flex-direction: row-reverse; }

/* ── Botão base ── */
.cfb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.35);
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
    flex-shrink: 0;
}

.cfb-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,.42);
    text-decoration: none;
    z-index: 1;
}

#cfb-whatsapp { background: #25D366; color: #fff; }
#cfb-tiktok   { background: #010101; color: #fff; }
.cfb-toggle   { background: #444;    color: #fff; }

/* ── Pulso WhatsApp ── */
@keyframes cfb-pulse {
    0%   { box-shadow: 0 0 0 0    rgba(37,211,102,.6); }
    70%  { box-shadow: 0 0 0 10px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0    rgba(37,211,102,0); }
}
#cfb-whatsapp { animation: cfb-pulse 2.5s infinite; }
#cfb-whatsapp:hover { animation: none; box-shadow: 0 6px 20px rgba(0,0,0,.42); }

/* ── Tooltip ── */
.cfb-btn[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,.72);
    color: #fff;
    font-size: 12px;
    font-family: sans-serif;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 99999;
}

#cfb-wrap.cfb-pos-bottom-left  .cfb-btn[data-tooltip]::after,
#cfb-wrap.cfb-pos-top-left     .cfb-btn[data-tooltip]::after { left:  calc(100% + 10px); }

#cfb-wrap.cfb-pos-bottom-right .cfb-btn[data-tooltip]::after,
#cfb-wrap.cfb-pos-top-right    .cfb-btn[data-tooltip]::after { right: calc(100% + 10px); }

.cfb-btn:hover[data-tooltip]::after { opacity: 1; }

/* ══════════════════════════════════════════
   DESKTOP: toggle nunca aparece
══════════════════════════════════════════ */
@media (min-width: 769px) {
    #cfb-toggle { display: none !important; }
    .cfb-child  { opacity: 1 !important; pointer-events: auto !important; transform: none !important; }
}

/* ══════════════════════════════════════════
   MOBILE
══════════════════════════════════════════ */
@media (max-width: 768px) {

    /* Posições mobile */
    #cfb-wrap.cfb-mobile-bottom-left  { bottom: 14px !important; left: 16px !important;  top: auto !important; right: auto !important; flex-direction: row; }
    #cfb-wrap.cfb-mobile-bottom-right { bottom: 14px !important; right: 16px !important; top: auto !important; left: auto !important;  flex-direction: row-reverse; }
    #cfb-wrap.cfb-mobile-top-left     { top: 14px !important;    left: 16px !important;  bottom: auto !important; right: auto !important; flex-direction: row; }
    #cfb-wrap.cfb-mobile-top-right    { top: 14px !important;    right: 16px !important; bottom: auto !important; left: auto !important;  flex-direction: row-reverse; }

    .cfb-btn { width: 50px; height: 50px; }

    /* Modo lado a lado no mobile: sempre visíveis */
    #cfb-wrap[data-mode="sidebyside"] .cfb-child {
        opacity: 1;
        pointer-events: auto;
        transform: none;
    }
    #cfb-wrap[data-mode="sidebyside"] #cfb-toggle { display: none !important; }

    /* Modo expansível no mobile */
    #cfb-wrap[data-mode="expandable"] .cfb-child {
        opacity: 0;
        pointer-events: none;
        transform: scale(.7);
        transition: opacity .2s ease, transform .2s ease;
    }
    #cfb-wrap[data-mode="expandable"].cfb-open .cfb-child {
        opacity: 1;
        pointer-events: auto;
        transform: scale(1);
    }
    #cfb-wrap[data-mode="expandable"].cfb-open #cfb-whatsapp { transition-delay: .04s; }
    #cfb-wrap[data-mode="expandable"].cfb-open #cfb-tiktok   { transition-delay: .08s; }
    #cfb-wrap[data-mode="expandable"] #cfb-toggle             { display: flex !important; }
    #cfb-wrap[data-mode="expandable"].cfb-open #cfb-toggle    { background: #555; }

    /* Tooltip no mobile: posição baseada na classe mobile */
    #cfb-wrap.cfb-mobile-bottom-left  .cfb-btn[data-tooltip]::after,
    #cfb-wrap.cfb-mobile-top-left     .cfb-btn[data-tooltip]::after { left:  calc(100% + 8px); right: auto; }
    #cfb-wrap.cfb-mobile-bottom-right .cfb-btn[data-tooltip]::after,
    #cfb-wrap.cfb-mobile-top-right    .cfb-btn[data-tooltip]::after { right: calc(100% + 8px); left: auto; }
}
