/*
 * "AI generated" image label.
 * Uses the theme's design tokens (theme.json presets) with fallbacks, and sits in the
 * bottom-left corner so it never collides with sale/product badges (top-right).
 */

.tsc-ai-label-host--relative {
  position: relative;
}

.tsc-ai-label-host--inline-block {
  display: inline-block;
}

.tsc-ai-label {
  --tsc-ai-offset: 0.75rem;

  position: absolute;
  left: var(--tsc-ai-offset);
  bottom: var(--tsc-ai-offset);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  max-width: calc(100% - (2 * var(--tsc-ai-offset)));
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--wp--preset--color--blue-200, #ecedf2);
  border-radius: var(--radius-sm, 0.25rem);
  background-color: rgb(255 255 255 / 0.92);
  box-shadow: 0 1px 2px rgb(28 29 40 / 0.08);
  color: var(--wp--preset--color--blue-800, #383c54);
  font-family: var(--font-sans, 'Work Sans', sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  cursor: default;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.tsc-ai-label__icon {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  fill: var(--wp--preset--color--blue-600, #4f557a);
}

.tsc-ai-label__text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tsc-ai-label__short {
  display: none;
}

/* Small images (thumbnails, cart, swatches): short "AI" badge. */
.tsc-ai-label.is-compact {
  --tsc-ai-offset: 0.25rem;

  gap: 0.125rem;
  padding: 0.125rem 0.25rem;
  font-size: 0.625rem;
}

.tsc-ai-label.is-compact .tsc-ai-label__icon {
  width: 0.625rem;
  height: 0.625rem;
}

.tsc-ai-label.is-compact .tsc-ai-label__short {
  display: inline;
}

/* Keep the full text available to assistive technology. */
.tsc-ai-label.is-compact .tsc-ai-label__text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tsc-ai-label.is-hidden {
  display: none;
}

@media print {
  .tsc-ai-label {
    box-shadow: none;
    backdrop-filter: none;
  }
}
