/* ============================================================================
   GOOBA AI — widget styles
   Consumes the site's own tokens from styles.css (:root). Everything is
   namespaced `gai-` so nothing here can reach the page, and nothing on the
   page reaches in.
   ========================================================================= */

.gai-panel, .gai-launcher {
  --gai-radius: 18px;
  --gai-head: var(--forest, #0B1712);
  --gai-body: var(--paper, #FBF9F3);
  --gai-line: rgba(20, 24, 18, .12);
  --gai-ink: var(--fg, #141812);
  --gai-ink-2: var(--fg-2, #414839);
  --gai-ink-3: var(--fg-3, #5C6357);
  --gai-brand: var(--green, #1F4632);
  --gai-lime: var(--lime, #C8E45C);
  --gai-shadow: 0 30px 70px -28px rgba(11, 23, 18, .55), 0 2px 10px rgba(11, 23, 18, .08);
  font-family: var(--font-body, 'Inter', system-ui, sans-serif);
}

.gai-sr {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.gai-ico { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ── launcher ────────────────────────────────────────────────────────────── */
.gai-launcher {
  position: fixed; z-index: 920;
  right: clamp(16px, 3vw, 32px);
  bottom: clamp(16px, 3vw, 32px);
  display: flex; align-items: center; gap: 0;
  height: 60px; padding: 0; width: 60px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--gai-brand); color: var(--ivory, #F4F1E8);
  box-shadow: 0 18px 40px -16px rgba(11, 23, 18, .6);
  transition: width .45s cubic-bezier(.22,1,.36,1), background-color .3s, transform .3s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}
.gai-launcher__ico { position: absolute; left: 19px; font-size: 22px; stroke-width: 1.4; }
.gai-launcher__label {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .82rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; opacity: 0; margin-left: 52px; padding-right: 22px;
  transition: opacity .3s .08s;
}
.gai-launcher:hover, .gai-launcher:focus-visible { width: 208px; background: var(--forest, #0B1712); }
.gai-launcher:hover .gai-launcher__label, .gai-launcher:focus-visible .gai-launcher__label { opacity: 1; }
.gai-launcher:active { transform: scale(.96); }
.gai-launcher.is-active .gai-launcher__ico { transform: rotate(90deg); }

.gai-launcher__pulse {
  position: absolute; inset: 0; border-radius: 999px;
  border: 1.5px solid var(--gai-lime);
  animation: gai-pulse 3.6s cubic-bezier(.65,0,.35,1) infinite;
  pointer-events: none;
}
.gai-launcher:hover .gai-launcher__pulse, .gai-launcher.is-active .gai-launcher__pulse { animation: none; opacity: 0; }
@keyframes gai-pulse {
  0%   { transform: scale(1); opacity: .55 }
  55%  { transform: scale(1.32); opacity: 0 }
  100% { transform: scale(1.32); opacity: 0 }
}

/* ── panel ───────────────────────────────────────────────────────────────── */
.gai-panel {
  position: fixed; z-index: 930;
  right: clamp(16px, 3vw, 32px);
  bottom: calc(clamp(16px, 3vw, 32px) + 72px);
  width: min(400px, calc(100vw - 32px));
  height: min(660px, calc(100vh - 140px));
  display: flex; flex-direction: column;
  background: var(--gai-body);
  border: 1px solid var(--gai-line);
  border-radius: var(--gai-radius);
  box-shadow: var(--gai-shadow);
  overflow: hidden;
  opacity: 0; transform: translateY(18px) scale(.97);
  transform-origin: 100% 100%;
  pointer-events: none;
  transition: opacity .32s cubic-bezier(.22,1,.36,1), transform .38s cubic-bezier(.22,1,.36,1);
}
.gai-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

/* ── header ──────────────────────────────────────────────────────────────── */
.gai-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 14px 14px 16px;
  background: var(--gai-head); color: var(--ivory, #F4F1E8);
  flex: none;
}
.gai-head__brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.gai-head__avatar {
  width: 38px; height: 38px; padding: 5px; flex: none;
  border-radius: 50%; background: var(--paper, #FBF9F3); object-fit: contain;
}
.gai-head__title {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .98rem; font-weight: 600; letter-spacing: .06em; line-height: 1.2;
}
.gai-head__sub { font-size: .76rem; color: rgba(244, 241, 232, .68); line-height: 1.3; margin-top: 2px; }

.gai-status {
  display: inline-flex; align-items: center; gap: 6px; margin-left: auto;
  font-size: .7rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(244, 241, 232, .8);
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
}
.gai-status__dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--gai-lime);
  box-shadow: 0 0 0 0 rgba(200, 228, 92, .6);
  animation: gai-blink 2.6s ease-out infinite;
}
@keyframes gai-blink {
  0%   { box-shadow: 0 0 0 0 rgba(200, 228, 92, .55) }
  70%  { box-shadow: 0 0 0 7px rgba(200, 228, 92, 0) }
  100% { box-shadow: 0 0 0 0 rgba(200, 228, 92, 0) }
}

.gai-head__tools { display: flex; gap: 2px; }
.gai-iconbtn {
  display: grid; place-items: center;
  width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: rgba(244, 241, 232, .75);
  font-size: 17px; cursor: pointer; transition: background-color .25s, color .25s;
}
.gai-iconbtn:hover { background: rgba(244, 241, 232, .12); color: #F4F1E8; }

/* ── message list ────────────────────────────────────────────────────────── */
.gai-list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 18px 16px 8px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin; scrollbar-color: rgba(20,24,18,.2) transparent;
}
.gai-list::-webkit-scrollbar { width: 8px; }
.gai-list::-webkit-scrollbar-thumb { background: rgba(20,24,18,.18); border-radius: 8px; }

.gai-msg { display: flex; flex-direction: column; max-width: 100%; }
.gai-msg--user { align-items: flex-end; }
.gai-msg--bot > div { width: 100%; }

.gai-bubble {
  max-width: 90%; padding: 11px 14px;
  background: #fff; border: 1px solid var(--gai-line);
  border-radius: 14px 14px 14px 4px;
  font-size: .93rem; line-height: 1.55; color: var(--gai-ink-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.gai-bubble--user {
  align-self: flex-end; background: var(--gai-brand); border-color: var(--gai-brand);
  color: var(--ivory, #F4F1E8); border-radius: 14px 14px 4px 14px;
}
.gai-bubble--err { border-left: 3px solid #9B2C1E; color: #7A2317; background: rgba(155,44,30,.05); }

.gai-bubble--typing { display: inline-flex; gap: 4px; padding: 14px; width: auto; }
.gai-bubble--typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--gai-ink-3);
  animation: gai-dot 1.2s ease-in-out infinite;
}
.gai-bubble--typing i:nth-child(2) { animation-delay: .15s }
.gai-bubble--typing i:nth-child(3) { animation-delay: .3s }
@keyframes gai-dot { 0%,60%,100% { opacity: .25; transform: translateY(0) } 30% { opacity: 1; transform: translateY(-3px) } }

.gai-hint { font-size: .76rem; color: var(--gai-ink-3); margin-top: 6px; }

/* ── chips ───────────────────────────────────────────────────────────────── */
.gai-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.gai-chip {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .78rem; font-weight: 500; letter-spacing: .02em;
  padding: 9px 13px; min-height: 36px;
  background: #fff; color: var(--gai-brand);
  border: 1px solid rgba(31, 70, 50, .28); border-radius: 999px;
  cursor: pointer; transition: background-color .25s, color .25s, border-color .25s, transform .2s;
}
.gai-chip:hover { background: var(--gai-brand); color: var(--ivory, #F4F1E8); border-color: var(--gai-brand); }
.gai-chip:active { transform: scale(.97); }

/* ── buttons ─────────────────────────────────────────────────────────────── */
.gai-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .78rem; font-weight: 500; letter-spacing: .05em;
  padding: 10px 14px; min-height: 40px;
  border-radius: 999px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: background-color .25s, color .25s, border-color .25s, transform .2s;
}
.gai-btn:active { transform: scale(.98); }
.gai-btn--solid { background: var(--gai-brand); color: var(--ivory, #F4F1E8); border-color: var(--gai-brand); }
.gai-btn--solid:hover { background: var(--forest, #0B1712); border-color: var(--forest, #0B1712); }
.gai-btn--ghost { background: transparent; color: var(--gai-ink-2); border-color: var(--gai-line); }
.gai-btn--ghost:hover { border-color: var(--gai-brand); color: var(--gai-brand); }
.gai-btn--wa { background: #1f7a4d; color: #fff; border-color: #1f7a4d; }
.gai-btn--wa:hover { background: #18653f; border-color: #18653f; }
.gai-btn--wide { width: 100%; }
.gai-btn[disabled], .gai-btn.is-loading { opacity: .6; pointer-events: none; }

/* ── product cards ───────────────────────────────────────────────────────── */
.gai-cards { display: flex; flex-direction: column; gap: 9px; margin-top: 10px; }
.gai-pcard {
  display: flex; gap: 12px; padding: 11px;
  background: #fff; border: 1px solid var(--gai-line); border-radius: 13px;
  transition: border-color .3s, box-shadow .3s;
}
.gai-pcard:hover { border-color: rgba(31,70,50,.3); box-shadow: 0 10px 24px -18px rgba(11,23,18,.5); }
.gai-pcard__img { width: 64px; height: 64px; border-radius: 9px; object-fit: cover; flex: none; background: var(--stone, #DCD6C4); }
.gai-pcard__body { min-width: 0; flex: 1; }
.gai-pcard__name {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .92rem; font-weight: 600; color: var(--gai-ink); letter-spacing: -.01em;
}
.gai-pcard__tag { font-size: .82rem; line-height: 1.45; color: var(--gai-ink-3); margin-top: 3px; }
.gai-pcard__apps { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; list-style: none; padding: 0; }
.gai-pcard__apps li {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gai-ink-3); padding: 4px 8px;
  border: 1px solid var(--gai-line); border-radius: 999px;
}
.gai-pcard__actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.gai-pcard__actions .gai-btn { font-size: .72rem; padding: 8px 12px; min-height: 36px; }

/* ── countries ───────────────────────────────────────────────────────────── */
.gai-countries { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 10px; }
.gai-country {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; min-height: 42px;
  background: #fff; border: 1px solid var(--gai-line); border-radius: 10px;
  font-size: .85rem; color: var(--gai-ink-2); cursor: pointer; text-align: left;
  transition: border-color .25s, background-color .25s;
}
.gai-country:hover { border-color: var(--gai-brand); background: rgba(31,70,50,.04); }
.gai-country__flag { font-size: 1.05rem; line-height: 1; }

/* ── timeline ────────────────────────────────────────────────────────────── */
.gai-timeline { list-style: none; padding: 0; margin: 10px 0 0; border-left: 1px solid var(--gai-line); }
.gai-timeline li { display: flex; gap: 11px; padding: 9px 0 9px 14px; position: relative; }
.gai-timeline li::before {
  content: ''; position: absolute; left: -4px; top: 15px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--gai-brand);
}
.gai-timeline__n {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .72rem; font-weight: 600; color: var(--gai-brand); letter-spacing: .08em; flex: none; padding-top: 2px;
}
.gai-timeline strong { display: block; font-size: .87rem; font-weight: 600; color: var(--gai-ink); }
.gai-timeline span { display: block; font-size: .79rem; line-height: 1.5; color: var(--gai-ink-3); margin-top: 2px; }

/* ── OEM services ────────────────────────────────────────────────────────── */
.gai-oem { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 9px; }
.gai-oem li {
  display: flex; gap: 10px; padding: 11px 12px;
  background: #fff; border: 1px solid var(--gai-line); border-radius: 11px;
}
.gai-oem__ico { color: var(--gai-brand); font-size: 15px; margin-top: 2px; }
.gai-oem strong { display: block; font-size: .86rem; color: var(--gai-ink); font-weight: 600; }
.gai-oem span { display: block; font-size: .79rem; line-height: 1.5; color: var(--gai-ink-3); margin-top: 2px; }

/* ── recommendation ──────────────────────────────────────────────────────── */
.gai-rec {
  display: flex; gap: 9px; align-items: flex-start;
  padding: 12px 14px; border-radius: 12px;
  background: rgba(200, 228, 92, .16); border: 1px solid rgba(31, 70, 50, .18);
  font-size: .9rem; line-height: 1.5; color: var(--gai-ink);
}
.gai-rec__ico { color: var(--gai-brand); font-size: 16px; margin-top: 2px; }

/* ── summary ─────────────────────────────────────────────────────────────── */
.gai-summary {
  background: var(--forest, #0B1712); color: var(--ivory, #F4F1E8);
  border-radius: 13px; padding: 15px 16px;
}
.gai-summary__head {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .78rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gai-lime); padding-bottom: 11px; margin-bottom: 11px;
  border-bottom: 1px solid rgba(244, 241, 232, .16);
}
.gai-summary__ico { font-size: 15px; }
.gai-summary__list { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; }
.gai-summary__list dt {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(244, 241, 232, .55); padding-top: 2px;
}
.gai-summary__list dd { margin: 0; font-size: .87rem; color: var(--ivory, #F4F1E8); overflow-wrap: anywhere; }
.gai-summary__actions { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; }

.gai-sent {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 13px 15px; border-radius: 12px;
  background: rgba(31, 70, 50, .08); border: 1px solid rgba(31, 70, 50, .2);
}
.gai-sent__ico { color: var(--gai-brand); font-size: 17px; margin-top: 1px; }
.gai-sent p { font-size: .88rem; line-height: 1.55; color: var(--gai-ink-2); margin: 0; }

/* ── contact ─────────────────────────────────────────────────────────────── */
.gai-contact {
  background: #fff; border: 1px solid var(--gai-line); border-radius: 13px;
  padding: 14px 15px; margin-bottom: 8px;
}
.gai-contact h4 {
  font-family: var(--font-display, 'Space Grotesk', sans-serif);
  font-size: .9rem; font-weight: 600; color: var(--gai-ink); margin-bottom: 10px; letter-spacing: .02em;
}
.gai-contact__row { display: flex; gap: 9px; align-items: flex-start; font-size: .85rem; line-height: 1.5; color: var(--gai-ink-2); padding: 4px 0; }
.gai-contact__row .gai-ico { color: var(--gai-brand); font-size: 15px; margin-top: 2px; }
.gai-contact__row a {
  color: var(--gai-ink-2); text-decoration: none;
  border-bottom: 1px solid var(--gai-line);
  /* inline contact links are tap targets, so give them real height */
  display: inline-block; padding: 5px 0; min-height: 32px;
}
.gai-contact__row a:hover { color: var(--gai-brand); border-color: var(--gai-brand); }

/* ── composer ────────────────────────────────────────────────────────────── */
.gai-composer {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 11px 12px; border-top: 1px solid var(--gai-line); background: var(--gai-body);
}
.gai-input {
  flex: 1; min-width: 0; height: 44px; padding: 0 15px;
  background: #fff; border: 1px solid var(--gai-line); border-radius: 999px;
  font-size: .92rem; color: var(--gai-ink); font-family: inherit;
  transition: border-color .25s;
}
.gai-input::placeholder { color: var(--gai-ink-3); }
.gai-input:focus { outline: none; border-color: var(--gai-brand); }
.gai-send {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: var(--gai-brand); color: var(--ivory, #F4F1E8);
  font-size: 18px; cursor: pointer; transition: background-color .25s, transform .2s;
}
.gai-send:hover { background: var(--forest, #0B1712); }
.gai-send:active { transform: scale(.94); }
.gai-send[disabled] { opacity: .5; pointer-events: none; }

.gai-foot {
  flex: none; padding: 0 14px 10px; text-align: center;
  font-size: .68rem; line-height: 1.4; color: var(--gai-ink-3); background: var(--gai-body);
}

/* ── focus ───────────────────────────────────────────────────────────────── */
.gai-panel :focus-visible, .gai-launcher:focus-visible {
  outline: 2px solid var(--gai-lime); outline-offset: 2px; border-radius: 8px;
}
.gai-head :focus-visible { outline-color: var(--gai-lime); }

/* ── mobile ──────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .gai-panel {
    right: 0; bottom: 0; left: 0;
    width: 100%; height: 100dvh; max-height: 100dvh;
    border-radius: 0; border: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .gai-launcher { right: 16px; bottom: 16px; }
  body.gai-open { overflow: hidden; }
  body.gai-open .gai-launcher { opacity: 0; pointer-events: none; }
  .gai-list { padding: 14px 13px 6px; }
  .gai-countries { grid-template-columns: repeat(2, 1fr); }
  .gai-bubble { max-width: 100%; }
}

@media (max-width: 380px) {
  .gai-pcard { flex-direction: column; }
  .gai-pcard__img { width: 100%; height: 110px; }
}

/* ── reduced motion ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .gai-panel, .gai-launcher, .gai-chip, .gai-btn, .gai-pcard, .gai-send { transition-duration: .001ms !important; }
  .gai-launcher__pulse, .gai-status__dot, .gai-bubble--typing i { animation: none !important; }
  .gai-panel { transform: none; }
}
