.am-chatbot-root {
  --am-chatbot-blue: #01346c;
  --am-chatbot-blue-2: #023871;
  --am-chatbot-cyan: #8ee8ff;
  --am-chatbot-accent: #f05a28;
  --am-chatbot-shadow: 0 22px 60px rgba(1, 52, 108, 0.24);
  font-family: var(--font-family-base, Aptos, "Segoe UI", "Noto Sans", Arial, Helvetica, sans-serif);
}

.am-chatbot-button-wrap {
  position: fixed;
  left: 24px;
  right: auto;
  bottom: 24px;
  z-index: 150;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.am-chatbot-label {
  padding: 6px 12px;
  border: 1px solid rgba(142, 232, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--am-chatbot-blue);
  font-size: 0.86rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(1, 52, 108, 0.16);
  pointer-events: none;
}

.am-chatbot-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  padding: 0;
  background: radial-gradient(circle at 35% 25%, #ffffff 0%, #e8fbff 34%, #8ee8ff 68%, #0b73d9 100%);
  box-shadow: 0 16px 38px rgba(1, 52, 108, 0.28), 0 0 0 8px rgba(142, 232, 255, 0.15);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.am-chatbot-button:hover,
.am-chatbot-button:focus-visible {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 20px 45px rgba(1, 52, 108, 0.32), 0 0 0 10px rgba(142, 232, 255, 0.2);
}

.am-chatbot-button.is-open {
  animation: amChatbotBounce 420ms ease;
}

.am-chatbot-avatar-frame {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 4px;
  overflow: hidden;
  background: radial-gradient(circle, #e8fbff 0%, #8ee8ff 55%, #0b73d9 100%);
  box-shadow: 0 14px 35px rgba(0, 71, 145, 0.25);
}

.am-chatbot-avatar-frame--small {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  padding: 3px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.am-chatbot-avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
}

.am-chatbot-status-dot {
  position: absolute;
  left: 43px;
  right: auto;
  bottom: 5px;
  width: 15px;
  height: 15px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.am-chatbot-window {
  position: fixed;
  left: 24px;
  right: auto;
  bottom: 110px;
  z-index: 151;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 48px));
  max-height: min(620px, calc(100vh - 134px));
  overflow: hidden;
  border: 1px solid rgba(142, 232, 255, 0.72);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--am-chatbot-shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(18px) scale(0.96);
  transform-origin: bottom left;
  transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
  visibility: hidden;
}

.am-chatbot-window.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.am-chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #01346C 0%, #023871 55%, #03457F 100%);
  color: #ffffff;
}

.am-chatbot-title-wrap {
  min-width: 0;
  flex: 1 1 auto;
}

.am-chatbot-title {
  display: block;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.2;
}

.am-chatbot-subtitle,
.am-chatbot-header-status {
  display: block;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  line-height: 1.35;
}

.am-chatbot-header-status::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.am-chatbot-close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1;
}

