:root {
    --k3-fab-bg: #4a4a4a;
    --k3-fab-hover: #f78119;
    --k3-fab-text: #ffffff;
    --k3-fab-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.k3-overlay-fab {
    position: fixed;
    right: 8px;
    bottom: calc(7% + 72px);
    width: 88px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
}

.k3-fab-list {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}

.k3-fab-btn {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.92);
    background: var(--k3-fab-bg);
    color: var(--k3-fab-text);
    box-shadow: var(--k3-fab-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    pointer-events: auto;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.k3-fab-btn:hover,
.k3-fab-btn:focus-visible {
    background: var(--k3-fab-hover);
    color: var(--k3-fab-text);
    transform: translateX(-2px);
    outline: none;
}

.k3-fab-btn svg {
    width: 24px;
    height: 24px;
    display: block;
    fill: currentColor;
}

.k3-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #ea4b24;
    color: #ffffff;
    font-size: 11px;
    line-height: 20px;
    text-align: center;
    font-weight: 700;
    padding: 0 4px;
    display: none;
}

.k3-fab-badge.is-visible {
    display: block;
}

.k3-fab-login.is-authenticated {
    border-color: #f2c084;
}

.k3-fab-user-state {
    position: absolute;
    right: -4px;
    bottom: -4px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: #0e8a6f;
    color: #fff;
    font-size: 10px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
    padding: 0 3px;
    border: 2px solid #fff;
}

.k3-fab-toggle {
    margin-top: 2px;
}

.k3-fab-toggle svg {
    transition: transform 0.2s ease;
}

.k3-overlay-fab.is-collapsed .k3-fab-list {
    opacity: 0;
    transform: translateX(14px);
    pointer-events: none;
}

.k3-overlay-fab.is-collapsed .k3-fab-toggle svg {
    transform: rotate(180deg);
}

body #scroll-top {
    z-index: 10020;
}

body:not(.rtl) #scroll-top.show {
    right: calc(1.5rem + 64px);
}

body.rtl #scroll-top.show {
    left: calc(1.5rem + 64px);
}

@media (max-width: 1024px) {
    .k3-overlay-fab {
        bottom: 120px;
        right: 10px;
        width: 74px;
    }

    body:not(.rtl) #scroll-top.show {
        right: calc(1rem + 62px);
    }

    body.rtl #scroll-top.show {
        left: calc(1rem + 62px);
    }

    .k3-fab-btn {
        width: 50px;
        height: 50px;
    }

    .k3-fab-btn svg {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 640px) {
    .k3-overlay-fab {
        bottom: 92px;
        right: 8px;
    }

    body:not(.rtl) .mobile-icon-bar #scroll-top {
        margin-right: 60px;
    }

    body.rtl .mobile-icon-bar #scroll-top {
        margin-left: 60px;
    }

    .k3-fab-list {
        gap: 8px;
    }
}
