/* Chat Conversationnel - Style épuré et moderne */
.chat-container {
    position: fixed;
    right: 30px;
    bottom: 100px;
    z-index: 999;
    font-family: 'Public Sans', sans-serif;
}

.store-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.store-actions a:hover {
    background-color: #014d2b;
    color: #f9f5e1;
    gap: 5px;
}

.chat-toggle {
    width: 65px;
    height: 65px;
    min-width: 65px;
    min-height: 65px;
    background-color: #014d2b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f9f5e1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(1, 77, 43, 0.2);
    transition: all 0.3s ease;
    border: 2px solid #014d2b;
    aspect-ratio: 1/1;
    flex-shrink: 0;
}

.chat-toggle:hover {
    transform: scale(1.05);
}

.chat-toggle i {
    font-size: 26px;
}

.chat-box {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 370px;
    height: calc(100vh - 120px);
    max-height: 550px;
    background-color: #fff;
    border-radius: 16px;
    border: 1px solid #014d2b;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform-origin: bottom right;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.chat-container.active .chat-box {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chat-header {
    background: linear-gradient(to right, #014d2b, #016d3e);
    color: #f9f5e1;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(249, 245, 225, 0.2);
    position: relative;
}

.chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.chat-header h5 {
    margin: 0;
    font-size: 17px;
    font-weight: 500;
    position: relative;
    padding-left: 30px;
    letter-spacing: 0.3px;
}

.chat-header h5::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background-color: #4CAF50;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.chat-actions button {
    background: none;
    border: none;
    color: #f9f5e1;
    cursor: pointer;
    margin-left: 12px;
    padding: 5px;
    font-size: 14px;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: all 0.2s ease;
}

.chat-actions button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f9f5e1;
    scrollbar-width: thin;
    scrollbar-color: #014d2b #f9f5e1;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}

.chat-body::-webkit-scrollbar-track {
    background: #f9f5e1;
    border-radius: 10px;
}