.am-chatbot-body {
  flex: 1 1 auto;
  min-height: 250px;
  overflow-y: auto;
  padding: 16px;
  background: linear-gradient(180deg, #f4fbff 0%, #ffffff 46%, #f7fbff 100%);
  scroll-behavior: smooth;
}

.am-chatbot-message {
  display: flex;
  margin-bottom: 12px;
}

.am-chatbot-message.user { justify-content: flex-end; }
.am-chatbot-message.bot { justify-content: flex-start; }

.am-chatbot-bubble {
  max-width: 86%;
  border-radius: 18px;
  padding: 11px 13px;
  font-size: 0.94rem;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
  box-shadow: 0 8px 20px rgba(6, 42, 86, 0.08);
}

.am-chatbot-message.bot .am-chatbot-bubble {
  border: 1px solid rgba(142, 232, 255, 0.55);
  border-bottom-left-radius: 6px;
  background: #ffffff;
  color: var(--am-chatbot-blue);
}

.am-chatbot-message.user .am-chatbot-bubble {
  border-bottom-right-radius: 6px;
  background: linear-gradient(135deg, #01346c 0%, #136fce 64%, #f05a28 140%);
  color: #ffffff;
}

.am-chatbot-quick-replies,
.am-chatbot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 14px;
}

.am-chatbot-quick-replies {
  max-height: 108px;
  overflow-y: auto;
  padding-right: 2px;
}

.am-chatbot-quick-btn,
.am-chatbot-action-btn,
.am-chatbot-clear,
.am-chatbot-start {
  border: 1px solid rgba(1, 52, 108, 0.24);
  border-radius: 999px;
  background: #ffffff;
  color: var(--am-chatbot-blue);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.2;
  padding: 8px 10px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.am-chatbot-quick-btn:hover,
.am-chatbot-action-btn:hover,
.am-chatbot-clear:hover,
.am-chatbot-start:hover {
  border-color: var(--am-chatbot-blue);
  background: var(--am-chatbot-blue);
  color: #ffffff;
}

.am-chatbot-quick-btn:active,
.am-chatbot-action-btn:active,
.am-chatbot-clear:active,
.am-chatbot-start:active {
  transform: translateY(1px) scale(0.98);
}

.am-chatbot-actions { margin: 10px 0 0; }

.am-chatbot-action-btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.am-chatbot-action-btn--primary {
  border-color: rgba(240, 90, 40, 0.35);
  background: #fff7f3;
  color: #d94a1c;
}

.am-chatbot-product-list {
  display: grid;
  gap: 10px;
  max-width: 100%;
  margin-top: 10px;
  overflow: hidden;
}

.am-chatbot-product-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(142, 232, 255, 0.8);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(6, 42, 86, 0.08);
  overflow: hidden;
}


.am-chatbot-product-thumb {
  display: grid;
  place-items: center;
  width: 74px;
  height: 62px;
  overflow: hidden;
  border: 1px solid rgba(1, 52, 108, 0.08);
  border-radius: 13px;
  background: linear-gradient(135deg, #f6fbff 0%, #eef8ff 100%);
}

.am-chatbot-product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.am-chatbot-product-placeholder {
  display: grid;
  place-items: center;
  width: 48px;
  height: 34px;
  border: 2px solid rgba(1, 52, 108, 0.28);
  border-radius: 8px;
  color: var(--am-chatbot-blue);
  font-size: 0.8rem;
  font-weight: 900;
}

.am-chatbot-product-info {
  min-width: 0;
  overflow: hidden;
}

.am-chatbot-product-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--am-chatbot-blue);
  font-size: 0.9rem;
  line-height: 1.32;
}

.am-chatbot-product-card span {
  display: block;
  margin-top: 3px;
  color: #52667f;
  font-size: 0.8rem;
}

.am-chatbot-product-card .am-chatbot-product-price {
  color: var(--am-chatbot-accent);
  font-size: 0.88rem;
  font-weight: 900;
}

.am-chatbot-product-card .am-chatbot-product-old-price {
  color: #7b8794;
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: line-through;
}

.am-chatbot-product-card p {
  margin: 5px 0 0;
  color: #40536a;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: normal;
}

.am-chatbot-product-card a {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--am-chatbot-accent);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
  text-decoration: none;
}

.am-chatbot-typing {
  color: #52667f;
  font-size: 0.88rem;
  font-style: italic;
}

.am-chatbot-footer {
  flex: 0 0 auto;
  padding: 12px;
  border-top: 1px solid rgba(2, 56, 113, 0.1);
  background: #ffffff;
}

.am-chatbot-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
}

.am-chatbot-clear,
.am-chatbot-start {
  padding: 7px 10px;
  font-size: 0.8rem;
}

.am-chatbot-start {
  border-color: rgba(240, 90, 40, 0.35);
  background: #fff7f3;
  color: #d94a1c;
}

.am-chatbot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.am-chatbot-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(1, 52, 108, 0.18);
  border-radius: 999px;
  outline: 0;
  padding: 11px 13px;
  color: #101828;
  background: #f7fbff;
}

.am-chatbot-input:focus {
  border-color: #136fce;
  box-shadow: 0 0 0 4px rgba(19, 111, 206, 0.13);
}

