/* Nut Zalo dung chung cho tat ca cac trang. */
.zalo-contact {
    position: fixed;
    right: 24px;
    bottom: 24px;
    right: calc(24px + env(safe-area-inset-right, 0px));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #0068ff;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 60, 150, 0.3);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    /* Lac khoang 0.8 giay, nghi khoang 2.7 giay roi lap lai. */
    animation: zalo-contact-shake 3.5s ease-in-out 1s infinite;
    transform-origin: center;
    -webkit-tap-highlight-color: transparent;
}

@keyframes zalo-contact-shake {
    0%, 24%, 100% { transform: rotate(0deg); }
    4% { transform: rotate(-10deg); }
    8% { transform: rotate(10deg); }
    12% { transform: rotate(-10deg); }
    16% { transform: rotate(8deg); }
    20% { transform: rotate(-4deg); }
}

.zalo-contact:hover,
.zalo-contact:focus,
.zalo-contact:visited {
    background: #0068ff;
    color: #fff;
    text-decoration: none;
}

/* Dung lac khi bam hoac dung ban phim de khach de thao tac. */
.zalo-contact:focus,
.zalo-contact:active {
    animation: none;
}

.zalo-contact:focus-visible {
    outline: 3px solid #142b55;
    outline-offset: 4px;
}

.zalo-contact__icon {
    display: block;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}

.zalo-contact__label {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    padding: 9px 13px;
    border-radius: 8px;
    background: #142b55;
    color: #fff;
    font: 600 14px/1.4 Arial, sans-serif;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-50%);
    transition: opacity 0.18s ease;
}

@media (hover: hover) {
    .zalo-contact:hover {
        animation: none;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(0, 60, 150, 0.4);
    }

    .zalo-contact:hover .zalo-contact__label {
        opacity: 1;
        visibility: visible;
    }
}

.zalo-contact:focus-visible .zalo-contact__label {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 575.98px) {
    .zalo-contact {
        right: 16px;
        bottom: 16px;
        right: calc(16px + env(safe-area-inset-right, 0px));
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        width: 56px;
        height: 56px;
    }

    .zalo-contact__icon {
        width: 48px;
        height: 48px;
    }

    .zalo-contact__label {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zalo-contact {
        animation: none;
    }

    .zalo-contact,
    .zalo-contact__label {
        transition: none;
    }

    .zalo-contact:hover {
        transform: none;
    }
}

@media print {
    .zalo-contact {
        display: none;
    }
}
