.asac-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  font-family: "Segoe UI", Tahoma, sans-serif;
  display: flex;
  align-items: center;
  gap: 10px;
}

.asac-teaser {
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #11263c;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  animation: asacTeaserFloat 2.2s ease-in-out infinite;
}

.asac-bubble {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  cursor: pointer;
  box-shadow: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.asac-bubble img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.25));
}

.asac-panel {
  width: min(360px, calc(100vw - 24px));
  height: 500px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  margin-bottom: 12px;
  display: none;
  grid-template-rows: auto 1fr auto auto;
}

.asac-panel.is-open {
  display: grid;
}

.asac-header {
  background: #11263c;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.asac-title {
  font-size: 14px;
  font-weight: 700;
}

.asac-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.asac-messages {
  padding: 10px;
  overflow-y: auto;
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 100%);
}

.asac-msg {
  margin: 0 0 8px;
  padding: 9px 11px;
  border-radius: 10px;
  max-width: 90%;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.asac-bot,
.asac-agent {
  background: #e8f2ff;
  color: #13314f;
}

.asac-agent {
  background: #e9fff2;
  color: #0f5132;
}

.asac-me {
  margin-left: auto;
  background: #11263c;
  color: #fff;
}

.asac-actions {
  padding: 8px 10px;
  border-top: 1px solid #ebedf0;
}

.asac-handoff {
  border: 1px solid #ccd4de;
  background: #fff;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
}

.asac-close-live {
  border: 1px solid #fca5a5;
  background: #fff5f5;
  color: #b91c1c;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
  display: none;
}

.asac-end-chat {
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
}

.asac-handoff.is-highlight {
  border-color: #bd3a1c;
  color: #bd3a1c;
  font-weight: 600;
}

.asac-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  border-top: 1px solid #ebedf0;
  padding: 10px;
}

.asac-input {
  border: 1px solid #ccd4de;
  border-radius: 8px;
  padding: 9px;
  font-size: 13px;
}

.asac-send {
  border: 0;
  border-radius: 8px;
  background: #bd3a1c;
  color: #fff;
  font-weight: 600;
  padding: 9px 14px;
  cursor: pointer;
}

.asac-typing {
  font-style: italic;
  opacity: 0.9;
}

.asac-product-list {
  display: grid;
  gap: 8px;
  margin: 6px 0 10px;
}

.asac-product-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 8px;
  align-items: start;
  text-decoration: none;
  border: 1px solid #d7dde7;
  border-radius: 10px;
  background: #fff;
  padding: 7px;
}

.asac-product-image-wrap {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-size: 11px;
  overflow: hidden;
}

.asac-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asac-product-body {
  min-width: 0;
}

.asac-product-title {
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.asac-product-price {
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}

.asac-product-meta {
  color: #475569;
  font-size: 11px;
  margin-top: 2px;
}

.asac-product-cta {
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

@media (max-width: 640px) {
  .asac-root {
    right: 10px;
    /* Lift above sticky mobile bottom navigation */
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .asac-panel {
    width: calc(100vw - 12px);
    height: 72vh;
    max-height: 560px;
  }

  .asac-teaser {
    font-size: 12px;
    padding: 9px 12px;
  }
}

@keyframes asacTeaserFloat {
  0% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}
