/* assets/css/wa-chat.css — floating WhatsApp chat widget (includes/wa-chat.php) */
.wa-chat { --wa-green: #25D366; --wa-dark: #075E54; --wa-teal: #128C7E; position: fixed; right: 24px; bottom: 24px; z-index: 950; font-family: inherit; }
.wa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Launcher */
.wa-fab { position: relative; width: 60px; height: 60px; border: 0; border-radius: 50%; background: var(--wa-green); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(37,211,102,0.42), 0 2px 6px rgba(0,0,0,0.12); transition: transform .18s ease, box-shadow .18s ease; }
.wa-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 14px 30px rgba(37,211,102,0.5), 0 2px 6px rgba(0,0,0,0.12); }
.wa-fab:focus-visible { outline: 3px solid #0D1730; outline-offset: 3px; }
.wa-fab::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--wa-green); opacity: .55; animation: wa-pulse 2.6s ease-out infinite; z-index: -1; }
.wa-chat.is-open .wa-fab::before { animation: none; opacity: 0; }
@keyframes wa-pulse { 0% { transform: scale(1); opacity: .5; } 70%, 100% { transform: scale(1.55); opacity: 0; } }
.wa-fab-icon { grid-area: 1 / 1; display: grid; place-items: center; transition: transform .22s ease, opacity .22s ease; }
.wa-fab-icon svg { width: 32px; height: 32px; }
.wa-fab-x { opacity: 0; transform: rotate(-90deg) scale(.6); }
.wa-fab-x svg { width: 24px; height: 24px; }
.wa-chat.is-open .wa-fab-open { opacity: 0; transform: rotate(90deg) scale(.6); }
.wa-chat.is-open .wa-fab-x { opacity: 1; transform: none; }
.wa-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #C34A22; color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; border: 2px solid #fff; animation: wa-pop .3s ease; }
@keyframes wa-pop { from { transform: scale(0); } to { transform: scale(1); } }

