/* ==========================================================================
   Public WhatsApp Floating Tray & Back to Top Stylesheet
   ========================================================================== */

.floating-sticky-tray {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 7px;
    border-radius: 36px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.tray-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease, background 0.3s ease;
}

.tray-action-btn:hover {
    transform: scale(1.12);
    text-decoration: none;
}

a#top.tray-top-btn {
    background: linear-gradient(135deg, var(--primary-font-color, #ff8e64), #f27242);
    color: var(--extra-font-color, #ffffff) !important;
    box-shadow: 0 4px 14px rgba(255, 142, 100, 0.42);
    border: none;
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), height 0.3s ease, margin 0.3s ease, background 0.3s ease, box-shadow 0.3s ease !important;
}

a#top.tray-top-btn:hover {
    background: var(--secondary-font-color, #333333) !important;
    box-shadow: 0 6px 18px rgba(51, 51, 51, 0.4);
    color: var(--extra-font-color, #ffffff) !important;
}

a#top.tray-top-btn.opacity-0.invisible {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: scale(0.5) translateY(10px) !important;
    height: 0 !important;
    width: 48px !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
}

a#top.tray-top-btn.opacity-100.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1) translateY(0) !important;
    height: 48px !important;
    width: 48px !important;
    pointer-events: auto !important;
}

.tray-icon {
    font-size: 20px;
    color: #ffffff;
    line-height: 1;
    transition: transform 0.2s ease;
}

a#top.tray-top-btn:hover .tray-icon {
    transform: translateY(-2px);
}

.tray-whatsapp-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}

.tray-whatsapp-btn:hover {
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.65);
    color: #ffffff !important;
}

.tray-whatsapp-svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    transition: transform 0.3s ease;
}

.tray-whatsapp-btn:hover .tray-whatsapp-svg {
    transform: scale(1.06) rotate(-4deg);
}

.whatsapp-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #25D366;
    top: 0;
    left: 0;
    animation: tray-wa-pulse 2.2s infinite ease-out;
    pointer-events: none;
    opacity: 0;
}

@keyframes tray-wa-pulse {
    0% {
        transform: scale(1);
        opacity: 0.85;
    }
    50% {
        opacity: 0.35;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.tray-tooltip {
    position: absolute;
    right: 60px;
    background: #1e293b;
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: all 0.22s ease;
    pointer-events: none;
}

.tray-tooltip::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -5px;
    transform: translateY(-50%);
    border-width: 5px 0 5px 6px;
    border-style: solid;
    border-color: transparent transparent transparent #1e293b;
}

.tray-action-btn:hover .tray-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

@media (max-width: 768px) {
    .floating-sticky-tray {
        bottom: 75px;
        right: 14px;
        padding: 5px;
        gap: 8px;
        border-radius: 30px;
    }

    .tray-action-btn {
        width: 44px;
        height: 44px;
    }

    a#top.tray-top-btn.opacity-100.visible {
        height: 44px !important;
        width: 44px !important;
    }

    .tray-whatsapp-svg {
        width: 24px;
        height: 24px;
    }

    .tray-icon {
        font-size: 18px;
    }

    .tray-tooltip {
        display: none;
    }
}
