
/* Layout mobile: giữ dạng cột, gọn sát góc và thấp hơn */
@media (max-width: 768px) {
    .tanltd {
        top: auto;
        bottom: 16px;
        transform: none;
        right: 10px;
        left: auto;
        flex-direction: column;
        gap: 6px;
        padding: 8px 4px;
    }

    .tanltd.left {
        left: 10px;
        right: auto;
    }

    /* Thu nhỏ nút & icon trên mobile để thanh ngắn hơn */
    .tanltd-button {
        width: 44px;
        height: 44px;
        box-shadow: 0 3px 8px rgba(15, 23, 42, 0.35);
    }

    .tanltd-button .dashicons,
    .tanltd-custom-icon,
    .tanltd-button.tanltd-zalo span {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }
}

.tanltd {
    position: fixed;
    bottom: 32px;
    z-index: 9999;
    display: flex;
    bottom: 80px;
    flex-direction: column;
    gap: 14px;
    padding: 14px 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 999px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(148, 163, 184, 0.25);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    animation: tanltd-float 4s ease-in-out infinite;
}

@keyframes tanltd-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.tanltd.left {
    left: 20px;
}

.tanltd.right {
    right: 20px;
}

.tanltd-button {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    position: relative;
    overflow: hidden;
}

/* Màu default, sẽ bị override bởi CSS động */
.tanltd-button.tanltd-phone {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.tanltd-button.tanltd-messenger {
    background: linear-gradient(135deg, #0084FF, #00A4FF);
}

.tanltd-button.tanltd-zalo {
    background: linear-gradient(135deg, #0068FF, #00A3FF);
}

.tanltd-button:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.4);
    filter: brightness(1.05);
}

.tanltd-button:focus-visible {
    outline: 2px solid #facc15;
    outline-offset: 2px;
}

/* Icon mặc định */
.tanltd-button .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon Messenger to hơn một chút */
.tanltd-button.tanltd-messenger .dashicons {
    font-size: 28px;
    margin-top: 2px;
}

/* Icon tùy chỉnh dạng ảnh */
.tanltd-custom-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Chữ Z mặc định cho Zalo */
.tanltd-button.tanltd-zalo span {
    font-size: 24px;
    font-weight: bold;
    font-family: Arial, sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ffffff;
}

/* Hiệu ứng overlay khi hover */
.tanltd-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
    z-index: 1;
}

.tanltd-button:hover::before {
    opacity: 1;
}

/* Hiệu ứng tỏa sáng liên tục quanh nút */
@keyframes pulse-glow {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    60% {
        transform: scale(1.6);
        opacity: 0.25;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

.tanltd-button::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    z-index: 0;
    opacity: 0;
    animation: pulse-glow 2.4s infinite ease-out;
}

.tanltd-phone::after {
    box-shadow: 0 0 18px 6px #25D366;
    background-color: #25D366;
}

.tanltd-messenger::after {
    box-shadow: 0 0 18px 6px #0084FF;
    background-color: #0084FF;
}

.tanltd-zalo::after {
    box-shadow: 0 0 18px 6px #0068FF;
    background-color: #0068FF;
}

/* Delay cho hiệu ứng giữa các nút */
.tanltd-button:nth-child(2)::after {
    animation-delay: 0.5s;
}

.tanltd-button:nth-child(3)::after {
    animation-delay: 1s;
}
