/* Card de resultado do investigador de link (home, busca e /investigar).
 * Fica fora do evidelo-tailwind.css compilado: é um componente só, carregado
 * pelas três páginas que usam o evidelo-link-investigator.js. */

.inv-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  color: var(--text, #15171c);
}
.inv-card__head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.inv-card .link-investigator__copy { gap: 5px; }
.inv-card__title {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -.01em;
  overflow-wrap: anywhere;
  font-family: var(--font-ui, inherit);
}
/* Recebe foco só por script (tabindex=-1), para o leitor de tela anunciar. */
.inv-card__title:focus { outline: none; }

.inv-label {
  display: block;
  margin: 0 0 4px;
  color: #52647b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.inv-muted { display: block; color: #5f6573; font-size: 12px; line-height: 1.45; }

/* Preço deste anúncio + régua do histórico */
.inv-price {
  padding: 14px;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  background: #f8fafc;
}
.inv-price__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 14px;
}
.inv-price__value {
  display: block;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.inv-price__msg { margin: 10px 0 6px; color: #34445b; font-size: 13px; line-height: 1.5; }
.inv-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #d5dce6;
  background: #fff;
  color: #34445b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.inv-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}
.inv-badge[data-state="REAL_DROP"] { color: #0d6b4a; border-color: #a6e3c9; background: #ecfbf4; }
.inv-badge[data-state="REAL_DROP"]::before { background: var(--positive, #19a974); }
.inv-badge[data-state="TAG_DISCOUNT"],
.inv-badge[data-state="ABOVE_USUAL"] { color: #8a5a00; border-color: #f2d48a; background: #fff8e6; }
.inv-badge[data-state="TAG_DISCOUNT"]::before,
.inv-badge[data-state="ABOVE_USUAL"]::before { background: var(--warning, #e7a928); }
.inv-badge[data-state="USUAL"]::before { background: var(--info, #3b82f6); }

.inv-spark {
  display: block;
  width: 100%;
  max-width: 420px;
  height: 48px;
  margin: 4px 0 6px;
  overflow: visible;
}
.inv-spark polyline { fill: none; stroke: var(--brand-indigo, #5348e0); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.inv-spark circle { fill: #fff; stroke: var(--brand-indigo, #5348e0); stroke-width: 1.5; }
.inv-spark circle.is-last { fill: var(--brand-indigo, #5348e0); }

/* Lojas */
.inv-stores__list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 8px; }
.inv-store {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px 14px;
  padding: 11px 12px;
  border: 1px solid #e3e8f0;
  border-radius: 10px;
  background: #fff;
}
.inv-store.is-source { border-color: #c9c4f6; background: #f7f6ff; }
.inv-store.has-alert { border-color: #f2d48a; }
.inv-store__name { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.inv-store__name strong { font-size: 14px; }
.inv-store__name .inv-muted { flex-basis: 100%; overflow-wrap: anywhere; }
.inv-tag {
  padding: 2px 7px;
  border-radius: 999px;
  background: #ebe9fd;
  color: #3f35b8;
  font-size: 10.5px;
  font-weight: 700;
}
.inv-store__price { display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-store__price strong { font-size: 15px; }
.inv-delta { font-size: 12px; font-weight: 700; }
.inv-delta[data-dir="down"] { color: #0d6b4a; }
.inv-delta[data-dir="up"] { color: #9b2c35; }
.inv-store__go {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #c9ddf8;
  border-radius: 999px;
  background: #f4f8ff;
  color: #315d9b;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.inv-store__go { grid-column: 3; grid-row: 1; }
.inv-store__go:hover { background: #eaf2ff; border-color: #8fb7ee; }
.inv-store__go:focus-visible { outline: 3px solid var(--focus-ring, #45c7ff); outline-offset: 2px; }
.inv-store__alerts {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding: 8px 10px;
  list-style: none;
  border-radius: 8px;
  background: #fff8e6;
  color: #6b4700;
  font-size: 12.5px;
  line-height: 1.45;
}
.inv-store__alerts li { position: relative; padding-left: 20px; }
.inv-store__alerts li + li { margin-top: 3px; }
.inv-store__alerts li::before { content: "!"; position: absolute; left: 0; top: 1px; width: 14px; height: 14px; border-radius: 50%; background: var(--warning, #e7a928); color: #fff; font-size: 10px; font-weight: 800; line-height: 14px; text-align: center; }

/* Ações */
.inv-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.inv-card__actions .evidelo-button { margin: 0; }
.inv-card__actions .link-investigator__analise { margin: 0; }
.inv-copy {
  margin-left: auto;
  padding: 6px 0;
  border: 0;
  background: none;
  color: #52647b;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.inv-copy:hover { color: #15171c; }
.inv-disclosure { margin: 0; color: #6b7280; font-size: 11.5px; line-height: 1.45; }

/* Carregando */
.inv-loading p { margin: 0 0 10px; }
.inv-loading__bars { display: grid; gap: 7px; }
.inv-loading__bars span {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ffffff14 0%, #ffffff33 50%, #ffffff14 100%) 0 0 / 200% 100%;
  animation: inv-shimmer 1.3s linear infinite;
}
.inv-loading__bars span:nth-child(2) { width: 82%; }
.inv-loading__bars span:nth-child(3) { width: 64%; }
@keyframes inv-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .inv-loading__bars span { animation: none; }
}

@media (max-width: 640px) {
  .inv-card { padding: 12px; gap: 12px; }
  .inv-card__head { grid-template-columns: 68px minmax(0, 1fr); gap: 10px; }
  .inv-card__title { font-size: 15.5px; }
  .inv-price__value { font-size: 22px; }
  .inv-store { grid-template-columns: minmax(0, 1fr) auto; }
  .inv-store__go { grid-column: 1 / -1; grid-row: auto; justify-content: center; }
  .inv-card__actions .evidelo-button { width: 100%; text-align: center; white-space: normal; }
  .inv-copy { margin-left: 0; }
}

/* Página /investigar: formulário no topo, resultado com espaço para a tabela */
.investigate-page .investigate-hero { padding-bottom: 36px; }
.investigate-page .investigate-hero .link-investigator { width: 100%; max-width: 880px; margin-top: 22px; }
.investigate-page .investigate-hero .link-investigator summary {
  display: block;
  padding: 0;
  margin-bottom: 8px;
  border: 0;
  background: none;
  color: #e7eef8;
  font-size: 14px;
  font-weight: 650;
  cursor: default;
  list-style: none;
}
.investigate-page .investigate-hero .link-investigator summary::-webkit-details-marker { display: none; }
.investigate-page .investigate-hero .link-investigator__form input { height: 50px; font-size: 15px; }
.investigate-page .investigate-hero .link-investigator__form .evidelo-button { min-height: 50px; padding-inline: 22px; }
.investigate-stores { margin: 10px 0 0; color: #a8b3c7; font-size: 12.5px; line-height: 1.6; }
.investigate-stores button {
  padding: 0;
  border: 0;
  background: none;
  color: #9fd8ff;
  font: inherit;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.investigate-stores button:hover { color: #fff; }

.investigate-recent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.investigate-recent__item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border, #e6e1d7);
  border-radius: 12px;
  background: var(--surface, #fff);
  color: var(--text, #15171c);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.investigate-recent__item:hover { border-color: #c9c4f6; box-shadow: var(--shadow-card); }
.investigate-recent__item img,
.investigate-recent__thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: contain; background: #f1f5f9; }
.investigate-recent__item strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13.5px;
  line-height: 1.35;
}
.investigate-recent__item small { display: block; margin-top: 3px; color: var(--text-secondary, #4a5060); font-size: 12px; }
.investigate-recent__skeleton { height: 78px; border-radius: 12px; background: linear-gradient(90deg, #ece8df 0%, #f6f3ec 50%, #ece8df 100%) 0 0 / 200% 100%; animation: inv-shimmer 1.3s linear infinite; }

/* Produto exato de loja fora da integração */
.inv-store__title { -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; color: #34445b; }
.inv-match { flex-basis: 100%; color: #0d6b4a; font-size: 11.5px; font-weight: 650; }
