/* ==========================================
   SABLAGE45 - CHATBOT
   ========================================== */

#s45-chatbot * {
    box-sizing: border-box;
}

#s45-chatbot {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    font-family: Arial, Helvetica, sans-serif;
}

/* Bouton flottant */
#s45-chat-button {
    width: 62px;
    height: 62px;
    border: none;
    border-radius: 50%;
    background: #e88624;
    color: white;
    cursor: pointer;
    font-size: 28px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease;
}

#s45-chat-button:hover {
    transform: scale(1.06);
}

/* Fenêtre */
#s45-chat-window {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 370px;
    max-width: calc(100vw - 30px);
    height: 560px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.25);

    display: none;
    flex-direction: column;
}

#s45-chat-window.open {
    display: flex;
}

/* Header */
.s45-chat-header {
    background: #242424;
    color: white;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.s45-chat-title {
    font-size: 17px;
    font-weight: bold;
}

.s45-chat-subtitle {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 3px;
}

#s45-chat-close {
    background: transparent;
    border: 0;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* Zone messages */
#s45-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
}

.s45-message {
    margin-bottom: 12px;
    display: flex;
}

.s45-message.bot {
    justify-content: flex-start;
}

.s45-message.user {
    justify-content: flex-end;
}

.s45-bubble {
    max-width: 85%;
    padding: 11px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.45;
}

.s45-message.bot .s45-bubble {
    background: white;
    color: #252525;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 7px rgba(0,0,0,.08);
}

.s45-message.user .s45-bubble {
    background: #e88624;
    color: white;
    border-bottom-right-radius: 4px;
}

/* Boutons de choix */
.s45-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 10px 0 16px;
}

.s45-quick-button {
    border: 1px solid #e88624;
    background: white;
    color: #b65f0c;
    border-radius: 20px;
    padding: 8px 11px;
    cursor: pointer;
    font-size: 12px;
}

.s45-quick-button:hover {
    background: #fff3e6;
}

/* Formulaire */
#s45-chat-form {
    display: flex;
    padding: 10px;
    gap: 8px;
    background: white;
    border-top: 1px solid #ddd;
}

#s45-chat-input {
    flex: 1;
    border: 1px solid #ccc;
    border-radius: 22px;
    padding: 11px 14px;
    outline: none;
    font-size: 14px;
}

#s45-chat-input:focus {
    border-color: #e88624;
}

#s45-chat-send {
    border: none;
    border-radius: 22px;
    padding: 0 16px;
    background: #e88624;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

.s45-chat-footer {
    text-align: center;
    padding: 5px 10px 8px;
    font-size: 10px;
    color: #999;
    background: white;
}

/* Mobile */
@media (max-width: 600px) {
    #s45-chatbot {
        right: 12px;
        bottom: 12px;
    }

    #s45-chat-window {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 85px;
        width: auto;
        height: min(600px, calc(100vh - 105px));
    }
}