/* floating.css - เวอร์ชันรูปเล็ก นิ่ง และข้อความส่ายซ้ายขวา */

.floatingboss {
    position: fixed;
    bottom: -10px;           
    right: 40px;            
    width: 140px;           /* ลดความกว้างรวมลง */
    z-index: 9999;
    font-family: 'Prompt', 'Sarabun', Arial, sans-serif;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    
}

.floatingboss > div {
    pointer-events: auto;
}

/* ส่วนข้อความคำพูด - ขยับซ้ายขวา */
.floatingboss > div:first-child {
    text-align: center;
    font-size: 14px;         /* ปรับตัวอักษรให้พอดีกับรูปที่เล็กลง */
    font-weight: 500;
    color: #1a1a1a;
    background-color: #ffffff;
    padding: 6px 10px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    line-height: 1.3;
    margin-bottom: -5px;
    position: relative;
    z-index: 2;
    border: 1px solid #eee;
    width: max-content;
    

    /* Animation ขยับซ้าย-ขวา */
    animation: shake-side 3s ease-in-out infinite;
}

/* ส่วนรูปภาพ - อยู่นิ่งๆ และเล็กลง */
.floatingboss img {
    width: 100%;
    max-width: 140px;        /* ลดขนาดรูปภาพลงให้ดูน่ารัก */
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.15));
    /* ยกเลิก animation float เดิมออก */
}

/* Hover effect */
.floatingboss:hover div:first-child {
    animation-play-state: paused; /* หยุดส่ายเวลาเอาเมาส์ไปชี้ */
}

/* Keyframes สำหรับข้อความขยับซ้าย-ขวาแบบมีจังหวะ */
@keyframes shake-side {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50% { transform: translateX(-5px); }
    20%, 40%, 60% { transform: translateX(5px); }
    70% { transform: translateX(0); } /* จังหวะหยุดนิ่งสั้นๆ */
}

/* --- ✅ ปิดการแสดงผลบน Mobile (หน้าจอเล็กกว่า 768px) --- */
@media (max-width: 768px) {
    .floatingboss {
        display: none !important;
    }
}