#pecado-assistant-root {
  --pa-dark: #0a1020;
  --pa-text: #111827;
  --pa-muted: #64748b;
  --pa-line: #dbe4f0;
  --pa-soft: #f7f9fd;
  --pa-bg: #fff;
  --pa-accent: #2563eb;
  --pa-accent-dark: #1d4ed8;
  --pa-accent-soft: #eff6ff;
  --pa-cyan: #38bdf8;
  --pa-green: #168a4a;
  --pa-keyboard-offset: 0px;
  --pa-dynamic-offset: 0px;
  --pa-viewport-height: 100vh;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  right: 20px;
  bottom: calc(20px + var(--pa-dynamic-offset));
  z-index: 999999;
  color: var(--pa-text);
  transition: bottom 120ms ease;
}

#pecado-assistant-root * {
  box-sizing: border-box;
}

#pecado-assistant-root.has-cookie-consent {
  z-index: 10;
}

#pecado-assistant-root.is-hidden-for-mini-cart {
  display: none;
}

html.pa-chat-open,
body.pa-chat-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.pa-chat-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.pa-launcher {
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.pa-nudge {
  position: absolute;
  right: 4px;
  bottom: 80px;
  max-width: 190px;
  display: none;
  border: 1px solid var(--pa-line);
  border-radius: 18px;
  background: #fff;
  color: var(--pa-text);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  padding: 10px 13px;
  white-space: nowrap;
}

#pecado-assistant-root.show-nudge:not(.is-open):not(.has-seen-nudge) .pa-nudge {
  display: block;
}

.pa-nudge::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -7px;
  width: 13px;
  height: 13px;
  border-right: 1px solid var(--pa-line);
  border-bottom: 1px solid var(--pa-line);
  background: #fff;
  transform: rotate(45deg);
}

.pa-nudge:hover,
.pa-nudge:focus {
  border-color: rgba(37, 99, 235, 0.28);
  color: var(--pa-accent);
}

#pecado-assistant-root.is-open .pa-nudge {
  display: none;
}

.pa-launcher:hover,
.pa-launcher:focus {
  transform: translateY(-2px);
  background: transparent;
  box-shadow: none;
}

.pa-launcher-icon {
  width: 74px;
  height: 74px;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.pa-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(430px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 112px));
  display: none;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  overscroll-behavior: contain;
  background: #fff;
  border: 1px solid var(--pa-line);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
}

#pecado-assistant-root.is-open .pa-panel {
  display: grid;
}

.pa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 16px;
  background: #fff;
  color: var(--pa-text);
  border-bottom: 1px solid var(--pa-line);
}

.pa-header strong,
.pa-header span {
  display: block;
}

.pa-header strong {
  font-size: 15px;
  line-height: 1.2;
}

.pa-header span {
  margin-top: 2px;
  font-size: 12px;
  color: var(--pa-muted);
}

.pa-consent {
  padding: 10px 16px;
  border-bottom: 1px solid var(--pa-line);
  background: #fff;
  color: var(--pa-muted);
  font-size: 11px;
  line-height: 1.4;
}

.pa-consent a {
  color: var(--pa-accent);
  font-weight: 700;
  text-decoration: none;
}

.pa-consent a:hover,
.pa-consent a:focus {
  text-decoration: underline;
}

.pa-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.pa-header-actions .pa-new-chat {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.pa-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--pa-soft);
  color: var(--pa-text);
  cursor: pointer;
}

