#ecom-ai-assistant-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
}

.ecom-ai-launcher {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: #14532d;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(20, 83, 45, 0.25);
  font-weight: 600;
}

.ecom-ai-launcher-disabled,
.ecom-ai-launcher:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.ecom-ai-panel {
  width: min(380px, calc(100vw - 32px));
  margin-top: 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #d9d0c2;
  box-shadow: 0 20px 45px rgba(34, 32, 27, 0.16);
  overflow: hidden;
}

.ecom-ai-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: #f5f1e8;
}

.ecom-ai-header-copy {
  display: grid;
  gap: 4px;
}

.ecom-ai-title {
  display: block;
}

.ecom-ai-header-actions {
  display: flex;
  gap: 8px;
}

.ecom-ai-ghost-button {
  border: 0;
  background: transparent;
  color: #14532d;
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}

.ecom-ai-subtle,
.ecom-ai-status {
  color: #6b665e;
  font-size: 13px;
}

.ecom-ai-status {
  padding: 10px 16px 0;
}

.ecom-ai-thread {
  max-height: 420px;
  overflow-y: auto;
  display: grid;
  gap: 10px;
  padding: 16px;
}

.ecom-ai-message {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: 14px;
  background: #f8f3ea;
}

.ecom-ai-message-user {
  background: #eef7ef;
}

.ecom-ai-message-role {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b665e;
}

.ecom-ai-message-body {
  line-height: 1.5;
  white-space: pre-wrap;
}

.ecom-ai-products {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.ecom-ai-actions,
.ecom-ai-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.ecom-ai-action,
.ecom-ai-followup {
  border: 1px solid #d9d0c2;
  border-radius: 999px;
  background: #fff;
  color: #22201b;
  padding: 7px 11px;
  font-size: 12px;
  cursor: pointer;
}

.ecom-ai-followup {
  background: #f5f1e8;
}

.ecom-ai-sources {
  margin: 4px 0 0;
  padding-left: 18px;
  color: #6b665e;
  font-size: 12px;
  line-height: 1.4;
}

.ecom-ai-source + .ecom-ai-source {
  margin-top: 4px;
}

.ecom-ai-product {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #d9d0c2;
  color: inherit;
  text-decoration: none;
  align-items: start;
}

.ecom-ai-product-media {
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 10px;
  background: #f5f1e8;
}

.ecom-ai-product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ecom-ai-product-content {
  display: grid;
  gap: 4px;
}

.ecom-ai-product-title {
  color: #22201b;
}

.ecom-ai-product-price {
  color: #14532d;
  font-weight: 600;
}

.ecom-ai-product-description {
  color: #6b665e;
  font-size: 13px;
  line-height: 1.4;
}

.ecom-ai-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 16px;
  border-top: 1px solid #ece4d8;
}

.ecom-ai-form input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #d9d0c2;
  padding: 10px 12px;
}

.ecom-ai-send {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  background: #22201b;
  color: #fff;
  cursor: pointer;
}

.ecom-ai-send:disabled {
  cursor: wait;
  opacity: 0.72;
}

.ecom-ai-error {
  padding: 0 16px 12px;
  color: #b42318;
  font-size: 13px;
}

@media (max-width: 640px) {
  #ecom-ai-assistant-root {
    right: 12px;
    left: 12px;
    bottom: 12px;
  }

  .ecom-ai-panel {
    width: 100%;
  }

  .ecom-ai-product {
    grid-template-columns: 1fr;
  }

  .ecom-ai-product-media {
    width: 100%;
    height: 140px;
  }
}
