/* ============================================================
   ZUPI WHATSAPP CTA LAYER  (prefix: zpw-)
   Pairs with js/zupi-whatsapp-cta.js
   1) context-aware wa.me prefill (no CSS needed)
   2) exit-intent WhatsApp nudge card (all styles below)
   Revert: remove this file + js/zupi-whatsapp-cta.js
   ============================================================ */

/* ---------- Exit-intent nudge card ---------- */
.zpw-nudge {
    position: fixed;
    right: 24px;
    bottom: 100px; /* clears the 56-58px float buttons at bottom:28px */
    z-index: 10000;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid #e3eaf1;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(10, 22, 40, 0.10), 0 28px 64px -18px rgba(11, 87, 78, 0.35);
    overflow: hidden;
    font-family: 'Nunito', 'Inter', system-ui, -apple-system, sans-serif;
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    will-change: transform, opacity;
}
.zpw-nudge.zpw-in {
    animation: zpwSpringIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.zpw-nudge.zpw-out {
    opacity: 0 !important;
    transform: translateY(12px) scale(0.97) !important;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.zpw-nudge.zpw-static {
    opacity: 1;
    transform: none;
    animation: none;
}
@keyframes zpwSpringIn {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header — WhatsApp green bar */
.zpw-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    background: linear-gradient(135deg, #0F2E2B, #075E54);
}
.zpw-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.zpw-avatar svg { width: 19px; height: 19px; fill: #ffffff; display: block; }
.zpw-head-meta { flex: 1; min-width: 0; }
.zpw-head-name {
    display: block;
    font-size: 13.5px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: 0.01em;
}
.zpw-head-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.2;
}
.zpw-head-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #25D366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.25);
}
.zpw-close {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.14);
    border: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: background 0.15s ease;
}
.zpw-close:hover,
.zpw-close:focus-visible { background: rgba(255, 255, 255, 0.28); outline: none; }

/* Body — chat wallpaper + incoming bubble */
.zpw-body {
    padding: 14px 12px 12px;
    background: #eef5f1;
}
.zpw-bubble {
    position: relative;
    background: #ffffff;
    border-radius: 4px 12px 12px 12px;
    padding: 10px 12px;
    max-width: 94%;
    box-shadow: 0 1px 2px rgba(10, 22, 40, 0.10);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: #0a1628;
    min-height: 40px;
}
.zpw-bubble-text { opacity: 0; transition: opacity 0.25s ease; }
.zpw-bubble-text.zpw-show { opacity: 1; }
.zpw-nudge.zpw-static .zpw-bubble-text { opacity: 1; transition: none; }
.zpw-bubble-time {
    display: block;
    text-align: right;
    font-size: 9.5px;
    font-weight: 700;
    color: #64748b;
    margin-top: 3px;
}

/* Typing dots (one-shot, removed by JS after ~900ms) */
.zpw-typing {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 4px;
    align-items: center;
}
.zpw-typing i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    display: block;
    animation: zpwDot 0.9s ease-in-out infinite;
}
.zpw-typing i:nth-child(2) { animation-delay: 0.15s; }
.zpw-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes zpwDot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30%           { transform: translateY(-4px); opacity: 1; }
}

/* Actions */
.zpw-actions {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 12px;
    background: #ffffff;
    border-top: 1px solid #eef2f6;
}
.zpw-btn-go {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366;
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 800;
    text-decoration: none !important;
    border-radius: 10px;
    padding: 11px 14px;
    line-height: 1.2;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.zpw-btn-go svg { width: 17px; height: 17px; fill: #ffffff; flex-shrink: 0; }
.zpw-btn-go:hover,
.zpw-btn-go:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45);
    color: #ffffff !important;
    outline: none;
}
.zpw-btn-no {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: 0;
    padding: 6px 8px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
}
.zpw-btn-no:hover,
.zpw-btn-no:focus-visible { color: #0F2E2B; background: #f1f5f9; outline: none; }

/* ---------- Responsive ---------- */
@media (max-width: 575px) {
    .zpw-nudge {
        right: 12px;
        bottom: 78px; /* float btn is 48px @ bottom:16px on mobile */
        width: min(320px, calc(100vw - 24px));
    }
}

/* ---------- Reduced motion: instant show, zero movement ---------- */
@media (prefers-reduced-motion: reduce) {
    .zpw-nudge,
    .zpw-nudge.zpw-in {
        animation: none;
        opacity: 1;
        transform: none;
        transition: none;
    }
    .zpw-nudge.zpw-out { transition: none; }
    .zpw-typing i { animation: none; }
    .zpw-bubble-text { opacity: 1; transition: none; }
    .zpw-btn-go,
    .zpw-btn-no { transition: none; }
    .zpw-btn-go:hover { transform: none; }
}

/* Touch devices: no hover lift */
@media (hover: none) {
    .zpw-btn-go:hover { transform: none; }
}
