/* Ozeanic AI Agent: chat widget. Light surface, one accent colour set per store. */
.oai {
  --oai-ink: #1d2327;
  --oai-muted: #6b7177;
  --oai-paper: #fbfaf7;
  --oai-line: #e6e2d9;
  --oai-bot: #f1eee7;
  --oai-accent: #0e6e74;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99999;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--oai-ink);
}
.oai *,
.oai *::before,
.oai *::after { box-sizing: border-box; }

.oai-launcher {
  position: relative;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: var(--oai-accent);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  transition: transform .2s ease;
}
.oai-launcher:hover { transform: translateY(-2px); }
.oai button:focus-visible,
.oai input:focus-visible,
.oai a:focus-visible { outline: 3px solid var(--oai-accent); outline-offset: 2px; }

.oai-window {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 370px;
  height: 560px;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
  background: var(--oai-paper);
  border: 1px solid var(--oai-line);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .2);
  overflow: hidden;
}
.oai-window[hidden] { display: none; }

.oai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--oai-line);
}
.oai-header strong { flex: 1; font-weight: 600; }
.oai-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--oai-accent); }
.oai-close {
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--oai-muted);
  cursor: pointer;
}

.oai-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.oai-welcome { margin-bottom: 6px; }
.oai-welcome h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.oai-welcome p { margin: 0; color: var(--oai-muted); }

.oai-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; overflow-wrap: anywhere; }
.oai-user { align-self: flex-end; background: var(--oai-accent); color: #fff; border-bottom-right-radius: 4px; }
.oai-assistant { align-self: flex-start; background: var(--oai-bot); border-bottom-left-radius: 4px; }
.oai-assistant p { margin: 0 0 6px; }
.oai-assistant p:last-child { margin: 0; }
.oai-assistant ul { margin: 4px 0; padding-left: 18px; }
.oai-assistant pre { background: #1d2327; color: #f5f5f5; padding: 10px; border-radius: 8px; overflow-x: auto; font-size: 12px; }
.oai-assistant code { font-family: ui-monospace, monospace; font-size: .92em; }
.oai-error { background: #fdecea; color: #8a1c12; }

.oai-products { display: grid; gap: 8px; }
.oai-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--oai-line);
  border-radius: 12px;
}
.oai-card img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; background: #eee; }
.oai-card h4 { margin: 0 0 2px; font-size: 14px; font-weight: 600; }
.oai-price { font-weight: 600; }
.oai-meta { color: var(--oai-muted); font-size: 12px; }
.oai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.oai-btn {
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--oai-accent);
  background: var(--oai-accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.oai-btn.ghost { background: transparent; color: var(--oai-accent); }

.oai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.oai-chip {
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  border: 1px solid var(--oai-line);
  border-radius: 999px;
  background: #fff;
  color: var(--oai-ink);
  cursor: pointer;
}

.oai-feedback { display: flex; gap: 4px; margin-top: 4px; }
.oai-feedback button { background: none; border: 0; padding: 2px; color: var(--oai-muted); cursor: pointer; }
.oai-feedback button[aria-pressed="true"] { color: var(--oai-accent); }

.oai-typing { display: flex; gap: 4px; padding: 14px; }
.oai-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--oai-muted);
  animation: oai-pulse 1s infinite ease-in-out;
}
.oai-typing span:nth-child(2) { animation-delay: .15s; }
.oai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes oai-pulse { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.oai-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid var(--oai-line);
}
.oai-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--oai-line);
  border-radius: 10px;
}
.oai-form button {
  width: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--oai-accent);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.oai-form button:disabled { opacity: .5; cursor: default; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 480px) {
  .oai { right: 16px; bottom: 16px; }
  .oai-window {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    max-height: none;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .oai *, .oai *::before, .oai *::after { animation: none !important; transition: none !important; }
}
