#ai-shopper-chat {
  --nobot-black: #111111;
  --nobot-white: #ffffff;
  --nobot-pink: #ffc0cb;
  --nobot-pink-strong: #ff9bb1;
  --nobot-ink-soft: #2c2c2c;
  --nobot-line: #e8e8e8;
  --nobot-surface: #fff7f9;
  --nobot-font: "Avenir Next", "Montserrat", "Trebuchet MS", "Segoe UI", sans-serif;
}

@keyframes nobot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes nobot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 192, 203, 0.45); }
  100% { box-shadow: 0 0 0 20px rgba(255, 192, 203, 0); }
}

@keyframes nobot-pop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes nobot-robot-idle {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(-2deg); }
  75% { transform: translateY(-1px) rotate(2deg); }
}

@keyframes nobot-robot-think {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.05) rotate(-4deg); }
  50% { transform: scale(1) rotate(0deg); }
  75% { transform: scale(1.05) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes nobot-robot-reply {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes nobot-dot {
  0%, 80%, 100% { transform: scale(0.72); opacity: 0.42; }
  40% { transform: scale(1); opacity: 1; }
}

#ai-shopper-chat .ai-shopper-button {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  z-index: 2147483000 !important;
  width: 68px !important;
  height: 68px !important;
  border: 2px solid var(--nobot-white) !important;
  border-radius: 999px !important;
  appearance: none !important;
  display: grid !important;
  place-items: center !important;
  background: linear-gradient(160deg, #1e1e1e 0%, #050505 100%) !important;
  color: var(--nobot-white) !important;
  cursor: pointer !important;
  font: 900 19px/1 var(--nobot-font) !important;
  letter-spacing: 0 !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38) !important;
  animation: nobot-float 2.4s ease-in-out infinite, nobot-pulse 2.2s ease-out infinite !important;
  transition: transform 160ms ease, box-shadow 160ms ease !important;
  overflow: hidden;
}

#ai-shopper-chat .ai-shopper-button:hover {
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45) !important;
}

#ai-shopper-chat .ai-shopper-button::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  right: -1px;
  top: -1px;
  border-radius: 50%;
  background: var(--nobot-pink);
  border: 2px solid var(--nobot-white);
}

#ai-shopper-chat .ai-shopper-button-text {
  transform: translateY(1px);
}

#ai-shopper-chat .ai-shopper-robot-fallback {
  display: inline-flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  animation: nobot-robot-idle 1.8s ease-in-out infinite;
}

#ai-shopper-chat .ai-shopper-robot-fallback svg {
  width: 100%;
  height: 100%;
  display: block;
}

#ai-shopper-chat .ai-shopper-robot-icon {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  animation: nobot-robot-idle 1.8s ease-in-out infinite;
}

#ai-shopper-chat .ai-shopper-button.has-robot-icon {
  background: var(--nobot-white) !important;
  color: var(--nobot-black) !important;
}

#ai-shopper-chat .ai-shopper-button.has-robot-icon .ai-shopper-robot-icon {
  display: block;
}

#ai-shopper-chat .ai-shopper-button.has-robot-icon.is-tall-robot .ai-shopper-robot-icon {
  object-fit: cover;
  object-position: center 18%;
  transform: scale(1.34);
}

#ai-shopper-chat .ai-shopper-button.has-robot-icon .ai-shopper-robot-fallback {
  display: none;
}

#ai-shopper-chat .ai-shopper-button.has-robot-icon .ai-shopper-button-text {
  display: none;
}

#ai-shopper-chat .ai-shopper-button:not(.has-robot-icon) .ai-shopper-button-text {
  display: none;
}

#ai-shopper-chat .ai-shopper-button.has-robot-icon.is-thinking .ai-shopper-robot-icon {
  animation: nobot-robot-think 0.8s ease-in-out infinite;
}

#ai-shopper-chat .ai-shopper-button.has-robot-icon.just-replied .ai-shopper-robot-icon {
  animation: nobot-robot-reply 0.6s ease-in-out;
}

#ai-shopper-chat .ai-shopper-button:not(.has-robot-icon).is-thinking .ai-shopper-robot-fallback {
  animation: nobot-robot-think 0.8s ease-in-out infinite;
}

#ai-shopper-chat .ai-shopper-button:not(.has-robot-icon).just-replied .ai-shopper-robot-fallback {
  animation: nobot-robot-reply 0.6s ease-in-out;
}

#ai-shopper-chat .ai-shopper-panel {
  position: fixed !important;
  right: 18px !important;
  bottom: 96px !important;
  z-index: 2147483000 !important;
  display: none;
  width: min(432px, calc(100vw - 20px));
  height: min(690px, calc(100vh - 114px));
  border: 1px solid #dcdcdc;
  border-radius: 14px;
  background: var(--nobot-white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  font: 14px/1.45 var(--nobot-font);
}

#ai-shopper-chat .ai-shopper-panel.is-open {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  animation: nobot-pop 240ms cubic-bezier(0.2, 0.84, 0.3, 1);
}

#ai-shopper-chat .ai-shopper-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #202020;
  color: var(--nobot-white);
  background:
    radial-gradient(circle at right top, rgba(255, 192, 203, 0.25) 0 18%, rgba(255, 192, 203, 0) 45%),
    #101010;
}

#ai-shopper-chat .ai-shopper-title {
  display: block;
  font-size: 18px;
  font-weight: 900;
}

#ai-shopper-chat .ai-shopper-status {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
}

#ai-shopper-chat .ai-shopper-disclaimer {
  padding: 12px 16px;
  color: rgba(0, 0, 0, 0.72);
  font-size: 12px;
  line-height: 1.4;
  background: rgba(255, 211, 219, 0.22);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

