.list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;

  @for $var from 0 to 40 {
    &.count-#{$var} {
      .item:not(.empty):nth-child(n + #{$var + 1}) {
        display: none;
      }
    }
  }
}

section {
  width: 220px;
  padding: 5px;
  display: flex;

  header img {
    padding: 5px;
  }

  main {
    display: flex;
    flex: 1;
    margin-left: 1rem;
    padding: 5px 0;
    overflow: hidden;

    .number {
      width: 1.5rem;
    }

    .info {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .name,
    .category {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .subtitle {
      color: gray;
      font-size: 0.9rem;
      height: 40px;
      display: flex;
      justify-content: space-between;

    }
    &.hover {
      background-color: var(--main-item-bg-color-hover);
      .control {
        display: block;
      }
    }
  }

  .control {
    display: none;
  }

  &:hover {
    background-color: var(--main-item-bg-color-hover);

    .control {
      display: block;
    }
  }
}

.empty {
  height: 0;
  padding: 0;
}
