/* ==========================================================================
   Floating Contact Widget — ปุ่มติดต่อลอยมุมขวาล่าง (โทร / LINE / Messenger)

   วางเหนือ widget useraccess ซึ่งลอยอยู่ที่ bottom:24px และปุ่มสูง 56px
   (กินแนวตั้ง 24–80px) จึงตั้ง bottom:96px เว้นช่องว่างเหนือ useraccess ~16px
   ========================================================================== */
.contact-fab {
    position: fixed;
    right: 24px;
    bottom: 96px;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* ---- ปุ่มหลัก (toggle เปิด/ปิด) ---- */
.contact-fab__toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: #5c6bc0;
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    transition: transform .25s ease, background .25s ease;
}

.contact-fab__toggle:hover {
    transform: scale(1.06);
}

.contact-fab.is-open .contact-fab__toggle {
    background: #4a56a6;
}

/* สลับไอคอนแชท <-> กากบาท ตามสถานะเปิด/ปิด */
.contact-fab__toggle .icon-close {
    display: none;
}

.contact-fab.is-open .contact-fab__toggle .icon-open {
    display: none;
}

.contact-fab.is-open .contact-fab__toggle .icon-close {
    display: inline-block;
}

/* ---- รายการช่องทางติดต่อ ---- */
.contact-fab__items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.contact-fab__item {
    opacity: 0;
    transform: translateY(12px) scale(.8);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

.contact-fab.is-open .contact-fab__item {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* เด้งไล่จากปุ่มล่างสุดขึ้นบน (Messenger ก่อน แล้ว LINE แล้วโทร) */
.contact-fab.is-open .contact-fab__item:nth-last-child(1) {
    transition-delay: .05s;
}

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

.contact-fab.is-open .contact-fab__item:nth-last-child(3) {
    transition-delay: .15s;
}

.contact-fab__link {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
    transition: transform .2s ease;
}

.contact-fab__link:hover {
    transform: scale(1.1);
    color: #fff;
}

.contact-fab__link--phone {
    background: #3cba54;
}

.contact-fab__link--line {
    background: #06C755;
}

.contact-fab__link--messenger {
    background: #0084ff;
}

@media (max-width: 600px) {
    .contact-fab {
        right: 16px;
        bottom: 84px;
    }

    .contact-fab__toggle {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .contact-fab__link {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
}
