/* WhatsApp support: green round button bottom right and an on-page chat window
   in WhatsApp's own colours, so visitors recognise it at a glance. */
.zn-wa {
    --wa: #25d366;
    --wa-dark: #128c7e;
    --wa-deep: #075e54;
    position: fixed;
    right: 24px; bottom: 24px;
    z-index: 9990;
    display: flex; flex-direction: column; align-items: flex-end; gap: 16px;
    font-family: var(--font);
}
.zn-wa__toggle {
    position: relative;
    width: 62px; height: 62px;
    display: flex; align-items: center; justify-content: center;
    border: 0; border-radius: 50%;
    background: var(--wa);
    color: var(--white);
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.42);
    opacity: 0; transform: translateY(16px) scale(0.9);
    transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), background-color 0.3s var(--ease);
}
.zn-wa.is-ready .zn-wa__toggle { opacity: 1; transform: none; }
.zn-wa__toggle:hover { background: var(--wa-dark); }
.zn-wa:not(.is-open):not(.is-seen) .zn-wa__toggle::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--wa); animation: znWaPulse 2.4s ease-out infinite; z-index: -1; }
@keyframes znWaPulse { 0% { transform: scale(1); opacity: 0.55; } 100% { transform: scale(1.6); opacity: 0; } }
.zn-wa__icon { position: absolute; display: flex; font-size: 30px; transition: opacity 0.25s var(--ease), transform 0.3s var(--ease); }
.zn-wa__icon--close { opacity: 0; transform: rotate(-90deg); font-size: 26px; }
.zn-wa.is-open .zn-wa__icon--open { opacity: 0; transform: rotate(90deg); }
.zn-wa.is-open .zn-wa__icon--close { opacity: 1; transform: none; }
.zn-wa__badge { position: absolute; top: -2px; right: -2px; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--white); border-radius: 50%; background: #e53935; font-size: 11px; font-weight: 700; }
.zn-wa.is-seen .zn-wa__badge { display: none; }

/* Chat window */
.zn-wa__panel { width: 360px; max-width: calc(100vw - 32px); overflow: hidden; border-radius: 16px; background: #efeae2; box-shadow: 0 24px 60px rgba(1, 28, 41, 0.28); transform-origin: bottom right; animation: znWaIn 0.3s var(--ease); }
.zn-wa__panel[hidden] { display: none; }
@keyframes znWaIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
.zn-wa__head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 16px 18px; background: var(--wa-deep); color: var(--white); }
.zn-wa__avatar { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 50%; background: var(--white); color: var(--wa-deep); font-size: 22px; }
.zn-wa__avatar img { width: 100%; height: 100%; object-fit: cover; }
.zn-wa__who { flex: 1; min-width: 0; line-height: 1.3; }
.zn-wa__who strong { display: block; overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.zn-wa__who span { display: flex; align-items: center; gap: 6px; font-size: 13px; opacity: 0.85; }
.zn-wa__online { width: 8px; height: 8px; border-radius: 50%; background: var(--wa); }
.zn-wa__close { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--white); font-size: 20px; }
.zn-wa__close:hover { background: rgba(255, 255, 255, 0.12); }

.zn-wa__body { min-height: 170px; padding: 22px 18px 10px; background-color: #efeae2; background-image: radial-gradient(rgba(7, 94, 84, 0.07) 1px, transparent 1px); background-size: 16px 16px; }
.zn-wa__msg { position: relative; display: none; max-width: 88%; padding: 10px 14px 22px; border-radius: 0 10px 10px 10px; background: var(--white); color: #111b21; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08); animation: znWaIn 0.3s var(--ease); }
.zn-wa__msg::before { content: ''; position: absolute; top: 0; left: -8px; border-width: 0 8px 8px 0; border-style: solid; border-color: transparent var(--white) transparent transparent; }
.zn-wa__name { display: block; margin-bottom: 4px; color: var(--wa-dark); font-size: 13px; font-weight: 600; }
.zn-wa__msg p { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
.zn-wa__time { position: absolute; right: 10px; bottom: 6px; color: #667781; font-size: 11px; }
.zn-wa__typing { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 0 10px 10px 10px; background: var(--white); }
.zn-wa__typing i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: znWaDot 1.2s infinite; }
.zn-wa__typing i:nth-child(2) { animation-delay: 0.2s; }
.zn-wa__typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes znWaDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-4px); opacity: 1; } }
.zn-wa.is-greeted .zn-wa__typing { display: none; }
.zn-wa.is-greeted .zn-wa__msg { display: block; }

.zn-wa__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; background: #f0f2f5; }
.zn-wa__form textarea { flex: 1; min-height: 44px; max-height: 120px; padding: 11px 16px; border: 0; border-radius: 22px; background: var(--white); color: #111b21; font: 14px/1.45 var(--font); resize: none; }
.zn-wa__form textarea:focus { outline: 2px solid var(--wa); }
.zn-wa__send { width: 44px; height: 44px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: var(--wa); color: var(--white); font-size: 20px; transition: background-color 0.3s var(--ease); }
.zn-wa__send:hover { background: var(--wa-dark); }
.zn-wa__note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 0 12px 10px; background: #f0f2f5; color: #667781; font-size: 12px; }

@media (max-width: 575px) {
    .zn-wa { right: 16px; bottom: 16px; }
    .zn-wa__toggle { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
    .zn-wa *, .zn-wa *::before { animation: none !important; transition: none !important; }
    .zn-wa__toggle { opacity: 1; transform: none; }
}
