#fexnox-ai-commerce-widget {
  --fexnox-accent: #167247;
  --fexnox-text: #142033;
  --fexnox-muted: #64748b;
  --fexnox-border: #dfe6ef;
  --fexnox-soft: #f5f8fc;
  --fexnox-danger: #ba2d2d;
  --fexnox-handoff-bg: var(--fexnox-accent);
  --fexnox-handoff-text: #ffffff;
  --fexnox-viewport-height: 100dvh;
  --fexnox-viewport-top: 0px;
  color: var(--fexnox-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
  position: relative;
  z-index: 2147483000;
}

#fexnox-ai-commerce-widget,
#fexnox-ai-commerce-widget * {
  box-sizing: border-box;
}

#fexnox-ai-commerce-widget button,
#fexnox-ai-commerce-widget input {
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

#fexnox-ai-commerce-widget [hidden] {
  display: none !important;
}

.fexnox-visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.fexnox-launcher {
  align-items: center;
  appearance: none;
  background: var(--fexnox-accent);
  border: 0;
  border-radius: 999px;
  bottom: max(20px, env(safe-area-inset-bottom));
  box-shadow: 0 18px 42px rgba(8, 13, 26, 0.28);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 15px;
  font-weight: 800;
  gap: 9px;
  justify-content: center;
  line-height: 1;
  margin: 0;
  min-height: 52px;
  padding: 14px 18px;
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  transition: box-shadow 180ms ease, transform 180ms ease;
  z-index: 2147483001;
}

.fexnox-launcher:hover {
  box-shadow: 0 22px 50px rgba(8, 13, 26, 0.32);
  transform: translateY(-2px);
}

.fexnox-launcher:active {
  transform: translateY(0) scale(0.98);
}

.fexnox-launcher-left {
  left: max(20px, env(safe-area-inset-left));
  right: auto;
}

.fexnox-launcher-icon {
  font-size: 19px;
  line-height: 1;
}

.fexnox-panel {
  background: #fff;
  border: 1px solid var(--fexnox-border);
  border-radius: 22px;
  bottom: calc(max(20px, env(safe-area-inset-bottom)) + 64px);
  box-shadow: 0 24px 80px rgba(8, 13, 26, 0.25);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: min(620px, calc(100vh - 112px));
  height: min(620px, calc(100dvh - 112px));
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  overflow: hidden;
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  width: min(400px, calc(100vw - 28px));
  z-index: 2147483002;
}

.fexnox-panel.is-open {
  animation: fexnox-panel-in 180ms ease-out both;
}

.fexnox-panel-left {
  left: max(20px, env(safe-area-inset-left));
  right: auto;
}

.fexnox-header {
  align-items: center;
  background: #10192e;
  color: #fff;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: space-between;
  margin: 0;
  min-width: 0;
  padding: 14px 15px;
}

.fexnox-header-main {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 0;
}

.fexnox-brand-logo,
.fexnox-brand-icon {
  align-items: center;
  background: var(--fexnox-accent);
  border-radius: 13px;
  color: #fff;
  display: flex;
  flex: 0 0 40px;
  font-weight: 800;
  height: 40px;
  justify-content: center;
  overflow: hidden;
  width: 40px;
}

.fexnox-brand-logo img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.fexnox-title-wrap {
  min-width: 0;
}

