/* Lot timeline — full-width horizontal progress of ticket sales batches */

.lot-timeline .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lot-timeline-scroll {
  width: 100%;
  max-width: 100%;
  margin-top: var(--ds-space-3);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.lot-timeline {
  --lot-timeline-dot-size: 0.625rem;
  --lot-timeline-line-thickness: 2px;

  list-style: none;
  margin: 0;
  padding: var(--ds-space-1) 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  min-width: 0;
}

.lot-timeline__item {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 0 var(--ds-space-1) 0 0;
  z-index: 1;
}

.lot-timeline__item:last-child {
  padding-right: 0;
}

.lot-timeline__item:not(:first-child)::before {
  content: '';
  position: absolute;
  top: calc(var(--lot-timeline-dot-size) / 2);
  /* Bolinhas alinhadas à esquerda: liga a borda direita da anterior à esquerda da atual */
  left: calc(-100% + var(--lot-timeline-dot-size));
  width: calc(100% - var(--lot-timeline-dot-size));
  height: var(--lot-timeline-line-thickness);
  margin-top: calc(var(--lot-timeline-line-thickness) / -2);
  /* --lot-timeline-fill: % do trecho já percorrido (dias usados no lote anterior → este) */
  background-image: linear-gradient(
    to right,
    var(--ds-color-primary) 0,
    var(--ds-color-primary) var(--lot-timeline-fill, 0%),
    var(--ds-color-gray-300) var(--lot-timeline-fill, 0%),
    var(--ds-color-gray-300) 100%
  );
  background-color: transparent;
  z-index: 0;
  pointer-events: none;
  transition: background-image 0.2s ease;
}

.lot-timeline__dot {
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  width: var(--lot-timeline-dot-size);
  height: var(--lot-timeline-dot-size);
  border-radius: var(--ds-radius-full);
  border: var(--lot-timeline-line-thickness) solid var(--ds-color-gray-400);
  background-color: var(--ds-color-white);
  flex-shrink: 0;
  margin-bottom: var(--ds-space-2);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.lot-timeline__item--past .lot-timeline__dot {
  border-color: var(--ds-color-gray-500);
  background-color: var(--ds-color-gray-500);
}

.lot-timeline__item--past .lot-timeline__dot::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 45%;
  width: 0.22rem;
  height: 0.35rem;
  border: solid var(--ds-color-white);
  border-width: 0 1.5px 1.5px 0;
  transform: translate(-50%, -55%) rotate(45deg);
}

.lot-timeline__item--current .lot-timeline__dot {
  border-color: var(--ds-color-primary);
  background-color: var(--ds-color-primary);
  box-shadow: 0 0 0 3px var(--ds-color-primary-light);
}

.lot-timeline__item--future .lot-timeline__dot {
  border-color: var(--ds-color-gray-400);
  background-color: var(--ds-color-white);
}

.lot-timeline__name,
.lot-timeline__price,
.lot-timeline__date {
  display: block;
  max-width: 100%;
  font-family: var(--ds-font-family);
  font-size: var(--ds-font-size-xs);
  line-height: var(--ds-line-height-tight);
}

.lot-timeline__name {
  font-weight: var(--ds-font-weight-medium);
  color: var(--ds-color-gray-700);
  margin-bottom: 2px;
  overflow-wrap: anywhere;
}

.lot-timeline__price {
  font-weight: var(--ds-font-weight-medium);
  color: var(--ds-color-gray-700);
  margin-bottom: 2px;
}

.lot-timeline__date {
  font-weight: var(--ds-font-weight-medium);
  color: var(--ds-color-gray-700);
  white-space: nowrap;
}

.lot-timeline__item--past .lot-timeline__name,
.lot-timeline__item--past .lot-timeline__price,
.lot-timeline__item--past .lot-timeline__date {
  color: var(--ds-color-gray-600);
  font-weight: var(--ds-font-weight-normal);
}

.lot-timeline__item--current .lot-timeline__name,
.lot-timeline__item--current .lot-timeline__price {
  color: var(--ds-color-gray-900);
  font-weight: var(--ds-font-weight-bold);
}

.lot-timeline__item--current .lot-timeline__date {
  color: var(--ds-color-gray-700);
  font-weight: var(--ds-font-weight-semibold);
}

.lot-timeline__item--future .lot-timeline__name,
.lot-timeline__item--future .lot-timeline__price,
.lot-timeline__item--future .lot-timeline__date {
  color: var(--ds-color-gray-700);
}

@media (prefers-reduced-motion: reduce) {
  .lot-timeline__item:not(:first-child)::before,
  .lot-timeline__dot {
    transition: none;
  }
}
