/* AQUATAM Chatbot — styles
   Brand navy + ola azul; mobile-first
*/
:root{
  --aq-navy:#0e2a4d;
  --aq-blue:#1566ad;
  --aq-accent:#2f86d6;
  --aq-wa:#25d366;
  --aq-line:#e3e9f1;
  --aq-mute:#6b7a8d;
}

/* Modal overlay */
.aq-chat{position:fixed;inset:0;z-index:9999;pointer-events:none;display:flex;align-items:flex-end;justify-content:flex-end;padding:20px;font-family:'Hanken Grotesk','Inter',system-ui,sans-serif}
.aq-chat .aq-backdrop{position:absolute;inset:0;background:rgba(14,42,77,.45);opacity:0;transition:opacity .25s ease;backdrop-filter:blur(2px)}
.aq-chat.open{pointer-events:auto}
.aq-chat.open .aq-backdrop{opacity:1}

/* Panel */
.aq-panel{position:relative;width:100%;max-width:420px;height:min(640px, calc(100vh - 40px));background:#fff;border-radius:24px;box-shadow:0 30px 80px -20px rgba(8,35,63,.45);overflow:hidden;display:flex;flex-direction:column;transform:translateY(20px) scale(.98);opacity:0;transition:transform .3s cubic-bezier(.2,.7,.3,1), opacity .25s ease}
.aq-chat.open .aq-panel{transform:translateY(0) scale(1);opacity:1}

/* Head */
.aq-head{background:linear-gradient(135deg,var(--aq-navy) 0%,var(--aq-blue) 100%);color:#fff;padding:18px 20px;display:flex;align-items:center;gap:12px;position:relative;flex-shrink:0}
.aq-avatar{width:42px;height:42px;border-radius:50%;background:rgba(255,255,255,.15);display:grid;place-items:center;flex-shrink:0;border:2px solid rgba(255,255,255,.25)}
.aq-avatar svg{width:22px;height:22px;color:#fff}
.aq-meta{flex:1;min-width:0}
.aq-meta h3{margin:0;font-size:1rem;font-weight:700;font-family:'Sora','Fraunces',serif}
.aq-meta p{margin:2px 0 0;font-size:.78rem;opacity:.85;display:flex;align-items:center;gap:6px}
.aq-meta p::before{content:"";width:7px;height:7px;border-radius:50%;background:#4ade80;box-shadow:0 0 0 0 rgba(74,222,128,.7);animation:aq-pulse 1.8s infinite}
@keyframes aq-pulse{0%{box-shadow:0 0 0 0 rgba(74,222,128,.7)}70%{box-shadow:0 0 0 8px rgba(74,222,128,0)}100%{box-shadow:0 0 0 0 rgba(74,222,128,0)}}
.aq-close{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.22);color:#fff;width:32px;height:32px;border-radius:10px;cursor:pointer;display:grid;place-items:center;transition:background .15s}
.aq-close:hover{background:rgba(255,255,255,.25)}
.aq-close svg{width:16px;height:16px}

/* Progress */
.aq-progress{height:3px;background:#e7eef6;position:relative;overflow:hidden;flex-shrink:0}
.aq-progress::after{content:"";position:absolute;top:0;left:0;height:100%;width:var(--p,5%);background:linear-gradient(90deg,var(--aq-blue),var(--aq-accent));transition:width .4s}

/* Body */
.aq-body{flex:1;overflow-y:auto;padding:20px;background:#f7fafd;display:flex;flex-direction:column;gap:14px;scroll-behavior:smooth}
.aq-body::-webkit-scrollbar{width:6px}
.aq-body::-webkit-scrollbar-thumb{background:#cfd9e6;border-radius:3px}

/* Messages */
.aq-msg{max-width:82%;animation:aq-in .35s ease}
@keyframes aq-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.aq-bot{align-self:flex-start}
.aq-user{align-self:flex-end}
.aq-bubble{padding:12px 16px;border-radius:18px;font-size:.92rem;line-height:1.45}
.aq-bot .aq-bubble{background:#fff;color:var(--aq-navy);border:1px solid var(--aq-line);border-bottom-left-radius:6px;box-shadow:0 2px 6px rgba(14,42,77,.04)}
.aq-user .aq-bubble{background:linear-gradient(135deg,var(--aq-blue) 0%,var(--aq-accent) 100%);color:#fff;border-bottom-right-radius:6px}

/* Typing */
.aq-typing{display:inline-flex;gap:4px;padding:14px 18px;background:#fff;border:1px solid var(--aq-line);border-radius:18px;border-bottom-left-radius:6px}
.aq-typing span{width:7px;height:7px;background:#9bb0c8;border-radius:50%;animation:aq-bounce 1.2s infinite}
.aq-typing span:nth-child(2){animation-delay:.15s}
.aq-typing span:nth-child(3){animation-delay:.3s}
@keyframes aq-bounce{0%,80%,100%{transform:scale(.7);opacity:.5}40%{transform:scale(1);opacity:1}}

/* Choices */
.aq-choices{display:flex;flex-direction:column;gap:8px;margin-top:4px;animation:aq-in .4s ease .1s both}
.aq-choice{background:#fff;border:1.5px solid var(--aq-line);color:var(--aq-navy);padding:12px 16px;border-radius:14px;font-size:.9rem;font-weight:600;cursor:pointer;text-align:left;transition:all .2s;display:flex;align-items:center;justify-content:space-between;gap:10px;font-family:inherit}
.aq-choice:hover{border-color:var(--aq-blue);background:#eef5fc;transform:translateX(2px)}
.aq-arrow{opacity:0;transition:opacity .2s;color:var(--aq-blue)}
.aq-choice:hover .aq-arrow{opacity:1}

/* Input */
.aq-input{padding:14px 16px;background:#fff;border-top:1px solid var(--aq-line);display:flex;gap:8px;align-items:center;flex-shrink:0}
.aq-input input{flex:1;border:1.5px solid var(--aq-line);border-radius:12px;padding:12px 14px;font-size:.92rem;font-family:inherit;outline:none;color:var(--aq-navy);transition:border-color .2s}
.aq-input input:focus{border-color:var(--aq-blue)}
.aq-send{width:42px;height:42px;border-radius:12px;border:none;background:linear-gradient(135deg,var(--aq-blue) 0%,var(--aq-accent) 100%);color:#fff;cursor:pointer;display:grid;place-items:center;transition:transform .15s;flex-shrink:0}
.aq-send:hover{transform:scale(1.05)}
.aq-send svg{width:18px;height:18px}

/* Final CTA pinned */
.aq-cta-pinned{padding:14px 16px 18px;background:#fff;border-top:1px solid var(--aq-line);display:flex;flex-direction:column;align-items:center;gap:8px;animation:aq-in .4s ease;flex-shrink:0}
.aq-btn-wa{display:flex;align-items:center;justify-content:center;gap:10px;background:var(--aq-wa);color:#fff;padding:18px 22px;border-radius:14px;font-weight:700;text-decoration:none;font-size:1.05rem;width:100%;box-shadow:0 10px 24px -6px rgba(37,211,102,.55);transition:transform .15s;animation:aq-wa-pulse 1.8s ease-in-out infinite;font-family:inherit}
.aq-btn-wa:hover{transform:translateY(-1px)}
.aq-btn-wa svg{width:20px;height:20px}
@keyframes aq-wa-pulse{0%,100%{box-shadow:0 10px 24px -6px rgba(37,211,102,.55)}50%{box-shadow:0 14px 32px -4px rgba(37,211,102,.75)}}
.aq-cta-hint{font-size:.75rem;color:var(--aq-mute);font-weight:500}

/* FAB — botón flotante esquina inferior derecha */
.aq-fab{position:fixed;bottom:88px;right:20px;width:60px;height:60px;border-radius:50%;background:linear-gradient(135deg,var(--aq-blue) 0%,var(--aq-accent) 100%);box-shadow:0 12px 30px -8px rgba(21,102,173,.55);display:grid;place-items:center;cursor:pointer;border:none;color:#fff;z-index:75;transition:transform .2s ease, box-shadow .2s ease}
.aq-fab:hover{transform:scale(1.05);box-shadow:0 16px 36px -6px rgba(21,102,173,.7)}
.aq-fab::after{content:"";position:absolute;top:-2px;right:-2px;width:14px;height:14px;border-radius:50%;background:#4ade80;border:2px solid #fff;animation:aq-pulse 1.8s infinite}
.aq-fab svg{width:26px;height:26px}

/* Mobile */
@media(max-width:560px){
  .aq-chat{padding:0;align-items:stretch;justify-content:stretch}
  .aq-panel{max-width:100%;height:100vh;border-radius:0}
  .aq-fab{bottom:78px;right:14px;width:54px;height:54px}
  .aq-fab svg{width:22px;height:22px}
}

/* Evita scroll del body cuando el chat está abierto en mobile */
@media(max-width:560px){
  body.aq-chat-open{overflow:hidden}
}
