.dom-ai {
  position: fixed;
  bottom: 1.25rem;
  z-index: 9999;
  font-family: var(--wp--preset--font-family--body, system-ui, sans-serif);
}
.dom-ai--right { right: 1.25rem; }
.dom-ai--left { left: 1.25rem; }

/* The `hidden` attribute must win over the panel/teaser display rules below,
   otherwise the panel can never be closed (a bare class beats UA [hidden]). */
.dom-ai__panel[hidden],
.dom-ai__teaser[hidden] { display: none !important; }

.dom-ai__fab {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  background: var(--dom-ai-accent, #0E1116);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(14, 17, 22, .22);
  transition: transform .15s ease;
}
.dom-ai__fab:hover { transform: translateY(-2px); }

.dom-ai__panel {
  position: fixed;
  bottom: 5.5rem;
  width: min(380px, calc(100vw - 2rem));
  height: min(560px, calc(100vh - 8rem));
  background: #fff;
  border: 1px solid #E3E7ED;
  border-radius: 16px;
  box-shadow: 0 24px 48px rgba(14, 17, 22, .18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dom-ai--right .dom-ai__panel { right: 1.25rem; }
.dom-ai--left .dom-ai__panel { left: 1.25rem; }

.dom-ai__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1rem;
  background: var(--dom-ai-accent, #0E1116);
  color: #fff;
  font-weight: 700;
}
.dom-ai__close { background: none; border: 0; color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; }

/* "Powered by AI" subtext in the header */
.dom-ai__title { display: flex; flex-direction: column; line-height: 1.15; }
.dom-ai__title small { font-size: .68rem; font-weight: 400; opacity: .72; letter-spacing: .03em; }

/* Marketing teaser pill beside the launcher (closed state) */
.dom-ai__teaser {
  position: fixed;
  bottom: 1.55rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  max-width: 250px;
  padding: .6rem .7rem;
  background: #fff;
  color: #0E1116;
  border: 1px solid #E3E7ED;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(14, 17, 22, .18);
  cursor: pointer;
  z-index: 9999;
  animation: dom-ai-teaser-in .35s ease;
}
.dom-ai--right .dom-ai__teaser { right: 5.25rem; }
.dom-ai--left .dom-ai__teaser { left: 5.25rem; }
.dom-ai__teaser-spark { font-size: 1.05rem; line-height: 1; }
.dom-ai__teaser-tx { display: flex; flex-direction: column; line-height: 1.2; }
.dom-ai__teaser-tx strong { font-size: .82rem; }
.dom-ai__teaser-tx small { font-size: .7rem; color: #6B7280; }
.dom-ai__teaser-x { flex: 0 0 auto; align-self: flex-start; background: none; border: 0; color: #9aa1ab; font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0 .1rem; }
.dom-ai__teaser-x:hover { color: #0E1116; }
@keyframes dom-ai-teaser-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 600px) { .dom-ai__teaser { max-width: calc(100vw - 7rem); } }
@media (prefers-reduced-motion: reduce) { .dom-ai__teaser { animation: none; } }

.dom-ai__log {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  background: #F7F9FB;
}
.dom-ai__msg {
  max-width: 85%;
  padding: .6rem .8rem;
  border-radius: 12px;
  font-size: .9rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.dom-ai__msg--user { align-self: flex-end; background: var(--dom-ai-accent, #0E1116); color: #fff; border-bottom-right-radius: 4px; }
.dom-ai__msg--bot { align-self: flex-start; background: #fff; color: #0E1116; border: 1px solid #E3E7ED; border-bottom-left-radius: 4px; }
.dom-ai__typing { opacity: .6; }

.dom-ai__cards { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.dom-ai__card {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  background: #fff;
  border: 1px solid #E3E7ED;
  border-radius: 10px;
  padding: .5rem;
  text-decoration: none;
  color: #0E1116;
}
.dom-ai__card img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.dom-ai__card-name {
  font-size: .76rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dom-ai__card-price { font-weight: 700; font-size: .8rem; }
.dom-ai__card-price del { color: #6B7280; font-weight: 400; }

.dom-ai__form { display: flex; gap: .4rem; padding: .6rem; border-top: 1px solid #E3E7ED; background: #fff; }
.dom-ai__input { flex: 1; min-width: 0; border: 1px solid #E3E7ED; border-radius: 999px; padding: .55rem .9rem; font-size: .9rem; }
.dom-ai__input:focus { outline: none; border-color: var(--dom-ai-accent, #0E1116); }
.dom-ai__send { flex: 0 0 auto; width: 40px; border: 0; border-radius: 999px; background: var(--dom-ai-accent, #0E1116); color: #fff; cursor: pointer; font-size: 1.1rem; }

@media (max-width: 600px) {
  .dom-ai__panel { width: calc(100vw - 1.5rem); height: calc(100vh - 6.5rem); bottom: 5rem; }
  body.single-product .dom-ai { bottom: 5rem; } /* clear the PDP mobile buy bar */
}
@media (prefers-reduced-motion: reduce) { .dom-ai__fab { transition: none; } }
