/* /assets/css/whatsapp-button.css */

/* --- Contenedor para el botón de WhatsApp --- */
.whatsapp-container {
    position: fixed;
    bottom: 125px; /* Ajustado para estar sobre el botón del carrito (30px + 60px + 15px de espacio) */
    right: 30px;
    z-index: 1051;
    transition: transform 0.3s ease-out;
}

/* --- Botón flotante de WhatsApp con Onda --- */
.whatsapp-fab {
    width: 60px;
    height: 60px;
    background-color: var(--color-fab-whatsapp-bg, #25d365ba);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    transition: transform 0.2s ease-in-out;
    position: relative;
    cursor: pointer;
}

.whatsapp-fab:hover {
    transform: scale(1.1);
}

.whatsapp-fab i {
    color: white;
    font-size: 52px;
}

/* Animación de onda */
.whatsapp-fab::before {
    content: '';
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    transform: translateX(-50%) translateY(-50%);
    display: block;
    width: 100%;
    height: 100%;
    background-color: var(--color-fab-whatsapp-pulse, #0fa746);
    border-radius: 70%;
    animation: pulse-border 2000ms ease-out infinite;
}

@keyframes pulse-border {
    0% { transform: translateX(-50%) translateY(-50%) scale(1); opacity: 1; }
    100% { transform: translateX(-50%) translateY(-50%) scale(1.5); opacity: 0; }
}


/* ====================================================== */
/* --- ESTILOS PARA EL WIDGET MINIMALISTA --- */
/* ====================================================== */

/* --- Contenedor principal del Widget --- */
.whatsapp-widget {
    position: fixed;
    bottom: 180px; /* Ajustado para que aparezca sobre el botón de WhatsApp */
    right: 30px;
    width: 360px;
    max-width: calc(100vw - 40px);
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(20px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 1040;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.whatsapp-widget.visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* --- Cabecera del Widget --- */
.widget-header {
    background-color: var(--color-wa-widget-header-bg, #8d4896);
    color: var(--color-wa-widget-header-text, #111b21);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    border-bottom: 1px solid #e9edef;
}

.widget-profile-pic-container {
    position: relative;
}

.widget-profile-pic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

/* Indicador de "en línea" */
.widget-profile-pic-container::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #25d366;
    border-radius: 50%;
    border: 2px solid #ffffff;
}

.widget-business-info .name {
    font-size: 1.1rem;
    font-weight: 600;
}

.widget-business-info .status {
    font-size: 0.8rem;
    color: #ffffff;
}

#close-widget-btn {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #667781;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#close-widget-btn:hover {
    background-color: #e9edef;
}

/* --- Cuerpo del Widget (área de mensajes) --- */
.widget-body {
    padding: 1rem 1.25rem;
    height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-color: #a3a3a3a9;
}

.message-bubble {
    background-color: var(--color-wa-widget-bubble-bg, #ef8afe);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    max-width: 85%;
    align-self: flex-start;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #111b21;
    border-top-left-radius: 0;
}

/* --- Pie de página del Widget (input y botón de enviar) --- */
.widget-footer {
    padding: 0.75rem 1.25rem;
    background-color: var(--color-wa-widget-footer-bg, #ffffff);
    display: flex;
    gap: 10px;
    align-items: center;
    border-top: 1px solid #e9edef;
}

#whatsapp-message-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    background-color: #f0f2f5;
    border-radius: 20px;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

#whatsapp-message-input:focus {
    border-color: #25d366;
}

#send-whatsapp-btn {
    background-color: var(--color-wa-widget-send-btn-bg, #25d366);
    color: var(--color-wa-widget-send-btn-icon, white);
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

#send-whatsapp-btn:hover {
    background-color: #1da855;
}

/* --- INICIO DE LA CORRECCIÓN --- */
@media (max-width: 768px) {
    /* Ocultamos solo el botón flotante, no el widget */
    .whatsapp-container {
        display: none;
    }

    /* Ajustamos la posición del widget para que aparezca sobre la barra de navegación inferior */
    .whatsapp-widget {
        bottom: 80px; /* Sube el widget para que no lo tape la barra de navegación */
        right: 15px; /* Lo acerca un poco más al borde */
    }
}
/* --- FIN DE LA CORRECCIÓN --- */