/* WhatsApp button and Bridget chat assistant */

.wa-float { position: fixed; left: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 65; display: flex; align-items: center; gap: 0; height: 56px; padding: 0 14px; border-radius: 999px; background: #25D366; color: #fff; box-shadow: 0 10px 28px rgba(37,211,102,.38); transition: transform .25s var(--ease), box-shadow .25s, gap .3s var(--ease), padding .3s var(--ease); text-decoration: none; }
.wa-float:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 34px rgba(37,211,102,.45); }
.wa-float__label { max-width: 0; overflow: hidden; white-space: nowrap; font-family: var(--font-head); font-weight: 700; font-size: .92rem; transition: max-width .35s var(--ease); }
@media (hover: hover) { .wa-float:hover { gap: 10px; padding-right: 20px; } .wa-float:hover .wa-float__label { max-width: 160px; } }
.wa-float::before { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 rgba(37,211,102,.5); animation: wa-pulse 2.6s infinite; }
@keyframes wa-pulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.45); } 70% { box-shadow: 0 0 0 16px rgba(37,211,102,0); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); } }

.bridget { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 66; font-family: var(--font-body); }
.bridget__launcher { position: relative; width: 62px; height: 62px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; background: radial-gradient(circle at 30% 25%, #2FA57C, #0E7A58 55%, #0A5F44); box-shadow: 0 12px 30px rgba(14,122,88,.4); display: grid; place-items: center; transition: transform .25s var(--ease); }
.bridget__launcher:hover { transform: translateY(-2px) scale(1.03); }
.bridget__face, .bridget__avatar { position: relative; font-family: var(--font-serif); font-style: italic; font-size: 30px; line-height: 1; color: #fff; }
.bridget__spark { position: absolute; top: -4px; right: -9px; width: 10px; height: 10px; background: #E3C77A; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: spark 2.8s ease-in-out infinite; }
@keyframes spark { 0%, 100% { transform: scale(.8) rotate(0); opacity: .8; } 50% { transform: scale(1.2) rotate(45deg); opacity: 1; } }
.bridget__close-icon { display: none; }
.bridget.is-open .bridget__face { display: none; }
.bridget.is-open .bridget__close-icon { display: grid; }
.bridget__dot { position: absolute; top: 4px; right: 4px; width: 14px; height: 14px; border-radius: 50%; background: #E3C77A; border: 2px solid #fff; }

.bridget__nudge { position: absolute; right: 0; bottom: 76px; width: 250px; padding: 14px 34px 14px 16px; background: #fff; border-radius: 16px 16px 4px 16px; box-shadow: 0 16px 40px rgba(12,42,34,.18); border: 1px solid var(--line); font-size: .9rem; color: var(--body); animation: nudge-in .5s var(--ease); }
.bridget__nudge strong { display: block; color: var(--navy); font-family: var(--font-head); margin-bottom: 2px; }
.bridget__nudge-close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
@keyframes nudge-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

.bridget__panel { position: absolute; right: 0; bottom: 78px; width: 380px; height: min(600px, calc(100vh - 120px)); height: min(600px, calc(100dvh - 120px)); display: flex; flex-direction: column; background: #FAFAF7; border-radius: 22px; overflow: hidden; box-shadow: 0 30px 70px rgba(12,42,34,.28); border: 1px solid rgba(12,42,34,.08); transform-origin: bottom right; animation: panel-in .35s var(--ease); }
.bridget__panel[hidden] { display: none; }
@keyframes panel-in { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.bridget__head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px; color: #fff; background: radial-gradient(60% 120% at 100% 0%, rgba(200,160,74,.35), transparent 60%), linear-gradient(135deg, #0C2A22, #0E5A43); }
.bridget__avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, #2FA57C, #0E7A58 60%); font-size: 22px; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.bridget__avatar .bridget__spark { top: -2px; right: -2px; width: 9px; height: 9px; }
.bridget__title { flex: 1; min-width: 0; }
.bridget__title strong { display: block; font-family: var(--font-head); font-size: 1.05rem; }
.bridget__title span { font-size: .78rem; color: #C7D6CF; display: flex; align-items: center; gap: 6px; }
.bridget__online { width: 8px; height: 8px; border-radius: 50%; background: #4ADE80; display: inline-block; }
.bridget__icon-btn { background: rgba(255,255,255,.1); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.bridget__icon-btn:hover { background: rgba(255,255,255,.2); }

.bridget__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; scroll-behavior: smooth; }
.bmsg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-size: .92rem; line-height: 1.5; animation: msg-in .3s var(--ease); overflow-wrap: anywhere; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.bmsg--bot { align-self: flex-start; background: #fff; color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bmsg--bot strong { color: var(--navy); }
.bmsg--me { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 4px; }
.bmsg__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.bmsg__actions a { display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--navy); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: .82rem; }
.bmsg__actions a:hover { background: var(--red); color: #fff; }
.bchips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; animation: msg-in .3s var(--ease); }
.bchips button { border: 1.5px solid #CFE6DB; background: #fff; color: var(--red-600); border-radius: 999px; padding: 8px 13px; font-size: .84rem; font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: background .2s, border-color .2s; }
.bchips button:hover { background: var(--red-50); border-color: var(--red); }
.btyping { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 4px; }
.btyping i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.btyping i:nth-child(2) { animation-delay: .15s; } .btyping i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }

.bridget__form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); background: #fff; }
.bridget__form input { flex: 1; border: 1.5px solid var(--line); border-radius: 999px; padding: 12px 16px; font-size: 16px; background: #FAFAF7; }
.bridget__form input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(14,122,88,.1); }
.bridget__form button { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; background: var(--red); color: #fff; display: grid; place-items: center; cursor: pointer; }
.bridget__form button:hover { background: var(--red-600); }
.bridget__foot { margin: 0; padding: 0 14px 10px; background: #fff; font-size: .72rem; color: var(--muted); text-align: center; }

body.nav-open .wa-float, body.nav-open .bridget { display: none; }
@media print { .wa-float, .bridget { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .wa-float::before, .bridget__spark { animation: none; } }

@media (max-width: 640px) {
  .wa-float { left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); height: 52px; padding: 0 12px; }
  .bridget { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .bridget__launcher { width: 56px; height: 56px; }
  .bridget__nudge { bottom: 68px; width: min(260px, calc(100vw - 100px)); }
  .bridget.is-open .bridget__panel { position: fixed; inset: 0; width: 100%; height: 100%; border-radius: 0; bottom: 0; }
  .bridget.is-open .bridget__launcher { display: none; }
  .bridget__head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .bridget__form { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  body.bridget-open { overflow: hidden; }
  body.bridget-open .wa-float { display: none; }
}
