/* =====================================================
   SCROLL TO TOP BUTTON
   AVM NETWORKS LIMITED
   PURPOSE: UI ONLY (NO LOGIC)
===================================================== */

.top-to-bottom {
    position: fixed;
    right: 28px;
    bottom: 28px;

    width: 64px;
    height: 64px;

    border-radius: 14px;
    border: none;

    background: #0B3A6E;
    color: #ffffff;

    font-size: 28px;
    font-weight: 700;

    /* IMPORTANT: display:none REMOVED (was breaking JS visibility) */
    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    /* STACKING (below chatbot, above footer) */
    z-index: 9000;
    isolation: isolate;

    box-shadow: 0 16px 40px rgba(11, 58, 110, 0.45);

    transition:
        background 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease,
        bottom 0.3s ease,
        opacity .25s ease;

    /* Hidden by default (correct modern method) */
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

.top-to-bottom:hover {
    background: #084298;
    transform: translateY(-6px);
}

.top-to-bottom:active {
    transform: scale(0.95);
}

/* ================= CHATBOT OPEN ADJUST ================= */
/* chatbot.js already toggles #chatbotBox.active */

#chatbotBox.active ~ .top-to-bottom,
body.chatbot-open .top-to-bottom {
    bottom: 160px; /* chatbot ke upar shift */
}

/* ================= MOBILE ================= */

@media (max-width: 768px) {
    .top-to-bottom {
        width: 56px;
        height: 56px;
        font-size: 24px;
        right: 20px;
        bottom: 20px;
    }

    #chatbotBox.active ~ .top-to-bottom,
    body.chatbot-open .top-to-bottom {
        bottom: 140px;
    }
}

/* ===== VISIBLE STATE (JS ADDS .visible) ===== */

.top-to-bottom.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
