/**
 * Floating Contact & Social Buttons Widget - KÜEYE Storefront
 */
.kueye-floating-contact {
    position: fixed;
    right: 12px;
    bottom: 36px;
    z-index: 9990;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    user-select: none;
}

/* Danh sách nút con */
.floating-items-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
}

/* Trạng thái thu gọn */
.kueye-floating-contact.is-collapsed .floating-items-list {
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px) scale(0.7);
    pointer-events: none;
    height: 0;
    margin: 0;
    gap: 0;
}

/* Nút liên hệ chung */
.floating-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
    background: #fff;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.floating-btn:active {
    transform: scale(0.96);
}

.floating-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

/* 1. Nút Shopee */
.btn-shopee {
    background: #ffffff;
    border: 1px solid #f2f2f2;
}

/* 2. Nút Facebook */
.btn-facebook {
    background: #1877F2;
    color: #ffffff;
}

/* 3. Nút Zalo */
.btn-zalo {
    background: #0068FF;
    color: #ffffff;
}

/* 4. Nút Hotline (Điện thoại) */
.btn-hotline {
    background: linear-gradient(135deg, #e64a19 0%, #ba3815 100%);
    color: #ffffff;
}

/* Hiệu ứng sóng lan tỏa cho nút Hotline */
.btn-pulse-wave {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid #e64a19;
    opacity: 0.8;
    animation: floatingPulse 2s infinite cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
    pointer-events: none;
}

@keyframes floatingPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }

    70% {
        transform: scale(1.4);
        opacity: 0;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Rung nhẹ icon điện thoại */
.btn-hotline svg {
    animation: phoneShake 3s infinite ease-in-out;
}

@keyframes phoneShake {

    0%,
    80%,
    100% {
        transform: rotate(0deg);
    }

    85% {
        transform: rotate(15deg);
    }

    90% {
        transform: rotate(-15deg);
    }

    95% {
        transform: rotate(8deg);
    }
}

/* Nút chính Toggle */
.floating-main-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #2b2b2b;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    transition: transform 0.25s ease, background-color 0.25s ease;
    padding: 0;
}

.floating-main-toggle:hover {
    background: #111111;
    transform: scale(1.08);
}

.floating-main-toggle .toggle-icon-close {
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    display: block;
    transition: transform 0.3s ease;
}

.floating-main-toggle .toggle-icon-chat {
    display: none;
    align-items: center;
    justify-content: center;
}

/* Khi đang thu gọn (is-collapsed): hiển thị icon chat thay vì icon close */
.kueye-floating-contact.is-collapsed .floating-main-toggle {
    background: linear-gradient(135deg, #f87908 0%, #ba3815 100%);
    width: 48px;
    height: 48px;
}

.kueye-floating-contact.is-collapsed .floating-main-toggle .toggle-icon-close {
    display: none;
}

.kueye-floating-contact.is-collapsed .floating-main-toggle .toggle-icon-chat {
    display: flex;
}

/* Tooltip hiển thị khi hover trên Desktop */
.floating-tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    background: rgba(30, 30, 30, 0.9);
    color: #ffffff;
    padding: 5px 11px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.floating-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -4px;
    transform: translateY(-50%);
    border-width: 4px 0 4px 5px;
    border-style: solid;
    border-color: transparent transparent transparent rgba(30, 30, 30, 0.9);
}

.floating-btn:hover .floating-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Responsive cho thiết bị di động */
@media (max-width: 768px) {
    .kueye-floating-contact {
        right: 8px;
        bottom: 45px;
        gap: 10px;
    }

    .floating-btn {
        width: 42px;
        height: 42px;
    }

    .floating-btn svg {
        width: 22px;
        height: 22px;
    }

    .floating-main-toggle {
        width: 38px;
        height: 38px;
    }

    .kueye-floating-contact.is-collapsed .floating-main-toggle {
        width: 44px;
        height: 44px;
    }

    /* Trên mobile ẩn tooltip để tránh che màn hình */
    .floating-tooltip {
        display: none !important;
    }
}