.chat-body::-webkit-scrollbar-thumb {
    background-color: #014d2b;
    border-radius: 10px;
    border: 2px solid #f9f5e1;
    background-clip: content-box;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.message {
    display: flex;
    max-width: 85%;
    position: relative;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.message.visible {
    opacity: 1;
    transform: translateY(0);
}

.message.agent {
    align-self: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #014d2b;
    color: #f9f5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    border: 2px solid #014d2b;
    flex-shrink: 0;
    aspect-ratio: 1/1;
}

.message.user .avatar {
    margin-right: 0;
    margin-left: 10px;
    background: #f9f5e1;
    border: 2px solid #014d2b;
}

.avatar i {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

.message-content {
    background-color: #fff;
    border-radius: 12px;
    padding: 12px 18px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #014d2b;
    position: relative;
    min-width: 120px;
}

.message.agent .message-content {
    border-top-left-radius: 0;
}

.message.user .message-content {
    background: #014d2b;
    color: #f9f5e1;
    border-top-right-radius: 0;
    border-color: #014d2b;
    text-align: right;
}

.message-content p {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-content br {
    display: block;
    content: "";
    margin-top: 5px;
}

.message-content h3 {
    margin: 10px 0 8px;
    font-size: 15px;
    font-weight: 600;
    color: #014d2b;
}

.message.user .message-content h3 {
    color: #f9f5e1;
}

.message-content ul,
.message-content ol {
    margin: 5px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 5px;
    font-size: 13px;
}

.message-content .time {
    font-size: 10px;
    color: #888;
    display: block;
    text-align: right;
    font-style: italic;
    margin-top: 2px;
}

.message.user .message-content .time {
    color: rgba(249, 245, 225, 0.8);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 0;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: #014d2b;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

@keyframes typing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.chat-footer {
    padding: 15px 20px;
    border-top: 2px solid #014d2b;
    display: flex;
    background-color: #fff;
    transition: all 0.3s ease;
}


.chat-footer:has(input:focus) {
    padding: 15px 10px;
}

.chat-footer input {
    flex: 1;
    border: 1px solid #014d2b;
    border-radius: 25px;
    padding: 10px 20px;
    outline: none;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #f9f5e1;
    color: #333;
    transition: all 0.3s ease;
}

.chat-footer input:hover,
.chat-footer input:focus {
    border-color: #014d2b;
    box-shadow: 0 0 0 2px rgba(1, 77, 43, 0.1);
}

.chat-footer input::placeholder {
    color: rgba(1, 77, 43, 0.5);
}

.chat-footer input:focus {
    border-color: #014d2b;
    box-shadow: 0 0 0 2px rgba(1, 77, 43, 0.1);
}

.chat-footer .send-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    border-radius: 50%;
    background: #014d2b;
    color: #f9f5e1;
    border: none;
    margin-left: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    aspect-ratio: 1/1;
    padding: 0;
    flex-shrink: 0;
}

.chat-footer .send-btn:hover {
    transform: translateY(-2px);
}

.chat-footer .send-btn i {
    font-size: 16px;
}

/* Media queries pour les appareils mobiles */
@media (max-width: 767px) {
    .chat-container {
        right: 15px;
    }

    .chat-toggle {
        width: 55px;
        height: 55px;
        min-width: 55px;
        min-height: 55px;
    }

    .chat-toggle i {
        font-size: 22px;
    }

    .chat-box {
        width: 300px;
        height: 450px;
        right: 70px;
    }

    .message {
        max-width: 95%;
    }

    .avatar {
        width: 35px;
        height: 35px;
        min-width: 35px;
        min-height: 35px;
    }

    .chat-header h5 {
        font-size: 16px;
    }
}

/* Styles pour les suggestions de chat */
.chat-suggestions {
    margin: 15px 0;
    padding: 5px 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.suggestions-title {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
    padding-left: 5px;
}

.suggestion-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-item {
    display: inline-block;
    background-color: #fff;
    color: #014d2b;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid #014d2b;
    user-select: none;
}

.suggestion-item:hover {
    background-color: #014d2b;
    color: #f9f5e1;
    transform: translateY(-2px);
}

/* Styles pour les recommandations de produits */
.product-recommendations {
    width: 95%;
    margin: 15px auto;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s ease;
}

.product-recommendations.visible {
    opacity: 1;
    transform: translateY(0);
}

.product-recommendations h4 {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
    text-align: center;
    font-weight: 500;
}

.product-carousel {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding: 5px 0;
    scrollbar-width: thin;
    scrollbar-color: #014d2b #f9f5e1;
}

.product-carousel::-webkit-scrollbar {
    height: 4px;
}

.product-carousel::-webkit-scrollbar-track {
    background: #f9f5e1;
    border-radius: 10px;
}

.product-carousel::-webkit-scrollbar-thumb {
    background-color: #014d2b;
    border-radius: 10px;
}

.chat-container .product-card {
    flex: 0 0 auto;
    width: 160px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border: 1px solid #014d2b;
}

.chat-container .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.chat-container .product-image {
    height: 80px;
    background: #f9f5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid #014d2b;
}

.chat-container .product-image img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

.chat-container .product-info {
    padding: 10px;
    flex: 1;
}

.chat-container .product-info h5 {
    margin: 0 0 5px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.chat-container .product-info p {
    margin: 0 0 8px;
    font-size: 11px;
    color: #666;
    line-height: 1.3;
}

.chat-container .product-price {
    font-weight: 600;
    color: #014d2b;
    font-size: 14px;
}

.chat-container .add-to-cart-btn {
    background: #014d2b;
    color: white;
    border: none;
    padding: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.chat-container .add-to-cart-btn:hover {
    opacity: 0.9;
}

.chat-container .add-to-cart-btn.added {
    background: #4CAF50;
}

.chat-container .view-product-btn {
    background: #014d2b;
    color: white;
    border: none;
    padding: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    text-decoration: none;
}

.chat-container .view-product-btn:hover {
    opacity: 0.9;
}