/* ChatWave — modern floating WhatsApp button and popup. No emoji, SVG icons only. */
.chatwave-wrap{position:fixed;z-index:99999;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;line-height:1.45;box-sizing:border-box}
.chatwave-wrap *,.chatwave-wrap *::before,.chatwave-wrap *::after{box-sizing:border-box}
.chatwave-bottom-right{right:22px;bottom:22px}
.chatwave-bottom-left{left:22px;bottom:22px}
.chatwave-button{position:relative;display:flex;align-items:center;justify-content:center;gap:10px;border:0;cursor:pointer;color:#fff;box-shadow:0 10px 28px rgba(0,0,0,.28),0 2px 8px rgba(0,0,0,.18);transition:transform .18s ease,box-shadow .18s ease;text-decoration:none;padding:0;flex:0 0 auto}
.chatwave-button:hover{transform:translateY(-2px) scale(1.03);box-shadow:0 14px 34px rgba(0,0,0,.32)}
.chatwave-button:focus-visible,.chatwave-chip:focus-visible,.chatwave-chat-now:focus-visible,.chatwave-close:focus-visible,.chatwave-agent:focus-visible{outline:3px solid #075e54;outline-offset:2px}
.chatwave-size-small .chatwave-button{width:52px;height:52px;border-radius:50%}
.chatwave-size-medium .chatwave-button{width:62px;height:62px;border-radius:50%}
.chatwave-size-large .chatwave-button{width:72px;height:72px;border-radius:50%}
.chatwave-shape-rounded .chatwave-button{border-radius:18px}
.chatwave-shape-pill .chatwave-button{width:auto;height:56px;border-radius:999px;padding:0 18px 0 10px}
.chatwave-size-small.chatwave-shape-pill .chatwave-button{height:48px}
.chatwave-size-large.chatwave-shape-pill .chatwave-button{height:64px}
.chatwave-icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;flex:0 0 auto}
.chatwave-shape-pill .chatwave-icon{width:36px;height:36px}
.chatwave-icon svg{width:34px;height:34px;display:block}
.chatwave-size-small .chatwave-icon svg{width:28px;height:28px}
.chatwave-size-large .chatwave-icon svg{width:40px;height:40px}
.chatwave-icon-close{display:none;font-size:30px;line-height:1;font-weight:300}
/* Icon swap: driven by the .open class AND by aria-expanded, so the
   button turns into an X even if one state hook is missed. */
.chatwave-wrap.open .chatwave-icon-open,.chatwave-button[aria-expanded="true"] .chatwave-icon-open{display:none}
.chatwave-wrap.open .chatwave-icon-close,.chatwave-button[aria-expanded="true"] .chatwave-icon-close{display:flex}
/* When open, the pill collapses to a round X button, so it is obvious
   that tapping it again closes the popup. */
.chatwave-wrap.open .chatwave-button,.chatwave-button[aria-expanded="true"]{width:56px;height:56px;border-radius:50%;padding:0}
.chatwave-wrap.open .chatwave-label,.chatwave-button[aria-expanded="true"] .chatwave-label{display:none}
.chatwave-wrap.open .chatwave-badge,.chatwave-button[aria-expanded="true"] .chatwave-badge{display:none}
.chatwave-label{font-size:15px;font-weight:600;white-space:nowrap}
.chatwave-badge{position:absolute;top:-4px;right:-4px;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:#ff3b30;color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center;border:2px solid #fff}
.chatwave-anim-pulse .chatwave-button::after{content:"";position:absolute;inset:0;border-radius:inherit;border:2px solid currentColor;opacity:.55;animation:chatwave-pulse 2.2s ease-out infinite;pointer-events:none}
@keyframes chatwave-pulse{0%{transform:scale(1);opacity:.55}70%{transform:scale(1.35);opacity:0}100%{transform:scale(1.35);opacity:0}}
.chatwave-anim-bounce .chatwave-button{animation:chatwave-bounce 2.6s ease-in-out infinite}
@keyframes chatwave-bounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)}}
.chatwave-anim-shake .chatwave-button{animation:chatwave-shake .6s ease .4s 1}
@keyframes chatwave-shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)}}
/* Popup: fixed header, scrollable middle, fixed footer with Chat Now.
   Height is capped with vh AND dvh (dynamic viewport height, so the
   mobile browser chrome / keyboard does not push it off screen). */
