/* Bomba Chat v2 widget. Card geometry follows UI-REFERENCE (Puma-style density,
   adapted for appliance photos: contain on white, 3-line title, no code/article rows). */
:root {
  --bv3-accent: #e30613;
  --bv3-ink: #1a1a1a;
  --bv3-muted: #6b6b6b;
  --bv3-line: #e8e8e8;
  --bv3-bg: #ffffff;
  --bv3-soft: #f5f5f5;
  --bv3-font: "RF Dewi", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.bv3-launcher {
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483000;
  font: 600 15px/1 var(--bv3-font); color: #fff; background: var(--bv3-accent);
  border: 0; border-radius: 24px; padding: 14px 20px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}
.bv3-launcher:focus-visible, .bv3-send:focus-visible, .bv3-close:focus-visible, .bv3-retry:focus-visible { outline: 2px solid var(--bv3-ink); outline-offset: 2px; }
.bv3-open .bv3-launcher { display: none; }

.bv3-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 2147483001;
  width: 400px; height: min(640px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bv3-bg); color: var(--bv3-ink); font: 400 14px/1.4 var(--bv3-font);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  animation: bv3-drop-in .32s ease-out both;
}
.bv3-panel[hidden] { display: none; }
.bv3-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--bv3-line); }
.bv3-heading { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.bv3-beta { font-weight: 500; font-size: 11px; color: var(--bv3-muted); background: var(--bv3-soft); border-radius: 10px; padding: 2px 8px; }
.bv3-close { width: 32px; height: 32px; border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--bv3-muted); }

.bv3-log { flex: 1 1 auto; overflow-y: auto; padding: 12px 0; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.bv3-msg { max-width: 82%; margin: 0 14px; padding: 9px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; animation: bv3-reveal .24s ease-out both; }
.bv3-msg--user { align-self: flex-end; background: var(--bv3-ink); color: #fff; }
.bv3-msg--assistant { align-self: flex-start; background: var(--bv3-soft); }
.bv3-msg--notice { align-self: stretch; max-width: none; background: #fff7e6; border: 1px solid #f3d9a4; color: #5b4200; font-size: 13px; }
.bv3-retry { display: block; margin-top: 8px; font: 600 13px/1 var(--bv3-font); padding: 8px 12px; border-radius: 8px; border: 1px solid #c9a24a; background: #fff; cursor: pointer; }

.bv3-typing { align-self: flex-start; margin: 0 14px; padding: 10px 12px; background: var(--bv3-soft); border-radius: 12px; display: flex; gap: 4px; }
.bv3-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--bv3-muted); animation: bv3-dots 1s infinite ease-in-out; }
.bv3-typing span:nth-child(2) { animation-delay: .15s; }
.bv3-typing span:nth-child(3) { animation-delay: .3s; }

/* One horizontal row, up to 12 cards; the row animates once, cards do not. */
.bv3-row {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
  padding: 2px 14px 12px; scroll-snap-type: x proximity; scroll-padding: 0 14px;
  scrollbar-width: none; min-height: 236px;
  animation: bv3-drop-in .32s ease-out .18s both;
}
.bv3-row::-webkit-scrollbar { display: none; }
.bv3-card {
  flex: 0 0 168px; box-sizing: border-box; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 8px;
  border: 1px solid var(--bv3-line); border-radius: 8px; background: #fff;
  color: inherit; text-decoration: none;
}
.bv3-card:hover { border-color: #cfcfcf; }
.bv3-card:focus-visible { outline: 2px solid var(--bv3-accent); outline-offset: 1px; }
.bv3-card__media { display: block; height: 136px; background: #fff; }
.bv3-card__media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bv3-card__title {
  font: 500 12px/1.3 var(--bv3-font); min-height: calc(12px * 1.3 * 3);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.bv3-card__price { font: 700 13px/1.2 var(--bv3-font); margin-top: auto; }

.bv3-composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--bv3-line); }
.bv3-input { flex: 1 1 auto; resize: none; font: 400 15px/1.35 var(--bv3-font); padding: 9px 12px; border: 1px solid var(--bv3-line); border-radius: 10px; max-height: 96px; }
.bv3-send { font: 600 14px/1 var(--bv3-font); padding: 0 14px; border: 0; border-radius: 10px; background: var(--bv3-accent); color: #fff; cursor: pointer; }
.bv3-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 600px) {
  .bv3-panel { inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; z-index: 2147483647; }
  .bv3-open body { overflow: hidden; }
  .bv3-launcher { right: 16px; bottom: 16px; }
  .bv3-card { flex-basis: 160px; }
  .bv3-card__media { height: 128px; }
  .bv3-row { min-height: 228px; }
}

@keyframes bv3-drop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes bv3-reveal { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes bv3-dots { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

@media (prefers-reduced-motion: reduce) {
  .bv3-panel, .bv3-row, .bv3-msg, .bv3-typing span { animation: none !important; }
}
