/* Saramoon Chat Widget — all selectors namespaced .sm-chat-* / .sm-* */

#sm-chat-root,
#sm-chat-root * {
  box-sizing: border-box;
}

#sm-chat-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  /* Maximum 32-bit safe; Divi often uses 99999, so we sit above it. */
  z-index: 2147483000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #28251d;
}

.sm-chat-launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #01696f;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition: background 180ms ease;
}
.sm-chat-launcher:hover,
.sm-chat-launcher:focus-visible { background: #0c4e54; outline: none; }
.sm-chat-launcher svg { display: block; }

.sm-chat-panel {
  display: none;
  flex-direction: column;
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 360px;
  max-height: min(560px, calc(100vh - 110px));
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.20);
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}
.sm-chat-panel.sm-open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.sm-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #01696f;
  color: #fff;
  padding: 14px 16px;
  font-weight: 600;
}
.sm-chat-header button {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  width: 32px;
  height: 32px;
  line-height: 1;
}

.sm-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.sm-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.sm-msg-user { background: #01696f; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.sm-msg-bot  { background: #f3f0ec; color: #28251d; align-self: flex-start; border-bottom-left-radius: 4px; }

.sm-typing { display: flex; gap: 4px; align-items: center; padding: 12px 16px; }
.sm-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #bab9b4;
  animation: sm-bounce 1.2s infinite;
}
.sm-typing span:nth-child(2) { animation-delay: 0.2s; }
.sm-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sm-bounce { 0%,80%,100%{transform:scale(0.8)} 40%{transform:scale(1.2)} }

.sm-products { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.sm-product-card {
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  background: #f9f8f5;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 10px;
  transition: box-shadow 180ms ease;
}
.sm-product-card:hover,
.sm-product-card:focus-visible {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
  outline: none;
}
.sm-product-card img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.sm-product-info { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.sm-product-info strong { font-size: 13px; font-weight: 600; line-height: 1.3; color: #28251d; }
.sm-product-info span { color: #7a7974; }
.sm-product-info em { color: #01696f; font-style: normal; font-size: 12px; }

.sm-chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 2px; }
.sm-chip {
  background: #cedcd8;
  color: #0c4e54;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
  cursor: pointer;
  transition: background 150ms;
}
.sm-chip:hover { background: #b0ccc8; }

.sm-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.sm-chat-input-row input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  min-height: 44px;
  background: #fff;
  color: #28251d;
}
.sm-chat-input-row input:focus { border-color: #01696f; }
.sm-chat-input-row button {
  background: #01696f;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 18px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  transition: background 150ms;
}
.sm-chat-input-row button:hover { background: #0c4e54; }
.sm-chat-input-row input:disabled,
.sm-chat-input-row button:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 420px) {
  #sm-chat-root { bottom: 12px; right: 12px; }
  .sm-chat-panel {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 76px;
    max-height: calc(100vh - 110px);
  }
}