.am-chatbot-send {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #f05a28, #ff824f);
  color: #ffffff;
  font-weight: 850;
  padding: 0 16px;
  box-shadow: 0 10px 22px rgba(240, 90, 40, 0.2);
}

.am-chatbot-note {
  margin: 8px 2px 0;
  color: #66758a;
  font-size: 0.76rem;
  line-height: 1.4;
}

@keyframes amChatbotBounce {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  45% { transform: translateY(-4px) rotate(-4deg) scale(1.04); }
  75% { transform: translateY(1px) rotate(3deg) scale(1); }
}

@media (max-width: 700px) {
  .am-chatbot-button-wrap {
    left: 14px;
    right: auto;
    bottom: 14px;
  }

  .am-chatbot-label { display: none; }

  .am-chatbot-button {
    width: 64px;
    height: 64px;
  }

  .am-chatbot-avatar-frame {
    width: 58px;
    height: 58px;
    padding: 3px;
  }

  .am-chatbot-avatar-frame--small {
    width: 44px;
    height: 44px;
  }

  .am-chatbot-window {
    left: 14px;
    right: auto;
    bottom: 88px;
    width: calc(100vw - 28px);
    max-width: 420px;
    max-height: calc(100vh - 172px);
    border-radius: 22px;
  }

  .am-chatbot-body {
    min-height: 220px;
    padding: 14px;
  }

  .am-chatbot-bubble {
    max-width: 92%;
    font-size: 0.9rem;
  }

  .am-chatbot-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .am-chatbot-quick-replies {
    gap: 6px;
    max-height: 96px;
  }

  .am-chatbot-quick-btn,
  .am-chatbot-action-btn {
    font-size: 0.8rem;
    padding: 7px 9px;
  }

  .am-chatbot-product-card {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 9px;
    padding: 9px;
  }

  .am-chatbot-product-thumb {
    width: 64px;
    height: 56px;
  }

  .am-chatbot-send { padding-inline: 14px; }
}

@media (max-width: 390px) {
  .am-chatbot-window {
    max-height: calc(100vh - 116px);
    bottom: 84px;
  }

  .am-chatbot-button-wrap { bottom: 14px; }
  .am-chatbot-header { padding: 13px; }
  .am-chatbot-subtitle { font-size: 0.78rem; }
}

/* AM AI chatbot forced bottom-left positioning */
.am-chatbot-root {
  position: fixed !important;
  left: 24px !important;
  right: auto !important;
  bottom: 24px !important;
  z-index: 9999 !important;
  pointer-events: none !important;
}

.am-chatbot-root .am-chatbot-button-wrap {
  position: fixed !important;
  left: 24px !important;
  right: auto !important;
  bottom: 24px !important;
  z-index: 10000 !important;
  justify-items: start !important;
  transform: none !important;
  pointer-events: auto !important;
}

.am-chatbot-root .am-chatbot-label {
  display: inline-flex !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 10001 !important;
  transform: none !important;
}

.am-chatbot-root .am-chatbot-button {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 10000 !important;
}

.am-chatbot-root .am-chatbot-window {
  position: fixed !important;
  left: 24px !important;
  right: auto !important;
  bottom: 110px !important;
  width: min(400px, calc(100vw - 48px)) !important;
  max-height: min(620px, calc(100vh - 134px)) !important;
  transform-origin: bottom left !important;
  z-index: 10002 !important;
  pointer-events: none !important;
}

.am-chatbot-root .am-chatbot-window.open {
  pointer-events: auto !important;
}

@media (max-width: 640px) {
  .am-chatbot-root {
    left: 14px !important;
    right: auto !important;
    bottom: 14px !important;
  }

  .am-chatbot-root .am-chatbot-button-wrap {
    left: 14px !important;
    right: auto !important;
    bottom: 14px !important;
  }

  .am-chatbot-root .am-chatbot-label {
    display: inline-flex !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
  }

  .am-chatbot-root .am-chatbot-button {
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
  }

  .am-chatbot-root .am-chatbot-window {
    left: 14px !important;
    right: auto !important;
    bottom: 96px !important;
    width: calc(100vw - 28px) !important;
    max-width: 420px !important;
    max-height: calc(100vh - 110px) !important;
  }
}
