.chat-back-icon {
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    color: #333;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 0;
}

.conversation-item {
    background: #ffffffff;
    border-bottom: 1px solid #ecececff;
    padding: 20px 10px;
    cursor: pointer;
}

.conversation-item:hover {
    background: #fafafaff;
}

.conversation-item-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.new-conversation-btn {
    width: 300px;
    padding: 12px;
    background: #4a6fdc;
    margin-top: 20px;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s ease;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);

    /* Ajout ? centre le bouton */
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.new-conversation-btn:hover {
    background: #3a59b8;
}


.chat-toggler {
    position: fixed;
    bottom: 20px;
    right: 30px;
    z-index: 1001;
}

.chat-toggler button {
    background: #4a6fdc;
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-resize-icon {
    cursor: pointer;
    transform: rotate(45deg);
}

.resized-widget {
    height: 850px !important;
    width: 600px !important;
}

.chat-widget-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    background: white;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: height 0.3s ease;
    height: 650px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.chat-widget-container.chat-closed {
    height: 0;
    width: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.chat-header {
    background: #ffffffff;
    color: #000;
    border-bottom: 1px solid #e9e9eb;
    padding: 15px;
    border-radius: 10px 10px 0 0;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-actions {
    display: flex;
    gap: 15px;
    border: none;
}

.chat-header-inner {
    display: flex;
    align-items: center;
}

.chat-toggle-icon {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.chat-closed .chat-toggle-icon {
    transform: rotate(0deg);
}

.chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-closed .chat-body {
    display: none;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.message {
    display: flex;
    margin-bottom: 10px;
}

.message.user-message {
    justify-content: flex-end;
}

.message.bot-message {
    justify-content: flex-start;
}

.message-content {
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 72%;
    word-wrap: break-word;
}

.user-message .message-content {
    background: #4a6fdc;
    color: white;
    border-bottom-right-radius: 4px;
}

.bot-message .message-content {
    background: #e9e9eb;
    color: #333;
    border-bottom-left-radius: 4px;
}

.chat-input {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 15px;
    border-top: 1px solid #e9e9eb;
}

.chat-input textarea {
    box-sizing: border-box;
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e9e9eb;
    border-radius: 5px;
    resize: none;
    min-height: 50px;
    height: 100%;
    font-size: 16px;
}

.chat-input button {
    background: #4a6fdc;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.chat-input .chat-btn {
    display: flex;
    flex-direction: column;

    gap: 5px;
}

.attachment-btn {
    background: none !important;
    color: #555 !important;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-btn:hover {
    background: #e0e0e0 !important;
    color: #333 !important;
}

.attachment-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px 0;
    font-size: 13px;
    color: #555;
    background: #f8f9ff;
    border-top: 1px dashed #c0cbe8;
    animation: fadeIn 0.2s ease;
}

.attachment-preview span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-preview span::before {
    content: "?? ";
}

.attachment-remove-btn {
    background: none !important;
    border: none !important;
    color: #999 !important;
    font-size: 18px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    padding: 0 4px !important;
    cursor: pointer;
    line-height: 1;
}

.attachment-remove-btn:hover {
    color: #c00 !important;
}

.message-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 2px;
    background: rgba(255,255,255,0.2);
    border-radius: 8px;
    font-size: 13px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255,255,255,0.4);
    transition: background 0.2s;
}

.message-attachment:hover {
    background: rgba(255,255,255,0.35);
}

.bot-message .message-attachment {
    background: rgba(0,0,0,0.06);
    border-color: rgba(0,0,0,0.1);
    color: #333;
}

.message-attachment-img {
    max-width: 200px;
    max-height: 150px;
    display: block;
    border-radius: 8px;
    cursor: pointer;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-actions {
    padding: 15px;
    border-top: 1px solid #e9e9eb;
    display: flex;
    justify-content: space-between;
}

.action-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 3px 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: #e0e0e0;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    margin: 15px;
    border-radius: 5px;
    display: none;
}

/* Style pour les messages de date/heure */
.message .timestamp {
    font-size: 0.8em;
    color: #fff;
    margin-top: 5px;
}

.bot-message .timestamp {
    text-align: left;
    color: #777;
}

/* Style pour les questions oui/non (à implémenter plus tard) */
.binary-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.binary-option {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.binary-option:hover {
    background: #e0e0e0;
}

.product-options {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.product-option {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 15px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 5px;
}

.product-option:hover {
    background: #e0e0e0;
}

    /* Styles pour l'animation de chargement */
    .loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20px;
}

.loading-dots .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    background-color: #777;
    border-radius: 50%;
    animation: dot-bounce 1.4s infinite ease-in-out both;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dot-bounce {
    0%, 80%, 100% { 
        transform: scale(0);
    }
    40% { 
        transform: scale(1.0);
    }
}

/* Style pour la bulle de chargement */
.loading-message .message-content {
    min-width: 60px;
}

/* === Produits dans le chatbot === */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.product-item {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 6px 8px;
    gap: 8px;
}

.product-item .flex {
    display: flex;
    gap: 10px;
    align-items: center;
}

.product-image img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid #eee;
}

.product-details {
    flex: 1;
    font-size: 13px;
    color: #333;
    overflow: hidden;
}

.product-title {
    font-weight: bold;
    color: #0056b3;
    text-decoration: none;
    display: block;
    margin-bottom: 2px;
    white-space: normal;
}

.product-title:hover {
    text-decoration: underline;
}

.product-specs {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    color: #555;
}

.product-pricing {
    margin-top: 3px;
    font-size: 13px;
}

.price-normal {
    font-weight: bold;
}

.price-promo {
    font-weight: bold;
    color: #d9534f;
}

.price-old {
    text-decoration: line-through;
    color: #777;
    margin-left: 5px;
}

.price-discount {
    color: #28a745;
    margin-left: 5px;
}

.product-stock {
    margin-top: 2px;
    font-weight: 500;
    font-size: 12.5px;
}

.product-stock.in-stock {
    color: #28a745;
}

.product-stock.out-of-stock {
    color: #b45f06;
}

.product-actions .btn-add-to-cart {
    width: 100%;
}

@media screen and (max-width: 500px) {
    .chat-widget-container {
        width: 100%;
        height: 100%;
        right: 0;
        bottom: 0;
        z-index: 1002;
        border-radius: 0;
        max-height: 100vh;
    }
    .resized-widget {
        height: 100% !important;
        width: 100% !important;
    }
    .chat-resize-icon{
        display:none;
    }
}