.pa-new-chat {
  min-height: 34px;
  border: 1px solid var(--pa-line);
  border-radius: 10px;
  background: #fff;
  color: var(--pa-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.pa-new-chat svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pa-new-chat span {
  display: inline-block;
}

.pa-new-chat:hover,
.pa-new-chat:focus {
  background: #f1f5f9;
}

.pa-close:hover,
.pa-close:focus {
  background: #eaf1fb;
}

.pa-close {
  font-size: 24px;
  line-height: 1;
}

.pa-messages {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
  background: var(--pa-soft);
  scroll-behavior: smooth;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pa-messages::before {
  content: "";
  margin-top: auto;
}

.pa-message {
  width: fit-content;
  flex: 0 0 auto;
  max-width: 86%;
  margin: 0 0 10px;
  padding: 11px 13px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  box-shadow: none;
}

.pa-final-question {
  font-weight: 800;
}

.pa-assistant {
  background: #fff;
  border: 1px solid var(--pa-line);
  border-bottom-left-radius: 6px;
}

.pa-user {
  margin-left: auto;
  background: var(--pa-accent);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.pa-loading {
  color: var(--pa-muted);
}

.pa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pa-product-card {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 12px;
  width: min(310px, 100%);
  padding: 10px;
  border: 1px solid var(--pa-line);
  border-radius: 16px;
  background: #fff;
}

.pa-product-card-compact {
  grid-template-columns: 1fr auto;
  align-items: center;
  width: min(280px, 100%);
  padding: 8px 9px 8px 11px;
  border-radius: 14px;
}

.pa-product-image {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--pa-soft);
}

.pa-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pa-product-card-compact .pa-product-image {
  display: none;
}

.pa-product-body {
  min-width: 0;
}

.pa-product-name {
  color: var(--pa-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.pa-product-card-compact .pa-product-name {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pa-product-meta {
  margin-top: 5px;
  color: var(--pa-muted);
  font-size: 12px;
  line-height: 1.35;
}

.pa-product-card-compact .pa-product-meta {
  margin-top: 2px;
  font-size: 12px;
}

.pa-product-description {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: #334155;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.pa-product-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.pa-product-card-compact .pa-product-buttons {
  margin-top: 0;
}

.pa-product-buttons button {
  min-height: 32px;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.pa-product-card-compact .pa-product-buttons button {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 12px;
}

.pa-product-order {
  background: var(--pa-accent);
  color: #fff;
}

.pa-product-order:hover,
.pa-product-order:focus {
  background: var(--pa-accent-dark);
}

.pa-product-view {
  background: #fff;
  color: #1e40af;
  border-color: rgba(37, 99, 235, 0.22) !important;
}

.pa-product-view:hover,
.pa-product-view:focus {
  background: var(--pa-accent-soft);
}

.pa-action-button {
  min-height: 36px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: var(--pa-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  padding: 8px 12px;
}

.pa-quick-action {
  background: var(--pa-accent-soft);
  color: #1e40af;
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: none;
}

.pa-link-action {
  background: var(--pa-accent);
  color: #fff;
  border-color: transparent;
}

.pa-link-action:hover,
.pa-link-action:focus {
  background: var(--pa-accent-dark);
}

.pa-payment-action {
  background: var(--pa-accent);
  color: #fff;
  border-color: transparent;
}

.pa-payment-action:hover,
.pa-payment-action:focus {
  background: var(--pa-accent-dark);
}

.pa-whatsapp-action {
  background: var(--pa-green);
  color: #fff;
  border-color: transparent;
}

.pa-whatsapp-action:hover,
.pa-whatsapp-action:focus {
  background: #0f6f3b;
}

.pa-quick-action:hover,
.pa-quick-action:focus {
  background: #dbeafe;
}

.pa-action-button:hover,
.pa-action-button:focus {
  filter: brightness(0.96);
}

.pa-composer {
  border-top: 1px solid var(--pa-line);
  background: #fff;
}

.pa-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  align-items: end;
  gap: 8px;
  padding: 14px 16px 8px;
}

.pa-form textarea {
  width: 100%;
  height: 46px;
  min-height: 46px;
  max-height: 112px;
  resize: none;
  overflow: auto;
  scrollbar-width: none;
  border: 1px solid var(--pa-line);
  border-radius: 18px;
  padding: 12px 13px;
  font: inherit;
  line-height: 1.35;
  background: #fff;
  outline: none;
}

.pa-form textarea::-webkit-scrollbar {
  display: none;
}

.pa-form textarea:focus {
  border-color: rgba(37, 99, 235, 0.74);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pa-form button {
  width: 82px;
  min-width: 82px;
  height: 46px;
  border: 0;
  border-radius: 18px;
  background: var(--pa-accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.pa-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.pa-ai-note {
  padding: 0 16px 12px;
  color: var(--pa-muted);
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 480px) {
  #pecado-assistant-root {
    inset: auto 12px calc(12px + var(--pa-keyboard-offset) + var(--pa-dynamic-offset)) auto;
  }

  .pa-panel {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: var(--pa-viewport-height);
    max-height: var(--pa-viewport-height);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  #pecado-assistant-root.is-open .pa-launcher {
    display: none;
  }

  .pa-nudge {
    right: 2px;
    bottom: 78px;
  }

  .pa-header {
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .pa-messages {
    padding-bottom: 20px;
  }

  .pa-composer {
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .pa-form {
    padding-bottom: 8px;
  }
}

@media (max-width: 480px) {
  .pa-new-chat {
    padding: 0 3px;
    font-size: 13px;
  }

  .pa-new-chat svg {
    width: 16px;
    height: 16px;
  }
}
