#bot-ia #chat-bubble-toggle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #ff6600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    transition: background-color 0.3s ease, width 0.3s ease, height 0.3s ease, bottom 0.3s ease, right 0.3s ease;
    z-index: 9999;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
}

#bot-ia #chat-bubble-toggle img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: width 0.3s ease, height 0.3s ease;
}

#bot-ia #chat-bubble-toggle.open {
    width: 50px;
    height: 50px;
    bottom: 1rem;
    right: 1rem;
}

#bot-ia #chat-bubble-toggle.open img {
    width: 50%;
    height: 50%;
}

#bot-ia #chat-container {
    font-family: 'Segoe UI', Tahoma, sans-serif;
    position: fixed;
    bottom: 5rem;
    right: 1rem;
    width: 380px;
    height: 540px;
    max-height: 540px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    display: flex;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    animation: fadeInUp 0.3s ease;
}

#bot-ia #chat-container.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

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

#bot-ia #chat-header {
    background-color: #ff6600;
    color: white;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

#bot-ia #chat-branding {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
}

#bot-ia #chat-branding span {
    font-size: 1.1rem;
    font-weight: bold;
}

#bot-ia #chat-status {
    font-size: 0.85rem;
    color: #ccebd5;
}

#bot-ia #chat-header img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: white;
    object-fit: cover;
}

#bot-ia #chat {
    padding: 1rem;
    flex: 1 1 auto;
    overflow-y: auto;
    background-color: #fff9f0;
    min-height: 0;
}

#bot-ia .message-wrapper {
    margin-bottom: 1rem;
}

#bot-ia .message {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: #f1f1f1;
    width: fit-content;
    max-width: 90%;
}

#bot-ia .message.user {
    font-size: 16px;
    margin-left: auto;
    background: #ff6600;
    color: white;
    font-weight: 500;
}

#bot-ia .assistant-response {
    background-color: #fff9f0;
    border: 2px solid #ff6600;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    font-size: 1rem;
    text-align: left;
    max-width: 100%;
    width: fit-content;
    margin: 0;
    box-sizing: border-box;
}

#bot-ia .message-wrapper.assistant {
    margin-bottom: 1rem;
    margin-right: 0;
    display: flex;
    justify-content: flex-start;
}

#bot-ia .assistant-response .title {
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: underline;
    margin: 0.5rem 0 0.3rem;
}

#bot-ia .assistant-response .composition,
#bot-ia .assistant-response .allergenes-content {
    text-align: justify;
    margin: 0 0 0.5rem 0;
}

#bot-ia .assistant-response .allergenes-title {
    text-decoration: underline;
    font-weight: bold;
    color: #cc5200;
    margin: 0 0 0.3rem 0;
}

#bot-ia .assistant-response .link {
    font-style: italic;
    font-weight: 600;
    margin: 0.5rem 0 0.3rem 0;
}

#bot-ia .assistant-response .link a {
    color: #ff6600;
    text-decoration: underline;
}

#bot-ia #typing-indicator {
    font-style: italic;
    color: #888;
    margin: 0.5rem 1rem;
}

#bot-ia #input-section {
    flex-shrink: 0;
    height: 90px;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    gap: 0.3rem;
    border-top: 1px solid #eee;
    background: white;
    margin-bottom: 10px;
}

#bot-ia #input-line {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#bot-ia #input-user-message {
    flex: 1;
    padding: 0 0.8rem;
    border: 2px solid #ff6600;
    border-radius: 1rem;
    font-size: 1rem;
    height: 40px;
    outline: none;
    margin: 0;
    box-sizing: border-box;
}

#bot-ia #input-user-message:focus {
    border-color: #cc5200;
}

#bot-ia #send-btn {
    padding: 0;
    background: #ff6600;
    border: none;
    border-radius: 1rem;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    height: 40px;
    box-sizing: border-box;
    margin: 0;
}

#bot-ia #send-btn:hover {
    background: #cc5200;
}

#bot-ia #footer-credit {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    text-align: center;
    background: #fafafa;
    font-weight: 500;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    user-select: none;
    transition: background-color 0.3s ease;
    cursor: default;
}

#bot-ia #footer-credit a {
    color: #ff6600;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

#bot-ia #footer-credit a:hover,
#bot-ia #footer-credit a:focus {
    color: #cc5200;
    text-decoration: underline;
}

#bot-ia #chat-messages a {
    color: orange;
    text-decoration: none;
    font-weight: bold;
}

#bot-ia #chat-messages a:hover {
    text-decoration: underline;
}

#bot-ia #typing-indicator {
    font-style: italic;
    font-size: 1.1rem;
    color: #777;
    margin: 0.3rem 0 0.3rem 0.5rem;
    padding: 0;
    border-radius: 0;
    display: inline-block;
}

@media (min-width: 421px) and (max-width: 800px) {
    #bot-ia #chat-container {
        height: 75vh !important;
        max-height: none !important;
    }
}

@media (max-width: 420px) {
    #bot-ia #chat-container {
        width: 320px !important;
        height: 75vh !important;
        bottom: 4.5rem !important;
        right: 0.5rem !important;
        max-height: none !important;
        max-width: none !important;
        border-radius: 1rem !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15) !important;
    }
    #bot-ia #chat-header img {
        width: 40px !important;
        height: 40px !important;
    }
    #bot-ia #chat-bubble-toggle {
        width: 60px !important;
        height: 60px !important;
        bottom: 1rem !important;
        right: 1rem !important;
    }
    #bot-ia #chat-bubble-toggle.open {
        width: 40px !important;
        height: 40px !important;
    }
    #bot-ia #chat-bubble-toggle img {
        width: 70% !important;
        height: 70% !important;
    }
    #bot-ia #chat-bubble-toggle.open img {
        width: 50% !important;
        height: 50% !important;
    }
    #bot-ia #input-section {
        height: auto !important;
        padding: 0.5rem 1rem !important;
    }
    #bot-ia #input-line {
        flex-direction: column !important;
        gap: 0.3rem !important;
    }
    #bot-ia #input-user-message {
        padding: 0.6rem 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    #bot-ia #send-btn {
        width: 100% !important;
        padding: 0.6rem 1rem !important;
        box-sizing: border-box !important;
    }
}