/* ==========================================================================
   K-Tech Floating Contact Buttons (Nút Liên Hệ Cố Định Bên Phải)
   ========================================================================== */

.ktech-floating-contacts {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    font-family: inherit;
    user-select: none;
    pointer-events: auto;
}

/* Wrapper thanh nút liên hệ */
.ktech-floating-contacts__wrapper {
    background: #f1f3f7;
    border-radius: 24px 0 0 24px;
    box-shadow: -4px 6px 20px rgba(0, 0, 0, 0.12);
    width: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Danh sách nút */
.ktech-floating-contacts__list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
}

.ktech-floating-contacts__item {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid #e2e8f0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ktech-floating-contacts__item:last-child {
    border-bottom: none;
}

/* Thẻ link liên kết */
.ktech-floating-contacts__link {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 58px;
    height: 58px;
    position: relative;
    text-decoration: none !important;
    color: inherit !important;
    transition: background-color 0.2s ease;
}

.ktech-floating-contacts__link:hover {
    background-color: rgba(0, 79, 140, 0.08);
}

.ktech-floating-contacts__icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ktech-floating-contacts__link:hover .ktech-floating-contacts__icon {
    transform: scale(1.12);
}

/* --- ĐỊNH DẠNG TỪNG ICON MẶC ĐỊNH (CHUẨN ẢNH THIẾT KẾ) --- */

/* 1. Zalo Badge (Hình tròn xanh Zalo, viền trắng, chữ Zalo) */
.ktech-icon-zalo-badge {
    width: 40px;
    height: 40px;
    background-color: #2579f6;
    border: 2.5px solid #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(37, 121, 246, 0.35);
}

.ktech-icon-zalo-badge span {
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-weight: 800;
    font-size: 13.5px;
    letter-spacing: -0.3px;
    line-height: 1;
}

/* 2. Hotline Phone Icon (Ống nghe điện thoại Navy viền mỏng nét) */
.ktech-svg-phone {
    width: 26px;
    height: 26px;
    color: #173d63;
    transition: transform 0.2s ease;
}

.ktech-item--phone:hover .ktech-svg-phone,
.ktech-item--hotline:hover .ktech-svg-phone {
    animation: ktech-phone-ring 0.6s ease-in-out infinite alternate;
}

@keyframes ktech-phone-ring {
    0% {
        transform: rotate(-10deg) scale(1.1);
    }

    100% {
        transform: rotate(10deg) scale(1.1);
    }
}

/* 3. WhatsApp Badge (Hình tròn navy viền mỏng, icon WhatsApp trắng) */
.ktech-icon-whatsapp-badge {
    width: 40px;
    height: 40px;
    background-color: #173d63;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 6px rgba(23, 61, 99, 0.35);
}

.ktech-svg-whatsapp {
    width: 23px;
    height: 23px;
    color: #ffffff;
}

/* 4. Telegram Badge */
.ktech-icon-telegram-badge {
    width: 38px;
    height: 38px;
    background-color: #0088cc;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
}

.ktech-icon-telegram-badge svg {
    width: 20px;
    height: 20px;
}

/* 5. Messenger Badge */
.ktech-icon-messenger-badge {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #00B2FE 0%, #006AFF 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
}

.ktech-icon-messenger-badge svg {
    width: 20px;
    height: 20px;
}

/* 6. Viber Badge */
.ktech-icon-viber-badge {
    width: 38px;
    height: 38px;
    background-color: #7360f2;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
}

.ktech-icon-viber-badge svg {
    width: 20px;
    height: 20px;
}

/* 7. WeChat Badge */
.ktech-icon-wechat-badge {
    width: 38px;
    height: 38px;
    background-color: #07c160;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
}

.ktech-icon-wechat-badge svg {
    width: 22px;
    height: 22px;
}

/* Custom Image Icons (Ảnh do quản trị tải lên từ Media) */
.ktech-floating-contacts__icon img {
    width: 38px !important;
    height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    object-fit: contain;
    display: block;
}

/* --- TOOLTIP KHI HOVER SANG BÊN TRÁI --- */
.ktech-floating-contacts__tooltip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background-color: var(--fs-color-primary, #004f8c);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    padding: 7px 14px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
    z-index: 10000;
}

.ktech-floating-contacts__tooltip::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px 0 5px 6px;
    border-style: solid;
    border-color: transparent transparent transparent var(--fs-color-primary, #004f8c);
}

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

/* --- NÚT THU VÀO (TOGGLE BUTTON Ở ĐÁY) --- */
.ktech-floating-contacts__toggle {
    width: 58px;
    height: 46px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #173d63;
    padding: 0;
    margin: 0;
    outline: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.ktech-floating-contacts__toggle:hover {
    color: var(--fs-color-secondary, #d91c29);
    background-color: rgba(0, 0, 0, 0.04);
}

.ktech-svg-chevron {
    transition: transform 0.3s ease;
}

/* --- TRẠNG THÁI THU GỌN (COLLAPSED STATE) --- */
.ktech-floating-contacts.is-collapsed .ktech-floating-contacts__wrapper {
    transform: translateX(100%);
    pointer-events: none;
}

/* Tab mở lại khi đã thu gọn */
.ktech-floating-contacts__expand-tab {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) translateX(100%);
    background: #f1f3f7;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-right: none;
    border-radius: 12px 0 0 12px;
    box-shadow: -3px 3px 12px rgba(0, 0, 0, 0.15);
    width: 26px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #173d63;
    padding: 0;
    margin: 0;
    outline: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s ease;
}

.ktech-floating-contacts.is-collapsed .ktech-floating-contacts__expand-tab {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.ktech-floating-contacts__expand-tab:hover {
    background-color: #ffffff;
    color: var(--fs-color-primary, #004f8c);
}

/* --- RESPONSIVE TRÊN MOBILE & TABLET --- */
@media (max-width: 768px) {
    .ktech-floating-contacts__wrapper {
        width: 50px;
        border-radius: 20px 0 0 20px;
    }

    .ktech-floating-contacts__link {
        width: 50px;
        height: 50px;
    }

    .ktech-icon-zalo-badge,
    .ktech-icon-whatsapp-badge,
    .ktech-icon-wechat-badge,
    .ktech-icon-telegram-badge,
    .ktech-icon-messenger-badge,
    .ktech-icon-viber-badge {
        width: 36px;
        height: 36px;
    }

    .ktech-icon-zalo-badge span {
        font-size: 12px;
    }

    .ktech-svg-phone {
        width: 22px;
        height: 22px;
    }

    .ktech-svg-whatsapp {
        width: 20px;
        height: 20px;
    }

    .ktech-floating-contacts__toggle {
        width: 50px;
        height: 40px;
    }

    /* Trên mobile không cần hiển thị tooltip khi tap */
    .ktech-floating-contacts__tooltip {
        display: none !important;
    }
}