/*
╔══════════════════════════════════════════════════════════════╗
║  CHATBOT NOËL - JULES - CSS                                  ║
║  Styles uniquement pour le chatbot popup                     ║
╚══════════════════════════════════════════════════════════════╝
*/
:root
{
    --chatbotNoelPrimary: #8C1517;
    --chatbotNoelSecondary: #9C0414;
    --chatbotNoelText: #172028;
    --chatbotNoelTextLight: #5c6c76;
    --chatbotNoelWhite: #ffffff;
    --chatbotNoelBorder: #e1ebf2;
    --chatbotNoelShadow: rgba(0, 0, 0, 0.1);
}

/* ===== CHATBOT POPUP ===== */
.chatBotNoelPopup
{
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: min(380px, calc(100vw - 40px));
    height: 600px;
    max-height: calc(100vh - 100px);
    background: var(--chatbotNoelWhite);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: none;
    flex-direction: column;
    z-index: 9999;
    animation: chatbotNoelSlideIn 0.3s ease;
    transition: all 0.3s ease;
    transform: translateZ(0);
    /* ← AJOUTEZ pour forcer l'accélération GPU */
    -webkit-transform: translateZ(0);
    /* ← AJOUTEZ */
}

.chatBotNoelPopup.chatbotNoelActive
{
    display: flex;
}

/* État minimisé */
.chatBotNoelPopup.chatbotNoelMinimized
{
    height: 60px;
    width: 300px;
    border-radius: 30px;
    cursor: pointer;
}

#chatBotNoelPopup .chatbotNoelInfo p:last-child::after
{
    content: '';
    width: 10px;
    height: 10px;
    background: #44b700;
    border-radius: 50px;
    z-index: 100;
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
}

.chatBotNoelPopup.chatbotNoelMinimized .chatBotNoelMessage,
.chatBotNoelPopup.chatbotNoelMinimized .chatbotNoelControls
{
    display: none;
}

.chatBotNoelPopup.chatbotNoelMinimized .chatbotNoelHeader
{
    cursor: pointer;
    padding: 8px;
}

@keyframes chatbotNoelSlideIn
{
    from
    {
        opacity: 0;
        transform: translateY(20px) translateX(20px) scale(0.9);
    }

    to
    {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
    }
}

/* Contrôles */
.chatbotNoelControls
{
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 10000;
}

