.floating-tools {
    position: fixed;
    right: 18px;
    bottom: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    pointer-events: none;
}

.floating-tools > * {
    pointer-events: auto;
}

/* =========================================================
   Back to top
   ========================================================= */
/* =========================================================
   Nút về đầu trang
   ========================================================= */

.floating-tools__backtop {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 58px;
    height: 58px;
    padding: 0;

    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #ffffff;

    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.18),
        0 0 0 1px rgba(0, 0, 0, 0.03);

    cursor: pointer;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

/* Vòng tròn xanh phía trong */
.floating-tools__backtop::before {
    content: "";

    position: absolute;
    inset: 8px;

    border-radius: 50%;
    background: #77bddb;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

/* Khi cuộn trang thì hiện nút */
.floating-tools__backtop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-tools__backtop:hover {
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.22),
        0 0 0 1px rgba(0, 0, 0, 0.03);
}

.floating-tools__backtop:hover::before {
    background: #56acd1;
    transform: scale(1.05);
}

.floating-tools__backtop:active::before {
    transform: scale(0.95);
}

.floating-tools__backtop svg {
    position: relative;
    z-index: 2;

    display: block;
    width: 24px;
    height: 24px;

    color: #ffffff;
    pointer-events: none;
}

/* =========================================================
   Floating contact
   ========================================================= */
.floating-contact {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.floating-contact__items {
    position: absolute;
    right: 0;
    bottom: 88px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
}

.floating-contact.is-open .floating-contact__items {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-contact__item {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    text-decoration: none;
}

.floating-contact__label {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    background: #ffffff;
    color: #3d3d3d;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.floating-contact__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.floating-contact__item--messenger .floating-contact__icon {
    background: linear-gradient(135deg, #1387ff 0%, #7b4dff 100%);
}

.floating-contact__item--zalo .floating-contact__icon {
    background: #1167ea;
}

.floating-contact__item--call .floating-contact__icon {
    background: #28b85b;
}

.floating-contact__icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

.floating-contact__zalo-text {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    color: #ffffff;
}

/* =========================================================
   Main button
   ========================================================= */
/* =========================================================
   Nút liên hệ chính
   ========================================================= */

.floating-contact__main-wrap {
    position: relative;
}

/*
 * Bỏ vòng bao quanh toàn bộ nút cũ.
 */
.floating-contact__main-wrap::before {
    display: none;
}

/*
 * Container chung trong suốt.
 * Nhãn "Liên hệ" và icon tròn được tách rời bằng gap.
 */
.floating-contact__main {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;

    min-width: 0;
    height: auto;
    padding: 0;

    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;

    cursor: pointer;
}

/*
 * Nút chữ Liên hệ độc lập.
 */
.floating-contact__main-label {
    position: relative;
    z-index: 4;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 104px;
    height: 48px;
    padding: 0 20px;

    border: 2px solid #ffc4a3;
    border-radius: 999px;

    background: #ffffff;
    color: #ff7135;

    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;

    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.floating-contact__main:hover
.floating-contact__main-label {
    color: #ffffff;
    background: #ff8245;
    border-color: #ff8245;
    transform: translateY(-1px);
}

/*
 * Nút icon tin nhắn hình tròn độc lập.
 */
.floating-contact__main-icon {
    position: relative;
    z-index: 3;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    width: 64px;
    height: 64px;

    border: 3px solid #ffffff;
    border-radius: 50%;

    background: linear-gradient(
        180deg,
        #ff9d62 0%,
        #ff7739 100%
    );

    box-shadow:
        0 8px 22px rgba(255, 119, 57, 0.38),
        0 0 0 1px rgba(255, 119, 57, 0.15);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

/*
 * Hai vòng tròn nhấp nháy bên ngoài.
 */
.floating-contact__main-icon::before,
.floating-contact__main-icon::after {
    content: "";
    position: absolute;
    inset: -7px;
    z-index: -1;

    border: 2px solid rgba(255, 119, 57, 0.65);
    border-radius: 50%;

    pointer-events: none;
    animation: floating-contact-pulse 1.8s ease-out infinite;
}

.floating-contact__main-icon::after {
    inset: -14px;
    border-color: rgba(255, 119, 57, 0.35);
    animation-delay: 0.6s;
}

.floating-contact__main:hover
.floating-contact__main-icon {
    transform: scale(1.05);

    box-shadow:
        0 10px 28px rgba(255, 119, 57, 0.5),
        0 0 0 1px rgba(255, 119, 57, 0.2);
}

.floating-contact__main-icon svg {
    display: block;
    width: 29px;
    height: 29px;
}

/*
 * Trạng thái đóng/mở.
 */
.floating-contact__main-icon--close {
    display: none;
}

.floating-contact.is-open
.floating-contact__main-icon--message {
    display: none;
}

.floating-contact.is-open
.floating-contact__main-icon--close {
    display: inline-flex;
}

/*
 * Hiệu ứng vòng tròn lan ra rồi mờ dần.
 */
@keyframes floating-contact-pulse {
    0% {
        opacity: 0.9;
        transform: scale(0.85);
    }

    65% {
        opacity: 0.25;
    }

    100% {
        opacity: 0;
        transform: scale(1.25);
    }
}

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 767px) {
    .floating-tools {
        right: 14px;
        bottom: 16px;
        gap: 10px;
    }

    .floating-contact__main {
        gap: 12px;
    }

    .floating-contact__main-label {
        min-width: 96px;
        height: 44px;
        padding: 0 17px;
        font-size: 14px;
    }

    .floating-contact__main-icon {
        width: 58px;
        height: 58px;
    }

    .floating-contact__main-icon svg {
        width: 26px;
        height: 26px;
    }

    .floating-contact__main-icon::before {
        inset: -6px;
    }

    .floating-contact__main-icon::after {
        inset: -12px;
    }

    .floating-contact__label {
        padding: 0 16px;
        font-size: 14px;
    }

    .floating-contact__icon {
        width: 54px;
        height: 54px;
    }

    .floating-tools__backtop {
        width: 54px;
        height: 54px;
    }

    .floating-tools__backtop::before {
        inset: 7px;
    }

    .floating-tools__backtop svg {
        width: 22px;
        height: 22px;
    }
}