/* Ventana flotante de WhatsApp (js/modules/wa-widget.js). Abajo a la izquierda: el widget del tipo de cambio ocupa la derecha. */
.arwa { --arwa-green: #25d366; --arwa-green-dark: #1da851; --arwa-ink: var(--ink, #111511); --arwa-gold: var(--gold, #dea202); position: fixed; left: 24px; bottom: 24px; z-index: 1600; font-family: var(--font-body, "Helvetica Neue", Helvetica, Arial, sans-serif); }
.arwa *, .arwa *::before, .arwa *::after { box-sizing: border-box; }
.arwa [hidden] { display: none !important; }

/* ----- botón ----- */
.arwa-fab { position: relative; display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: var(--arwa-green); color: #fff; cursor: pointer; box-shadow: 0 8px 22px rgba(17, 21, 17, .32), 0 0 0 1px rgba(255, 255, 255, .12) inset; transition: transform .2s cubic-bezier(.22, 1, .36, 1), background .2s, box-shadow .2s; animation: arwa-pulse 2.6s ease-out 1.2s 3; }
.arwa-fab:hover { background: var(--arwa-green-dark); transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 28px rgba(17, 21, 17, .38); }
.arwa-fab:focus-visible { outline: 3px solid var(--arwa-gold); outline-offset: 3px; }
.arwa-fab svg { width: 32px; height: 32px; }
.arwa-fab__dot { position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%; background: #ff3b30; border: 2px solid #fff; }
.arwa.is-open .arwa-fab__dot { display: none; }
@keyframes arwa-pulse { 0% { box-shadow: 0 8px 22px rgba(17, 21, 17, .32), 0 0 0 0 rgba(37, 211, 102, .55); } 100% { box-shadow: 0 8px 22px rgba(17, 21, 17, .32), 0 0 0 20px rgba(37, 211, 102, 0); } }

/* ----- globo de invitación ----- */
.arwa-teaser { position: absolute; left: 70px; bottom: 8px; display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; max-width: 250px; border-radius: 16px 16px 16px 4px; background: #fff; color: var(--arwa-ink); font-size: .9rem; line-height: 1.3; box-shadow: 0 10px 30px rgba(17, 21, 17, .22); cursor: pointer; animation: arwa-rise .4s cubic-bezier(.22, 1, .36, 1); }
.arwa-teaser b { color: var(--arwa-green-dark); }
.arwa-teaser__x { flex: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: rgba(17, 21, 17, .08); color: var(--arwa-ink); cursor: pointer; }
.arwa-teaser__x svg { width: 12px; height: 12px; }

/* ----- ventana ----- */
.arwa-panel { position: absolute; left: 0; bottom: 74px; display: flex; flex-direction: column; width: 360px; max-width: calc(100vw - 32px); max-height: min(560px, calc(100vh - 120px)); overflow: hidden; border-radius: 20px; background: #f3eee4; color: var(--arwa-ink); box-shadow: 0 24px 60px rgba(17, 21, 17, .38), 0 0 0 1px rgba(17, 21, 17, .08); opacity: 0; transform: translateY(14px) scale(.97); transform-origin: bottom left; transition: opacity .25s ease, transform .3s cubic-bezier(.22, 1, .36, 1); }
.arwa-panel.is-in { opacity: 1; transform: none; }
.arwa-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: linear-gradient(135deg, #1b231c, #263c2a); color: #fff; border-bottom: 3px solid var(--arwa-gold); }
.arwa-head__img { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #fff; object-fit: contain; padding: 3px; }
.arwa-head__txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.arwa-head__txt strong { font-family: var(--font-display, "Oswald", Arial, sans-serif); font-weight: 600; font-size: 1.05rem; letter-spacing: .04em; text-transform: uppercase; }
.arwa-head__txt span { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: rgba(255, 255, 255, .78); }
.arwa-live { width: 8px; height: 8px; border-radius: 50%; background: var(--arwa-green); box-shadow: 0 0 0 3px rgba(37, 211, 102, .25); }
.arwa-head__close { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; cursor: pointer; transition: background .2s; }
.arwa-head__close:hover { background: rgba(255, 255, 255, .2); }
.arwa-head__close:focus-visible { outline: 2px solid var(--arwa-gold); outline-offset: 2px; }
.arwa-head__close svg { width: 16px; height: 16px; }

.arwa-body { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 120px; overflow-y: auto; padding: 16px 16px 8px; background-image: radial-gradient(rgba(17, 21, 17, .045) 1px, transparent 1px); background-size: 14px 14px; }
.arwa-msg { align-self: flex-start; max-width: 86%; padding: 9px 13px; border-radius: 4px 14px 14px 14px; background: #fff; font-size: .93rem; line-height: 1.4; box-shadow: 0 1px 2px rgba(17, 21, 17, .1); animation: arwa-rise .3s cubic-bezier(.22, 1, .36, 1); }
.arwa-typing { display: flex; gap: 4px; padding: 12px 14px; }
.arwa-typing i { width: 7px; height: 7px; border-radius: 50%; background: #9a9486; animation: arwa-dot 1s ease-in-out infinite; }
.arwa-typing i:nth-child(2) { animation-delay: .15s; }
.arwa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes arwa-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes arwa-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.arwa-replies { display: grid; gap: 7px; padding: 6px 16px 12px; background: #f3eee4; animation: arwa-rise .35s cubic-bezier(.22, 1, .36, 1); }
.arwa-reply { display: block; padding: 10px 14px; border: 1.5px solid var(--arwa-gold); border-radius: 999px; background: #fff; color: var(--arwa-ink); font-size: .9rem; font-weight: 600; text-align: center; text-decoration: none; transition: background .18s, color .18s, transform .18s; }
.arwa-reply:hover { background: var(--arwa-gold); transform: translateY(-1px); }
.arwa-reply:focus-visible { outline: 3px solid var(--arwa-ink); outline-offset: 2px; }
.arwa-reply--featured { border-color: var(--arwa-green-dark); background: var(--arwa-green); color: #fff; }
.arwa-reply--featured:hover { background: var(--arwa-green-dark); color: #fff; }

.arwa-form { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid rgba(17, 21, 17, .1); }
.arwa-form__input { flex: 1; min-width: 0; height: 42px; padding: 0 16px; border: 1px solid rgba(17, 21, 17, .18); border-radius: 999px; background: #f7f4ee; color: var(--arwa-ink); font: inherit; font-size: .92rem; }
.arwa-form__input:focus { outline: 0; border-color: var(--arwa-green-dark); box-shadow: 0 0 0 3px rgba(37, 211, 102, .2); }
.arwa-form__send { flex: none; display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: var(--arwa-green); color: #fff; cursor: pointer; transition: background .2s, transform .2s; }
.arwa-form__send:hover { background: var(--arwa-green-dark); transform: scale(1.05); }
.arwa-form__send:focus-visible { outline: 3px solid var(--arwa-ink); outline-offset: 2px; }
.arwa-form__send svg { width: 20px; height: 20px; }
.arwa-note { margin: 0; padding: 0 14px 10px; background: #fff; color: #6d675b; font-size: .72rem; text-align: center; }

/* ----- celular: hoja inferior ----- */
@media (max-width: 768px) {
  .arwa { left: max(16px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .arwa-fab { width: 54px; height: 54px; }
  .arwa-fab svg { width: 28px; height: 28px; }
  .arwa-panel { position: fixed; left: 12px; right: 12px; bottom: 82px; width: auto; max-width: none; max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); }
  .arwa-teaser { left: 62px; max-width: calc(100vw - 100px); }
}
@media (max-height: 520px) {
  .arwa-panel { max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px); bottom: 74px; }
  .arwa-body { min-height: 60px; }
  .arwa-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .arwa-fab { animation: none; }
  .arwa-panel, .arwa-msg, .arwa-replies, .arwa-teaser { animation: none; transition: none; }
  .arwa-typing i { animation: none; }
}
@media print { .arwa { display: none; } }
