/* Tombol melayang pojok bawah — tombol tambahan (WhatsApp, Instagram, …) +
   tombol "Kembali ke atas". Diatur di Setting → Tombol Melayang
   (App\Helpers\ToTopSettings::cssVars()/buttonVars()); markup di
   partials/_floating-buttons.blade.php. Tombol ke atas tampil lewat class
   .is-visible (public/myScript.js). */
.ft-fab {
    position: fixed; bottom: 24px; z-index: 999;
    display: flex; align-items: center; gap: 10px;
}
.ft-fab-right { right: 24px; }
.ft-fab-left  { left: 24px; }
/* Vertikal: tombol tambahan di atas, tombol ke atas paling bawah */
.ft-fab-vertical { flex-direction: column; }
/* Horizontal: tombol ke atas paling dekat ke pojok */
.ft-fab-horizontal.ft-fab-right { flex-direction: row; }
.ft-fab-horizontal.ft-fab-left  { flex-direction: row-reverse; }

.ft-fab-btn, .ft-totop {
    position: relative;
    width: var(--tt-size, 48px); height: var(--tt-size, 48px);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    padding: 0; border: 0; border-radius: var(--tt-radius, 999px);
    font-size: var(--tt-icon, 19px); line-height: 1; cursor: pointer; text-decoration: none;
    transition: transform .2s ease, background-color .2s, color .2s, filter .2s, box-shadow .2s;
}
.ft-fab-btn .bi, .ft-totop .bi { line-height: 1; }

/* Tombol tambahan — warna per tombol, hover sedikit lebih gelap */
.ft-fab-btn {
    background: var(--fb-bg, #475467); color: var(--fb-color, #fff);
    box-shadow: 0 6px 18px -4px var(--fb-shadow, rgba(0, 0, 0, .3));
}
.ft-fab-btn:hover, .ft-fab-btn:focus-visible { color: var(--fb-color, #fff); filter: brightness(.9); transform: translateY(-3px); }

/* Tombol ke atas */
.ft-totop {
    display: none;
    background: var(--tt-bg, #2563eb); color: var(--tt-color, #fff);
    box-shadow: 0 6px 18px -4px var(--tt-shadow, rgba(37, 99, 235, .4));
}
.ft-totop.is-visible { display: flex; animation: ft-fab-in .25s ease-out; }
.ft-totop:hover { background: var(--tt-hover-bg, #1d4ed8); color: var(--tt-hover-color, #fff); transform: translateY(-3px); }

.ft-fab-btn:focus-visible, .ft-totop:focus-visible { outline: 3px solid var(--tt-hover-bg, #1d4ed8); outline-offset: 3px; }

/* Label kecil di samping tombol saat hover (desktop, susunan vertikal) */
@media (hover: hover) and (min-width: 768px) {
    .ft-fab-vertical .ft-fab-btn::after, .ft-fab-vertical .ft-totop::after {
        content: attr(data-label);
        position: absolute; top: 50%; transform: translateY(-50%) translateX(6px);
        padding: 5px 10px; border-radius: 6px; background: #101828; color: #fff;
        font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none;
        opacity: 0; transition: opacity .15s, transform .15s;
    }
    .ft-fab-right.ft-fab-vertical .ft-fab-btn::after, .ft-fab-right.ft-fab-vertical .ft-totop::after { right: calc(100% + 10px); }
    .ft-fab-left.ft-fab-vertical .ft-fab-btn::after, .ft-fab-left.ft-fab-vertical .ft-totop::after { left: calc(100% + 10px); transform: translateY(-50%) translateX(-6px); }
    .ft-fab-vertical .ft-fab-btn:hover::after, .ft-fab-vertical .ft-totop:hover::after { opacity: 1; transform: translateY(-50%); }
}

@keyframes ft-fab-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 575.98px) {
    .ft-fab { bottom: 16px; gap: 8px; }
    .ft-fab-right { right: 16px; }
    .ft-fab-left  { left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .ft-totop.is-visible { animation: none; }
    .ft-fab-btn:hover, .ft-totop:hover { transform: none; }
}
