/* ═══════════════════════════════════════════════════════
   COMPONENTS — Tawk/LiveChat Button
   Extracted from layout_desktop.php & layout_mobile.php
   ═══════════════════════════════════════════════════════ */

/* ── Heartbeat animation ── */
@keyframes heartbeat-tawk {
    0% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
    100% { transform: scale(1); }
}

/* ── Desktop Tawk Button ── */
.floating-tawk-btn-desktop {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 110px;
    height: 110px;
    z-index: 1040;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    animation: heartbeat-tawk 2.5s infinite;
}
.floating-tawk-btn-desktop:hover {
    animation: none;
    transform: scale(1.15);
}
.floating-tawk-btn-desktop img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ── Mobile Tawk Button ── */
.floating-tawk-btn {
    position: fixed;
    bottom: 85px; /* Above bottom nav */
    right: 15px;
    width: 90px;
    height: 90px;
    z-index: 1040;
    border-radius: 50%;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    animation: heartbeat-tawk 2.5s infinite;
}
.floating-tawk-btn:active,
.floating-tawk-btn:hover {
    animation: none;
    transform: scale(1.15);
}
.floating-tawk-btn img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ── Hide default chat widgets (keep custom button only) ── */
/* LiveChat default bubble */
#chat-widget-container {
    display: none !important;
}
/* Tawk.to default bubble */
iframe[title="chat widget"] {
    display: none !important;
}

/* ══════ MOBILE PERFORMANCE ══════
   Disable heavy GPU animations on mobile to prevent device heating */
@media (max-width: 768px) {
    .floating-tawk-btn {
        animation: none !important;
    }
}

/* Respect user's motion preference (accessibility) */
@media (prefers-reduced-motion: reduce) {
    .floating-tawk-btn-desktop,
    .floating-tawk-btn {
        animation: none !important;
    }
}
