/* Chatbot Widget Styles */

.ps-chatbot-widget {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Position variants */
.ps-chatbot-bottom-right {
    bottom: 20px;
    right: 20px;
}

.ps-chatbot-bottom-left {
    bottom: 20px;
    left: 20px;
}

.ps-chatbot-top-right {
    top: 20px;
    right: 20px;
}

.ps-chatbot-top-left {
    top: 20px;
    left: 20px;
}

/* Chatbot Button */
.ps-chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: none;
    outline: none;
    background-color: #007bff !important; /* Couleur par défaut, sera surchargée par le style inline */
}

.ps-chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.ps-chatbot-button:active {
    transform: scale(0.95);
}

/* Chatbot Window */
.ps-chatbot-window {
    position: absolute !important;
    bottom: 80px !important;
    right: 0 !important;
    width: 500px !important;
    height: 580px !important;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ps-chatbot-slide-up 0.3s ease;
    transition: all 0.3s ease !important;
}

.ps-chatbot-bottom-left .ps-chatbot-window {
    right: auto;
    left: 0;
}

.ps-chatbot-top-right .ps-chatbot-window {
    bottom: auto;
    top: 80px;
}

.ps-chatbot-top-left .ps-chatbot-window {
    bottom: auto;
    top: 80px;
    right: auto;
    left: 0;
}

@keyframes ps-chatbot-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.ps-chatbot-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-weight: 600;
}

.ps-chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ps-chatbot-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.ps-chatbot-close, .ps-chatbot-maximize-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 1.3em;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.ps-chatbot-close:hover, .ps-chatbot-maximize-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Messages Container */
.ps-chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background-color: #f8f9fa;
}

.ps-chatbot-messages::-webkit-scrollbar {
    width: 4px;
}

.ps-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ps-chatbot-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

/* Message Styles */
.ps-chatbot-message {
    display: flex;
    margin-bottom: 16px;
    gap: 8px;
}

.ps-chatbot-message.ps-chatbot-bot {
    align-items: flex-start;
}

.ps-chatbot-message.ps-chatbot-user {
    align-items: flex-end;
    flex-direction: row-reverse;
}

.ps-chatbot-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #6c757d;
}

.ps-chatbot-message.ps-chatbot-user .ps-chatbot-avatar {
    background-color: var(--user-bubble-color, #007bff);
    color: white;
}

.ps-chatbot-text {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.ps-chatbot-message.ps-chatbot-bot .ps-chatbot-text {
    background-color: white;
    color: #333;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ps-chatbot-message.ps-chatbot-user .ps-chatbot-text {
    background-color: var(--user-bubble-color, #007bff);
    color: white;
}

/* Input Area */
.ps-chatbot-input-area {
    padding: 16px;
    background-color: white;
    border-top: 1px solid #e9ecef;
}

.ps-chatbot-input-container {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ps-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.ps-chatbot-input:focus {
    border-color: var(--user-bubble-color, #007bff);
}

.ps-chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ps-chatbot-send:hover {
    transform: scale(1.1);
}

.ps-chatbot-send:active {
    transform: scale(0.95);
}

.ps-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.ps-chatbot-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

.ps-chatbot-typing-dots {
    display: flex;
    gap: 4px;
}

.ps-chatbot-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #6c757d;
    animation: ps-chatbot-typing 1.4s infinite ease-in-out;
}

.ps-chatbot-typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.ps-chatbot-typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes ps-chatbot-typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Product Suggestions */
.ps-chatbot-suggestions {
    width: 100%;
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
    align-items: stretch;
}

/* Étendu : 4 par ligne */
.ps-chatbot-widget.ps-chatbot-maximized .ps-chatbot-product-suggestion {
    flex: 0 1 200px;
    width: 200px;
    max-width: 200px;
    min-width: 160px;
}

.ps-chatbot-product-suggestion {
    flex: 0 1 calc(50% - 12px);
    min-width: 120px;
    max-width: 200px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #ececec;
    box-shadow: 0 2px 8px #0001;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px 10px 8px;
    margin-bottom: 0;
    transition: box-shadow 0.2s, border 0.2s;
    cursor: pointer;
}

.ps-chatbot-product-suggestion:hover {
    box-shadow: 0 4px 16px #0002;
    border: 1px solid #d0d0d0;
    background: #f8f9fa;
}

.ps-chatbot-product-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
    box-shadow: 0 1px 4px #0001;
}

.ps-chatbot-product-info {
    text-align: center;
    padding: 0 4px;
}

.ps-chatbot-product-suggestion h4 {
    font-size: 13px;
    margin: 0 0 4px 0;
    font-weight: 600;
    color: #333;
}

.ps-chatbot-product-suggestion p {
    font-size: 12px;
    color: #6c757d;
    margin: 0 0 4px 0;
}

.ps-chatbot-product-suggestion .price {
    font-weight: 600;
    color: var(--user-bubble-color, #007bff);
    margin-bottom: 4px;
}

/* Responsive Design */
@media (max-width: 480px) {
    .ps-chatbot-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
        bottom: 80px;
        right: 20px;
    }
    
    .ps-chatbot-bottom-left .ps-chatbot-window {
        right: 20px;
        left: 20px;
    }
    
    .ps-chatbot-top-right .ps-chatbot-window,
    .ps-chatbot-top-left .ps-chatbot-window {
        bottom: 80px;
        top: 20px;
        right: 20px;
        left: 20px;
    }
    
    .ps-chatbot-text {
        max-width: 85%;
    }

    .ps-chatbot-suggestions {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
        margin-left: 0;
    }
    .ps-chatbot-product-suggestion {
        max-width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }
    .ps-chatbot-product-img {
        width: 60px;
        height: 60px;
    }
}

/* Loading Animation */
.ps-chatbot-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: ps-chatbot-spin 1s linear infinite;
}

@keyframes ps-chatbot-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.ps-chatbot-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    font-size: 12px;
}

/* Success Message */
.ps-chatbot-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    font-size: 12px;
}

