:host {
  display: block;
  width: 100%;
}

.ticket-selector {
  width: 100%;

  &__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
  }

  &__title {
    margin: 0;
    color: #666;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
  }

  &__description {
    margin: 0.35rem 0 0;
    color: #777;
    font-size: 13px;
  }

  &__price {
    flex: 0 0 auto;
    font-size: 25px;
    font-weight: 400;

    strong {
      font-weight: 700;
    }
  }

  &__selection {
    padding-top: 1rem;
  }

  &__label {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: #555;
    font-size: 15px;
    font-weight: 700;
  }

  &__rows {
    display: grid;
    gap: 0.5rem;
  }

  &__columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.5rem;
  }

  &__column-labels {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 0.5rem;
  }

  &__column-label {
    color: #666;
    font-size: 13px;
    font-weight: 600;
  }

  &__action-spacer {
    width: 38px;
  }

  &__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.5rem;
  }

  &__row-content {
    min-width: 0;
  }

  &__fields {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 0.5rem;
  }

  .variant-selector__select {
    width: 100%;
    min-width: 0;
    height: 38px;
    color: #666;
    border-color: var(--border-color);
    font-size: 14px;
    cursor: pointer;

    &:focus {
      border-color: var(--tenant-primary);
      box-shadow: 0 0 0 0.25rem rgba(0, 153, 51, 0.25);
    }
  }

  &__add-row {
    display: block;
    width: 100%;
    margin-top: 0.5rem;

    ::ng-deep .ticket-selector__add-row-button {
      width: 100%;
    }
  }

  &__row-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.35rem;
    color: #777;
    font-size: 13px;

    &::before {
      width: 0.8rem;
      height: 0.8rem;
      border: 2px solid currentcolor;
      border-right-color: transparent;
      border-radius: 50%;
      animation: ticket-selector-spin 0.7s linear infinite;
      content: '';
    }
  }

  &__empty {
    margin: 0;
    color: #777;
    font-size: 13px;
  }

  &__actions {
    margin-top: 0.75rem;
  }

  &__map {
    display: block;
    width: min(100%, 720px);
    max-height: 680px;
    margin: 3rem auto 0;
    object-fit: contain;
  }
}

@keyframes ticket-selector-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticket-selector__row-status::before {
    animation: none;
  }
}

@media (max-width: 767.98px) {
  .ticket-selector {
    &__header {
      flex-direction: column;
    }

    &__fields {
      grid-template-columns: 1fr;
    }

    &__columns {
      display: none;
    }

    &__map {
      margin-top: 2rem;
    }
  }
}
