.wa-float, .mobile-bar { display: none !important; }
@media (max-width: 768px) { body { padding-bottom: 0 !important; } }

/* Floating button */
.cw-btn { position: fixed; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); right: calc(1.25rem + env(safe-area-inset-right, 0px)); width: 60px; height: 60px; background: #25d366; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 24px rgba(37,211,102,0.42); cursor: pointer; border: none; z-index: 1000; transition: transform 160ms cubic-bezier(0.23,1,0.32,1), background-color 160ms ease; padding: 0; text-decoration: none; touch-action: manipulation; }
.cw-btn:active { transform: scale(0.95); }
.cw-btn svg { width: 30px; height: 30px; stroke: none; fill: white; }
.cw-btn .cw-icon-close { display: none; }
.cw-btn.open .cw-icon-chat { display: none; }
.cw-btn.open .cw-icon-close { display: block; }

/* Reusable face avatar — outer wrapper holds the dot OUTSIDE the circular clip */
.cw-face { position: relative; flex-shrink: 0; display: block; }
.cw-face-img { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: #eef3fb; display: block; }
.cw-face-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; display: block; }
.cw-face-status { position: absolute; bottom: -1px; right: -1px; width: 12px; height: 12px; background: #22c55e; border: 2px solid white; border-radius: 50%; box-sizing: border-box; }

/* Teaser bubble */
.cw-teaser { display: none !important; position: fixed; bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); right: calc(1.25rem + env(safe-area-inset-right, 0px)); background: white; padding: 0.7rem 2rem 0.7rem 0.7rem; border-radius: 16px; max-width: 280px; box-shadow: 0 12px 32px rgba(20,33,61,0.16), 0 2px 6px rgba(20,33,61,0.06); font-size: 0.88rem; line-height: 1.4; color: #1a2540; z-index: 999; opacity: 0; transform-origin: bottom right; transform: translateY(10px) scale(0.96); pointer-events: none; transition: opacity 180ms cubic-bezier(0.23,1,0.32,1), transform 180ms cubic-bezier(0.23,1,0.32,1); cursor: pointer; font-family: inherit; align-items: center; gap: 0.7rem; border: 1px solid #eef0f5; }
.cw-teaser.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.cw-teaser .cw-face { width: 40px; height: 40px; }
.cw-teaser-text { min-width: 0; flex: 1; }
.cw-teaser-close { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; background: transparent; border: none; cursor: pointer; color: #9aa3b2; font-size: 20px; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; }

/* Popup */
.cw-popup { position: fixed; bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); right: calc(1.25rem + env(safe-area-inset-right, 0px)); width: 360px; max-width: calc(100vw - 1.5rem); max-height: calc(100dvh - 7.5rem); background: white; border-radius: 16px; box-shadow: 0 20px 48px rgba(20,33,61,0.22), 0 4px 12px rgba(20,33,61,0.08); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; z-index: 1001; opacity: 0; transform-origin: bottom right; transform: translateY(12px) scale(0.96); pointer-events: none; transition: opacity 150ms cubic-bezier(0.23,1,0.32,1), transform 150ms cubic-bezier(0.23,1,0.32,1); font-family: inherit; border: 1px solid #eef0f5; }
.cw-popup.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; transition: opacity 220ms cubic-bezier(0.23,1,0.32,1), transform 220ms cubic-bezier(0.23,1,0.32,1); }
.cw-header { background: linear-gradient(135deg, #001d61 0%, #264d9a 60%, #3b6bbf 100%); color: white; padding: 1.1rem 1.1rem; display: flex; align-items: center; gap: 0.8rem; position: sticky; top: 0; z-index: 2; overflow: hidden; }
.cw-header::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 100% 0%, rgba(255,255,255,0.10), transparent 50%); pointer-events: none; }
.cw-header .cw-face { width: 44px; height: 44px; box-shadow: 0 0 0 2px rgba(255,255,255,0.35); border-radius: 50%; }
.cw-header-text { flex: 1; min-width: 0; position: relative; }
.cw-header-text strong { display: block; font-size: 1.05rem; font-weight: 600; letter-spacing: -0.005em; }
.cw-close { background: rgba(255,255,255,0.12); border: none; color: white; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: background-color 160ms ease, transform 140ms cubic-bezier(0.23,1,0.32,1); position: relative; }
.cw-close:active { transform: scale(0.94); }

.cw-body { padding: 1.1rem 1rem 0.6rem; background: #f6f8fb; min-height: 130px; }
.cw-msg-row, .cw-typing-row { display: none; align-items: flex-end; gap: 0.5rem; margin-bottom: 0.5rem; }
.cw-msg-row.show, .cw-typing-row.show { display: flex; animation: cwMsgIn 240ms cubic-bezier(0.23,1,0.32,1); }
@keyframes cwMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cw-msg-row .cw-face, .cw-typing-row .cw-face { width: 26px; height: 26px; }
.cw-msg-row .cw-face .cw-face-status, .cw-typing-row .cw-face .cw-face-status { display: none; }
.cw-msg-row .cw-face + .cw-face { visibility: hidden; }
.cw-msg { background: white; padding: 0.65rem 0.85rem; border-radius: 14px 14px 14px 4px; font-size: 0.91rem; color: #1a2540; line-height: 1.45; max-width: 78%; box-shadow: 0 1px 2px rgba(20,33,61,0.06); }
.cw-typing { background: white; padding: 0.7rem 0.85rem; border-radius: 14px 14px 14px 4px; box-shadow: 0 1px 2px rgba(20,33,61,0.06); display: inline-flex; gap: 4px; align-items: center; line-height: 1; }
.cw-typing span { width: 6px; height: 6px; border-radius: 50%; background: #8a93a4; animation: cwDot 1.2s infinite ease-in-out; }
.cw-typing span:nth-child(2) { animation-delay: 0.18s; }
.cw-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes cwDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-4px); opacity: 1; } }

/* Form */
.cw-form { padding: 0.9rem 1rem 1rem; background: white; border-top: 1px solid #eef0f5; }
.cw-form label { display: block; font-size: 0.78rem; color: #5a6478; margin-bottom: 0.32rem; font-weight: 500; }
.cw-phone { display: flex; align-items: stretch; border: 1px solid #d8dde6; border-radius: 10px; overflow: hidden; margin-bottom: 0.7rem; transition: border-color 160ms ease, box-shadow 160ms ease; background: white; }
.cw-phone span { padding: 0 0.7rem; color: #5a6478; background: #f6f8fb; font-size: 0.92rem; display: flex; align-items: center; border-right: 1px solid #e5e9f0; font-weight: 500; }
.cw-phone input { flex: 1; border: none; padding: 0.62rem 0.7rem; font-size: 1rem; outline: none; font-family: inherit; min-width: 0; color: #1a2540; }
.cw-form textarea { width: 100%; border: 1px solid #d8dde6; border-radius: 10px; padding: 0.6rem 0.7rem; font-size: 1rem; font-family: inherit; resize: vertical; min-height: 68px; outline: none; box-sizing: border-box; margin-bottom: 0.8rem; transition: border-color 160ms ease, box-shadow 160ms ease; line-height: 1.4; color: #1a2540; background: white; }
.cw-form textarea:focus, .cw-phone:focus-within { border-color: #264d9a; box-shadow: 0 0 0 3px rgba(38,77,154,0.16); }
.cw-form button { width: 100%; background: #264d9a; color: white; border: none; padding: 0.78rem; border-radius: 10px; font-size: 0.96rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: background-color 160ms ease, transform 140ms cubic-bezier(0.23,1,0.32,1); display: flex; align-items: center; justify-content: center; gap: 0.45rem; }
.cw-form button:active { transform: scale(0.97); }
.cw-form button:disabled { opacity: 0.6; cursor: not-allowed; }
.cw-form button svg { width: 16px; height: 16px; stroke: white; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cw-form .cw-note { font-size: 0.72rem; color: #5f6875; text-align: center; margin: 0.55rem 0 0; line-height: 1.4; }
.cw-form .cw-note a { color: #5a6478; text-decoration: underline; }

@media (hover: hover) and (pointer: fine) {
  .cw-btn:hover { transform: scale(1.04); background: #1ebe57; }
  .cw-teaser-close:hover { color: #1a2540; }
  .cw-close:hover { background: rgba(255,255,255,0.22); }
  .cw-form button:hover { background: #1f3f80; }
}

.cw-success { padding: 1.8rem 1rem 1.5rem; text-align: center; background: white; }
.cw-success-icon { width: 52px; height: 52px; border-radius: 50%; background: #ecfdf5; display: flex; align-items: center; justify-content: center; margin: 0 auto 0.85rem; }
.cw-success-icon svg { width: 26px; height: 26px; stroke: #16a34a; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cw-success strong { display: block; font-size: 1.05rem; font-weight: 600; color: #1a2540; margin-bottom: 0.3rem; }
.cw-success p { font-size: 0.9rem; color: #5a6478; line-height: 1.45; margin: 0; }

@media (max-width: 480px) {
  .cw-btn { width: 56px; height: 56px; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); right: calc(1rem + env(safe-area-inset-right, 0px)); }
  .cw-popup, .cw-teaser { right: calc(1rem + env(safe-area-inset-right, 0px)); bottom: calc(5rem + env(safe-area-inset-bottom, 0px)); }
  .cw-popup { width: calc(100vw - 2rem); }
}

@keyframes cwPulse {
  0% { transform: scale(1); opacity: 0.45; }
  70%, 100% { transform: scale(1.47); opacity: 0; }
}
.cw-btn.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: rgba(38,77,154,0.45); pointer-events: none;
  animation: cwPulse 2.4s ease-in-out infinite;
}
.cw-btn-whatsapp.pulse::after { background: rgba(37,211,102,0.45); }

@media (prefers-reduced-motion: reduce) {
  .cw-btn.pulse::after,
  .cw-typing span,
  .cw-msg-row.show,
  .cw-typing-row.show { animation: none; }
  .cw-popup,
  .cw-teaser { transform: none; transition: opacity 150ms ease; }
  .cw-btn, .cw-close, .cw-form button { transition: background-color 150ms ease; }
}
