@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700&family=Sora:wght@400;500;600;700&display=swap');

.ai-sales-agent {
  --asa-accent: #c92127;
  --asa-bg: #ffffff;
  --asa-ink: #1b1d24;
  --asa-muted: #69707d;
  --asa-body-font: "Manrope", "Sora", "Trebuchet MS", sans-serif;
  --asa-body-size: 13px;
  --asa-title-font: "Manrope", "Sora", "Trebuchet MS", sans-serif;
  --asa-title-size: 17px;
  --asa-subtitle-font: "Manrope", "Sora", "Trebuchet MS", sans-serif;
  --asa-subtitle-size: 11px;
  font-family: var(--asa-body-font);
  font-size: var(--asa-body-size);
  position: fixed;
  bottom: 24px;
  z-index: 9999;
}

.ai-sales-agent--right {
  right: 24px;
}

.ai-sales-agent--left {
  left: 24px;
}

.ai-sales-agent__launcher {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(135deg, var(--asa-accent), #86181c);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.ai-sales-agent__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 32px rgba(0, 0, 0, 0.25);
}

.ai-sales-agent__launcher.is-pulsing::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 18px;
  background: var(--asa-pulse, var(--asa-accent));
  box-shadow: 0 0 0 10px rgba(0, 0, 0, 0.04);
  opacity: 0.45;
  animation: asa-pulse 1.6s ease-out infinite;
  pointer-events: none;
  z-index: 0;
}

.ai-sales-agent__launcher.is-pulsing::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 14px;
  background: var(--asa-pulse, var(--asa-accent));
  opacity: 0.5;
  animation: asa-pulse-small 1.6s ease-out infinite;
  pointer-events: none;
  z-index: 0;
}

.ai-sales-agent__launcher-icon {
  font-size: 18px;
  line-height: 1;
}

.ai-sales-agent__launcher-text {
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: none;
}

.ai-sales-agent__panel {
  position: absolute;
  bottom: 72px;
  width: var(--asa-panel-width, 360px);
  max-width: 90vw;
  height: var(--asa-panel-height, 520px);
  max-height: 78vh;
  background: var(--asa-bg);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(15, 20, 40, 0.25);
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.ai-sales-agent--right .ai-sales-agent__panel {
  right: 0;
}

.ai-sales-agent--left .ai-sales-agent__panel {
  left: 0;
}

.ai-sales-agent.is-open .ai-sales-agent__panel {
  display: flex;
  animation: asa-rise 0.25s ease;
}

.ai-sales-agent__header {
  background: linear-gradient(135deg, var(--asa-accent), #86181c);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  position: relative;
}

.ai-sales-agent__title span {
  display: block;
  font-size: var(--asa-title-size);
  font-weight: 700;
  letter-spacing: 0.01em;
  font-family: var(--asa-title-font);
  text-transform: none;
}

.ai-sales-agent__title small {
  display: block;
  font-size: var(--asa-subtitle-size);
  font-family: var(--asa-subtitle-font);
  opacity: 0.82;
  letter-spacing: 0.06em;
  text-transform: none;
  padding-top: 4px;
}

.ai-sales-agent__toggle {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.ai-sales-agent__toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.ai-toggle-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #5ad865;
  box-shadow: 0 0 0 3px rgba(90, 216, 101, 0.25);
}

.ai-sales-agent.is-off .ai-toggle-indicator {
  background: #f95f62;
  box-shadow: 0 0 0 3px rgba(249, 95, 98, 0.25);
}

.ai-toggle-label {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.ai-header-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.ai-sales-agent__close {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  border-radius: 10px;
  padding: 6px 10px;
  position: absolute;
  top: 10px;
  right: 10px;
}

.ai-sales-agent__loader {
  position: absolute;
  top: 10px;
  right: 12px;
  display: none;
  align-items: center;
  gap: 6px;
}

.ai-sales-agent__loader-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c92127;
  animation: asa-bounce 1s infinite ease-in-out;
}

.ai-sales-agent__loader-dot:nth-child(2) {
  animation-delay: 0.12s;
}

.ai-sales-agent__loader-dot:nth-child(3) {
  animation-delay: 0.24s;
}

.ai-sales-agent.is-loading .ai-sales-agent__loader {
  display: inline-flex;
}

.ai-sales-agent__messages {
  flex: 1;
  padding: 16px 18px;
  overflow-y: auto;
  background: radial-gradient(circle at top right, rgba(201, 33, 39, 0.08), transparent 55%);
}

.ai-sales-agent__bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 12px;
  font-size: var(--asa-body-size);
  line-height: 1.4;
  white-space: pre-line;
}

.ai-sales-agent__bubble--user {
  margin-left: auto;
  background: var(--asa-accent);
  color: #fff;
}

.ai-sales-agent__bubble--assistant {
  background: #f1f3f8;
  color: var(--asa-ink);
}

.ai-sales-agent__bubble--assistant hr {
  border: 0;
  border-top: 1px solid rgba(19, 24, 33, 0.12);
  margin: 8px 0;
}

.ai-sales-agent__bubble--loader {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
}

.ai-sales-agent__loader-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.ai-sales-agent__composer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 16px 16px;
  border-top: 1px solid #e7e9f0;
  background: #fff;
}

