/* STELLA Multi-Store Widget — SIIL Ostomy Editorial Palette
 * All classes prefixed stella- to avoid collisions with storefront CSS. */

.stella-root {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999999;
  font-family: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.48;
  color: #181818;
  pointer-events: none;
}

.stella-root * { box-sizing: border-box; }

/* Bubble */
.stella-bubble {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  background: #181818;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.24);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
  margin-left: auto;
}
.stella-bubble:hover {
  background: #2b2b2b;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.30);
}

/* Panel */
.stella-panel {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100dvh - 96px);
  background: #ffffff;
  border: 1px solid #e4e1db;
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(15, 15, 15, 0.22);
  overflow: hidden;
}

.stella-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #181818;
  color: #fff;
  padding: 13px 16px;
  flex: 0 0 auto;
}
.stella-title { font-weight: 600; font-size: 14.5px; letter-spacing: 0.01em; }
.stella-subtitle { font-size: 11.5px; opacity: 0.78; margin-top: 1px; }
.stella-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  border-radius: 6px;
}
.stella-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.1); }

/* Messages */
.stella-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px;
  background: #f7f5f2;
}

.stella-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  margin-bottom: 9px;
  word-wrap: break-word;
  white-space: normal;
}
.stella-bot {
  background: #ffffff;
  border: 1px solid #e6e3dd;
  border-bottom-left-radius: 4px;
  margin-right: auto;
  color: #181818;
}
.stella-user {
  background: #181818;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  margin-left: auto;
}

/* Typing dots */
.stella-typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.stella-typing span {
  width: 6.5px; height: 6.5px; border-radius: 50%;
  background: #8c8881;
  animation: stella-blink 1.2s infinite;
}
.stella-typing span:nth-child(2) { animation-delay: .2s; }
.stella-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes stella-blink {
  0%, 80%, 100% { opacity: .28; }
  40% { opacity: 1; }
}

/* Identify form */
.stella-idform {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-top: 1px solid #ece9e2;
  background: #faf9f6;
}
.stella-idform-label { margin: 0 0 6px; font-size: 12px; color: #5c5954; }
.stella-idform .stella-input { margin-bottom: 6px; }
.stella-idform-row { display: flex; gap: 8px; }
.stella-idform-save {
  background: #181818; color: #fff; border: none; border-radius: 8px;
  padding: 7px 14px; cursor: pointer; font-size: 12.5px; font-weight: 500;
}
.stella-idform-skip {
  background: none; border: none; color: #78746d; cursor: pointer; font-size: 12.5px;
  padding: 7px 6px;
}

/* Input row */
.stella-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid #ece9e2;
  background: #ffffff;
  flex: 0 0 auto;
}
.stella-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #dad6ce;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #fff;
  color: #181818;
}
.stella-input:focus { border-color: #181818; }
.stella-msg-input { flex: 1 1 auto; }
.stella-send {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  border: none;
  border-radius: 10px;
  background: #181818;
  color: #fff;
  cursor: pointer;
}
.stella-send:disabled { opacity: .45; cursor: default; }

/* Mobile: lift bubble above sticky Add-to-Cart bar so it never blocks conversion controls */
@media (max-width: 768px) {
  .stella-root { bottom: 14px; right: 14px; left: 14px; }
  .stella-bubble { margin-bottom: 66px; margin-left: auto; width: 50px; height: 50px; }
  .stella-panel {
    width: 100%;
    max-width: 100%;
    height: min(540px, calc(100dvh - 84px));
  }
  /* 16px prevents iOS Safari from auto-zooming the page when tapping chat inputs */
  .stella-input { font-size: 16px; }
}