.chatwave-popup{position:absolute;bottom:72px;width:360px;max-width:calc(100vw - 44px);max-height:min(460px,calc(100vh - 140px));display:flex;flex-direction:column;background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 22px 60px rgba(0,0,0,.28),0 4px 16px rgba(0,0,0,.14);animation:chatwave-pop .22s ease}
/* CRITICAL: display:flex above overrides the browser's built-in
   [hidden]{display:none}. Without this rule the popup can never
   close, because closePopup() only sets hidden=true. This was the
   live-site bug on tibborganic.com in 1.0.2. */
.chatwave-wrap[hidden],.chatwave-popup[hidden]{display:none !important}
@supports (height:100dvh){.chatwave-popup{max-height:min(460px,calc(100dvh - 140px))}}
.chatwave-bottom-right .chatwave-popup{right:0}
.chatwave-bottom-left .chatwave-popup{left:0}
@keyframes chatwave-pop{from{opacity:0;transform:translateY(12px) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}
.chatwave-popup-head{display:flex;align-items:center;gap:12px;padding:13px 14px;color:#fff;flex:0 0 auto;min-height:68px}
.chatwave-agent-avatar{width:46px;height:46px;border-radius:50%;object-fit:cover;flex:0 0 auto;background:#fff;color:#075e54;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:16px}
.chatwave-head-text{flex:1;min-width:0}
.chatwave-head-text strong{display:block;font-size:16px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Only the line itself is a block. The dot, status and role inside it
   stay inline, so they can never stack under the avatar. */
.chatwave-head-line{display:block;font-size:12.5px;line-height:1.4;opacity:.92;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chatwave-head-line .chatwave-online-dot,.chatwave-head-line #chatwave-head-status,.chatwave-head-line #chatwave-head-role{display:inline;white-space:normal}
.chatwave-online-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#25d366;margin-right:4px;vertical-align:baseline}
.chatwave-online-dot.offline{background:#ffb020}
.chatwave-close{position:relative;z-index:2;background:rgba(255,255,255,.2);border:0;color:#fff;width:38px;height:38px;border-radius:50%;font-size:24px;line-height:1;cursor:pointer;flex:0 0 auto;display:flex;align-items:center;justify-content:center;padding:0}
.chatwave-close:hover{background:rgba(255,255,255,.32)}
.chatwave-agents{padding:10px 12px 6px;display:flex;flex-direction:column;gap:8px;background:#f0f2f5;flex:0 0 auto;max-height:150px;overflow-y:auto;-webkit-overflow-scrolling:touch}
.chatwave-agent{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:#fff;border:1px solid #e3e6ea;border-radius:14px;padding:9px 10px;cursor:pointer}
.chatwave-agent.selected{border-color:#25d366;box-shadow:0 0 0 1px #25d366}
.chatwave-agent img,.chatwave-agent-initials{width:40px;height:40px;border-radius:50%;object-fit:cover;background:#075e54;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px;flex:0 0 auto}
.chatwave-agent-meta{flex:1;min-width:0}
.chatwave-agent-meta strong{display:block;font-size:14px;color:#111b21;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chatwave-agent-meta span{display:block;font-size:12px;color:#667781;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chatwave-agent-check{color:#25d366;font-weight:800;opacity:0;flex:0 0 auto}
.chatwave-agent.selected .chatwave-agent-check{opacity:1}
.chatwave-popup-body{padding:14px;background:#efeae2;background-image:radial-gradient(rgba(0,0,0,.04) 1px,transparent 1px);background-size:18px 18px;flex:1 1 auto;overflow-y:auto;min-height:0;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}
.chatwave-greeting{background:#fff;border-radius:14px 14px 14px 4px;padding:11px 12px;box-shadow:0 1px 2px rgba(0,0,0,.12);margin-bottom:10px;overflow-wrap:anywhere}
.chatwave-greeting strong{font-size:14.5px;color:#111b21}
.chatwave-greeting p{margin:5px 0 6px;font-size:14px;color:#3b4a54}
.chatwave-time{font-size:11px;color:#8696a0}
.chatwave-chips{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:12px}
.chatwave-chip{border:1px solid #cfe3d8;background:#fff;color:#075e54;border-radius:999px;padding:7px 11px;font-size:13px;cursor:pointer;max-width:100%;text-align:left}
.chatwave-chip:hover{background:#e7f8ef}
.chatwave-msg-label{font-size:12px;font-weight:700;color:#54656f;text-transform:uppercase;letter-spacing:.04em}
.chatwave-popup-body textarea{width:100%;box-sizing:border-box;border:1px solid #d1d7db;border-radius:12px;padding:10px 12px;font:inherit;font-size:14px;resize:none;margin:6px 0 0;background:#fff;max-height:84px;overflow-y:auto}
.chatwave-popup-foot{flex:0 0 auto;background:#fff;padding:12px 14px 13px;border-top:1px solid #e8e8e8}
.chatwave-chat-now{width:100%;border:0;border-radius:999px;background:#25d366;color:#fff;font-size:16px;font-weight:700;padding:13px 16px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:9px;box-shadow:0 6px 16px rgba(37,211,102,.35)}
.chatwave-chat-now:hover{background:#1fb857}
.chatwave-chat-now:disabled{background:#a8b0b5;cursor:not-allowed;box-shadow:none}
.chatwave-chat-now-icon{display:flex;flex:0 0 auto}
.chatwave-chat-now-icon svg{width:22px;height:22px}
.chatwave-offline-note{font-size:13px;color:#7a3b00;background:#fff3d6;border-radius:10px;padding:9px 11px;margin:10px 0 0}
.chatwave-secure{text-align:center;font-size:11.5px;color:#8696a0;margin:9px 0 0}
.chatwave-inline-link{display:inline-flex;align-items:center;gap:8px;background:#25d366;color:#fff;padding:10px 16px;border-radius:999px;text-decoration:none;font-weight:600}

/* Tablet: 481px to 768px. */
@media (max-width:768px){
.chatwave-bottom-right{right:16px;bottom:16px}
.chatwave-bottom-left{left:16px;bottom:16px}
.chatwave-popup{width:340px;max-width:calc(100vw - 32px);bottom:70px;max-height:min(440px,calc(100vh - 120px))}
@supports (height:100dvh){.chatwave-popup{max-height:min(440px,calc(100dvh - 120px))}}
.chatwave-popup-head{padding:12px}
.chatwave-agent-avatar{width:44px;height:44px}
}

/* Phone: up to 480px. Popup fills the width with a small margin,
   sits just above the button, and never runs off the top or bottom. */
@media (max-width:480px){
.chatwave-bottom-right{right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px))}
.chatwave-bottom-left{left:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px))}
.chatwave-popup{width:calc(100vw - 24px);max-width:none;bottom:66px;max-height:calc(100vh - 110px);border-radius:18px}
@supports (height:100dvh){.chatwave-popup{max-height:calc(100dvh - 110px)}}
.chatwave-label{display:none}
.chatwave-shape-pill .chatwave-button{padding:0;width:56px;height:56px;border-radius:50%}
.chatwave-popup-head{min-height:62px;padding:11px 12px}
.chatwave-agent-avatar{width:42px;height:42px}
.chatwave-head-text strong{font-size:15px}
.chatwave-popup-body{padding:12px}
.chatwave-chat-now{padding:12px 14px;font-size:15px}
}

/* Very small phones: up to 360px wide. */
@media (max-width:360px){
.chatwave-popup{width:calc(100vw - 20px);bottom:62px}
.chatwave-popup-head{gap:9px}
.chatwave-head-line{font-size:11.5px}
.chatwave-greeting p,.chatwave-chip{font-size:13px}
.chatwave-popup-body textarea{font-size:13px}
}
