/* Front end css for chat */

.wooagent-chat {
  bottom: 75px;
  color: #111827;
  position: fixed;
  right: 5px;
  z-index: 99999;
}

.wooagent-chat * {
  box-sizing: border-box;
}

button[type=button].wooagent-chat__toggle {
  align-items: center;
  background: var(--wooagent-primary, #2563eb);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
  color: var(--wooagent-primary-text, #ffffff);
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 700;
  height: 58px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transform: translateY(0) scale(1);
  transition: box-shadow 180ms ease, filter 180ms ease, transform 180ms ease;
  width: 58px;
}

button[type=button].wooagent-chat__toggle::before {
  background: rgba(255, 255, 255, 0.24);
  border-radius: inherit;
  content: "";
  inset: 8px;
  opacity: 0;
  position: absolute;
  transform: scale(0.4);
  transition: opacity 180ms ease, transform 180ms ease;
}

button[type=button].wooagent-chat__toggle:hover {
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.34);
  filter: saturate(1.08);
  transform: translateY(-3px) scale(1.04);
}

button[type=button].wooagent-chat__toggle:hover::before {
  opacity: 1;
  transform: scale(1);
}

button[type=button].wooagent-chat__toggle:active {
  transform: translateY(-1px) scale(0.96);
}

.wooagent-chat--open button[type=button].wooagent-chat__toggle {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  transform: scale(0.92) rotate(8deg);
}

.wooagent-chat__toggle-avatar {
  border-radius: 999px;
  display: block;
  height: 42px;
  object-fit: cover;
  position: relative;
  width: 42px;
  z-index: 1;
}

.wooagent-chat__toggle-icon {
  position: relative;
  z-index: 1;
}

.wooagent-chat__toggle:focus,
.wooagent-chat__send:focus,
.wooagent-chat__close:focus,
.wooagent-chat__tool:focus,
.wooagent-chat__input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.wooagent-chat__panel {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  bottom: 74px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  height: min(560px, calc(100vh - 112px));
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  transform: translateY(14px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.2, 0.85, 0.2, 1);
  width: min(380px, calc(100vw - 32px));
}

.wooagent-chat__panel[hidden] {
  display: none;
}

.wooagent-chat__panel--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.wooagent-chat__panel--closing {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.97);
  transition-duration: 180ms;
}