/* Mode maximisé du widget */
.ps-chatbot-widget.ps-chatbot-modal.ps-chatbot-maximized .ps-chatbot-window {
    width: 900px !important;
    height: 90vh !important;
    max-width: 900px !important;
    max-height: 90vh !important;
    right: 5vw !important;
    bottom: 5vh !important;
    z-index: 99999 !important;
    position: fixed !important;
    transition: all 0.3s ease !important;
}

.ps-chatbot-widget.ps-chatbot-modal.ps-chatbot-maximized.ps-chatbot-bottom-left .ps-chatbot-window {
    left: 5vw !important;
    right: auto !important;
}

.ps-chatbot-widget.ps-chatbot-modal.ps-chatbot-maximized.ps-chatbot-top-right .ps-chatbot-window {
    top: 5vh !important;
    bottom: auto !important;
}

.ps-chatbot-widget.ps-chatbot-modal.ps-chatbot-maximized.ps-chatbot-top-left .ps-chatbot-window {
    top: 5vh !important;
    left: 5vw !important;
    bottom: auto !important;
    right: auto !important;
}

.ps-chatbot-widget.ps-chatbot-modal.ps-chatbot-maximized .ps-chatbot-suggestions {
    gap: 12px !important;
    justify-content: flex-start !important;
}

.ps-chatbot-widget.ps-chatbot-modal.ps-chatbot-maximized .ps-chatbot-product-suggestion {
    flex: 0 1 200px !important;
    width: 200px !important;
    max-width: 200px !important;
    min-width: 160px !important;
}

.ps-chatbot-close {
    font-size: 2em;
    width: 40px;
    height: 40px;
}

.ps-chatbot-products-loading {
    font-size: 12px;
    color: #6c757d;
    margin: 8px 0 0 48px;
    font-style: italic;
    letter-spacing: 0.2px;
}

.ps-chatbot-dots {
    display: inline-block;
    min-width: 16px;
    letter-spacing: 2px;
}

/* Styles pour le HTML dans les messages du bot */
.ps-chatbot-text h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.ps-chatbot-text p {
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.ps-chatbot-text ul,
.ps-chatbot-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ps-chatbot-text li {
    margin: 4px 0;
    line-height: 1.4;
}

.ps-chatbot-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 13px;
}

.ps-chatbot-text th,
.ps-chatbot-text td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: left;
}

.ps-chatbot-text th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.ps-chatbot-text strong {
    font-weight: 600;
}

.ps-chatbot-text em {
    font-style: italic;
}

.ps-chatbot-text br {
    margin: 4px 0;
}

.ps-chatbot-text a {
    color: #007bff;
    text-decoration: underline;
}

.ps-chatbot-text a:hover {
    color: #0056b3;
}