.chatbotNoelMinimize,
.chatbotNoelClose
{
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chatbotNoelMinimize:hover,
.chatbotNoelClose:hover
{
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.chatbotNoelMinimize
{
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
}

/* Header */
.chatbotNoelHeader
{
    background: var(--chatbotNoelPrimary);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    height: auto;
}

.chatbotNoelAvatar
{
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white url("/on/demandware.static/-/Sites/default/jules-sfcc/PLP/Logo-Chat-Noel.png") center/cover no-repeat;
    border: 2px solid rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

.chatbotNoelInfo
{
    flex: 1;
}

.chatbotNoelTitle
{
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.chatbotNoelInfo p:last-child
{
    font-size: 12px;
    opacity: 0.9;
    position: relative;
    width: fit-content;
    margin: 0;
}

/* Messages */
.chatBotNoelMessage
{
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: linear-gradient(180deg, #f8f9fc 0%, white 100%);
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.chatBotNoelMessage::-webkit-scrollbar
{
    width: 6px;
}

.chatBotNoelMessage::-webkit-scrollbar-thumb
{
    background: var(--chatbotNoelBorder);
    border-radius: 10px;
}

/* Message individuel */
.chatbotNoelMessageItem
{
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    animation: chatbotNoelSlideInMessage 0.3s ease;
}

@keyframes chatbotNoelSlideInMessage
{
    from
    {
        opacity: 0;
        transform: translateY(10px);
    }

    to
    {
        opacity: 1;
        transform: translateY(0);
    }
}

.chatbotNoelMessageItem.chatbotNoelBot
{
    align-items: flex-start;
}

.chatbotNoelMessageItem.chatbotNoelUser
{
    align-items: flex-end;
}

.chatbotNoelMessageAvatar
{
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--chatbotNoelBorder);
    flex-shrink: 0;
    margin-top: 4px;
}

.chatbotNoelMessageItem.chatbotNoelBot .chatbotNoelMessageAvatar
{
    background: white url("/on/demandware.static/-/Sites/default/jules-sfcc/PLP/Logo-Chat-Noel.png") center/cover no-repeat;
    background-size: cover;
}

.chatbotNoelMessageItem.chatbotNoelUser .chatbotNoelMessageAvatar
{
    background: var(--chatbotNoelSecondary);
    border: 2px solid var(--chatbotNoelSecondary);
}

.chatbotNoelMessageBubble
{
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.4;
    box-shadow: 0 2px 8px var(--chatbotNoelShadow);
}

.chatbotNoelMessageItem.chatbotNoelBot .chatbotNoelMessageBubble
{
    background: white;
    border: 1px solid var(--chatbotNoelBorder);
    border-bottom-left-radius: 4px;
}

.chatbotNoelMessageItem.chatbotNoelUser .chatbotNoelMessageBubble
{
    background: var(--chatbotNoelSecondary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing indicator */
.chatbotNoelTyping
{
    display: flex;
    gap: 5px;
    padding: 8px 12px;
}

.chatbotNoelTypingDot
{
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chatbotNoelTextLight);
    animation: chatbotNoelTypingAnimation 1.4s infinite;
}

.chatbotNoelTypingDot:nth-child(2)
{
    animation-delay: 0.2s;
}

.chatbotNoelTypingDot:nth-child(3)
{
    animation-delay: 0.4s;
}

@keyframes chatbotNoelTypingAnimation
{

    0%,
    60%,
    100%
    {
        opacity: 0.3;
        transform: translateY(0);
    }

    30%
    {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* Chips */
.chatbotNoelChips
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.chatbotNoelChip
{
    background: white;
    border: 1px solid var(--chatbotNoelBorder);
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--chatbotNoelText);
    font-weight: 500;
    display: inline-block;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.chatbotNoelChip:hover
{
    background: var(--chatbotNoelSecondary);
    color: white;
    border-color: var(--chatbotNoelSecondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.chatbotNoelChip:active
{
    transform: translateY(0);
}

/* Boutons d'action */
.chatbotNoelActionButton
{
    background: var(--chatbotNoelSecondary);
    color: white;
    border: none;
    padding: 0.35em 1.2em;
    border-radius: 25px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.chatbotNoelActionButton:hover
{
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
    color: #fff;
}

.chatbotNoelActionButton.chatbotNoelSecondaryBtn
{
    background: #fff;
    color: var(--chatbotNoelSecondary);
    border: 2px solid var(--chatbotNoelSecondary);
}

.chatbotNoelActionButton.chatbotNoelSecondaryBtn:hover
{
    background: var(--chatbotNoelSecondary);
    color: #fff;
}

/* Récap */
.chatbotNoelRecap
{
    font-size: 13px;
    color: var(--chatbotNoelText);
    margin-top: 10px;
    padding: 10px;
    background: rgba(217, 43, 50, 0.08);
    border-radius: 10px;
    border-left: 3px solid var(--chatbotNoelSecondary);
}

/* Toast */
.chatbotNoelToast
{
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--chatbotNoelSecondary);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10001;
}

.chatbotNoelToast.chatbotNoelShow
{
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media screen and (max-width: 385px)
{
    .chatbotNoelTitle
    {
        max-width: 115px;
    }

    .chatBotNoelPopup.chatbotNoelMinimized .chatbotNoelTitle
    {
        max-width: none;
    }
}

/* Responsive */
@media (max-width: 500px)
{
    .chatbotNoelToast
    {
        width: calc(100% - 30%);
    }

    .chatBotNoelPopup
    {
        bottom: 1.1em;
        right: 10px;
        left: 10px;
        width: calc(100vw - 20px);
        height: calc(100% - 15%);
        max-height: none;
    }

    .chatBotNoelPopup.chatbotNoelMinimized
    {
        left: 10px;
        bottom: 1.1em;
        right: 10px;
        width: calc(100vw - 30px);
        height: 60px;
        background-color: #9C0414;
        margin: 0 auto;
    }
}