#ai-shopper-chat .ai-shopper-close {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--nobot-white);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

#ai-shopper-chat .ai-shopper-prompts {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--nobot-line);
  background: var(--nobot-white);
}

#ai-shopper-chat .ai-shopper-chip {
  flex: 0 0 auto;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d6d6d6;
  border-radius: 999px;
  padding: 8px 11px;
  background: #fff;
  color: var(--nobot-black);
  cursor: pointer;
  font: 800 12px/1 var(--nobot-font);
  white-space: nowrap;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

#ai-shopper-chat .ai-shopper-chip:hover {
  transform: translateY(-1px);
  border-color: var(--nobot-black);
  background: var(--nobot-pink);
}

#ai-shopper-chat .ai-shopper-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 88% 8%, rgba(255, 192, 203, 0.22) 0 18%, rgba(255, 192, 203, 0) 42%),
    var(--nobot-surface);
}

#ai-shopper-chat .ai-shopper-message {
  max-width: 84%;
  padding: 10px 12px;
  border-radius: 11px;
  color: var(--nobot-black);
  background: var(--nobot-white);
  border: 1px solid #ececec;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
  animation: nobot-pop 190ms ease;
}

#ai-shopper-chat .ai-shopper-message.user {
  align-self: flex-end;
  background: var(--nobot-black);
  color: var(--nobot-white);
  border-color: #000000;
}

#ai-shopper-chat .ai-shopper-message.loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#ai-shopper-chat .ai-shopper-message.loading .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #343434;
  animation: nobot-dot 1.2s infinite ease-in-out;
}

#ai-shopper-chat .ai-shopper-message.loading .dot:nth-child(2) { animation-delay: 0.14s; }
#ai-shopper-chat .ai-shopper-message.loading .dot:nth-child(3) { animation-delay: 0.28s; }

#ai-shopper-chat .ai-shopper-handoff {
  padding: 12px;
  border-top: 1px solid var(--nobot-line);
  background: #fff4f7;
}

#ai-shopper-chat .ai-shopper-handoff[hidden] { display: none; }

#ai-shopper-chat .ai-shopper-handoff label {
  display: grid;
  gap: 6px;
  color: var(--nobot-ink-soft);
  font-weight: 800;
  font-size: 12px;
}

#ai-shopper-chat .ai-shopper-email,
#ai-shopper-chat .ai-shopper-input {
  min-width: 0;
  border: 1px solid #d5d5d5;
  border-radius: 8px;
  padding: 11px;
  background: #ffffff;
  color: var(--nobot-black);
  line-height: 1.4;
  font: inherit;
}

#ai-shopper-chat .ai-shopper-input {
  min-height: 56px;
  resize: none;
  white-space: pre-wrap;
  overflow: auto;
}

#ai-shopper-chat .ai-shopper-email::placeholder,
#ai-shopper-chat .ai-shopper-input::placeholder {
  color: rgba(17, 17, 17, 0.6);
  opacity: 1;
}

#ai-shopper-chat .ai-shopper-email:focus::placeholder,
#ai-shopper-chat .ai-shopper-input:focus::placeholder {
  color: rgba(17, 17, 17, 0.45);
}

#ai-shopper-chat .ai-shopper-handoff-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

#ai-shopper-chat .ai-shopper-handoff-send,
#ai-shopper-chat .ai-shopper-handoff-cancel,
#ai-shopper-chat .ai-shopper-support,
#ai-shopper-chat .ai-shopper-send {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  font: 800 13px/1 var(--nobot-font);
}

#ai-shopper-chat .ai-shopper-handoff-send {
  background: linear-gradient(150deg, var(--nobot-pink) 0%, var(--nobot-pink-strong) 100%);
  color: var(--nobot-black);
}

#ai-shopper-chat .ai-shopper-handoff-cancel,
#ai-shopper-chat .ai-shopper-support {
  background: #f1f1f1;
  color: #242424;
}

#ai-shopper-chat .ai-shopper-send {
  background: var(--nobot-black);
  color: var(--nobot-white);
}

#ai-shopper-chat .ai-shopper-form {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--nobot-line);
  background: var(--nobot-white);
}

#ai-shopper-chat .product-card,
#ai-shopper-chat .ai-shopper-product-card {
  display: block;
  max-width: 232px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #e1e1e1;
  border-radius: 8px;
  background: #fff;
}

#ai-shopper-chat .product-card img,
#ai-shopper-chat .ai-shopper-product-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
}

#ai-shopper-chat .product-card h4 {
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 700;
}

#ai-shopper-chat .product-card p {
  margin: 0 0 6px;
  color: #4f4f4f;
}

#ai-shopper-chat .product-card a {
  color: #181818;
  text-decoration: none;
}

#ai-shopper-chat .add-to-cart-btn {
  min-height: 30px;
  margin-top: 6px;
  padding: 6px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  background: var(--nobot-pink);
  color: var(--nobot-black);
  cursor: pointer;
  font: 800 12px/1 var(--nobot-font);
}

@media (max-width: 640px) {
  #ai-shopper-chat .ai-shopper-button {
    right: 12px !important;
    bottom: 12px !important;
    width: 60px !important;
    height: 60px !important;
    font-size: 17px !important;
  }

  #ai-shopper-chat .ai-shopper-robot-icon {
    width: 48px;
    height: 48px;
  }

  #ai-shopper-chat .ai-shopper-panel {
    right: 8px !important;
    bottom: 78px !important;
    width: calc(100vw - 16px);
    height: min(74vh, 620px);
    border-radius: 11px;
  }

  #ai-shopper-chat .ai-shopper-form {
    grid-template-columns: 1fr auto;
  }

  #ai-shopper-chat .ai-shopper-support {
    grid-column: 1 / -1;
    order: 3;
  }
}
