.az-contact-widget {
    position: fixed;
    left: max(16px, env(safe-area-inset-left));
    bottom: calc(22px + env(safe-area-inset-bottom));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    font-family: inherit;
}

.az-contact-widget *,
.az-contact-widget *::before,
.az-contact-widget *::after { box-sizing: border-box; }

.az-contact-widget__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 52px;
    color: #fff;
    text-decoration: none !important;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 10px 28px rgba(20, 36, 63, .18);
    transition: transform .2s ease, box-shadow .2s ease;
}

.az-contact-widget__link:hover,
.az-contact-widget__link:focus-visible {
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(20, 36, 63, .24);
}

.az-contact-widget__link:focus-visible,
.az-contact-widget__toggle:focus-visible {
    outline: 3px solid #142e59;
    outline-offset: 3px;
}

.az-contact-widget__icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.az-contact-widget__icon svg { display: block; width: 24px; height: 24px; }
.az-contact-widget__icon img { display: block; width: 36px; height: 36px; object-fit: contain; }
.az-contact-widget__brand { font-size: 13px; font-weight: 800; letter-spacing: -.04em; }
.az-contact-widget__text { white-space: nowrap; }
.az-contact-widget__link--zalo { border: 1px solid #005ae0; background: #005ae0; color: #fff; }
.az-contact-widget__link--zalo:hover,
.az-contact-widget__link--zalo:focus-visible { color: #fff; }
.az-contact-widget__link--messenger { background: #3478f6; }
.az-contact-widget__link--whatsapp { background: #1dbb71; }
.az-contact-widget__link--phone { background: #df2e31; }

/* Style 1: layered blue Zalo circle and red hotline bar. */
.az-contact-widget--stacked { gap: 32px; }

.az-contact-widget--stacked .az-contact-widget__link {
    position: relative;
    isolation: isolate;
}

.az-contact-widget--stacked .az-contact-widget__icon {
    transform-origin: center;
    animation: az-contact-widget-wiggle 3.6s ease-in-out infinite;
}

.az-contact-widget--stacked .az-contact-widget__link::before,
.az-contact-widget--stacked .az-contact-widget__link::after {
    position: absolute;
    inset: -3px;
    border: 2px solid var(--az-contact-widget-wave, rgba(55, 158, 240, .5));
    border-radius: inherit;
    content: '';
    pointer-events: none;
    opacity: 0;
    animation: az-contact-widget-wave 3.6s ease-out infinite;
}

.az-contact-widget--stacked .az-contact-widget__link::after { animation-delay: 1.8s; }
.az-contact-widget--stacked .az-contact-widget__link--phone { --az-contact-widget-wave: rgba(223, 58, 69, .38); }
.az-contact-widget--stacked .az-contact-widget__link--zalo { --az-contact-widget-wave: rgba(0, 90, 224, .4); }
.az-contact-widget--stacked .az-contact-widget__link--messenger { --az-contact-widget-wave: rgba(52, 120, 246, .42); }
.az-contact-widget--stacked .az-contact-widget__link--whatsapp { --az-contact-widget-wave: rgba(29, 187, 113, .42); }

.az-contact-widget--stacked .az-contact-widget__link:hover .az-contact-widget__icon,
.az-contact-widget--stacked .az-contact-widget__link:focus-visible .az-contact-widget__icon {
    animation: none;
}

.az-contact-widget--stacked .az-contact-widget__link:hover::before,
.az-contact-widget--stacked .az-contact-widget__link:hover::after,
.az-contact-widget--stacked .az-contact-widget__link:focus-visible::before,
.az-contact-widget--stacked .az-contact-widget__link:focus-visible::after { animation: none; opacity: 0; }

@keyframes az-contact-widget-wiggle {
    0%, 35%, 65%, 100% { transform: rotate(0); }
    42% { transform: rotate(-10deg); }
    49% { transform: rotate(10deg); }
    56% { transform: rotate(-6deg); }
    62% { transform: rotate(4deg); }
}

@keyframes az-contact-widget-wave {
    0% { opacity: 0; transform: scale(1); }
    15% { opacity: .7; }
    70%, 100% { opacity: 0; transform: scale(1.42); }
}

@keyframes az-contact-widget-phone-wave {
    0% { opacity: 0; transform: translateY(-50%) scale(.75); }
    15% { opacity: .65; }
    70%, 100% { opacity: 0; transform: translateY(-50%) scale(1.4); }
}

.az-contact-widget--stacked .az-contact-widget__link:not(.az-contact-widget__link--phone) {
    width: 60px;
    height: 60px;
    min-height: 0;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 10px rgba(74, 166, 239, .14);
}

.az-contact-widget--stacked .az-contact-widget__link:not(.az-contact-widget__link--phone) .az-contact-widget__icon {
    width: 46px;
    height: 46px;
    background: rgba(0, 62, 149, .17);
}

.az-contact-widget--stacked .az-contact-widget__link:not(.az-contact-widget__link--phone) .az-contact-widget__icon img {
    width: 26px;
    height: 26px;
}

.az-contact-widget--stacked .az-contact-widget__link--zalo { background: #55aaf2; }
.az-contact-widget--stacked .az-contact-widget__link--zalo .az-contact-widget__icon { background: #005ae0; }

.az-contact-widget--stacked .az-contact-widget__link--phone {
    min-width: 0;
    min-height: 0;
    height: 40px;
    gap: 8px;
    margin-left: 10px;
    padding: 0 13px 0 0;
    border: 0;
    border-radius: 999px;
    background: #e52e35;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    box-shadow: none;
}

.az-contact-widget--stacked .az-contact-widget__link--phone:hover,
.az-contact-widget--stacked .az-contact-widget__link--phone:focus-visible {
    color: #fff;
}

.az-contact-widget--stacked .az-contact-widget__link--phone .az-contact-widget__icon {
    position: relative;
    z-index: 1;
    width: 40px;
    height: 40px;
    background: #e52e35;
    color: #fff;
    box-shadow: 0 0 0 9px rgba(232, 73, 81, .4);
}

.az-contact-widget--stacked .az-contact-widget__link--phone .az-contact-widget__icon svg { width: 18px; height: 18px; }
.az-contact-widget--stacked .az-contact-widget__link--phone .az-contact-widget__text { position: relative; z-index: 1; }

.az-contact-widget--stacked .az-contact-widget__link--phone::before,
.az-contact-widget--stacked .az-contact-widget__link--phone::after {
    inset: auto;
    left: -22px;
    top: 50%;
    width: 84px;
    height: 84px;
    border: 0;
    border-radius: 50%;
    background: rgba(227, 54, 65, .1);
    opacity: 1;
    transform: translateY(-50%);
    animation: none;
    z-index: -1;
}

.az-contact-widget--stacked .az-contact-widget__link--phone::after {
    left: -22px;
    width: 84px;
    height: 84px;
    border: 2px solid var(--az-contact-widget-wave);
    background: transparent;
    opacity: 0;
    animation: az-contact-widget-phone-wave 3.6s ease-out infinite;
}

.az-contact-widget--stacked .az-contact-widget__link--phone:hover::before,
.az-contact-widget--stacked .az-contact-widget__link--phone:focus-visible::before { opacity: 1; }

/* Style 2: compact launcher with an expandable contact panel. */
.az-contact-widget--expandable { gap: 12px; }
.az-contact-widget__panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(290px, calc(100vw - 32px));
    padding: 17px;
    border: 1px solid #e7ebf2;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 55px rgba(18, 36, 65, .2);
}

.az-contact-widget__panel[hidden] { display: none; }
.az-contact-widget__heading { display: block; margin: 0 0 4px; color: #183153; font-size: 15px; font-weight: 750; }
.az-contact-widget--expandable .az-contact-widget__link {
    justify-content: flex-start;
    width: 100%;
    min-height: 50px;
    padding: 4px 12px 4px 6px;
    border-radius: 12px;
    font-size: 14px;
    box-shadow: none;
}
.az-contact-widget--expandable .az-contact-widget__link:hover { transform: translateX(2px); box-shadow: none; }
.az-contact-widget--expandable .az-contact-widget__icon { width: 40px; height: 40px; background: rgba(255,255,255,.17); }
.az-contact-widget--expandable .az-contact-widget__link--zalo .az-contact-widget__icon { background: transparent; }
.az-contact-widget__toggle {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    padding: 0;
    border: 0;
    border-radius: 19px;
    background: linear-gradient(135deg, #1767c7, #00a9d7);
    color: #fff;
    box-shadow: 0 12px 30px rgba(15, 92, 174, .3);
    cursor: pointer;
    transition: transform .2s ease, border-radius .2s ease;
}
.az-contact-widget__toggle:hover { transform: translateY(-3px); }
.az-contact-widget__toggle[aria-expanded="true"] { border-radius: 50%; }
.az-contact-widget__toggle svg { width: 29px; height: 29px; }

@media (max-width: 600px) {
    .az-contact-widget { left: max(12px, env(safe-area-inset-left)); bottom: calc(16px + env(safe-area-inset-bottom)); }
    .az-contact-widget--stacked { gap: 28px; }
    .az-contact-widget--stacked .az-contact-widget__link:not(.az-contact-widget__link--phone) { width: 54px; height: 54px; box-shadow: 0 0 0 8px rgba(74, 166, 239, .14); }
    .az-contact-widget--stacked .az-contact-widget__link:not(.az-contact-widget__link--phone) .az-contact-widget__icon { width: 42px; height: 42px; }
    .az-contact-widget--stacked .az-contact-widget__link:not(.az-contact-widget__link--phone) .az-contact-widget__icon img { width: 24px; height: 24px; }
    .az-contact-widget--stacked .az-contact-widget__link--phone { height: 44px; margin-left: 5px; padding-right: 11px; font-size: 14px; }
    .az-contact-widget--stacked .az-contact-widget__link--phone .az-contact-widget__icon { width: 44px; height: 44px; }
    .az-contact-widget--stacked .az-contact-widget__link--phone::before,
    .az-contact-widget--stacked .az-contact-widget__link--phone::after { left: -18px; width: 80px; height: 80px; }
    .az-contact-widget__toggle { width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .az-contact-widget__link,
    .az-contact-widget__toggle { transition: none; }
    .az-contact-widget--stacked .az-contact-widget__link,
    .az-contact-widget--stacked .az-contact-widget__icon,
    .az-contact-widget--stacked .az-contact-widget__link::before,
    .az-contact-widget--stacked .az-contact-widget__link::after { animation: none; }
}
