/* Widget Chatbot Rasa Carrstm */
#rasa-chat-bubble {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #e31e24, #c1181e);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(227, 30, 36, 0.4);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 32px;
    z-index: 9999;
    transition: all 0.3s ease;
}
#rasa-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(227, 30, 36, 0.5);
}
#rasa-chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    max-height: 550px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
}
@media (max-width: 480px) {
    #rasa-chat-window {
        width: 95%;
        right: 2.5%;
        bottom: 100px;
    }
    #rasa-chat-bubble {
        bottom: 20px;
        right: 20px;
    }
}
#rasa-chat-header {
    background: linear-gradient(135deg, #e31e24, #c1181e);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#rasa-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}
#rasa-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
}
#rasa-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f7fa;
}
.rasa-msg-user {
    background: linear-gradient(135deg, #e31e24, #c1181e);
    color: white;
    padding: 12px 18px;
    border-radius: 16px 16px 4px 16px;
    margin-left: auto;
    margin-bottom: 12px;
    max-width: 80%;
    box-shadow: 0 2px 8px rgba(227,30,36,0.2);
    white-space: pre-line;
}
.rasa-msg-bot {
    background: white;
    color: #333;
    padding: 12px 18px;
    border-radius: 16px 16px 16px 4px;
    margin-bottom: 12px;
    max-width: 90%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    white-space: pre-line;
}

/* Texto plano dentro de la burbuja del bot: que herede el salto de línea */
.rasa-msg-bot p {
    margin: 0 0 8px 0;
}
.rasa-msg-bot p:last-child {
    margin-bottom: 0;
}

#rasa-chat-footer {
    padding: 15px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    background: white;
}
#rasa-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #eee;
    border-radius: 24px;
    outline: none;
    font-size: 15px;
    transition: border-color 0.2s;
}
#rasa-chat-input:focus {
    border-color: #e31e24;
}
#rasa-chat-send {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #e31e24, #c1181e);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}
#rasa-chat-send:hover {
    transform: scale(1.05);
}

/* ============================
   Typing indicator (3 puntos)
   ============================ */
.rasa-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    background: white;
    padding: 14px 18px;
    border-radius: 16px 16px 16px 4px;
    margin-bottom: 12px;
    width: fit-content;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.rasa-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c1c8d2;
    animation: rasa-typing-bounce 1.2s infinite ease-in-out;
}
.rasa-typing span:nth-child(2) {
    animation-delay: 0.2s;
}
.rasa-typing span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes rasa-typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* ============================
   Tarjetas de producto
   ============================ */
.rasa-product-card {
    display: block;
    position: relative;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 12px 14px;
    margin: 10px 0;
    background: #fafbfc;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.rasa-product-card:hover {
    border-color: #e31e24;
    box-shadow: 0 2px 10px rgba(227,30,36,0.12);
}
.rasa-product-card:first-of-type {
    margin-top: 4px;
}

/* Número de selección (1, 2, 3...) */
.rasa-product-num {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e31e24;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(227,30,36,0.4);
}

/* Fila superior: imagen + info */
.rasa-product-card-top {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-right: 28px; /* espacio para el número */
}
.rasa-product-img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eee;
    flex-shrink: 0;
}
.rasa-product-info {
    flex: 1;
    min-width: 0;
}
.rasa-product-title {
    font-weight: 600;
    color: #222;
    margin: 0 0 4px 0;
    font-size: 14px;
    line-height: 1.3;
}
.rasa-product-price {
    color: #e31e24;
    font-weight: 700;
    font-size: 15px;
    margin: 0 0 6px 0;
}
.rasa-product-price-old {
    color: #999;
    font-weight: 400;
    font-size: 12.5px;
    text-decoration: line-through;
    margin-right: 4px;
}

/* Badges de stock */
.rasa-stock-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 10px;
}
.rasa-stock-badge.en-stock {
    background: #e6f7ec;
    color: #1a8a4a;
}
.rasa-stock-badge.sin-stock {
    background: #fdeaea;
    color: #c1181e;
}

/* Botón base */
.rasa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rasa-btn:hover {
    transform: translateY(-1px);
}

/* Botón WhatsApp (verde) */
.rasa-btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #1ebe5d);
    color: #fff;
    box-shadow: 0 2px 6px rgba(37,211,102,0.3);
}

/* Botón "Añadir al carrito" (oscuro/neutro), dentro de la tarjeta clicable */
.rasa-btn-carrito {
    width: 100%;
    margin-top: 4px;
    background: #2c2c2c;
    color: #fff;
}
.rasa-btn-carrito:disabled {
    opacity: 0.85;
    cursor: default;
    transform: none;
}
.rasa-btn-carrito.rasa-btn-success {
    background: linear-gradient(135deg, #25D366, #1ebe5d);
}

/* Caja destacada para el CTA general de WhatsApp (sin productos) */
.rasa-whatsapp-cta {
    margin-top: 10px;
}
.rasa-whatsapp-cta .rasa-btn {
    width: 100%;
    padding: 10px 14px;
    font-size: 13.5px;
}

/* Botón secundario / quick reply (gris claro, "elige el número") */
.rasa-btn-secundario {
    background: #fff;
    color: #e31e24;
    border: 1.5px solid #e31e24;
}
.rasa-btn-secundario:hover {
    background: #fdeaea;
}

/* Lista de quick replies (ej: números de producto) */
.rasa-quick-replies {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* Nota auxiliar pequeña, ej: "Escribe el número de tu elección" */
.rasa-hint {
    font-size: 12.5px;
    color: #888;
    margin-top: 6px;
    margin-bottom: 0;
}
