/* Contact FAB - Messenger, Phone */
.contact-fab {
    position: fixed;
    z-index: 9999;
    bottom: 100px;
    right: 32px;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.contact-fab__menu {
    list-style: none;
    margin: 0 15px 0 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
}

.contact-fab__item {
    opacity: 0;
    visibility: hidden;
    transform: translateX(50px) scale(0.4);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    position: relative;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
    flex-shrink: 0;
}

.contact-fab__item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    line-height: 0;
}

.contact-fab__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.contact-fab__item--phone img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.contact-fab__item--zalo {
    display: none !important;
}

@media (max-width: 768px) {
    .contact-fab__item--zalo {
        display: block !important;
    }
}

.contact-fab.is-open .contact-fab__item {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
}

.contact-fab.is-open .contact-fab__item:nth-child(1) { transition-delay: 0.05s; }
.contact-fab.is-open .contact-fab__item:nth-child(2) { transition-delay: 0.1s; }
.contact-fab.is-open .contact-fab__item:nth-child(3) { transition-delay: 0.15s; }

.contact-fab__tooltip {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 160px;
    font-size: 13px;
    background: #ebebeb;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    pointer-events: none;
    white-space: nowrap;
}

.contact-fab__tooltip::after {
    content: "";
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #ebebeb;
}

.contact-fab__tooltip a {
    display: block;
    font-size: 14px;
    line-height: 28px;
    color: #333;
}

.contact-fab__item--phone:hover .contact-fab__tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.contact-fab__toggle {
    position: relative;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #0083c1 0%, #1b4688 100%);
    box-shadow: 0 4px 18px rgba(27, 70, 136, 0.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    outline: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.contact-fab__toggle:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 22px rgba(27, 70, 136, 0.55);
}

.contact-fab__toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    transition: opacity 0.25s, transform 0.25s;
}

.contact-fab__toggle-icon--close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.contact-fab.is-open .contact-fab__toggle-icon--chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.contact-fab.is-open .contact-fab__toggle-icon--close {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.contact-fab.is-open .contact-fab__toggle {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 4px 18px rgba(231, 76, 60, 0.4);
}

@media (max-width: 768px) {
    .contact-fab {
        right: 20px;
        bottom: 100px;
    }

    .contact-fab__item {
        width: 50px;
        height: 50px;
    }

    .contact-fab__toggle {
        width: 54px;
        height: 54px;
    }

    .contact-fab__tooltip {
        display: none;
    }
}

/* Position Zalo Chat Widget higher up and hide it by default, only show when menu is active */
.zalo-chat-widget {
    bottom: 100px !important;
    right: 240px !important;
    z-index: 9998 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, bottom 0.3s ease !important;
}

.zalo-chat-widget.is-active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

@media (max-width: 768px) {
    .zalo-chat-widget {
        bottom: 100px !important;
        right: 214px !important;
    }
}
