.swc-root, .swc-root * { box-sizing: border-box; }
.swc-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 99999;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--swc-color, #2563eb); color: #fff;
  border: none; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease;
}
.swc-launcher:hover { transform: scale(1.06); }
.swc-launcher img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.swc-launcher svg { width: 28px; height: 28px; }

.swc-panel {
  position: fixed; right: 20px; bottom: 92px; z-index: 99999;
  width: 380px; max-width: calc(100vw - 24px); height: 580px; max-height: calc(100vh - 120px);
  background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: 'Noto Sans', 'Noto Sans Sinhala', 'Noto Sans Tamil', 'Noto Sans Devanagari', system-ui, sans-serif;
}
.swc-header {
  background: var(--swc-color, #2563eb); color: #fff;
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.swc-header img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.swc-header .swc-title { font-weight: 600; flex: 1; }
.swc-header button { background: transparent; border: none; color: #fff; cursor: pointer; padding: 4px; }
.swc-lang { background: rgba(255,255,255,.2); color: #fff; border: none; border-radius: 6px; padding: 4px 8px; font-size: 12px; }

.swc-body { flex: 1; overflow-y: auto; padding: 14px; background: #f7f8fa; display: flex; flex-direction: column; gap: 10px; }
.swc-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-wrap: break-word; }
.swc-msg.user { align-self: flex-end; background: var(--swc-color, #2563eb); color: #fff; border-bottom-right-radius: 4px; }
.swc-msg.bot { align-self: flex-start; background: #fff; color: #1a1a1a; border: 1px solid #e6e8eb; border-bottom-left-radius: 4px; }
.swc-msg p { margin: 0 0 6px; } .swc-msg p:last-child { margin: 0; }
.swc-msg ul, .swc-msg ol { margin: 4px 0 4px 18px; }
.swc-msg a { color: var(--swc-color, #2563eb); }
.swc-msg code { background: #f1f3f5; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.swc-typing { display: inline-flex; gap: 3px; padding: 12px; }
.swc-typing span { width: 6px; height: 6px; border-radius: 50%; background: #b3b8bf; animation: swcBounce 1s infinite; }
.swc-typing span:nth-child(2) { animation-delay: .15s; }
.swc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes swcBounce { 0%,80%,100% { transform: translateY(0); opacity: .5 } 40% { transform: translateY(-4px); opacity: 1 } }

.swc-cards { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; }
.swc-card { min-width: 180px; max-width: 200px; background: #fff; border: 1px solid #e6e8eb; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.swc-card img { width: 100%; height: 120px; object-fit: cover; background: #f1f3f5; }
.swc-card-body { padding: 8px 10px; }
.swc-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 4px; max-height: 34px; overflow: hidden; }
.swc-card-price { font-size: 13px; color: #1a1a1a; margin-bottom: 6px; }
.swc-card-price.sale { color: #d63638; }
.swc-card-actions { display: flex; gap: 4px; }
.swc-card-actions button, .swc-card-actions a {
  flex: 1; font-size: 11px; padding: 6px 4px; border-radius: 6px; text-align: center;
  cursor: pointer; text-decoration: none;
  background: var(--swc-color, #2563eb); color: #fff; border: none;
}
.swc-card-actions a.alt { background: #f1f3f5; color: #1a1a1a; }

.swc-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; background: #f7f8fa; }
.swc-quick button {
  background: #fff; border: 1px solid var(--swc-color, #2563eb); color: var(--swc-color, #2563eb);
  border-radius: 16px; padding: 6px 12px; font-size: 12px; cursor: pointer;
}

.swc-input { padding: 10px 12px; background: #fff; border-top: 1px solid #e6e8eb; display: flex; gap: 8px; align-items: flex-end; }
.swc-input textarea {
  flex: 1; resize: none; border: 1px solid #e6e8eb; border-radius: 10px;
  padding: 9px 12px; font: inherit; font-size: 14px; max-height: 100px; min-height: 40px;
  font-family: inherit;
}
.swc-input button { background: var(--swc-color, #2563eb); color: #fff; border: none; border-radius: 10px; padding: 9px 14px; cursor: pointer; }
.swc-input button:disabled { opacity: .5; cursor: not-allowed; }

.swc-consent {
  position: absolute; inset: 0; background: rgba(255,255,255,.97);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 24px; z-index: 10;
}
.swc-consent h3 { margin: 0 0 8px; font-size: 16px; }
.swc-consent p { font-size: 13px; color: #555; margin: 0 0 16px; }
.swc-consent button { background: var(--swc-color, #2563eb); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; }

.swc-footer-actions { padding: 6px 12px; background: #f7f8fa; display: flex; justify-content: space-between; font-size: 11px; }
.swc-footer-actions button { background: none; border: none; color: #888; cursor: pointer; font-size: 11px; }
.swc-footer-actions button:hover { color: var(--swc-color, #2563eb); }

@media (max-width: 600px) {
  .swc-panel {
    right: 0; bottom: 0; width: 100%; max-width: 100%;
    height: 90vh; max-height: 90vh;
    border-radius: 16px 16px 0 0;
  }
  .swc-launcher { right: 16px; bottom: 16px; width: 56px; height: 56px; }
}

[lang="si"] .swc-msg, [lang="si"] .swc-input textarea { font-family: 'Noto Sans Sinhala', 'Noto Sans', sans-serif; }
[lang="ta"] .swc-msg, [lang="ta"] .swc-input textarea { font-family: 'Noto Sans Tamil', 'Noto Sans', sans-serif; }
[lang="hi"] .swc-msg, [lang="hi"] .swc-input textarea { font-family: 'Noto Sans Devanagari', 'Noto Sans', sans-serif; }

/* Figure-mode launcher: transparent character (no circle, no background) */
.swc-launcher.figure {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  width: var(--swc-avatar-size, 96px);
  height: auto;
  padding: 0;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.22));
  transition: transform .18s ease;
}
.swc-launcher.figure:hover { transform: translateY(-3px) scale(1.04); }
.swc-launcher.figure img {
  width: 100%;
  height: auto;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  display: block;
}
@media (max-width: 600px) {
  .swc-launcher.figure { width: calc(var(--swc-avatar-size, 96px) * 0.85); }
}

/* In-stock badge + Buy now button */
.swc-card-stock { font-size: 11px; margin-bottom: 6px; font-weight: 600; }
.swc-card-stock.ok { color: #2e7d32; }
.swc-card-stock.oos { color: #d63638; }
.swc-card-actions { flex-wrap: wrap; }
.swc-card-actions a.buy {
  flex: 1 1 100%;
  background: var(--swc-color, #2563eb);
  color: #fff;
  font-weight: 600;
  margin-bottom: 4px;
}
.swc-card-actions button[data-pid] {
  background: #fff;
  color: var(--swc-color, #2563eb);
  border: 1px solid var(--swc-color, #2563eb);
}
