.wfb-floating-buttons {
    --wfb-bg: #1a1a1a;
    --wfb-bg-hover: #000;
    --wfb-color: #fff;
    --wfb-size: 40px;
    --wfb-radius: 8px;
    --wfb-expand: 176px;
    --wfb-icon-size: 14px;
    --wfb-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
    --wfb-gap: 0.5rem;
    --wfb-z: 9800;
    --wfb-ease: cubic-bezier(0.4, 0, 0.2, 1);

    display: none;
    position: fixed;
    top: 50%;
    right: 1rem;
    z-index: var(--wfb-z);
    transform: translateY(-50%);
    pointer-events: none;
}

.wfb-floating-buttons__list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--wfb-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.wfb-floating-buttons__item {
    margin: 0;
    padding: 0;
}

.wfb-floating-buttons__link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--wfb-size);
    min-width: var(--wfb-size);
    max-width: var(--wfb-size);
    overflow: hidden;
    border-radius: var(--wfb-radius);
    background: var(--wfb-bg);
    color: var(--wfb-color);
    text-decoration: none;
    box-shadow: var(--wfb-shadow);
    pointer-events: auto;
    transition:
        max-width 0.5s var(--wfb-ease),
        background-color 0.4s var(--wfb-ease),
        box-shadow 0.4s var(--wfb-ease),
        color 0.4s var(--wfb-ease);
}

.wfb-floating-buttons__link:hover,
.wfb-floating-buttons__link:focus-visible {
    max-width: var(--wfb-expand);
    background: var(--wfb-bg-hover);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    outline: none;
}

.wfb-floating-buttons__icon {
    display: inline-flex;
    flex: 0 0 var(--wfb-size);
    align-items: center;
    justify-content: center;
    width: var(--wfb-size);
    height: var(--wfb-size);
    font-size: var(--wfb-icon-size);
}

.wfb-floating-buttons__label {
    flex: 1 1 auto;
    padding-right: calc(var(--wfb-size) * 0.22);
    font-family: var(--wfb-font-family, inherit);
    font-size: var(--wfb-font-size, inherit);
    font-weight: var(--wfb-font-weight, inherit);
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(-0.35rem);
    transition:
        opacity 0.45s var(--wfb-ease) 0.04s,
        transform 0.45s var(--wfb-ease) 0.04s;
}

.wfb-floating-buttons--theme-font .wfb-floating-buttons__label {
    font: inherit;
    font-weight: inherit;
}

.wfb-floating-buttons__link:hover .wfb-floating-buttons__label,
.wfb-floating-buttons__link:focus-visible .wfb-floating-buttons__label {
    opacity: 1;
    transform: translateX(0);
}

@media (min-width: 768px) {
    .wfb-floating-buttons.wfb-floating-buttons--show-desktop {
        display: block;
    }

    .wfb-floating-buttons__item {
        display: none;
    }

    .wfb-floating-buttons.wfb-floating-buttons--show-desktop .wfb-floating-buttons__item--show-desktop {
        display: block;
    }
}

@media (max-width: 767px) {
    body.wfb-has-buttons {
        padding-bottom: var(--wfb-mobile-offset, 4.5rem);
    }

    .wfb-floating-buttons.wfb-floating-buttons--show-mobile {
        display: block;
    }

    .wfb-floating-buttons {
        --wfb-mobile-font-size: 0.5625rem;

        inset: auto 0 0;
        top: auto;
        right: auto;
        left: 0;
        width: 100%;
        transform: none;
        box-sizing: border-box;
        padding: 0 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0));
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .wfb-floating-buttons__list {
        flex-direction: row;
        align-items: stretch;
        justify-content: stretch;
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: max(var(--wfb-radius), 12px);
        background: var(--wfb-bg);
        color: var(--wfb-color);
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16);
        filter: none;
    }

    .wfb-floating-buttons__item {
        flex: 1 1 0;
        min-width: 0;
        display: none;
        margin: 0;
        padding: 0;
        position: relative;
    }

    .wfb-floating-buttons.wfb-floating-buttons--show-mobile .wfb-floating-buttons__item--show-mobile {
        display: flex;
    }

    .wfb-floating-buttons__item--show-mobile + .wfb-floating-buttons__item--show-mobile::before {
        content: '';
        position: absolute;
        top: 0.625rem;
        bottom: 0.625rem;
        left: 0;
        width: 1px;
        background: rgba(255, 255, 255, 0.22);
        background: color-mix(in srgb, var(--wfb-color) 22%, transparent);
        pointer-events: none;
        z-index: 1;
    }

    .wfb-floating-buttons__link {
        flex: 1 1 auto;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        max-width: none;
        margin: 0;
        padding: 0.5rem 0.375rem;
        background: var(--wfb-bg);
        color: var(--wfb-color);
        border: 0;
        border-radius: 0;
        box-shadow: none;
        gap: 0.2rem;
    }

    .wfb-floating-buttons__link:hover,
    .wfb-floating-buttons__link:focus-visible,
    .wfb-floating-buttons__link:active {
        max-width: none;
        background: var(--wfb-bg-hover);
        color: var(--wfb-color);
        box-shadow: none;
    }

    .wfb-floating-buttons__icon {
        display: flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: auto;
        height: auto;
        font-size: var(--wfb-icon-size);
        line-height: 1;
    }

    .wfb-floating-buttons__icon i {
        display: block;
        line-height: 1;
    }

    .wfb-floating-buttons__icon i::before {
        display: block;
        line-height: 1;
    }

    .wfb-floating-buttons .wfb-floating-buttons__label {
        display: block;
        padding: 0 0.125rem;
        margin: 0;
        font-size: var(--wfb-mobile-font-size);
        font-weight: var(--wfb-font-weight, 500);
        line-height: 1;
        text-align: center;
        white-space: normal;
        opacity: 1;
        transform: none;
        transition: none;
    }

    .wfb-floating-buttons.wfb-floating-buttons--theme-font .wfb-floating-buttons__label {
        font-family: inherit;
        font-size: var(--wfb-mobile-font-size);
        font-weight: inherit;
        line-height: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wfb-floating-buttons__link,
    .wfb-floating-buttons__label {
        transition: none;
    }
}
