/* =============================================
   Chatbot Siempre Flores - Widget flotante
   ============================================= */

#sf-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    font-family: inherit;
}

/* ---------- Tooltip invitación ---------- */

.sf-chatbot-tooltip {
    position: fixed;
    bottom: 30px;
    right: 90px;
    background-color: #fff;
    padding: 12px 32px 12px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 9997;
    max-width: 260px;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}

.sf-chatbot-tooltip.show {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.sf-chatbot-tooltip::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid #fff;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
}

.sf-chatbot-tooltip p {
    margin: 0;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.35;
}

.sf-chatbot-tooltip-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

.sf-chatbot-tooltip-close:hover {
    color: #333;
}

/* Ocultar tooltip cuando el chat está abierto */
#sf-chatbot.sf-chatbot-open .sf-chatbot-tooltip {
    display: none;
}

@media (max-width: 600px) {
    .sf-chatbot-tooltip {
        max-width: calc(100vw - 110px);
    }
}

/* ---------- Botón flotante ---------- */

#sf-chatbot-toggle {
    background: linear-gradient(135deg, #F92D89, #ff5fa3);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(249, 45, 137, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: transform .2s ease, box-shadow .2s ease;
}

#sf-chatbot-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(249, 45, 137, 0.5);
}

#sf-chatbot-toggle i {
    font-size: 18px;
}

@media (max-width: 600px) {
    .sf-chatbot-toggle-label {
        display: none;
    }
    #sf-chatbot-toggle {
        padding: 14px;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        justify-content: center;
    }
}

/* ---------- Panel ---------- */

#sf-chatbot-panel {
    display: none;
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 30px);
    height: 560px;
    max-height: calc(100vh - 110px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    flex-direction: column;
}

#sf-chatbot.sf-chatbot-open #sf-chatbot-panel {
    display: flex;
    animation: sfChatbotIn .25s ease;
}

#sf-chatbot.sf-chatbot-open #sf-chatbot-toggle {
    display: none;
}

@keyframes sfChatbotIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Header ---------- */

.sf-chatbot-header {
    background: linear-gradient(135deg, #F92D89, #ff5fa3);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sf-chatbot-header-info strong {
    display: block;
    font-size: 15px;
}

.sf-chatbot-header-info small {
    font-size: 12px;
    opacity: 0.9;
}

#sf-chatbot-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

#sf-chatbot-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ---------- Mensajes ---------- */

.sf-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fb;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sf-chatbot-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.sf-chatbot-msg-bot {
    background: #fff;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sf-chatbot-msg-user {
    background: #F92D89;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.sf-chatbot-msg-error {
    background: #fff0f0;
    color: #c0392b;
    border: 1px solid #f5c6cb;
    align-self: flex-start;
}

/* ---------- Typing ---------- */

.sf-chatbot-typing {
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border-radius: 14px;
    align-self: flex-start;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sf-chatbot-typing span {
    width: 7px;
    height: 7px;
    background: #bbb;
    border-radius: 50%;
    animation: sfTyping 1.2s infinite;
}

.sf-chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.sf-chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes sfTyping {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-4px); }
}

/* ---------- Sugerencias rápidas ---------- */

.sf-chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.sf-chatbot-chip {
    background: #fff;
    border: 1px solid #F92D89;
    color: #F92D89;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s ease;
}

.sf-chatbot-chip:hover {
    background: #F92D89;
    color: #fff;
}

/* ---------- Tarjetas de producto ---------- */

.sf-chatbot-products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-self: stretch;
    margin-top: 4px;
}

.sf-chatbot-product {
    display: block;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform .15s ease, box-shadow .15s ease;
}

.sf-chatbot-product:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    color: inherit;
    text-decoration: none;
}

.sf-chatbot-product-img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    background: #eee;
    display: block;
}

.sf-chatbot-product-img.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 28px;
}

.sf-chatbot-product-info {
    padding: 8px 10px;
}

.sf-chatbot-product-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sf-chatbot-product-price {
    font-size: 13px;
    color: #F92D89;
    font-weight: 700;
}

.sf-chatbot-product-price del {
    color: #bbb;
    font-weight: 400;
    font-size: 11px;
    margin-right: 4px;
}

/* ---------- Form ---------- */

.sf-chatbot-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #fff;
}

#sf-chatbot-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 22px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease;
}

#sf-chatbot-input:focus {
    border-color: #F92D89;
}

#sf-chatbot-send {
    background: #F92D89;
    color: #fff;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s ease;
}

#sf-chatbot-send:hover {
    background: #d61f73;
}

#sf-chatbot-send:disabled {
    background: #ccc;
    cursor: not-allowed;
}