/* Teaser bubble */
.wa-teaser { position: absolute; right: 0; bottom: 74px; width: 250px; padding: 14px 34px 14px 16px; background: #fff; border-radius: 14px 14px 4px 14px; box-shadow: 0 12px 32px rgba(13,23,48,0.18); color: #0D1730; font-size: 0.9rem; line-height: 1.4; cursor: pointer; animation: wa-rise .3s ease; }
.wa-teaser[hidden] { display: none; }
.wa-teaser strong { display: block; margin-bottom: 2px; font-size: 0.95rem; }
.wa-teaser span { color: #4a5568; }
.wa-teaser-close { position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border: 0; background: none; color: #8a94a6; font-size: 20px; line-height: 1; cursor: pointer; border-radius: 50%; }
.wa-teaser-close:hover { background: #f1f3f6; color: #0D1730; }
@keyframes wa-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Panel */
.wa-panel { position: absolute; right: 0; bottom: 76px; width: 360px; max-height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 60px rgba(13,23,48,0.28), 0 4px 12px rgba(13,23,48,0.08); opacity: 0; transform: translateY(14px) scale(.97); transform-origin: bottom right; transition: opacity .2s ease, transform .2s ease; }
.wa-panel[hidden] { display: none; }
.wa-chat.is-open .wa-panel { opacity: 1; transform: none; }

.wa-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 16px; background: linear-gradient(135deg, var(--wa-dark), var(--wa-teal)); color: #fff; }
.wa-avatar { position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.wa-avatar img { width: 36px; height: 36px; object-fit: contain; border-radius: 50%; }
.wa-avatar > svg { width: 26px; height: 26px; color: var(--wa-teal); }
.wa-dot { position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--wa-green); border: 2px solid var(--wa-dark); }
.wa-dot.is-away { background: #f5b301; }
.wa-head-text { flex: 1; min-width: 0; }
.wa-title { font-weight: 700; font-size: 1rem; line-height: 1.25; }
.wa-status { font-size: 0.8rem; opacity: .88; margin-top: 2px; }
.wa-close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.14); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s; }
.wa-close:hover { background: rgba(255,255,255,0.26); }
.wa-close svg { width: 18px; height: 18px; }

.wa-body { flex: 1; overflow-y: auto; padding: 16px 14px 12px; min-height: 200px; background-color: #efeae2; background-image: radial-gradient(rgba(13,23,48,0.05) 1px, transparent 1px); background-size: 14px 14px; }
.wa-day { width: max-content; margin: 0 auto 12px; padding: 3px 10px; border-radius: 8px; background: rgba(255,255,255,0.85); color: #54656f; font-size: 0.72rem; font-weight: 600; letter-spacing: .02em; }
.wa-bubble { position: relative; max-width: 88%; padding: 9px 12px 20px; border-radius: 0 10px 10px 10px; background: #fff; color: #111b21; font-size: 0.92rem; line-height: 1.45; box-shadow: 0 1px 1px rgba(0,0,0,0.08); animation: wa-rise .25s ease; }
.wa-bubble[hidden] { display: none; }
.wa-bubble::before { content: ''; position: absolute; top: 0; left: -7px; border: 7px solid transparent; border-top-color: #fff; border-right-color: #fff; border-width: 0 7px 9px 0; }
.wa-bubble time { position: absolute; right: 10px; bottom: 5px; font-size: 0.68rem; color: #8696a0; }
.wa-typing { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 0 10px 10px 10px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,0.08); }
.wa-typing span { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: wa-dots 1.2s infinite ease-in-out; }
.wa-typing span:nth-child(2) { animation-delay: .15s; }
.wa-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes wa-dots { 0%, 60%, 100% { transform: none; opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.wa-topics { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; margin-top: 14px; animation: wa-rise .3s ease .1s both; }
.wa-topics[hidden] { display: none; }
.wa-topic { max-width: 92%; padding: 8px 14px; border: 1.5px solid var(--wa-teal); border-radius: 18px; background: #fff; color: var(--wa-dark); font: inherit; font-size: 0.86rem; font-weight: 600; text-align: right; cursor: pointer; transition: background .15s, color .15s; }
.wa-topic[hidden] { display: none; }
.wa-topic:hover { background: #e7f7ef; }
.wa-topic.is-on { background: var(--wa-teal); color: #fff; }
.wa-topic:focus-visible { outline: 2px solid #0D1730; outline-offset: 2px; }

.wa-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 10px 8px; background: #f0f2f5; }
.wa-compose textarea { flex: 1; min-height: 42px; max-height: 110px; resize: none; padding: 11px 14px; border: 0; border-radius: 21px; background: #fff; color: #111b21; font: inherit; font-size: 0.92rem; line-height: 1.35; outline: none; }
.wa-compose textarea:focus { box-shadow: 0 0 0 2px rgba(18,140,126,0.35); }
.wa-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--wa-teal); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .15s, transform .15s; }
.wa-send:hover { background: var(--wa-dark); transform: scale(1.05); }
.wa-send svg { width: 20px; height: 20px; margin-left: 2px; }
.wa-foot { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 0 9px; background: #f0f2f5; color: #667781; font-size: 0.72rem; }
.wa-foot svg { width: 13px; height: 13px; color: var(--wa-teal); }

/* Pages with their own floating "Enquire" button (resort pages): sit above it */
body:has(.mv-fab) .wa-chat { bottom: 92px; }

/* Phones: smaller launcher, panel becomes a bottom sheet */
@media (max-width: 640px) {
    .wa-chat { right: 16px; bottom: 16px; }
    body:has(.mv-fab) .wa-chat { bottom: 82px; }
    .wa-fab { width: 54px; height: 54px; }
    .wa-fab-icon svg { width: 29px; height: 29px; }
    .wa-panel { position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh; border-radius: 18px 18px 0 0; transform: translateY(100%); transform-origin: bottom center; }
    .wa-chat.is-open .wa-fab { opacity: 0; pointer-events: none; }
    .wa-compose textarea { font-size: 16px; } /* stops iOS zoom on focus */
    .wa-foot { padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
    .wa-fab::before, .wa-typing span { animation: none; }
    .wa-panel, .wa-fab-icon { transition: none; }
}
