/* ──────────────────────────────────────────────
   WhatsApp IA — Frontend Styles v2.2
   ────────────────────────────────────────────── */

/* ── Botón flotante ── */
.whatsapp-float {
    position: fixed;
    z-index: 9999;
}

.whatsapp-button {
    background: #25D366;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,211,102,0.42);
    transition: background .22s ease, transform .18s ease, box-shadow .22s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 15px;
    border: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}
.whatsapp-button:hover {
    background: #128C7E;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(18,140,126,0.48);
}
.whatsapp-button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(37,211,102,0.45);
}

/* ── Overlay ── */
.whatsapp-modal {
    position: fixed;
    z-index: 10000;
    inset: 0;
    background: rgba(0,0,0,.52);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: wa-overlay-in .18s ease;
}
@keyframes wa-overlay-in { from{opacity:0} to{opacity:1} }

/* ── Modal wrapper ── */
.whatsapp-modal-content {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,.28);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    animation: wa-modal-in .24s cubic-bezier(.34,1.52,.64,1);
}
@keyframes wa-modal-in {
    from { opacity:0; transform:scale(.88) translateY(18px); }
    to   { opacity:1; transform:scale(1)   translateY(0);    }
}

/* ═══════════════════════════════════════
   CABECERA — layout de una sola fila
═══════════════════════════════════════ */
.wa-header {
    background: #075e54;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 62px;
}

.wa-header-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wa-header-avatar svg { width:26px; height:26px; fill:#fff; display:block; }

.wa-header-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.wa-header-title {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0 0 4px 0;   /* exactamente 4px entre las dos líneas de texto */
    padding: 0;
}
.wa-header-sub {
    color: rgba(255,255,255,.72);
    font-size: 12.5px;
    margin: 0;
    padding: 0;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wa-header-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .14s;
    line-height: 1;
}
.wa-header-close:hover { background: rgba(255,255,255,.15); color:#fff; }
.wa-header-close:focus-visible { outline:2px solid #fff; outline-offset:2px; }
.wa-header-close svg { width:18px; height:18px; fill:currentColor; display:block; }

/* ═══════════════════════════════════════
   BODY
═══════════════════════════════════════ */
.wa-body {
    padding: 18px 18px 22px;
    background: #f7f8fa;
}

/* ── Badge estado ── */
.wa-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 12px;
}
.wa-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.wa-status-dot.online  { background:#25D366; animation: wa-pulse 2s infinite; }
.wa-status-dot.offline { background:#9ca3af; }
@keyframes wa-pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── Burbuja de mensaje ── */
.wa-bubble {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0 10px 10px 10px;
    padding: 10px 13px;
    margin-bottom: 16px;
    font-size: 13.5px;
    color: #111827;
    line-height: 1.55;
    box-shadow: 0 1px 3px rgba(0,0,0,.07);
    position: relative;
    max-width: 90%;
}
.wa-bubble::before {
    content:'';
    position:absolute;
    top:0; left:-8px;
    border-width:0 8px 8px 0;
    border-style:solid;
    border-color:transparent #e5e7eb transparent transparent;
}
.wa-bubble::after {
    content:'';
    position:absolute;
    top:1px; left:-6px;
    border-width:0 6px 6px 0;
    border-style:solid;
    border-color:transparent #fff transparent transparent;
}
.wa-bubble-icon {
    display:inline-block;
    vertical-align: middle;
    margin-right: 4px;
}
.wa-bubble-icon svg { width:15px; height:15px; fill:#6b7280; display:inline-block; vertical-align:middle; }

/* ── Formulario ── */
.wa-form { display:flex; flex-direction:column; gap:11px; }

.wa-field { display:flex; flex-direction:column; gap:4px; }

.wa-field label {
    font-size:11px;
    font-weight:700;
    color:#4b5563;
    text-transform:uppercase;
    letter-spacing:.55px;
}

.wa-field input,
.wa-field textarea {
    background:#fff;
    border: 1.5px solid #d1d5db;
    border-radius:7px;
    padding: 9px 12px;
    font-size:14.5px;
    color:#111827;
    font-family:inherit;
    transition: border-color .14s, box-shadow .14s;
    width:100%;
    box-sizing:border-box;
    outline:none;
    -webkit-appearance:none;
}
.wa-field input:hover,
.wa-field textarea:hover  { border-color:#9ca3af; }
.wa-field input:focus,
.wa-field textarea:focus  { border-color:#25D366; box-shadow:0 0 0 3px rgba(37,211,102,.13); }
.wa-field input::placeholder,
.wa-field textarea::placeholder { color:#9ca3af; }
.wa-field textarea { resize:vertical; min-height:82px; max-height:150px; }

/* ── Botón envío ── */
.wa-submit {
    background:#25D366;
    color:#fff;
    border:none;
    border-radius:22px;
    padding:12px 20px;
    font-size:15px;
    font-weight:700;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    transition: background .18s, transform .1s;
    margin-top:2px;
    width:100%;
    font-family:inherit;
    box-shadow:0 2px 8px rgba(37,211,102,.33);
}
.wa-submit:hover:not(:disabled)  { background:#128C7E; }
.wa-submit:active:not(:disabled) { transform:scale(.98); }
.wa-submit:disabled               { background:#d1d5db; cursor:not-allowed; box-shadow:none; }
.wa-submit:focus-visible          { outline:3px solid #075e54; outline-offset:2px; }
.wa-submit svg { width:18px; height:18px; fill:#fff; flex-shrink:0; }

/* ── Responsive: mobile bottom-sheet ── */
@media (max-width:480px){
    .whatsapp-modal { align-items:flex-end; padding:0; }
    .whatsapp-modal-content {
        border-radius:18px 18px 0 0;
        max-width:100%;
        width:100%;
        animation: wa-slide-up .28s cubic-bezier(.22,1,.36,1);
        max-height:92dvh;
        overflow-y:auto;
    }
    @keyframes wa-slide-up {
        from { transform:translateY(100%); opacity:.8; }
        to   { transform:translateY(0);    opacity:1;  }
    }
    .wa-body { padding:14px 14px 30px; }
}
