/* =========================================================
   WhatsApp Bubble — Botón flotante + formulario
   public/css/components/whatsapp-bubble.css
   ========================================================= */

#whatsapp-bubble {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1081;
    font-family: 'Poppins', sans-serif;
}

/* ── BOTÓN FLOTANTE WHATSAPP ─────────────────────────── */
#whatsapp-bubble .wa-toggle-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-direction: row-reverse;
}

#whatsapp-bubble .wa-toggle-btn {
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

#whatsapp-bubble .wa-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(37, 211, 102, 0.45);
}

/* ── BURBUJA DE HABLA ────────────────────────────────── */
#whatsapp-bubble .wa-speech-bubble {
    background: #ffffff;
    color: #333333;
    padding: 10px 14px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    font-size: 0.88rem;
    line-height: 1.35;
    max-width: 220px;
    position: relative;
    border: 1px solid #e9ecef;
    animation: wa-fade-in 0.6s ease-out;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

#whatsapp-bubble .wa-speech-bubble::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #ffffff;
}

#whatsapp-bubble .wa-speech-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    line-height: 1;
    color: #adb5bd;
    cursor: pointer;
    padding: 0;
    margin: -2px -4px 0 0;
    flex-shrink: 0;
}

#whatsapp-bubble .wa-speech-close:hover {
    color: #495057;
}

#whatsapp-bubble .wa-speech-bubble.wa-hidden {
    display: none !important;
}

/* ── PANEL DEL FORMULARIO ────────────────────────────── */
#whatsapp-bubble .wa-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: min(340px, calc(100vw - 32px));
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    display: none;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

#whatsapp-bubble .wa-panel.wa-open {
    display: block;
    animation: wa-slide-up 0.22s ease-out;
}

/* ── ENCABEZADO DEL PANEL ────────────────────────────── */
#whatsapp-bubble .wa-panel-header {
    background: #075E54;
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}

#whatsapp-bubble .wa-panel-header i {
    font-size: 22px;
}

#whatsapp-bubble .wa-btn-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    padding: 0;
}

#whatsapp-bubble .wa-btn-close:hover {
    opacity: 1;
}

/* ── CUERPO DEL FORMULARIO ───────────────────────────── */
#whatsapp-bubble .wa-panel-body {
    padding: 16px;
}

#whatsapp-bubble .wa-panel-subtitle {
    font-size: 13px;
    color: #6c757d;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

#whatsapp-bubble .wa-field {
    margin-bottom: 12px;
}

#whatsapp-bubble .wa-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
}

#whatsapp-bubble .wa-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: #212529;
    background: #f8f9fa;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

#whatsapp-bubble .wa-input:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.15);
    background: #fff;
}

#whatsapp-bubble select.wa-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ── BOTÓN ENVIAR ────────────────────────────────────── */
#whatsapp-bubble .wa-btn-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #25D366;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    transition: background 0.15s ease;
}

#whatsapp-bubble .wa-btn-submit:hover {
    background: #1ebe5b;
}

#whatsapp-bubble .wa-btn-submit i {
    font-size: 18px;
}

/* ── ANIMACIONES ─────────────────────────────────────── */
@keyframes wa-slide-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes wa-fade-in {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 576px) {
    #whatsapp-bubble {
        right: 12px;
        bottom: 12px;
    }

    #whatsapp-bubble .wa-panel {
        width: calc(100vw - 24px);
        right: -8px;
        bottom: 76px;
    }
}
