.oaichatbot {
  position: fixed;
  bottom: var(--oaichatbot-offset-bottom, 24px);
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.oaichatbot--right {
  right: var(--oaichatbot-offset-side, 20px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.oaichatbot--left {
  left: var(--oaichatbot-offset-side, 20px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.oaichatbot__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-width: 4rem;
  min-height: 4rem;
  padding: 0.95rem 1.2rem;
  border: 0;
  border-radius: 999px;
  background: var(--oaichatbot-launcher-bg, #0f4c81);
  color: var(--oaichatbot-launcher-text, #ffffff);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 12px 30px rgba(10, 39, 64, 0.28);
  cursor: pointer;
}

.oaichatbot--icon-only .oaichatbot__toggle {
  width: 4rem;
  padding-inline: 0.8rem;
}

.oaichatbot__toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  font-size: 1.15rem;
}

.oaichatbot__toggle:focus-visible,
.oaichatbot__close:focus-visible,
.oaichatbot__send:focus-visible,
.oaichatbot__back:focus-visible,
.oaichatbot__input:focus-visible,
.oaichatbot__store-button:focus-visible,
.oaichatbot__preview-action:focus-visible {
  outline: 3px solid rgba(21, 97, 109, 0.25);
  outline-offset: 2px;
}

.oaichatbot__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.85rem);
  display: none;
  width: min(var(--oaichatbot-window-width, 400px), calc(100vw - 2rem));
  max-height: min(var(--oaichatbot-window-max-height, 640px), calc(100vh - 7rem));
  background: #ffffff;
  border: 1px solid #d8e0e8;
  border-radius: 1rem;
  box-shadow: 0 22px 48px rgba(19, 37, 54, 0.22);
  overflow: hidden;
}

.oaichatbot--left .oaichatbot__panel {
  right: auto;
  left: 0;
}

.oaichatbot.is-open .oaichatbot__panel {
  display: flex;
  flex-direction: column;
}

.oaichatbot__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1rem 0.85rem;
  background: linear-gradient(180deg, #f5f9fc 0%, #eef4f8 100%);
  border-bottom: 1px solid #dde7ee;
}

.oaichatbot__title {
  display: block;
  color: #0e2433;
  font-size: 1rem;
}

.oaichatbot__close {
  border: 0;
  background: transparent;
  color: #355063;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.oaichatbot__view {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.oaichatbot__messages,
.oaichatbot__request-summary {
  flex: 1 1 auto;
  padding: 1rem;
  overflow-y: auto;
  background:
    radial-gradient(circle at top right, rgba(232, 242, 248, 0.8), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #f6f9fb 100%);
}

.oaichatbot__message {
  max-width: 92%;
  margin-bottom: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.oaichatbot__message--bot {
  background: #ffffff;
  border: 1px solid #dde7ee;
  border-bottom-left-radius: 0.35rem;
  color: #173042;
}

.oaichatbot__message--user {
  margin-left: auto;
  background: #15616d;
  border-bottom-right-radius: 0.35rem;
  color: #ffffff;
}

.oaichatbot__message--system {
  background: #fff4e8;
  border: 1px solid #f1d0a8;
  color: #6a4317;
}

.oaichatbot__message--pending {
  opacity: 0.7;
}

.oaichatbot__preview-list {
  margin: 0.65rem 0 0;
  padding: 0;
  list-style: none;
}

.oaichatbot__preview-item {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid #e7eef3;
}

.oaichatbot__preview-title {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 700;
}

.oaichatbot__preview-meta {
  display: block;
  color: #557083;
  font-size: 0.8125rem;
}

.oaichatbot__preview-action {
  margin-top: 0.65rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid #0f4c81;
  border-radius: 999px;
  background: transparent;
  color: #0f4c81;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
}

.oaichatbot__form,
.oaichatbot__request-form {
  border-top: 1px solid #dde7ee;
  background: #ffffff;
  padding: 0.95rem;
}

.oaichatbot__stores {
  margin-bottom: 0.9rem;
}

.oaichatbot__label--stores {
  margin-bottom: 0.45rem;
}

.oaichatbot__store-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.oaichatbot__store-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid #cbd8e2;
  border-radius: 999px;
  background: #f8fbfd;
  color: #173042;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.oaichatbot__store-button:hover {
  border-color: #0f4c81;
}

.oaichatbot__store-button.is-selected {
  border-color: #0f4c81;
  background: #0f4c81;
  color: #ffffff;
}

.oaichatbot__store-button[disabled] {
  opacity: 0.7;
  cursor: wait;
}

.oaichatbot__store-button--icon-only {
  min-width: 2.75rem;
  padding-inline: 0.7rem;
}

.oaichatbot__store-button--text-only .oaichatbot__store-icon {
  display: none;
}

.oaichatbot__store-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.oaichatbot__store-text {
  display: inline-block;
}

.oaichatbot__store-error {
  margin-top: 0.55rem;
  color: #9d2d2d;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.oaichatbot__label {
  display: block;
  margin-bottom: 0.5rem;
  color: #345265;
  font-size: 0.8125rem;
  font-weight: 600;
}

.oaichatbot__form-row {
  display: flex;
  gap: 0.7rem;
  align-items: flex-end;
}

.oaichatbot__phone-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.oaichatbot__request-actions {
  display: flex;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.oaichatbot__input {
  flex: 1 1 auto;
  width: 100%;
  min-height: 2.85rem;
  resize: vertical;
  padding: 0.75rem 0.85rem;
  border: 1px solid #cbd8e2;
  border-radius: 0.85rem;
  color: #173042;
  background: #ffffff;
}

.oaichatbot__input--field {
  min-height: auto;
  margin-bottom: 0.85rem;
}

.oaichatbot__input--phone {
  margin-bottom: 0;
}

.oaichatbot__request-errors {
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #f1d0a8;
  border-radius: 0.85rem;
  background: #fff4e8;
  color: #6a4317;
  font-size: 0.8125rem;
}

.oaichatbot__request-errors ul {
  margin: 0;
  padding-left: 1rem;
}

.oaichatbot__send,
.oaichatbot__back {
  flex: 0 0 auto;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.oaichatbot__send {
  background: var(--oaichatbot-send-bg, #0f4c81);
  color: var(--oaichatbot-send-text, #ffffff);
}

.oaichatbot__back {
  background: #edf3f7;
  color: #355063;
}

.oaichatbot__send[disabled],
.oaichatbot__back[disabled] {
  opacity: 0.65;
  cursor: wait;
}

.oaichatbot__request-card {
  padding: 0.9rem;
  border: 1px solid #dde7ee;
  border-radius: 1rem;
  background: #ffffff;
}

.oaichatbot__captcha {
  margin-top: 0.85rem;
}

.oaichatbot__privacy {
  margin-top: 0.85rem;
}

.oaichatbot__privacy-label {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  color: #355063;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.oaichatbot__privacy-checkbox {
  margin-top: 0.15rem;
}

.oaichatbot__privacy-text a {
  color: #0f4c81;
  text-decoration: underline;
}

.oaichatbot__whatsapp-consent {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd8e2;
  border-radius: 0.85rem;
  background: #f8fbfd;
  color: #355063;
  font-size: 0.8125rem;
  line-height: 1.35;
  cursor: pointer;
}

.oaichatbot__whatsapp-checkbox {
  flex: 0 0 auto;
}

.oaichatbot__whatsapp-text {
  display: block;
}

@media (max-width: 640px) {
  .oaichatbot {
    right: 0.75rem;
    left: 0.75rem;
    bottom: max(var(--oaichatbot-offset-bottom, 24px), 0.75rem);
  }

  .oaichatbot__toggle {
    margin-left: auto;
  }

  .oaichatbot__panel {
    right: 0;
    left: 0;
    width: auto;
    max-height: calc(100vh - 6.5rem);
  }

  .oaichatbot__form-row,
  .oaichatbot__request-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .oaichatbot__phone-row {
    flex-direction: column;
    align-items: stretch;
  }

  .oaichatbot__send,
  .oaichatbot__back {
    width: 100%;
  }
}