.wooagent-chat__header {
  align-items: center;
  background: var(--wooagent-primary, #2563eb);
  color: var(--wooagent-primary-text, #ffffff);
  display: flex;
  gap: 10px;
  padding: 14px 16px;
}

.wooagent-chat__header .wooagent-chat__header-avatar {
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  flex: 0 0 auto;
  height: 38px;
  object-fit: cover;
  width: 38px;
  box-sizing: border-box;
  padding: 3px;
}

.wooagent-chat__header > div {
  flex: 1;
  min-width: 0;
}

.wooagent-chat__header strong,
.wooagent-chat__header span {
  display: block;
}

.wooagent-chat__header strong {
  font-size: 15px;
  line-height: 1.2;
}

.wooagent-chat__header span {
  font-size: 12px;
  opacity: 0.86;
}

.wooagent-chat__close {
  background: transparent;
  border: 0;
  color: var(--wooagent-primary-text, #ffffff);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  padding: 0 2px;
}

.wooagent-chat__lead {
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
}

.wooagent-chat__lead[hidden],
.wooagent-chat__messages[hidden],
.wooagent-chat__form[hidden] {
  display: none;
}

.wooagent-chat__lead-title {
  font-size: 15px;
  line-height: 1.3;
}

.wooagent-chat__lead-intro {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 2px;
}

.wooagent-chat__lead input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font: inherit;
  padding: 10px;
  width: 100%;
}

.wooagent-chat__lead input:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

button[type=submit].wooagent-chat__lead-submit {
  background: var(--wooagent-primary, #2563eb);
  border: 0;
  border-radius: 6px;
  color: var(--wooagent-primary-text, #ffffff);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 10px 14px;
}

button[type=submit].wooagent-chat__lead-submit:hover {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
}

.wooagent-chat__messages {
  background: #f8fafc;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  scrollbar-color: #cbd5e1 #f8fafc;
  scrollbar-width: thin;
}

.wooagent-chat__messages::-webkit-scrollbar {
  width: 8px;
}

.wooagent-chat__messages::-webkit-scrollbar-track {
  background: #f8fafc;
}

.wooagent-chat__messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.wooagent-chat__messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.wooagent-chat__tools {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px 0;
}

.wooagent-chat__tools[hidden] {
  display: none;
}

.wooagent-chat__tool[hidden],
.wooagent-chat__file-name[hidden],
.wooagent-chat__voice-status[hidden] {
  display: none !important;
}

.wooagent-chat__suggestions {
  align-items: center;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 9px 10px;
}

.wooagent-chat__suggestions[hidden] {
  display: none;
}

button[type=button].wooagent-chat__suggestion {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #3730a3;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
  max-width: 100%;
  padding: 7px 10px;
  text-align: left;
}

button[type=button].wooagent-chat__suggestion:hover {
  background: #e0e7ff;
}

button[type=button].wooagent-chat__suggestion:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

button[type=button].wooagent-chat__suggestion:disabled {
  cursor: default;
  opacity: 0.62;
}

button[type=button].wooagent-chat__tool {
  align-items: center;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  padding: 0;
  width: 32px;
}

.wooagent-chat--listening .wooagent-chat__tool--voice {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.wooagent-chat__tool-icon {
  display: block;
  fill: none;
  height: 17px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 17px;
}

.wooagent-chat__tool:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.wooagent-chat__file-name,
.wooagent-chat__voice-status {
  color: #4b5563;
  flex: 1;
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wooagent-chat__voice-status {
  color: #991b1b;
  font-weight: 600;
}

.wooagent-chat__file {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.wooagent-chat__message {
  border-radius: 8px;
  clear: both;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 10px;
  max-width: 86%;
  overflow-wrap: anywhere;
  padding: 10px 12px;
  white-space: pre-wrap;
}

.wooagent-chat__message--assistant {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  float: left;
}

.wooagent-chat__message--assistant p {
  margin-bottom: 0;
}

.wooagent-chat__message--assistant a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.wooagent-chat__message--assistant a:hover,
.wooagent-chat__message--assistant a:focus {
  text-decoration: underline;
}

.wooagent-chat__product-matches {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.wooagent-chat__product-matches li {
  display: grid;
  gap: 3px;
}

.wooagent-chat__product-price {
  color: #374151;
  font-weight: 700;
}

.wooagent-chat__product-price del {
  text-decoration: line-through;
}

.wooagent-chat__product-price ins {
  text-decoration: none;
}

.wooagent-chat__message--typing {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  min-height: 38px;
  min-width: 58px;
}

.wooagent-chat__typing-dot {
  animation: wooagent-typing-bounce 1.1s infinite ease-in-out;
  background: #94a3b8;
  border-radius: 999px;
  display: block;
  height: 7px;
  width: 7px;
}

.wooagent-chat__typing-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.wooagent-chat__typing-dot:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes wooagent-typing-bounce {
  0%,
  80%,
  100% {
    opacity: 0.45;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.wooagent-chat__message--user {
  background: var(--wooagent-primary, #2563eb);
  color: var(--wooagent-primary-text, #ffffff);
  float: right;
}

.wooagent-chat__message-image {
  border-radius: 6px;
  display: block;
  height: auto;
  margin-top: 8px;
  max-height: 180px;
  max-width: 100%;
  object-fit: contain;
}

.wooagent-chat__form {
  background: #ffffff;
  display: flex;
  gap: 8px;
  padding: 10px;
}

input[type=text].wooagent-chat__input {
  border: 1px solid #d1d5db;
  border-radius: 6px;
  flex: 1;
  font: inherit;
  min-width: 0;
  padding: 10px;
}

button[type=submit].wooagent-chat__send {
  background: var(--wooagent-primary, #2563eb);
  border: 0;
  border-radius: 6px;
  color: var(--wooagent-primary-text, #ffffff);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 14px;
}

button[type=submit].wooagent-chat__send:disabled,
input[type=text].wooagent-chat__input:disabled {
  opacity: 0.65;
}

@media (prefers-reduced-motion: reduce) {
  button[type=button].wooagent-chat__toggle,
  button[type=button].wooagent-chat__toggle::before,
  .wooagent-chat__panel,
  .wooagent-chat__typing-dot {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 480px) {
  .wooagent-chat {
    bottom: 14px;
    right: 14px;
  }

  .wooagent-chat__panel {
    bottom: 70px;
    height: min(560px, calc(100vh - 96px));
    width: calc(100vw - 28px);
  }
}