.ai-sales-agent[data-maintenance="1"] .ai-sales-agent__composer {
  display: none;
}

.ai-sales-agent[data-maintenance="1"] .ai-sales-agent__toggle {
  pointer-events: none;
  opacity: 0.4;
}

#ai-sales-agent .ai-sales-agent__input {
  flex: 1;
  border: 1px solid #dde1ec;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: var(--asa-body-size);
  outline: none;
  color: var(--asa-ink);
}

#ai-sales-agent .ai-sales-agent__input:focus {
  border-color: var(--asa-accent);
  box-shadow: 0 0 0 3px rgba(201, 33, 39, 0.15);
}

#ai-sales-agent .ai-sales-agent__send {
  background: var(--asa-accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
}

.ai-sales-agent__end {
  display: none;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.ai-sales-agent__end:hover {
  background: rgba(255, 255, 255, 0.22);
}

.ai-sales-agent.has-conversation .ai-sales-agent__end {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ai-sales-agent__products {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.ai-sales-agent__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
  align-items: center;
  flex-direction: column;
}

.ai-sales-agent__categories-title {
  font-weight: 600;
  color: #c92127;
  width: 100%;
  padding-left: 2px;
}

.ai-category-pill {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: var(--asa-cat-pill-bg, #fff1f2);
  color: var(--asa-ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-category-pill:hover,
.ai-category-pill:focus {
  border-color: var(--asa-cat-pill-hover, var(--asa-accent));
  background: var(--asa-cat-pill-hover, var(--asa-accent));
  color: #fff;
  outline: none;
}

.ai-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-sales-agent__product {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  border: 1px solid #edf0f6;
  border-radius: 12px;
  background: #fff;
}

.ai-sales-agent__product img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  background: #f3f4f8;
}

.ai-sales-agent__product h4 {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--asa-ink);
}

.ai-sales-agent__product-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.ai-sales-agent__product-link:hover {
  color: var(--asa-accent);
  text-decoration: underline;
}

.ai-sales-agent__product p {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--asa-muted);
}

.ai-sales-agent__quick-actions {
  display: flex;
  gap: 10px;
  margin: 10px 4px 8px;
  flex-wrap: wrap;
  justify-content: space-between;
  width: 85%;
  max-width: 85%;
}

.ai-quick-action {
  border: 2px solid rgba(201, 33, 39, 0.3);
  background: #fff;
  color: var(--asa-ink);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-quick-action--primary {
  background: var(--asa-action);
  color: var(--asa-action-text);
  border-color: transparent;
}

.ai-quick-action--ghost:hover {
  border-color: var(--asa-action);
  color: var(--asa-action);
}

.ai-quick-action--primary:hover {
  opacity: 0.92;
}


.ai-sales-agent__product button {
  background: transparent;
  border: 1px solid var(--asa-action, var(--asa-accent));
  color: var(--asa-action, var(--asa-accent));
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.ai-sales-agent__product button:hover {
  background: var(--asa-action, var(--asa-accent));
  color: var(--asa-action-text, #fff);
}

.ai-sales-agent__cart {
  border: 1px solid #edf0f6;
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  margin-bottom: 12px;
}

.ai-product-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.ai-qty {
  display: inline-flex;
  align-items: center;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
}

.ai-qty__btn {
  background: var(--asa-action, var(--asa-accent));
  border: none;
  width: 32px;
  height: 32px;
  font-weight: 700;
  color: var(--asa-action-text, #fff);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.15s ease, color 0.15s ease;
}

.ai-qty__btn:hover {
  background: var(--asa-action, var(--asa-accent));
}

.ai-qty__btn.ai-qty__btn--minus,
.ai-qty__btn.ai-qty__btn--plus {
  border-radius: 0;
  background: var(--asa-action, var(--asa-accent));
  color: var(--asa-action-text, #fff);
}

.ai-qty__input {
  width: 52px;
  text-align: center;
  border: 1px solid var(--asa-action, var(--asa-accent)) !important;
  outline: none;
  font-size: 13px;
  padding: 4px 6px;
  height: 32px;
  box-sizing: border-box;
  border-radius: 0 !important;
  background: #fff !important;
}

.ai-sales-agent__cart-item {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.ai-sales-agent__cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-top: 8px;
}

.ai-sales-agent__actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.ai-sales-agent__actions a,
.ai-sales-agent__actions button {
  flex: 1;
  text-align: center;
  border-radius: 10px;
  border: none;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ai-sales-agent__actions a {
  background: #f1f3f8;
  color: var(--asa-ink);
  text-decoration: none;
}

.ai-sales-agent__actions button {
  background: var(--asa-accent);
  color: #fff;
}

.ai-sales-agent__notice {
  position: fixed;
  right: 16px;
  bottom: 90px;
  background: var(--asa-accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
  z-index: 10000;
  font-size: 13px;
  font-weight: 600;
}

.ai-toast-stack {
  position: fixed;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10001;
}

.ai-toast {
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.18);
  font-size: 13px;
  font-weight: 600;
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.ai-toast.is-hide {
  opacity: 0;
  transform: translateY(-6px);
}

.ai-sales-agent__suggestions-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--asa-ink);
}

.ai-sales-agent__categories .ai-sales-agent__categories-title {
  color: #c92127;
  font-weight: 800;
  font-size: 15px;
  padding-left: 2px;
}

.tippy-box[data-theme~='ai-sa-toast'] {
  border-radius: 12px;
  padding: 8px 10px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.22);
  color: inherit;
  letter-spacing: 0.01em;
  transform-origin: bottom center;
}

.tippy-box[data-theme~='ai-sa-toast'] .tippy-arrow {
  color: inherit;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.tippy-box[data-theme~='ai-sa-toast'][data-state='hidden'] {
  transform: translateY(6px) scale(0.97);
  opacity: 0.75;
}

.tippy-box[data-theme~='ai-sa-toast'][data-state='visible'] {
  transform: translateY(0) scale(1.03);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.28);
}

.tippy-box[data-theme~='ai-sa-tooltip'] {
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.01em;
}

.tippy-box[data-theme~='ai-sa-tooltip'] .tippy-arrow {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

@keyframes asa-rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes asa-pulse {
  0% {
    transform: scale(0.85);
    opacity: 0.45;
  }
  60% {
    transform: scale(1.3);
    opacity: 0.18;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

@keyframes asa-pulse-small {
  0% {
    transform: scale(0.95);
    opacity: 0.5;
  }
  60% {
    transform: scale(1.15);
    opacity: 0.22;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

@keyframes asa-bounce {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0.6;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .ai-sales-agent {
    bottom: 16px;
  }

  .ai-sales-agent__panel {
    width: var(--asa-panel-width-mobile, 92vw);
    height: var(--asa-panel-height-mobile, 70vh);
  }
}

@media (max-width: 480px) {
  .ai-qty__btn {
    font-size: 12px;
    width: 30px;
    height: 30px;
  }
  .ai-qty__input {
    height: 30px;
    font-size: 12px;
  }
  .ai-sales-agent__product button {
    font-size: 11px;
    padding: 6px 8px;
  }
}
