.woo-chatbot-local__root {
  border: 1px solid #d8dee6;
  border-radius: 14px;
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 100%);
  box-shadow: 0 10px 30px rgba(30, 42, 56, 0.08);
  max-width: 560px;
  width: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.woo-chatbot-local__title {
  background: #16324f;
  color: #fff;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.woo-chatbot-local__title-text {
  font-weight: 600;
}

.woo-chatbot-local__title-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.woo-chatbot-local__quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #d8dee6;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.woo-chatbot-local__faq-button {
  border: 1px solid #c4d2e5;
  background: #ffffff;
  color: #16324f;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.woo-chatbot-local__faq-button:hover {
  border-color: #0f8b8d;
  background: #eefbfb;
}

.woo-chatbot-local__faq-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.woo-chatbot-local__end-chat {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.woo-chatbot-local__end-chat:hover {
  background: rgba(255, 255, 255, 0.2);
}

.woo-chatbot-local__close-chat {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.woo-chatbot-local__close-chat:hover {
  background: rgba(255, 255, 255, 0.18);
}

.woo-chatbot-local__contact-button {
  border: 1px solid #183E5E;
  background: #183E5E;
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.woo-chatbot-local__contact-button:hover {
  filter: brightness(1.05);
}

.woo-chatbot-local__log {
  min-height: 320px;
  max-height: 420px;
  overflow-y: auto;
  padding: 14px;
  background: #f4f7fb;
}

.woo-chatbot-local__msg {
  display: flex;
  width: 100%;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.woo-chatbot-local__msg--user {
  justify-content: flex-start;
  flex-direction: row-reverse;
}

.woo-chatbot-local__msg--bot {
  justify-content: flex-start;
}

.woo-chatbot-local__avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  overflow: hidden;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #d9e2ef;
  border: 1px solid #c7d4e4;
}

.woo-chatbot-local__avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.woo-chatbot-local__msg-content {
  max-width: 85%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.woo-chatbot-local__msg--user .woo-chatbot-local__msg-content {
  align-items: flex-end;
}

.woo-chatbot-local__bubble {
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.woo-chatbot-local__time {
  margin-top: 4px;
  font-size: 11px;
  color: #71839a;
  line-height: 1;
}

.woo-chatbot-local__msg--user .woo-chatbot-local__bubble {
  background: #16324f;
  color: #fff;
}

.woo-chatbot-local__msg--bot .woo-chatbot-local__bubble {
  background: #fff;
  color: #1a2433;
  border: 1px solid #d8dee6;
}

.woo-chatbot-local__bubble--loading {
  min-width: 64px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.woo-chatbot-local__typing {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.woo-chatbot-local__typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #183E5E;
  opacity: 0.35;
  animation: woo-chatbot-local-dot 0.9s ease-in-out infinite;
}

.woo-chatbot-local__typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.woo-chatbot-local__typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes woo-chatbot-local-dot {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }

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

.woo-chatbot-local__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #d8dee6;
  background: #fff;
}

.woo-chatbot-local__input {
  flex: 1;
  border: 1px solid #b7c4d6;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.woo-chatbot-local__button {
  border: 0;
  border-radius: 10px;
  width: 58px;
  height: 40px;
  padding: 0;
  background: #183E5E;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.woo-chatbot-local__button svg {
  width: 30px;
  height: 30px;
  display: block;
}

.woo-chatbot-local__button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.woo-chatbot-local__button.is-loading svg {
  opacity: 0;
}

.woo-chatbot-local__button.is-loading::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: woo-chatbot-local-spin 0.7s linear infinite;
}

@keyframes woo-chatbot-local-spin {
  to {
    transform: rotate(360deg);
  }
}

.woo-chatbot-local__cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 6px 0 12px;
}

.woo-chatbot-local__card {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px;
  background: #fff;
  border: 1px solid #d6deea;
  border-radius: 12px;
  padding: 8px;
  text-decoration: none;
  color: inherit;
}

.woo-chatbot-local__card:hover {
  border-color: #0f8b8d;
  box-shadow: 0 6px 18px rgba(15, 139, 141, 0.12);
}

.woo-chatbot-local__card-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

.woo-chatbot-local__card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.woo-chatbot-local__card-name {
  font-weight: 700;
  color: #142132;
}

.woo-chatbot-local__card-reason {
  font-size: 13px;
  color: #3c4a5f;
}

.woo-chatbot-local__card-price {
  font-weight: 700;
  color: #0f8b8d;
}

.woo-chatbot-local__links-wrap {
  margin: 2px 0 10px;
}

.woo-chatbot-local__links {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.woo-chatbot-local__links-item {
  margin: 0;
  line-height: 1.35;
  color: #1a2433;
}

.woo-chatbot-local__card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.woo-chatbot-local__card-stock {
  font-size: 12px;
  color: #3c4a5f;
  background: #eef3fa;
  border: 1px solid #d8dee6;
  border-radius: 999px;
  padding: 2px 8px;
}

.woo-chatbot-local__card--no-image {
  grid-template-columns: 1fr;
}

.woo-chatbot-local__faq-wrap {
  margin: 2px 0 10px;
}

.woo-chatbot-local__faq-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.woo-chatbot-local__faq-item {
  border: 1px solid #c4d2e5;
  border-radius: 999px;
  background: #ffffff;
  color: #16324f;
  font-size: 13px;
  line-height: 1.25;
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
}

.woo-chatbot-local__faq-item:hover {
  border-color: #0f8b8d;
  background: #eefbfb;
}

.woo-chatbot-local__floating-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.woo-chatbot-local__floating-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(420px, calc(100vw - 24px));
  max-height: min(70vh, 680px);
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.woo-chatbot-local__floating-wrap.is-open .woo-chatbot-local__floating-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.woo-chatbot-local__floating-root .woo-chatbot-local__root {
  width: 100%;
  max-width: 100%;
}

.woo-chatbot-local__floating-toggle {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: linear-gradient(120deg, #183E5E, #183E5E);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(17, 109, 128, 0.28);
  pointer-events: auto;
}

.woo-chatbot-local__floating-toggle:hover {
  filter: brightness(1.05);
}

@media (max-width: 640px) {
  .woo-chatbot-local__root {
    max-width: 100%;
  }

  .woo-chatbot-local__log {
    min-height: 280px;
  }

  .woo-chatbot-local__card {
    grid-template-columns: 64px 1fr;
  }

  .woo-chatbot-local__card-image {
    width: 64px;
    height: 64px;
  }

  .woo-chatbot-local__floating-wrap {
    right: 10px;
    bottom: 10px;
  }

  .woo-chatbot-local__floating-wrap.is-open {
    inset: 0;
    right: auto;
    bottom: auto;
    align-items: stretch;
  }

  .woo-chatbot-local__floating-panel {
    width: calc(100vw - 20px);
    max-height: 75vh;
  }

  .woo-chatbot-local__floating-wrap.is-open .woo-chatbot-local__floating-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-height: 100dvh;
    bottom: auto;
    right: auto;
    border-radius: 0;
    transform: none;
  }

  .woo-chatbot-local__floating-wrap.is-open .woo-chatbot-local__floating-root,
  .woo-chatbot-local__floating-wrap.is-open .woo-chatbot-local__floating-root .woo-chatbot-local__root {
    height: 100dvh;
    max-height: 100dvh;
  }

  .woo-chatbot-local__floating-wrap.is-open .woo-chatbot-local__root {
    border-radius: 0;
    border: 0;
    display: flex;
    flex-direction: column;
  }

  .woo-chatbot-local__floating-wrap.is-open .woo-chatbot-local__log {
    flex: 1;
    min-height: 0;
    max-height: none;
  }

  .woo-chatbot-local__floating-wrap.is-open .woo-chatbot-local__form {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .woo-chatbot-local__floating-wrap.is-open .woo-chatbot-local__floating-toggle {
    display: none;
  }

  .woo-chatbot-local__floating-toggle {
    width: 50px;
    height: 50px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
    line-height: 1;
  }

  .woo-chatbot-local__floating-toggle::before {
    content: '?';
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
  }
}