/* === Stepper moderne et épuré Alyss === */
.alyss-steps-progress {
  width: 100%;
  max-width: 700px;
  margin: 0 auto 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.alyss-steps-bar-wrapper {
  width: 766px; /* largeur fixe */
  max-width: 100%;
  position: relative;
  height: 3px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.alyss-progress-bar-bg,
.alyss-progress-bar-fill {
  display: none !important;
}
.alyss-steps-icons {
  display: flex;
  justify-content: space-between;
  width: 88%; /* Même valeur que .alyss-steps-bar-wrapper */
  margin-top: -25px; /* Pour rapprocher les pictos de la barre */
  position: relative;
  z-index: 3;
}
.alyss-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 0;
  background: transparent;
  cursor: pointer;
  z-index: 3;
}
.alyss-step-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(108,71,230,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  border: 2px solid #ede9fa;
  transition: border 0.2s, background 0.2s;
}
.alyss-step.active .alyss-step-icon {
  background: #6c47e6;
  border: 2px solid #6c47e6;
  box-shadow: 0 4px 16px rgba(108,71,230,0.15);
}
.alyss-step.active .alyss-step-icon svg path,
.alyss-step.active .alyss-step-icon svg rect,
.alyss-step.active .alyss-step-icon svg circle {
  stroke: #fff !important;
}
.alyss-step-label {
  margin-top: 4px;
  font-size: 15px;
  color: #a3a3b3;
  font-weight: 500;
  text-align: center;
}
.alyss-step.active .alyss-step-label {
  color: #6c47e6;
  font-weight: 700;
}
@media (max-width: 600px) {
  .alyss-steps-progress {
    max-width: 98vw;
    height: 90px;
  }
  .alyss-step-label {
    font-size: 13px;
  }
  .alyss-step-icon {
    width: 38px;
    height: 38px;
  }
}

/* Widget Types */
.ps-chatbot-widget.ps-chatbot-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    z-index: 9999;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.ps-chatbot-widget.ps-chatbot-sidebar.ps-chatbot-open {
    transform: translateX(0);
}

.ps-chatbot-widget.ps-chatbot-sidebar .ps-chatbot-button {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    width: 60px;
    height: 60px;
    z-index: 99999;
    display: block;
    opacity: 1;
    border: 2px solid yellow;
}

/* Position du bouton en mode sidebar selon la position configurée */
.ps-chatbot-widget.ps-chatbot-sidebar.ps-chatbot-bottom-right .ps-chatbot-button {
    bottom: 20px;
    right: 20px;
}

.ps-chatbot-widget.ps-chatbot-sidebar.ps-chatbot-bottom-left .ps-chatbot-button {
    bottom: 20px;
    left: 20px;
}

.ps-chatbot-widget.ps-chatbot-sidebar.ps-chatbot-top-right .ps-chatbot-button {
    top: 20px;
    right: 20px;
}

.ps-chatbot-widget.ps-chatbot-sidebar.ps-chatbot-top-left .ps-chatbot-button {
    top: 20px;
    left: 20px;
}

.ps-chatbot-widget.ps-chatbot-sidebar .ps-chatbot-button:hover {
    transform: scale(1.1);
}

.ps-chatbot-widget.ps-chatbot-sidebar .ps-chatbot-window {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.ps-chatbot-widget.ps-chatbot-sidebar .ps-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ps-chatbot-widget.ps-chatbot-sidebar .ps-chatbot-input-area {
    border-top: 1px solid #e5e5e5;
    padding: 20px;
    background: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ps-chatbot-widget.ps-chatbot-sidebar {
        width: 100%;
        transform: translateX(100%);
    }
}

/* Sidebar Mode */
.ps-chatbot-sidebar .ps-chatbot-button {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 60px !important;
    height: 60px !important;
    z-index: 100000 !important;
    display: block !important;
    opacity: 1 !important;
    border: 2px solid yellow !important;
}

.ps-chatbot-sidebar .ps-chatbot-button svg {
    width: 32px !important;
    height: 32px !important;
    margin-bottom: 8px !important;
    transform: rotate(90deg) !important;
}

.ps-chatbot-sidebar .ps-chatbot-button::after {
    content: "Chat" !important;
    color: white !important;
    font-size: 14px !important;
    writing-mode: vertical-lr !important;
    transform: rotate(180deg) !important;
    margin-top: 8px !important;
}

.ps-chatbot-sidebar .ps-chatbot-window {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    transition: transform 0.3s ease !important;
    width: 400px !important;
    z-index: 100001 !important;
    box-shadow: -2px 0 16px rgba(0,0,0,0.18) !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important;
}

.ps-chatbot-sidebar.ps-chatbot-open .ps-chatbot-window {
    transform: translateX(0) !important;
    right: 0 !important;
}

@media (max-width: 480px) {
    .ps-chatbot-sidebar .ps-chatbot-window {
        width: 100vw !important;
        right: 0 !important;
    }
}

#ps-chatbot-button {
    position: fixed !important;
    bottom: 32px !important;
    right: 32px !important;
    left: auto !important;
    top: auto !important;
    width: 60px !important;
    height: 60px !important;
    z-index: 100000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 1 !important;
    border: 2px solid #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    transition: box-shadow 0.2s, transform 0.2s;
    background-color: var(--user-bubble-color, #4f3bd0) !important;
}
#ps-chatbot-button:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.25) !important;
    transform: scale(1.08);
}

.ps-chatbot-sidebar.ps-chatbot-open #ps-chatbot-button {
    display: none !important;
}

.ps-chatbot-modal.ps-chatbot-open .ps-chatbot-window {
    display: flex !important;
} 