.fexnox-title,
.fexnox-subtitle {
  display: block;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fexnox-title {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.fexnox-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  line-height: 1.25;
  margin-top: 3px;
}

.fexnox-close {
  align-items: center;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex: 0 0 42px;
  font-size: 25px;
  height: 42px;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0;
  width: 42px;
}

.fexnox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.fexnox-messages {
  background: #f7fafc;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 15px;
  scrollbar-color: #c7d2e1 transparent;
  scrollbar-width: thin;
}

.fexnox-msg {
  display: flex;
  margin: 0 0 12px;
}

.fexnox-msg p {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 7px 20px rgba(8, 13, 26, 0.07);
  color: var(--fexnox-text);
  font-size: 14px;
  line-height: 1.48;
  margin: 0;
  max-width: 88%;
  overflow-wrap: anywhere;
  padding: 11px 13px;
  white-space: pre-line;
}

.fexnox-msg-user {
  justify-content: flex-end;
}

.fexnox-msg-user p {
  background: #dcf8c6;
  color: #17352b;
}

.fexnox-products {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.fexnox-product {
  align-items: start;
  background: #fff;
  border: 1px solid var(--fexnox-border);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(8, 13, 26, 0.05);
  display: grid;
  gap: 10px;
  grid-template-columns: 76px minmax(0, 1fr);
  margin: 0;
  min-width: 0;
  padding: 10px;
}

.fexnox-product > img {
  background: var(--fexnox-soft);
  border: 0;
  border-radius: 12px;
  display: block;
  height: 76px;
  margin: 0;
  object-fit: contain;
  width: 76px;
}

.fexnox-product-content {
  min-width: 0;
}

.fexnox-product h4 {
  color: var(--fexnox-text);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 5px;
  overflow-wrap: anywhere;
  padding: 0;
}

.fexnox-product p {
  color: var(--fexnox-muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  padding: 0;
}

.fexnox-badges,
.fexnox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fexnox-badges {
  margin: 0 0 8px;
}

.fexnox-badge {
  align-items: center;
  background: var(--fexnox-soft);
  border-radius: 999px;
  color: var(--fexnox-muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 5px 7px;
}

.fexnox-badge-stock-ok {
  background: rgba(22, 114, 71, 0.1);
  color: var(--fexnox-accent);
}

.fexnox-badge-stock-bad {
  background: rgba(186, 45, 45, 0.1);
  color: var(--fexnox-danger);
}

.fexnox-actions a {
  align-items: center;
  background: var(--fexnox-soft);
  border: 1px solid var(--fexnox-border);
  border-radius: 10px;
  color: var(--fexnox-text) !important;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  line-height: 1.2;
  min-height: 36px;
  padding: 7px 9px;
  text-decoration: none !important;
}

.fexnox-actions a.fexnox-whatsapp {
  background: var(--fexnox-accent);
  border-color: var(--fexnox-accent);
  color: #fff !important;
}

.fexnox-handoff-wrap {
  display: flex;
  margin: 0 0 12px;
}

.fexnox-handoff-wrap .fexnox-handoff {
  align-items: center;
  background: var(--fexnox-handoff-bg) !important;
  border: 1px solid var(--fexnox-handoff-bg);
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(8, 13, 26, 0.12);
  color: var(--fexnox-handoff-text) !important;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  line-height: 1.25;
  min-height: 44px;
  padding: 10px 12px;
  text-align: center;
  text-decoration: none !important;
  width: 100%;
}

.fexnox-suggestions {
  display: flex;
  gap: 8px;
  margin: 0 0 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: thin;
}

.fexnox-suggestion {
  appearance: none;
  background: #fff;
  border: 1px solid var(--fexnox-border);
  border-radius: 999px;
  color: var(--fexnox-text);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
  min-height: 38px;
  padding: 8px 11px;
}

.fexnox-suggestion:first-child {
  border-color: var(--fexnox-accent);
}

.fexnox-form {
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--fexnox-border);
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  margin: 0;
  padding: 11px 12px;
}

.fexnox-form input {
  appearance: none;
  background: #fff;
  border: 1px solid var(--fexnox-border);
  border-radius: 12px;
  box-shadow: none;
  color: var(--fexnox-text);
  flex: 1 1 auto;
  font-size: 14px;
  height: 44px;
  line-height: 1.2;
  margin: 0;
  min-width: 0;
  outline: none;
  padding: 10px 11px;
  width: auto;
}

.fexnox-form input::placeholder {
  color: #8491a3;
  opacity: 1;
}

.fexnox-form button {
  align-items: center;
  appearance: none;
  background: var(--fexnox-accent);
  border: 0;
  border-radius: 12px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  height: 44px;
  justify-content: center;
  line-height: 1;
  margin: 0;
  min-width: 68px;
  padding: 0 13px;
}

.fexnox-form button:disabled,
.fexnox-form input:disabled {
  cursor: wait;
  opacity: 0.65;
}

.fexnox-form.is-pending button span {
  opacity: 0.75;
}

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

.fexnox-loading p::after {
  animation: fexnox-dots 1.2s steps(4, end) infinite;
  content: "";
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  width: 1.5em;
}

#fexnox-ai-commerce-widget :focus-visible {
  outline: 3px solid var(--fexnox-accent);
  outline: 3px solid color-mix(in srgb, var(--fexnox-accent) 32%, white);
  outline-offset: 2px;
}

.fexnox-form input:focus {
  border-color: var(--fexnox-accent);
  box-shadow: 0 0 0 3px rgba(22, 114, 71, 0.12);
}

@keyframes fexnox-panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fexnox-dots {
  0% { width: 0; }
  100% { width: 1.5em; }
}

@media (max-width: 700px) {
  html.fexnox-chat-open,
  body.fexnox-chat-open {
    overscroll-behavior: none;
    overflow: hidden !important;
  }

  .fexnox-launcher {
    bottom: max(12px, env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    min-height: 52px;
    right: max(12px, env(safe-area-inset-right));
  }

  .fexnox-launcher-left {
    left: max(12px, env(safe-area-inset-left));
    right: auto;
  }

  #fexnox-ai-commerce-widget.is-mobile-open .fexnox-launcher {
    display: none;
  }

  .fexnox-panel,
  .fexnox-panel-left {
    border: 0;
    border-radius: 0;
    bottom: auto;
    box-shadow: none;
    height: var(--fexnox-viewport-height);
    left: 0;
    max-height: none;
    right: 0;
    top: var(--fexnox-viewport-top);
    width: 100%;
  }

  .fexnox-panel.is-open {
    animation-duration: 140ms;
  }

  .fexnox-header {
    padding: calc(10px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  }

  .fexnox-close {
    flex-basis: 44px;
    height: 44px;
    width: 44px;
  }

  .fexnox-messages {
    padding: 12px max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
  }

  .fexnox-msg p {
    max-width: 92%;
  }

  .fexnox-form {
    padding: 9px max(10px, env(safe-area-inset-right)) calc(9px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  }

  .fexnox-form input {
    font-size: 16px;
  }
}

@media (max-width: 420px) {
  .fexnox-product {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 9px;
  }

  .fexnox-product > img {
    height: 64px;
    width: 64px;
  }

  .fexnox-actions a {
    flex: 1 1 110px;
  }
}

@media (max-width: 360px) {
  .fexnox-launcher-label {
    display: none;
  }

  .fexnox-launcher {
    height: 54px;
    min-height: 54px;
    padding: 0;
    width: 54px;
  }

  .fexnox-form button {
    min-width: 58px;
    padding: 0 10px;
  }

  .fexnox-brand-logo,
  .fexnox-brand-icon {
    flex-basis: 36px;
    height: 36px;
    width: 36px;
  }
}

@media (max-width: 700px) and (max-height: 480px) {
  .fexnox-header {
    padding-bottom: 7px;
    padding-top: calc(7px + env(safe-area-inset-top));
  }

  .fexnox-brand-logo,
  .fexnox-brand-icon {
    flex-basis: 34px;
    height: 34px;
    width: 34px;
  }

  .fexnox-subtitle {
    display: none;
  }

  .fexnox-messages {
    padding-bottom: 8px;
    padding-top: 8px;
  }

  .fexnox-form {
    padding-top: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fexnox-launcher,
  .fexnox-panel.is-open,
  .fexnox-loading p::after {
    animation: none !important;
    transition: none !important;
  }
}
