/* v1.3.3 AI Helper widget - floating button + chat panel. */
/* v1.3.11: the widget sits at the bottom-LEFT (was bottom-right). */
.ss-ai-helper { position: fixed; left: 20px; bottom: 20px; z-index: 9999; font-family: inherit; }
.ss-ai-fab { position: relative; display: flex; align-items: center; gap: 8px; border: 0; cursor: pointer; color: #fff; background: linear-gradient(135deg, #6d5ef8, #5848e8); border-radius: 999px; padding: 12px 18px 12px 14px; font-size: 15px; font-weight: 700; box-shadow: 0 8px 24px rgba(109, 94, 248, .45); }
.ss-ai-fab:hover { background: linear-gradient(135deg, #7d6ef9, #6d5ef8); }
.ss-ai-fab-ring { position: absolute; inset: -4px; border-radius: 999px; border: 2px solid rgba(109, 94, 248, .55); animation: ss-ai-pulse 2s ease-out infinite; pointer-events: none; }
@keyframes ss-ai-pulse { 0% { transform: scale(.95); opacity: .9; } 70% { transform: scale(1.15); opacity: 0; } 100% { transform: scale(1.15); opacity: 0; } }
.ss-ai-fab-icon { flex: none; }
.ss-ai-fab-label { white-space: nowrap; }
.ss-ai-panel { position: absolute; left: 0; bottom: 76px; width: 380px; max-width: calc(100vw - 40px); height: 520px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 16px 48px rgba(0, 0, 0, .22); overflow: hidden; }
/* v1.3.6: display:flex above overrides the hidden attribute's UA
   display:none, so the panel was stuck open on every page load. This
   rule (higher specificity) restores hidden. */
.ss-ai-panel[hidden] { display: none; }
/* v1.3.9: same hidden-attribute bug as the 1.3.6 panel - display:flex on
   .ss-ai-input-row and .ss-ai-messages overrode hidden, so the message
   box showed before name+phone were given. Any hidden element inside
   the widget stays hidden. */
.ss-ai-panel [hidden] { display: none !important; }
/* v1.3.7: belt and suspenders for minimise - the JS also adds this class
   when the visitor closes the panel, so no theme CSS can keep it open. */
.ss-ai-panel.ss-ai-closed { display: none !important; }
.ss-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; background: linear-gradient(135deg, #6d5ef8, #5848e8); color: #fff; }
.ss-ai-head-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ss-ai-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .22); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; position: relative; overflow: hidden; }
/* v1.3.10: the bot's photo (Rashed's photo) covers the letter avatar;
   if the image fails to load, it is removed and the letter shows. */
.ss-ai-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.ss-ai-head-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ss-ai-head-text strong { font-size: 16px; }
.ss-ai-online { font-size: 12px; opacity: .9; }
.ss-ai-head-btn { flex: none; border: 0; background: rgba(255, 255, 255, .18); color: #fff; width: 30px; height: 30px; border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; }
.ss-ai-body { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; background: #f9fafb; }
.ss-ai-start p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: #374151; }
.ss-ai-start label { display: block; font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 10px; }
.ss-ai-start input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 15px; font-family: inherit; box-sizing: border-box; }
.ss-ai-start input:focus { outline: 2px solid #6d5ef8; outline-offset: -1px; border-color: #6d5ef8; }
.ss-ai-error { color: #dc2626; font-size: 13px; font-weight: 700; }
.ss-ai-btn { border: 0; cursor: pointer; color: #fff; background: #6d5ef8; border-radius: 10px; padding: 10px 16px; font-size: 15px; font-weight: 700; font-family: inherit; }
.ss-ai-btn:hover { background: #5848e8; }
.ss-ai-btn:disabled { opacity: .6; cursor: default; }
.ss-ai-start .ss-ai-btn { width: 100%; margin-top: 4px; }
.ss-ai-messages { display: flex; flex-direction: column; gap: 10px; }
.ss-ai-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.ss-ai-msg-user { align-self: flex-end; background: #6d5ef8; color: #fff; border-bottom-right-radius: 4px; }
.ss-ai-msg-assistant { align-self: flex-start; background: #fff; color: #111827; border: 1px solid #e5e7eb; border-bottom-left-radius: 4px; }
.ss-ai-typing { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; color: #6b7280; font-size: 13px; }
.ss-ai-products { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ss-ai-product { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 10px; padding: 8px 10px; }
.ss-ai-product-info { min-width: 0; }
.ss-ai-product-title { display: block; font-size: 13px; font-weight: 700; color: #111827; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-ai-product-title:hover { color: #6d5ef8; }
.ss-ai-product-price { font-size: 13px; font-weight: 800; color: #6d5ef8; white-space: nowrap; }
.ss-ai-product-link { flex: none; font-size: 13px; font-weight: 700; color: #fff; background: #6d5ef8; border-radius: 8px; padding: 6px 10px; text-decoration: none; }
/* v1.3.16: tappable category options for a vague message. */
.ss-ai-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ss-ai-option { border: 1px solid #6d5ef8; background: #fff; color: #6d5ef8; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; }
.ss-ai-option:hover { background: #6d5ef8; color: #fff; }
.ss-ai-option:disabled { opacity: .45; cursor: default; }
.ss-ai-input-row { display: flex; gap: 8px; padding: 10px; border-top: 1px solid #e5e7eb; background: #fff; }
.ss-ai-input-row input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 15px; font-family: inherit; }
.ss-ai-input-row input:focus { outline: 2px solid #6d5ef8; outline-offset: -1px; border-color: #6d5ef8; }
@media (max-width: 480px) {
  .ss-ai-helper { left: 12px; bottom: 12px; }
  .ss-ai-fab { padding: 10px 14px 10px 12px; font-size: 14px; }
  .ss-ai-panel { left: 0; bottom: 68px; width: calc(100vw - 24px); height: 78vh; max-height: none; }
}
